/* ============================================
   MBF Studio CRM — Stylesheet
   ============================================ */

:root {
  --bg:          #0d0d14;
  --surface:     #14141f;
  --card:        #1a1a2a;
  --card2:       #20202e;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.12);
  --gold:        #d4a843;
  --gold-d:      #b8902e;
  --gold-soft:   rgba(212,168,67,0.12);
  --accent:      #e0724a;
  --accent-soft: rgba(224,114,74,0.12);
  --text:        #e8e8f2;
  --text-2:      #a0a0c0;
  --text-3:      #606080;
  --ok:          #4ade80;
  --ok-soft:     rgba(74,222,128,0.12);
  --warn:        #fbbf24;
  --warn-soft:   rgba(251,191,36,0.12);
  --err:         #f87171;
  --err-soft:    rgba(248,113,113,0.12);
  --info:        #60a5fa;
  --info-soft:   rgba(96,165,250,0.12);
  --sidebar-w:   240px;
  --topbar-h:    60px;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.6);
  --font:        'Inter', system-ui, sans-serif;
  --font-serif:  'Playfair Display', Georgia, serif;
  --trans:       0.18s ease;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

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

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--trans);
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}

.logo-ring {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  display: block;
  line-height: 1.2;
}
.logo-sub {
  font-size: 0.7rem;
  color: var(--text-3);
  display: block;
}

.sidebar-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 16px 16px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 450;
  border-radius: 0;
  transition: all var(--trans);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }

.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.nav-item.active {
  color: var(--gold);
  background: var(--gold-soft);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--err);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ── Main area ── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Topbar ── */
#topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  width: 240px;
}
.topbar-search svg { color: var(--text-3); width: 14px; height: 14px; }
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.85rem;
  width: 100%;
  font-family: var(--font);
}
.topbar-search input::placeholder { color: var(--text-3); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--trans);
  position: relative;
}
.topbar-btn:hover { color: var(--text); border-color: var(--border2); }
.topbar-btn .dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--err);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0d0d14;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Content ── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.section { display: none; }
.section.active { display: block; }

/* ─────────── TYPOGRAPHY ─────────── */
h1 { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 600; color: var(--text); }
h2 { font-size: 1.2rem; font-weight: 600; color: var(--text); }
h3 { font-size: 1rem; font-weight: 600; color: var(--text); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header h2 { font-family: var(--font-serif); font-size: 1.4rem; }

/* ─────────── BUTTONS ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--trans);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--gold); color: #0d0d14; }
.btn-primary:hover { background: var(--gold-d); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #e06060; }

.btn-ok { background: var(--ok); color: #0d0d14; }
.btn-ok:hover { background: #38c76a; }

.btn-info { background: var(--info); color: #0d0d14; }
.btn-info:hover { background: #4090e8; }

.btn-sm { padding: 5px 11px; font-size: 0.78rem; border-radius: 6px; }
.btn-lg { padding: 11px 22px; font-size: 0.95rem; }
.btn-icon { padding: 7px; border-radius: 7px; }

/* ─────────── CARDS ─────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--trans);
}
.card:hover { border-color: var(--border2); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.card-sub { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--trans);
}
.kpi-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.kpi-card.gold::before { background: linear-gradient(90deg, var(--gold), transparent); }
.kpi-card.green::before { background: linear-gradient(90deg, var(--ok), transparent); }
.kpi-card.blue::before { background: linear-gradient(90deg, var(--info), transparent); }
.kpi-card.orange::before { background: linear-gradient(90deg, var(--accent), transparent); }
.kpi-card.red::before { background: linear-gradient(90deg, var(--err), transparent); }
.kpi-card.purple::before { background: linear-gradient(90deg, #a78bfa, transparent); }

.kpi-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  font-size: 18px;
}
.kpi-card.gold .kpi-icon { background: var(--gold-soft); }
.kpi-card.green .kpi-icon { background: var(--ok-soft); }
.kpi-card.blue .kpi-icon { background: var(--info-soft); }
.kpi-card.orange .kpi-icon { background: var(--accent-soft); }
.kpi-card.red .kpi-icon { background: var(--err-soft); }
.kpi-card.purple .kpi-icon { background: rgba(167,139,250,0.12); }

.kpi-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-label { font-size: 0.78rem; color: var(--text-3); }
.kpi-delta {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--err); }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* ─────────── TABLES ─────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--card2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th.th-sort {
  cursor: pointer;
  user-select: none;
  transition: color var(--trans), background var(--trans);
}
thead th.th-sort:hover {
  color: var(--gold);
  background: var(--card);
}
thead th.th-sort span {
  color: var(--gold);
  font-size: 0.7rem;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--trans);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }

tbody td {
  padding: 12px 14px;
  color: var(--text);
  vertical-align: middle;
}

.td-muted { color: var(--text-2); }
.td-small { font-size: 0.78rem; color: var(--text-3); }

/* ─────────── BADGES ─────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-gold    { background: var(--gold-soft);   color: var(--gold); }
.badge-green   { background: var(--ok-soft);     color: var(--ok); }
.badge-red     { background: var(--err-soft);    color: var(--err); }
.badge-blue    { background: var(--info-soft);   color: var(--info); }
.badge-orange  { background: var(--accent-soft); color: var(--accent); }
.badge-purple  { background: rgba(167,139,250,.12); color: #a78bfa; }
.badge-gray    { background: rgba(255,255,255,.06); color: var(--text-3); }
.badge-warn    { background: var(--warn-soft);   color: var(--warn); }

/* ─────────── FORMS ─────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
}

input, select, textarea {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--trans);
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }

select option { background: var(--card2); }

textarea { resize: vertical; min-height: 80px; }

.form-hint { font-size: 0.72rem; color: var(--text-3); }
.form-error { font-size: 0.72rem; color: var(--err); }

.input-group {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--trans);
}
.input-group:focus-within { border-color: var(--gold); }
.input-group input { border: none; flex: 1; }
.input-group input:focus { box-shadow: none; }
.input-prefix, .input-suffix {
  background: var(--card);
  padding: 9px 12px;
  color: var(--text-3);
  font-size: 0.85rem;
  border: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ─────────── MODALS ─────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
}
.modal-close {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans);
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─────────── TABS ─────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--card2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  padding: 7px 16px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 0.83rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.tab-btn:hover:not(.active) { color: var(--text); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─────────── FILTERS BAR ─────────── */
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  min-width: 220px;
  flex: 1;
}
.filter-search svg { color: var(--text-3); width: 14px; height: 14px; flex-shrink: 0; }
.filter-search input {
  background: none;
  border: none;
  outline: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
}
.filter-search input:focus { border: none; box-shadow: none; }

.filter-select {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text-2);
  font-size: 0.83rem;
  min-width: 130px;
}

/* ─────────── CALENDAR ─────────── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-day-name {
  background: var(--card2);
  text-align: center;
  padding: 8px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.cal-cell {
  background: var(--card);
  min-height: 90px;
  min-width: 0;
  overflow: hidden;
  padding: 6px;
  cursor: pointer;
  transition: background var(--trans);
}
.cal-cell:hover { background: var(--card2); }
.cal-cell.other-month { opacity: 0.3; }
.cal-cell.today { background: var(--gold-soft); }
.cal-cell.today .cal-date { color: var(--gold); font-weight: 700; }

.cal-date {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 4px;
}

.cal-event {
  display: block;
  max-width: 100%;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-event.wedding  { background: rgba(212,168,67,0.2); color: var(--gold); }
.cal-event.civil    { background: rgba(212,168,67,0.2); color: var(--gold); }
.cal-event.aniversario { background: rgba(96,165,250,0.2); color: var(--info); }
.cal-event.infantil { background: rgba(96,165,250,0.2); color: var(--info); }
.cal-event.quinze   { background: rgba(236,72,153,0.2); color: #ec4899; }
.cal-event.corporativo { background: rgba(167,139,250,0.2); color: #a78bfa; }
.cal-event.ensaio   { background: rgba(45,212,191,0.2); color: #2dd4bf; }
.cal-event.entrega  { background: rgba(74,222,128,0.2); color: var(--ok); }
.cal-event.outro    { background: rgba(255,255,255,0.08); color: var(--text-2); }

/* ─────────── PIPELINE / KANBAN ─────────── */
.kanban {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-col {
  min-width: 240px;
  max-width: 280px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.kanban-col-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}

.kanban-col-count {
  font-size: 0.75rem;
  background: var(--card2);
  color: var(--text-3);
  padding: 1px 7px;
  border-radius: 10px;
}

.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 100px; }

.kanban-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all var(--trans);
}
.kanban-card:hover { border-color: var(--border2); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

.kanban-card-name { font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; }
.kanban-card-meta { font-size: 0.75rem; color: var(--text-3); display: flex; justify-content: space-between; }
.kanban-card-value { font-size: 0.82rem; color: var(--gold); font-weight: 600; margin-top: 4px; }

/* ─────────── PROGRESS ─────────── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-fill.gold { background: var(--gold); }
.progress-fill.green { background: var(--ok); }
.progress-fill.blue { background: var(--info); }
.progress-fill.red { background: var(--err); }

/* ─────────── AVATAR GROUP ─────────── */
.avatar-group { display: flex; }
.avatar-group .av {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0d0d14;
  border: 2px solid var(--card);
  margin-left: -6px;
  flex-shrink: 0;
}
.avatar-group .av:first-child { margin-left: 0; }

/* ─────────── CHARTS ─────────── */
.chart-wrap {
  position: relative;
  width: 100%;
}

/* ─────────── TOAST ─────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 260px;
  max-width: 360px;
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: toast-in 0.3s ease;
}
.toast.ok    { border-color: var(--ok);   }
.toast.err   { border-color: var(--err);  }
.toast.warn  { border-color: var(--warn); }
.toast.info  { border-color: var(--info); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg  { font-size: 0.83rem; flex: 1; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────── EMPTY STATE ─────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.empty-desc { font-size: 0.85rem; max-width: 300px; margin: 0 auto 20px; }

/* ─────────── MISC ─────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row-label { color: var(--text-2); }
.stat-row-value { font-weight: 600; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-text { flex: 1; }
.activity-time { color: var(--text-3); font-size: 0.75rem; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--gold-soft);
  color: var(--gold);
  cursor: default;
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* Contract preview */
.contract-preview {
  background: #fff;
  color: #1a1a1a;
  border-radius: var(--radius);
  padding: 40px;
  font-family: 'Times New Roman', serif;
  line-height: 1.6;
  font-size: 0.9rem;
}
.contract-preview h1 { text-align: center; font-size: 1.2rem; margin-bottom: 8px; color: #1a1a1a; }
.contract-preview h2 { font-size: 1rem; margin: 16px 0 8px; color: #1a1a1a; border-bottom: 1px solid #ccc; padding-bottom: 4px; }
.contract-preview p { margin-bottom: 10px; }
.contract-preview .contract-sigs { display: flex; justify-content: space-around; margin-top: 40px; }
.contract-preview .sig-line { text-align: center; }
.contract-preview .sig-line hr { width: 180px; border-color: #999; margin: 40px auto 6px; }

/* Delivery tracker */
.delivery-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 16px 0;
  overflow-x: auto;
}
.delivery-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 80px;
  position: relative;
}
.delivery-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(-50% + 14px);
  right: calc(50% + 14px);
  height: 2px;
  background: var(--border);
}
.delivery-step:first-child::before { display: none; }
.delivery-step.done::before { background: var(--ok); }
.delivery-step.active::before { background: linear-gradient(90deg, var(--ok), var(--gold)); }

.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--card2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  z-index: 1;
}
.delivery-step.done .step-dot { background: var(--ok); border-color: var(--ok); }
.delivery-step.active .step-dot { background: var(--gold-soft); border-color: var(--gold); }

.step-label { font-size: 0.68rem; color: var(--text-3); text-align: center; }
.delivery-step.done .step-label { color: var(--ok); }
.delivery-step.active .step-label { color: var(--gold); }
.delivery-step.album-step .step-dot { border-style: dashed; }
.delivery-step.album-step.done .step-dot,
.delivery-step.album-step.active .step-dot { border-color: var(--accent); background: var(--accent-soft); }
.delivery-step.album-step.active .step-label { color: var(--accent); }

/* Finance specific */
.amount-positive { color: var(--ok); font-weight: 600; }
.amount-negative { color: var(--err); font-weight: 600; }
.amount-neutral  { color: var(--text); font-weight: 600; }

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 900px) {
  #sidebar {
    position: fixed;
    left: -100%;
    height: 100%;
    z-index: 200;
    transition: left 0.25s ease;
  }
  #sidebar.open { left: 0; }
  .grid-2, .two-col { grid-template-columns: 1fr; }
  .grid-3, .three-col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  #content { padding: 16px; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; max-height: 95vh; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ─────────── PRINT (Contract) ─────────── */
@media print {
  #sidebar, #topbar, #toast-container, .no-print { display: none !important; }
  #content { padding: 0 !important; }
  body { background: #fff; }
  .contract-preview { box-shadow: none; border: none; }
}
