/* ═══════════════════════════════════════════════════════════════════
   Heads-Up Hub — Shared Design System
   Apple-inspired black/white/grey, applied to all tools.
   ═══════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* ── CSS VARIABLES ──────────────────────────────────────────────── */
:root {
  --bg:           #f4f4f2;   /* warm off-white page */
  --card:         #ffffff;   /* pure white card */
  --border:       #dcdcdc;   /* hairline border */
  --border-focus: #111111;   /* input focus ring */
  --accent:       #111111;   /* primary action color — charcoal black */
  --accent2:      #333333;   /* hover state */
  --text:         #111111;   /* primary text */
  --text-sec:     #444444;   /* secondary text */
  --muted:        #888888;   /* placeholders, hints */
  --input-bg:     #fafafa;   /* input field background */
  --success-bg:   #f2faf5;
  --success:      #1a7a3f;
  --error-bg:     #fdf2f2;
  --error:        #b91c1c;
  --info-bg:      #f4f4f2;
  --info:         #666666;
  --chip-bg:      #f4f4f2;   /* tag/chip/card-inner background */
  --chip-checked: #111111;
}

/* ── BASE ───────────────────────────────────────────────────────── */
html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.035em; }
.subtitle { color: var(--muted); font-size: 0.88rem; margin: 4px 0 24px; }

/* ── LABELS ─────────────────────────────────────────────────────── */
label, .field-label {
  display: block;
  font-size: 0.78rem; color: var(--text-sec);
  margin-bottom: 7px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── FORM FIELDS ────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--input-bg);
  color: var(--text); font-size: 0.95rem; outline: none;
  transition: border-color 0.15s;
  appearance: none; -webkit-appearance: none;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus); background: #fff;
}
select { cursor: pointer; }
select:disabled { opacity: 0.35; cursor: not-allowed; }
select option { background: #fff; color: var(--text); }
textarea { resize: vertical; min-height: 80px; }

/* ── BUTTONS ────────────────────────────────────────────────────── */
button {
  padding: 11px 22px; border-radius: 9px; border: none;
  background: var(--accent); color: #fff; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: background 0.15s, opacity 0.15s;
  white-space: nowrap; font-family: inherit; letter-spacing: -0.01em;
}
button:hover { background: var(--accent2); }
button:disabled { background: #cccccc; cursor: not-allowed; }

button.secondary {
  background: #fff; border: 1.5px solid var(--border);
  color: var(--text-sec); font-weight: 500;
}
button.secondary:hover { background: var(--chip-bg); border-color: #999; }

button.danger {
  background: #fff; border: 1.5px solid #e5b8b8;
  color: var(--error); font-weight: 500;
}
button.danger:hover { background: var(--error-bg); }

button.sm { padding: 7px 14px; font-size: 0.82rem; min-height: 44px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

/* ── CARD ───────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 32px;
  width: 100%; max-width: 700px; margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 8px 24px rgba(0,0,0,0.05);
}

/* ── SECTION HEADER — filled bar style ─────────────────────────── */
.section-header {
  font-size: 0.72rem; font-weight: 700; color: var(--card);
  background: var(--accent);
  margin: 28px 0 16px;
  padding: 7px 16px;
  border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── STATUS MESSAGES ────────────────────────────────────────────── */
.status {
  padding: 11px 14px; border-radius: 9px; font-size: 0.875rem;
  margin-top: 12px; display: none; line-height: 1.5;
}
.status.info    { display: block; background: var(--info-bg);    color: var(--info);    border: 1.5px solid var(--border); }
.status.error   { display: block; background: var(--error-bg);   color: var(--error);   border: 1.5px solid #e5b8b8; }
.status.success { display: block; background: var(--success-bg); color: var(--success); border: 1.5px solid #b8e0c8; }

/* ── AUTOCOMPLETE ───────────────────────────────────────────────── */
.autocomplete-wrapper { position: relative; }
.autocomplete-wrapper input[type="text"] { padding-right: 36px; }
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  background: var(--card); border: 1.5px solid var(--border); border-top: none;
  border-radius: 0 0 9px 9px; max-height: 220px; overflow-y: auto;
  display: none; box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.autocomplete-item {
  padding: 9px 14px; cursor: pointer; font-size: 0.9rem;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--chip-bg); font-weight: 600; }
.btn-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.95rem; padding: 4px; line-height: 1; display: none; border-radius: 4px;
}
.btn-clear:hover { color: var(--text); background: none; }

/* ── DIVIDER ────────────────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 18px; color: var(--muted); font-size: 0.78rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── LOADING SPINNER ────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: middle; margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ────────────────────────────────────────────────── */
.empty-state { text-align: center; color: var(--muted); padding: 48px 0; font-size: 0.9rem; }

/* ── NO DATA MESSAGE ────────────────────────────────────────────── */
.no-data-msg {
  background: var(--info-bg); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 18px; color: var(--info);
  font-size: 0.88rem; margin-bottom: 16px;
}
