/* FOH Pro — Stylesheet */

:root {
  --bg:           #F4F6F5;
  --surface:      #FFFFFF;
  --surface-alt:  #EEF1EF;
  --border:       #D8E0DA;
  --accent:       #5E8F70;
  --accent-dim:   #3D6B50;
  --accent-soft:  #DCE9E1;
  --success:      #4A8F5F;
  --danger:       #B84C47;
  --warning:      #B87A2A;
  --info:         #3A7DA8;
  --text:         #1A2620;
  --text-2:       #5A6E62;
  --text-3:       #9AAAA0;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    18px;
  --shadow:       0 1px 4px rgba(26,38,32,.08), 0 2px 12px rgba(26,38,32,.04);
  --shadow-lg:    0 4px 24px rgba(26,38,32,.12);
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:         'Courier New', Courier, monospace;
  --sidebar-w:    240px;
  --header-h:     60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* Auth screens */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; background: var(--bg);
}
.auth-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 40px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.auth-brand { text-align: center; margin-bottom: 32px; }
.auth-brand .logo { font-size: 48px; display: block; margin-bottom: 12px; }
.auth-brand h1 { font-size: 28px; font-weight: 900; letter-spacing: -.5px; }
.auth-brand p  { color: var(--text-2); margin-top: 4px; font-size: 14px; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto;
  transition: transform .2s; z-index: 100;
}
.sidebar-brand {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
  font-weight: 900; font-size: 20px; letter-spacing: -.5px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand span { font-size: 24px; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: var(--text-2); font-size: 14px;
  font-weight: 500; cursor: pointer; transition: all .15s; border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; border-left-color: var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-user {
  padding: 16px 20px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.sidebar-user strong { display: block; color: var(--text); font-size: 14px; }
.sidebar-user a { color: var(--danger); font-size: 12px; cursor: pointer; }

/* Main content */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px; flex-shrink: 0;
}
.topbar h2 { font-size: 18px; font-weight: 700; flex: 1; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px; }

.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 12px;
}
.card:last-child { margin-bottom: 0; }
.card-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.card-meta  { color: var(--text-2); font-size: 13px; }
.card-row   { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; transition: all .15s;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-ghost     { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-sm        { padding: 5px 12px; font-size: 13px; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }
.btn svg       { width: 16px; height: 16px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-2); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-alt);
  color: var(--text); font-family: var(--font); font-size: 14px;
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow); }
.stat-value { font-size: 32px; font-weight: 900; color: var(--accent); line-height: 1; }
.stat-label { color: var(--text-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; margin-top: 4px; }

.next-gig {
  background: var(--accent-soft); border: 1.5px solid var(--accent); border-radius: var(--radius-md);
  padding: 20px; margin-bottom: 24px; display: flex; align-items: center; gap: 20px;
  cursor: pointer; transition: box-shadow .15s;
}
.next-gig:hover { box-shadow: var(--shadow-lg); }
.countdown-num { font-size: 48px; font-weight: 900; color: var(--accent); line-height: 1; flex-shrink: 0; }
.countdown-unit { font-size: 11px; color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; text-align: center; }
.next-gig-label { font-size: 10px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.next-gig-name  { font-size: 20px; font-weight: 800; }
.next-gig-meta  { color: var(--text-2); font-size: 13px; margin-top: 4px; }

/* ── Pills / Status ──────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 99px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
}
.pill-upcoming { background: #e8f0ea; color: var(--accent); }
.pill-done     { background: #e8f0ea; color: var(--success); }
.pill-draft    { background: #eee; color: var(--text-3); }
.pill-sent     { background: #e3edf5; color: var(--info); }
.pill-paid     { background: #e5f0e9; color: var(--success); }
.pill-overdue  { background: #faeaea; color: var(--danger); }
.pill-active   { background: var(--accent-soft); color: var(--accent); }

/* ── Section headers ─────────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.section-header h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-2); }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-2); padding: 8px 12px; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--bg); }
tr:last-child td { border-bottom: none; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 1000; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-2); font-size: 20px; line-height: 1; padding: 4px; border-radius: 4px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body    { padding: 24px; }
.modal-footer  { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Checklist ───────────────────────────────────────────────────────────── */
.checklist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.checklist-item label { flex: 1; cursor: pointer; font-size: 14px; }
.checklist-item.done label { text-decoration: line-through; color: var(--text-3); }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-track { background: var(--border); border-radius: 4px; height: 6px; overflow: hidden; margin: 8px 0; }
.progress-fill  { background: var(--accent); height: 100%; border-radius: 4px; transition: width .3s; }

/* ── Invoice ─────────────────────────────────────────────────────────────── */
.money { font-family: var(--mono); font-weight: 700; }
.money-accent { color: var(--accent); }
.money-success { color: var(--success); }
.money-warning { color: var(--warning); }
.money-danger  { color: var(--danger); }

/* ── Filters / tabs ──────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 4px; background: var(--surface-alt); border-radius: var(--radius-sm); padding: 3px; width: fit-content; margin-bottom: 16px; }
.filter-btn { padding: 6px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; background: none; color: var(--text-2); transition: all .15s; }
.filter-btn.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-2); }
.empty-state svg { width: 48px; height: 48px; color: var(--border); margin-bottom: 16px; }
.empty-state h3  { font-size: 17px; color: var(--text); margin-bottom: 6px; }
.empty-state p   { font-size: 14px; margin-bottom: 20px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast {
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .2s ease;
  display: flex; align-items: center; gap: 10px; max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Sync indicator ──────────────────────────────────────────────────────── */
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .menu-toggle  { display: block; }
  .main         { width: 100%; }
  .page-content { padding: 16px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; display: flex; flex-direction: column; }
  .modal-body { overflow-y: auto; }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .card-row { flex-direction: column; align-items: flex-start; }
}
