/* ================================================
   ALQUIMIA PORTAL — Design System v1.0
   Fuentes: Syne (display) + DM Sans (body)
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── CSS Variables ─────────────────────────────── */
:root {
  --gold:        #E8A027;
  --gold-light:  #F5BF5D;
  --gold-dark:   #C4821A;
  --gold-muted:  rgba(232,160,39,.15);
  --gold-glow:   rgba(232,160,39,.25);

  /* Dark mode (default) */
  --bg:          #09090E;
  --surface:     #111118;
  --card:        #16161F;
  --card-hover:  #1C1C28;
  --border:      rgba(255,255,255,.07);
  --border-md:   rgba(255,255,255,.12);
  --text:        #F0EFFA;
  --text-muted:  #8B8A9E;
  --text-faint:  #4A4960;
  --sidebar-bg:  #0D0D14;
  --input-bg:    #1A1A24;
  --overlay:     rgba(9,9,14,.85);

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --shadow-gold: 0 0 32px rgba(232,160,39,.15);

  --sidebar-w:   260px;
  --header-h:    60px;
  --transition:  .18s cubic-bezier(.4,0,.2,1);
}

/* Light mode */
[data-theme="light"] {
  --bg:          #F4F4F8;
  --surface:     #FAFAFA;
  --card:        #FFFFFF;
  --card-hover:  #F0EFFA;
  --border:      rgba(0,0,0,.07);
  --border-md:   rgba(0,0,0,.12);
  --text:        #18172A;
  --text-muted:  #6B6980;
  --text-faint:  #B0AFBE;
  --sidebar-bg:  #FFFFFF;
  --input-bg:    #F0F0F7;
  --overlay:     rgba(244,244,248,.9);
  --shadow:      0 4px 24px rgba(0,0,0,.08);
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: var(--text);
}
::placeholder { color: var(--text-faint); }

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 99px; }

/* ── Typography ────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.display { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
.heading-xl { font-size: 1.75rem; }
.heading-lg { font-size: 1.375rem; }
.heading-md { font-size: 1.125rem; }
.heading-sm { font-size: .9375rem; }
.body-lg { font-size: 1rem; }
.body-sm { font-size: .875rem; }
.caption { font-size: .75rem; color: var(--text-muted); }
.label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Layout ────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--transition), width var(--transition);
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
}
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: contain;
}
.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--gold);
  letter-spacing: -.01em;
}
.brand-sub {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: -2px;
}

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 10px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover {
  background: var(--card);
  color: var(--text);
}
.nav-item.active {
  background: var(--gold-muted);
  color: var(--gold);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: #000;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.user-card:hover { background: var(--card); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-muted);
  border: 2px solid var(--gold);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: .85rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .7rem; color: var(--text-muted); }

/* ── Main content ──────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ── Header ────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-title {
  flex: 1;
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  position: relative;
}
.btn-icon:hover { background: var(--card); color: var(--text); border-color: var(--border-md); }
.btn-icon svg { width: 17px; height: 17px; }
.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--gold);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}
.sidebar-toggle { display: none; }

/* ── Page ──────────────────────────────────────── */
.page { padding: 24px; flex: 1; }
.page-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; }
.page-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: 2px; }

/* ── Cards ─────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover { border-color: var(--border-md); }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stat cards */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--gold); box-shadow: var(--shadow-gold); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--gold-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.stat-change {
  font-size: .75rem;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-change.up { color: #4ade80; }
.stat-change.down { color: #f87171; }

/* ── Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); color: #000; }
.btn-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border-md);
}
.btn-secondary:hover { background: var(--card-hover); border-color: var(--gold); color: var(--gold); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--card); color: var(--text); }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-sm { padding: 5px 11px; font-size: .8125rem; }
.btn-lg { padding: 11px 22px; font-size: .9375rem; }

/* ── Forms ─────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--input-bg);
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-muted);
}
.form-control::placeholder { color: var(--text-faint); }
textarea.form-control { resize: vertical; min-height: 88px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .775rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .775rem; color: #f87171; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Badges ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-gold  { background: var(--gold-muted); color: var(--gold); }
.badge-green { background: rgba(74,222,128,.12); color: #4ade80; }
.badge-red   { background: rgba(248,113,113,.12); color: #f87171; }
.badge-blue  { background: rgba(96,165,250,.12); color: #60a5fa; }
.badge-purple{ background: rgba(167,139,250,.12); color: #a78bfa; }
.badge-gray  { background: var(--border); color: var(--text-muted); }

/* Priority badges */
.priority-low     { background: rgba(74,222,128,.1); color: #4ade80; }
.priority-medium  { background: rgba(251,191,36,.1); color: #fbbf24; }
.priority-high    { background: rgba(251,146,60,.1); color: #fb923c; }
.priority-urgent  { background: rgba(248,113,113,.1); color: #f87171; }

/* Platform badges */
.platform-instagram { background: rgba(225,48,108,.12); color: #e1306c; }
.platform-facebook  { background: rgba(66,103,178,.12); color: #4267b2; }
.platform-tiktok    { background: rgba(255,255,255,.1); color: #fff; }
.platform-linkedin  { background: rgba(0,119,181,.12); color: #0077b5; }

/* ── Tables ────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: 11px 16px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  background: var(--surface);
}
td {
  padding: 13px 16px;
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--card-hover); }

/* ── Grids ─────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── Kanban ────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: calc(100vh - 180px);
}
.kanban-col {
  min-width: 280px;
  max-width: 300px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}
.kanban-col-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.col-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.col-title { font-size: .875rem; font-weight: 700; flex: 1; }
.col-count {
  background: var(--border);
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}
.kanban-cards { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
}
.kanban-card:hover { border-color: var(--gold); box-shadow: 0 4px 16px rgba(0,0,0,.3); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .6; transform: rotate(1.5deg) scale(1.02); cursor: grabbing; }
.card-title { font-size: .875rem; font-weight: 600; line-height: 1.35; margin-bottom: 8px; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-due { font-size: .72rem; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }
.card-due.overdue { color: #f87171; }
.kanban-add-btn {
  margin: 8px;
  border: 1.5px dashed var(--border-md);
  background: transparent;
  border-radius: var(--radius);
  padding: 10px;
  color: var(--text-muted);
  font-size: .82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.kanban-add-btn:hover { background: var(--card); color: var(--gold); border-color: var(--gold); }

/* Drop zone */
.drop-zone {
  background: var(--gold-muted);
  border: 2px dashed var(--gold);
  border-radius: var(--radius);
  min-height: 60px;
}

/* ── Calendar ──────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cal-day-header {
  background: var(--surface);
  padding: 10px;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cal-day {
  background: var(--card);
  min-height: 110px;
  padding: 8px;
  transition: background var(--transition);
}
.cal-day:hover { background: var(--card-hover); }
.cal-day.today { background: var(--gold-muted); }
.cal-day.other-month .day-num { opacity: .3; }
.day-num {
  font-size: .8125rem;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  margin-bottom: 6px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.cal-day.today .day-num { background: var(--gold); color: #000; }
.cal-event {
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity var(--transition);
}
.cal-event:hover { opacity: .85; }

/* ── Chat ──────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 48px);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.message-group { display: flex; gap: 10px; }
.message-group.mine { flex-direction: row-reverse; }
.message-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold-muted);
  border: 2px solid var(--border-md);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: var(--gold);
  object-fit: cover;
}
.message-bubble {
  max-width: 65%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
}
.message-group.mine .message-bubble {
  background: var(--gold-muted);
  border-color: var(--gold-dark);
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: var(--radius-lg);
}
.message-sender { font-size: .72rem; font-weight: 700; color: var(--gold); margin-bottom: 3px; }
.message-text { font-size: .875rem; line-height: 1.5; word-break: break-word; }
.message-time { font-size: .68rem; color: var(--text-faint); margin-top: 4px; text-align: right; }
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: var(--input-bg);
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  color: var(--text);
  font-size: .9rem;
  resize: none;
  max-height: 120px;
  outline: none;
  transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--gold); }

/* ── Meetings ──────────────────────────────────── */
.meeting-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.meeting-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--gold);
}
.meeting-card:hover { border-color: var(--gold); box-shadow: var(--shadow-gold); }
.meeting-date {
  text-align: center;
  min-width: 52px;
  background: var(--gold-muted);
  border-radius: var(--radius);
  padding: 8px 6px;
}
.meeting-day { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--gold); line-height: 1; }
.meeting-month { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.meeting-info { flex: 1; }
.meeting-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.meeting-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.meeting-meta span { display: flex; align-items: center; gap: 4px; }

/* ── Client Project Card ───────────────────────── */
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.project-card:hover { border-color: var(--gold); box-shadow: var(--shadow-gold); transform: translateY(-2px); }
.project-card-banner {
  height: 80px;
  position: relative;
}
.project-card-logo {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  border: 3px solid var(--surface);
  object-fit: contain;
  background: var(--card);
  position: absolute;
  bottom: -26px;
  left: 20px;
}
.project-card-body { padding: 36px 20px 20px; }
.project-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.project-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Modal ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  transform: translateY(16px) scale(.97);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: none; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--card-hover); color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Alerts ────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.25); color: #4ade80; }
.alert-error   { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.25); color: #f87171; }
.alert-warning { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.25); color: #fbbf24; }
.alert-info    { background: var(--gold-muted); border: 1px solid rgba(232,160,39,.3); color: var(--gold); }

/* ── Empty state ───────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }
.empty-title { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-text { font-size: .875rem; }

/* ── Tabs ──────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 16px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Dropdown ──────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: all var(--transition);
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: none; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: .875rem;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--card-hover); color: var(--text); }
.dropdown-item.danger { color: #f87171; }
.dropdown-item.danger:hover { background: rgba(248,113,113,.1); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Toasts ────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow);
  animation: slideIn .2s ease;
}
.toast.success { border-color: rgba(74,222,128,.4); }
.toast.error { border-color: rgba(248,113,113,.4); }
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg { font-size: .875rem; flex: 1; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } }

/* ── Login page ────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 110% 10%, rgba(232,160,39,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at -10% 90%, rgba(232,160,39,.1) 0%, transparent 60%);
  pointer-events: none;
}
.login-left {
  flex: 1;
  display: none;
  padding: 60px;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(232,160,39,.06) 0%, transparent 100%);
  border-right: 1px solid var(--border);
}
@media (min-width: 768px) { .login-left { display: flex; } }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand-logo { width: 40px; height: 40px; }
.login-brand-name { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.login-tagline { font-size: 2.8rem; font-family: 'Syne', sans-serif; font-weight: 800; line-height: 1.2; }
.login-tagline span { color: var(--gold); }
.login-features { display: flex; flex-direction: column; gap: 16px; }
.login-feature { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: .9rem; }
.login-feature svg { color: var(--gold); width: 18px; height: 18px; }
.login-right {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 768px) { .login-right { border-left: 1px solid var(--border); min-height: 100vh; padding: 60px 48px; } }
.login-title { font-size: 1.75rem; margin-bottom: 6px; }
.login-subtitle { color: var(--text-muted); font-size: .9rem; margin-bottom: 32px; }

/* ── Theme toggle ──────────────────────────────── */
.theme-toggle {
  width: 40px; height: 22px;
  background: var(--border-md);
  border-radius: 99px;
  border: none;
  position: relative;
  transition: background var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle.active { background: var(--gold); }
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}
.theme-toggle.active::after { transform: translateX(18px); }

/* ── File upload area ──────────────────────────── */
.upload-area {
  border: 2px dashed var(--border-md);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--gold);
  background: var(--gold-muted);
}
.upload-area p { font-size: .875rem; color: var(--text-muted); margin-top: 8px; }

/* ── Misc helpers ──────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-sm { font-size: .875rem; }
.font-bold { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.avatar-initials {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gold-muted);
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: .85rem; font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
}
.logo-sm {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,.5); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .page { padding: 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .header { padding: 0 16px; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(40px, 1fr)); }
  .cal-day { min-height: 70px; }
  .kanban-board { min-height: auto; }
}
@media (max-width: 480px) {
  .login-right { padding: 32px 20px; }
  .modal { margin: 0; max-height: 100vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; align-self: flex-end; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ── Animations ────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
.animate-in { animation: fadeIn .25s ease both; }
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .1s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .2s; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--border-md) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-md);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Notif panel ───────────────────────────────── */
.notif-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: 340px;
  height: calc(100vh - var(--header-h));
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 90;
  transform: translateX(100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
}
.notif-panel.open { transform: none; }
.notif-panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.notif-list { flex: 1; overflow-y: auto; }
.notif-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--card); }
.notif-item.unread { background: var(--gold-muted); }
.notif-dot-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; margin-top: 5px; }

/* Progress bar */
.progress { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s ease; }

/* Color picker swatches */
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatch {
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}
.color-swatch.selected { border-color: var(--text); }
