/* =========================================================
   Tinos Planner – design system
   Soft-surface SaaS look: lavender canvas, white cards,
   violet primary + lime accent, deep-ink hero cards.
   ========================================================= */
:root {
  --bg: #f3f2f9;
  --bg-2: #ebe9f5;
  --surface: #ffffff;
  --surface-2: #f8f7fc;
  --ink: #15132b;
  --ink-2: #3a3754;
  --muted: #7a7794;
  --line: #e7e5f0;
  --primary: #4c34d6;
  --primary-2: #6b55f0;
  --primary-soft: #ece8ff;
  --lime: #c8f53c;
  --lime-ink: #1f2a00;
  --navy: #17143a;
  --navy-2: #24205a;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(23, 20, 58, .04), 0 8px 24px -12px rgba(23, 20, 58, .12);
  --shadow-lg: 0 30px 60px -25px rgba(23, 20, 58, .35);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);
  --sidebar: 260px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0b1c;
  --bg-2: #13112a;
  --surface: #171530;
  --surface-2: #1d1a3a;
  --ink: #f2f1fb;
  --ink-2: #cfcbe8;
  --muted: #8e8aae;
  --line: #2a2750;
  --primary: #7b66ff;
  --primary-2: #9a8aff;
  --primary-soft: #262056;
  --navy: #0a0818;
  --navy-2: #1c1845;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-family: var(--display); letter-spacing: -.03em; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column;
  gap: 4px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; z-index: 40;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.sidebar .brand img { height: 30px; width: auto; }
.sidebar .brand span { font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--ink); }
.sidebar .brand small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 16px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 600; transition: background .2s, color .2s, transform .2s; position: relative;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); transform: translateX(2px); }
.nav-link.active { background: var(--navy); color: #fff; box-shadow: 0 10px 20px -10px rgba(23, 20, 58, .6); }
:root[data-theme="dark"] .nav-link.active { background: var(--primary); }
.nav-link.active [data-lucide] { color: var(--lime); }
.nav-link .pill { margin-left: auto; }
.sidebar-card {
  margin-top: auto; padding: 18px; border-radius: 18px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 100% 0%, #6b55f0 0%, var(--navy) 60%);
}
.sidebar-card::after {
  content: ""; position: absolute; width: 100px; height: 100px; right: -36px; bottom: -46px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #e9ff9a, var(--lime) 40%, #6f9400 100%); opacity: .9;
  animation: float 6s ease-in-out infinite;
}
.sidebar-card h4 { color: #fff; max-width: 150px; position: relative; z-index: 1; }
.sidebar-card p { font-size: 12.5px; opacity: .75; position: relative; z-index: 1; max-width: 150px; }
.sidebar-card .btn { position: relative; z-index: 1; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; color: var(--muted);
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; font: inherit; color: var(--ink); min-width: 0; }
.search kbd { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-family: inherit; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer; position: relative; transition: transform .2s, box-shadow .2s;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.icon-btn .dot {
  position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.icon-btn.ring [data-lucide] { animation: ring 1s ease; }
.menu-toggle { display: none; }
.content { padding: 8px 28px 48px; flex: 1; }

/* ---------- Avatars ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 13px; flex-shrink: 0; border: 2px solid var(--surface);
}
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -9px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--ink); }
.user-chip b { display: block; font-size: 13px; line-height: 1.1; }
.user-chip small { color: var(--muted); font-size: 11px; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 360px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; overflow: hidden;
}
.dropdown.open .dropdown-panel { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-panel.narrow { width: 220px; padding: 8px; }
.dropdown-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-item:hover { background: var(--surface-2); color: var(--ink); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif {
  display: flex; gap: 12px; padding: 12px 16px; color: var(--ink); border-bottom: 1px solid var(--line); transition: background .2s;
}
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.notif .ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.notif .ico.reminder { background: #fff4d6; color: #b45309; }
.notif .ico.success { background: #dcfce7; color: #15803d; }
.notif .ico.warning { background: #fee2e2; color: #b91c1c; }
.notif .ico.enquiry { background: #e0f2fe; color: #0369a1; }
.notif .ico.announcement { background: #f3ffcf; color: #4d6b00; }
.notif b { font-size: 13.5px; display: block; }
.notif p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- Cards & grid ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { margin: 0; }
.card.dark { background: var(--navy); color: #fff; border-color: transparent; position: relative; overflow: hidden; }
.card.dark .muted { color: rgba(255, 255, 255, .6); }
.card.lime { background: var(--lime); color: var(--lime-ink); border-color: transparent; }
.card.violet { background: linear-gradient(135deg, var(--primary), #8f7bff); color: #fff; border-color: transparent; }
.card.violet .muted { color: rgba(255, 255, 255, .75); }
.card.flush { padding: 0; overflow: hidden; }

.kpi { display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; transition: transform .3s, box-shadow .3s; }
.kpi:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.card.dark .kpi-ico, .card.violet .kpi-ico { background: rgba(255, 255, 255, .12); color: var(--lime); }
.card.lime .kpi-ico { background: rgba(0, 0, 0, .08); color: var(--lime-ink); }
.kpi .value { font-family: var(--display); font-size: 36px; font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.kpi .kpi-label { font-weight: 600; font-size: 13px; opacity: .8; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: #dcfce7; color: #15803d; }
.trend.down { background: #fee2e2; color: #b91c1c; }

.hero-card {
  border-radius: 28px; padding: 30px; color: #fff; position: relative; overflow: hidden; min-height: 210px;
  background: radial-gradient(90% 140% at 100% 0%, #5b43e8 0%, var(--navy) 55%);
}
.hero-card h1 { color: #fff; font-size: 30px; max-width: 520px; }
.hero-card p { color: rgba(255, 255, 255, .7); max-width: 460px; }
.hero-card .orb { position: absolute; border-radius: 50%; }
.hero-card .orb.a { width: 170px; height: 170px; right: 60px; top: -30px; background: radial-gradient(circle at 30% 30%, #f1ffbf, var(--lime) 35%, #5f8000 100%); animation: float 7s ease-in-out infinite; box-shadow: inset -12px -18px 30px rgba(0,0,0,.25); }
.hero-card .orb.b { width: 80px; height: 80px; right: 250px; bottom: -20px; background: radial-gradient(circle at 30% 30%, #fff, #b7a9ff 40%, #4c34d6 100%); animation: float 5s ease-in-out infinite reverse; box-shadow: inset -8px -10px 20px rgba(0,0,0,.25); }
.hero-card .ring3d { position: absolute; right: 20px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 14px solid rgba(200, 245, 60, .25); transform: rotateX(70deg); animation: spin3d 12s linear infinite; }
.hero-card > * { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: transform .2s, box-shadow .2s, background .2s; background: var(--surface); color: var(--ink); border-color: var(--line);
  position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 10px 20px -10px var(--primary); }
.btn-dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-lime { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn .shine { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); }
.btn:hover .shine { animation: shine .9s ease; }

/* ---------- Badges / pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.count { background: var(--danger); color: #fff; border: 0; padding: 2px 8px; }
.status { --c: #94a3b8; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.platform-dot { width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; }
.platforms { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-weight: 700; font-size: 12.5px; margin-bottom: 6px; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .error, .errorlist { color: var(--danger); font-size: 12px; margin: 4px 0 0; padding: 0; list-style: none; }
.input, select.input, textarea.input {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; outline: none; transition: border .2s, box-shadow .2s, background .2s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--surface); }
textarea.input { resize: vertical; }
input[type="color"].input { height: 46px; padding: 4px; }
.check { width: 18px; height: 18px; accent-color: var(--primary); }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-grid > div, .choice-grid label { margin: 0; }
.choice-grid ul, ul.choice-grid { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.choice-grid label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; background: var(--surface-2); transition: all .2s; }
.choice-grid label:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }
.choice-grid input { accent-color: var(--lime); }
.counter { float: right; font-size: 11.5px; color: var(--muted); font-weight: 600; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters .input { width: auto; min-width: 150px; padding: 9px 14px; border-radius: 999px; background: var(--surface); }

/* ---------- Tables / lists ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: var(--surface-2); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); color: var(--ink); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.list-item .grow small { color: var(--muted); font-size: 12px; }
.date-tile { width: 46px; height: 50px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; text-align: center; line-height: 1; flex-shrink: 0; }
.date-tile b { font-family: var(--display); font-size: 18px; }
.date-tile small { font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty [data-lucide] { width: 34px; height: 34px; margin: 0 auto 8px; opacity: .5; display: block; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transform-origin: left; animation: grow 1.2s cubic-bezier(.2,.8,.2,1) both; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 16px; font-size: 13px; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.tl-item small { color: var(--muted); display: block; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: var(--bg-2); border-radius: 20px; padding: 12px; min-height: 300px; transition: background .2s, outline .2s; }
.column.drag-over { outline: 2px dashed var(--primary); background: var(--primary-soft); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; font-weight: 800; }
.column-head .count { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--surface); padding: 2px 9px; border-radius: 99px; }
.k-card { background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); cursor: grab; transition: transform .2s, box-shadow .2s; display: block; color: var(--ink); }
.k-card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-lg); }
.k-card.dragging { opacity: .5; transform: rotate(3deg); }
.k-card .k-brand { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.k-card b { display: block; font-size: 14px; margin-bottom: 10px; }
.k-card .k-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.k-card .overdue { color: var(--danger); font-weight: 700; }

/* ---------- Calendar (FullCalendar skin) ---------- */
.fc { --fc-border-color: var(--line); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--surface-2); --fc-today-bg-color: color-mix(in srgb, var(--lime) 18%, transparent); --fc-event-border-color: transparent; font-size: 13px; }
.fc .fc-toolbar-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.fc .fc-button { background: var(--surface-2) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; border-radius: 999px !important; font-weight: 700; text-transform: capitalize; padding: 7px 14px; box-shadow: none !important; margin: 0 2px !important; }
.fc .fc-button-active, .fc .fc-button:hover { background: var(--navy) !important; color: #fff !important; }
.fc .fc-col-header-cell-cushion { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; padding: 10px 0; }
.fc .fc-daygrid-day-number { color: var(--ink-2); font-weight: 700; padding: 8px 10px; }
.fc .fc-daygrid-day:hover { background: var(--surface-2); cursor: copy; }
.fc-theme-standard .fc-scrollgrid { border-radius: 18px; overflow: hidden; }
.fc .fc-event { border-radius: 9px; padding: 0; cursor: pointer; transition: transform .15s; overflow: hidden; }
.fc .fc-event:hover { transform: scale(1.02); }
.ev { display: flex; align-items: center; gap: 6px; padding: 4px 7px; color: #fff; width: 100%; overflow: hidden; border-left: 4px solid var(--sc); }
.ev b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ev .t { opacity: .8; font-size: 11px; flex-shrink: 0; }
.ev .pd { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1.5px #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Post detail ---------- */
.preview-phone { border-radius: 30px; background: var(--navy); padding: 12px; max-width: 340px; margin: 0 auto; box-shadow: var(--shadow-lg); }
.preview-inner { background: var(--surface); border-radius: 22px; overflow: hidden; color: var(--ink); }
.preview-head { display: flex; align-items: center; gap: 10px; padding: 12px; }
.preview-media { aspect-ratio: 1/1; background: linear-gradient(135deg, var(--primary), #e1306c 60%, var(--lime)); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px; text-align: center; padding: 20px; }
.preview-media img, .preview-media video { width: 100%; height: 100%; object-fit: cover; }
.preview-media.has-media { padding: 0; }
.preview-body { padding: 12px; font-size: 13px; white-space: pre-wrap; }
.preview-body .tags { color: var(--primary); }
.comment { display: flex; gap: 12px; margin-bottom: 16px; }
.comment .bubble { background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 4px 16px 16px 16px; flex: 1; }
.comment .bubble p { margin: 4px 0 0; white-space: pre-wrap; }
.meta-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.meta-row:last-child { border: 0; }
.meta-row span:first-child { color: var(--muted); font-weight: 600; }

/* ---------- Role matrix ---------- */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.yes { color: var(--success); } .no { color: var(--line); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-lg); animation: toastIn .45s cubic-bezier(.2,1.4,.4,1) both; color: var(--ink); position: relative; overflow: hidden; }
.toast.out { animation: toastOut .35s ease forwards; }
.toast .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.toast.success .ico { background: #dcfce7; color: #15803d; }
.toast.error .ico, .toast.warning .ico { background: #fee2e2; color: #b91c1c; }
.toast.reminder .ico { background: #fff4d6; color: #b45309; }
.toast b { display: block; font-size: 13.5px; }
.toast p { margin: 0; font-size: 12.5px; color: var(--muted); }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--primary); animation: bar 5s linear forwards; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(100% 100% at 100% 0%, #5b43e8, var(--navy) 60%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; perspective: 1200px; }
.auth-art h2 { font-size: 40px; color: #fff; max-width: 440px; }
.auth-art p { color: rgba(255,255,255,.7); max-width: 400px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .box { width: 100%; max-width: 420px; }
.auth-form .box > img { height: 54px; width: auto; margin-bottom: 26px; }
.demo-logins { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.demo-logins button { font: inherit; font-size: 12px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); }
.demo-logins button:hover { border-color: var(--primary); color: var(--primary); }
.demo-logins b { display: block; font-size: 12.5px; color: var(--ink); }

/* ---------- 3D preloader (credit-card style) ---------- */
.loader { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: radial-gradient(80% 80% at 50% 40%, #241e63 0%, #0a0818 70%); perspective: 1100px; transition: opacity .6s ease, visibility .6s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader .stage { display: flex; flex-direction: column; align-items: center; gap: 34px; }
.card3d { width: 300px; height: 186px; position: relative; transform-style: preserve-3d; animation: cardSpin 2.4s cubic-bezier(.6,0,.2,1) infinite; }
.card3d .face { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; box-shadow: 0 40px 80px -20px rgba(0,0,0,.7); }
.card3d .front { background: linear-gradient(135deg, #f7f6ff 0%, #ddd6ff 45%, #c8f53c 140%); display: grid; place-items: center; }
.card3d .front img { width: 62%; }
.card3d .front::before, .card3d .back::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.7) 50%, transparent 65%); transform: translateX(-100%); animation: glare 2.4s ease-in-out infinite; }
.card3d .chip { position: absolute; left: 22px; top: 22px; width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #f8e27a, #c79a1b); }
.card3d .back { transform: rotateY(180deg); background: linear-gradient(135deg, #4c34d6, #17143a); color: #fff; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.card3d .back .stripe { position: absolute; left: 0; right: 0; top: 26px; height: 36px; background: #0a0818; }
.card3d .back b { font-family: var(--display); font-size: 20px; margin-top: 60px; letter-spacing: .12em; }
.card3d .back small { color: var(--lime); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 10.5px; }
.card3d .edge { position: absolute; inset: 0; border-radius: 20px; transform: translateZ(-2px); background: #9a8aff; }
.loader .shadow { width: 220px; height: 22px; border-radius: 50%; background: radial-gradient(rgba(124,102,255,.55), transparent 70%); animation: shadowPulse 2.4s cubic-bezier(.6,0,.2,1) infinite; }
.loader .bar-wrap { width: 180px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.loader .bar-wrap span { display: block; height: 100%; width: 40%; background: var(--lime); border-radius: 99px; animation: load 1.2s ease-in-out infinite; }
.loader p { color: rgba(255,255,255,.65); font-size: 12px; letter-spacing: .25em; text-transform: uppercase; margin: 0; font-weight: 700; }

/* ---------- WhatsApp widget ---------- */
.wa { position: fixed; right: 22px; bottom: 22px; z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.wa-btn { width: 62px; height: 62px; border-radius: 50%; background: #25d366; color: #fff; border: 0; cursor: pointer; display: grid; place-items: center; box-shadow: 0 16px 30px -10px rgba(37,211,102,.7); position: relative; transition: transform .3s; }
.wa-btn:hover { transform: scale(1.08) rotate(-6deg); }
.wa-btn svg { width: 32px; height: 32px; }
.wa-btn::before, .wa-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25d366; animation: pulse 2.2s ease-out infinite; }
.wa-btn::after { animation-delay: 1.1s; }
.wa-tip { position: absolute; right: 74px; top: 50%; transform: translateY(-50%); background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 12px; font-size: 12.5px; font-weight: 700; white-space: nowrap; animation: tipIn 6s ease 2s both; pointer-events: none; }
.wa-panel { width: 320px; max-width: calc(100vw - 44px); background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); transform-origin: bottom right; transform: scale(.6) translateY(20px); opacity: 0; pointer-events: none; transition: all .35s cubic-bezier(.2,1.3,.4,1); }
.wa.open .wa-panel { transform: none; opacity: 1; pointer-events: auto; }
.wa.open .wa-tip { display: none; }
.wa-head { background: #075e54; color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.wa-head img { width: 44px; height: 44px; border-radius: 50%; background: #fff; padding: 6px; object-fit: contain; }
.wa-head b { display: block; } .wa-head small { opacity: .8; font-size: 12px; }
.wa-body { padding: 16px; background: #ece5dd; display: flex; flex-direction: column; gap: 8px; }
:root[data-theme="dark"] .wa-body { background: #0b141a; }
.wa-msg { background: #fff; color: #111; padding: 10px 12px; border-radius: 0 12px 12px 12px; font-size: 13px; max-width: 90%; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.wa-opt { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: #fff; color: #075e54; font-weight: 700; font-size: 13.5px; transition: transform .2s, background .2s; border: 1px solid #d1e7dd; }
.wa-opt:hover { transform: translateX(4px); background: #dcf8c6; }
.wa-opt [data-lucide] { color: #128c7e; }
.wa-opt .arrow { margin-left: auto; }

/* ---------- Misc ---------- */
.alert { padding: 12px 16px; border-radius: 14px; background: var(--primary-soft); color: var(--ink); margin-bottom: 16px; display: flex; gap: 10px; align-items: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs a { padding: 8px 15px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tabs a.active { background: var(--navy); color: #fff; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-family: var(--display); font-size: 120px; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--primary), var(--lime)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.backdrop { display: none; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.tilt { transform-style: preserve-3d; transition: transform .25s ease; }

/* ---------- Keyframes ---------- */
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-14px) } }
@keyframes spin3d { from { transform: rotateX(70deg) rotateZ(0) } to { transform: rotateX(70deg) rotateZ(360deg) } }
@keyframes ring { 0%,100% { transform: rotate(0) } 15% { transform: rotate(18deg) } 30% { transform: rotate(-16deg) } 45% { transform: rotate(12deg) } 60% { transform: rotate(-8deg) } 75% { transform: rotate(4deg) } }
@keyframes shine { to { transform: translateX(120%) } }
@keyframes grow { from { transform: scaleX(0) } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.9) } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); height: 0; padding: 0; margin: 0 } }
@keyframes bar { from { width: 100% } to { width: 0 } }
@keyframes cardSpin { 0% { transform: rotateY(0) rotateX(12deg) } 45% { transform: rotateY(180deg) rotateX(-8deg) } 55% { transform: rotateY(180deg) rotateX(-8deg) } 100% { transform: rotateY(360deg) rotateX(12deg) } }
@keyframes glare { 0%,30% { transform: translateX(-100%) } 60%,100% { transform: translateX(100%) } }
@keyframes shadowPulse { 0%,100% { transform: scaleX(1); opacity: 1 } 25%,75% { transform: scaleX(.35); opacity: .5 } 50% { transform: scaleX(1) } }
@keyframes load { 0% { transform: translateX(-100%) } 100% { transform: translateX(260%) } }
@keyframes pulse { from { transform: scale(1); opacity: .8 } to { transform: scale(1.7); opacity: 0 } }
@keyframes tipIn { 0% { opacity: 0; transform: translate(10px,-50%) } 8%,85% { opacity: 1; transform: translate(0,-50%) } 100% { opacity: 0 } }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .3s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(10,8,24,.45); z-index: 35; }
  .menu-toggle { display: grid; }
  .g-main, .g-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 720px) {
  .content { padding: 4px 16px 90px; }
  .topbar { padding: 12px 16px; gap: 8px; }
  .search kbd, .user-chip div { display: none; }
  .user-chip { padding: 3px; }
  .g-2, .g-4, .form-grid { grid-template-columns: 1fr; }
  .dropdown-panel { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
  h1 { font-size: 24px; }
  .hero-card { padding: 24px; }
  .hero-card h1 { font-size: 24px; }
  .hero-card .orb.a { width: 110px; height: 110px; right: -20px; }
  .hero-card .orb.b, .hero-card .ring3d { display: none; }
  .kpi .value { font-size: 30px; }
  .fc .fc-toolbar { flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (max-width: 720px) { .hide-xs { display: none; } }

/* ---------- Mobile polish ---------- */
html, body { max-width: 100%; overflow-x: clip; }
.search { min-width: 0; }
.search-toggle { display: none; }
.page-head > div { min-width: 0; }
.page-head h1 { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar .search { display: none; order: 10; flex: 1 1 100%; max-width: none; }
  body.search-open .topbar .search { display: flex; }
  .search-toggle { display: grid; }
  .topbar .btn-primary { width: 42px; height: 42px; padding: 0; border-radius: 50%; }
  .icon-btn { width: 40px; height: 40px; }
  .page-head { margin: 6px 0 16px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .input { min-width: 140px; flex: 0 0 auto; }
  .tabs { width: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .card { padding: 18px; border-radius: 18px; }
  .card.flush { padding: 0; }
  .card-head { flex-wrap: wrap; }
  .kpi .value { font-size: 28px; }
  .grid { gap: 14px; }
  .list-item { flex-wrap: wrap; }
  .list-item .grow { flex: 1 1 60%; }
  .list-item form, .list-item > .btn { flex: 0 0 auto; }
  .table th, .table td { padding: 12px; }
  .table td { white-space: nowrap; }
  .chart-box { height: 220px; }
  .board { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 0 16px 12px; }
  .column { scroll-snap-align: start; }
  .fc .fc-toolbar-title { font-size: 17px; }
  .fc .fc-button { padding: 6px 10px; font-size: 12px; }
  .preview-phone { max-width: 300px; }
  .card.violet form .input { min-width: 0 !important; flex: 1 1 100% !important; }
  .card.violet form .btn { flex: 1 1 auto; }
  .comment { gap: 8px; }
  .meta-row { flex-wrap: wrap; }
  .meta-row span:last-child { text-align: right; margin-left: auto; }
  .dropdown-panel { top: 64px; }
  .notif-list { max-height: 60vh; }
  .toasts { top: auto; bottom: 96px; right: 12px; left: 12px; width: auto; }
  .wa { right: 14px; bottom: 14px; }
  .wa-btn { width: 54px; height: 54px; }
  .wa-btn svg { width: 28px; height: 28px; }
  .wa-tip { display: none; }
  .wa-panel { width: calc(100vw - 28px); }
  .demo-logins { grid-template-columns: 1fr 1fr 1fr !important; }
  .auth-form { padding: 28px 16px 90px; }
  .error-page .code { font-size: 84px; }
}
@media (max-width: 380px) {
  .topbar { padding: 10px 12px; gap: 6px; }
  .icon-btn { width: 38px; height: 38px; }
  .demo-logins { grid-template-columns: 1fr !important; }
}

.cal-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.ev-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ev-list b { color: var(--ink); font-weight: 700; }
.ev-list small { color: var(--muted); width: 100%; }
.fc .fc-list-event:hover td { background: var(--surface-2); }
@media (max-width: 1024px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .grid.g-4 { grid-template-columns: 1fr 1fr; }
  .grid.g-4 .kpi { padding: 16px; gap: 10px; }
  .grid.g-4 .kpi .kpi-ico { width: 36px; height: 36px; border-radius: 11px; }
  .grid.g-4 .kpi .kpi-top .pill, .grid.g-4 .kpi .kpi-top .trend { font-size: 10px; padding: 2px 7px; }
  .fc .fc-list-event-time { white-space: nowrap; }
  .fc .fc-list-table td { padding: 10px 8px; }
}
