:root {
  --bg: #fbf8f4; --card: #ffffff; --ink: #2d2a26; --muted: #7a7168; --line: #e8dfd2;
  --gold: #b08a55; --gold-d: #8f6d3e; --gold-l: #f6efe6; --blush: #f7e9e4;
  --red: #b3412f; --red-l: #fdecea; --green: #3f7d55; --green-l: #e8f3ec; --amber: #a86d12; --amber-l: #fbf1df;
  --r: 14px; --shadow: 0 1px 2px rgba(60,40,20,.05), 0 6px 24px rgba(60,40,20,.06);
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-d); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; font-size: 15px; transition: .15s; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.primary:hover { background: var(--gold-d); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--red); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

label.f { display: block; margin-bottom: 16px; }
label.f > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label.f > span .req { color: var(--gold); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; font-size: 16px; transition: .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,138,85,.15); }
.invalid input, .invalid textarea, input.invalid { border-color: var(--red); }
.err-msg { color: var(--red); font-size: 13px; margin-top: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-pending { background: var(--gold-l); color: var(--gold-d); }
.b-client_signed { background: var(--amber-l); color: var(--amber); }
.b-completed { background: var(--green-l); color: var(--green); }
.b-cancelled, .b-expired { background: #eee; color: #777; }
.b-alert { background: var(--red-l); color: var(--red); }

/* Segmentado Sí / No */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; flex-shrink: 0; }
.seg button { min-width: 64px; min-height: 44px; border: 0; background: transparent; cursor: pointer; font-weight: 600; color: var(--muted); padding: 0 14px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on[data-v=yes] { background: var(--gold); color: #fff; }
.seg button.on[data-v=no] { background: var(--ink); color: #fff; }
.seg button.on:not([data-v]) { background: var(--gold); color: #fff; }

.sigbox { position: relative; border: 1.5px dashed var(--gold); border-radius: 12px; background: #fff; height: 200px; }
.sigbox canvas { width: 100%; height: 100%; display: block; border-radius: 12px; cursor: crosshair; }
.sigbox .hint { position: absolute; left: 18px; right: 18px; bottom: 44px; border-bottom: 1px solid var(--line); pointer-events: none; }
.sigbox .hint span { position: absolute; left: 0; bottom: 4px; color: #c9bba6; font-size: 13px; }
.sigbox .clear { position: absolute; top: 8px; right: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 99; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
