/* =========================================================
   Amexe — Marketing Operating System
   Premium design system (light + dark)
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Tokens ---------- */
:root {
    --bg:            #F8FAFC;
    --surface:       #FFFFFF;
    --surface-2:     #F1F5F9;
    --border:        #E2E8F0;
    --border-strong: #CBD5E1;
    --text:          #0F172A;
    --text-muted:    #64748B;
    --text-soft:     #94A3B8;

    --brand:         #6366F1;
    --brand-hover:   #4F46E5;
    --brand-soft:    #EEF2FF;

    --success:       #10B981;
    --success-soft:  #D1FAE5;
    --warning:       #F59E0B;
    --warning-soft:  #FEF3C7;
    --danger:        #EF4444;
    --danger-soft:   #FEE2E2;
    --info:          #0EA5E9;
    --info-soft:     #DBEAFE;
    --purple:        #8B5CF6;
    --pink:          #EC4899;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
    --shadow:    0 4px 12px rgba(15,23,42,0.08);
    --shadow-lg: 0 12px 32px rgba(15,23,42,0.12);

    --sidebar-w: 240px;
    --topbar-h: 60px;
}

html[data-theme="dark"] {
    --bg:            #0B1220;
    --surface:       #111827;
    --surface-2:     #1E293B;
    --border:        #1E293B;
    --border-strong: #334155;
    --text:          #F1F5F9;
    --text-muted:    #94A3B8;
    --text-soft:     #64748B;
    --brand-soft:    #1E1B4B;
    --success-soft:  #052E24;
    --warning-soft:  #422006;
    --danger-soft:   #450A0A;
    --info-soft:     #082F49;
}

/* ---------- Reset helpers ---------- */
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---------- Layout ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 18px 12px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar__brand {
    display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px 10px;
    border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.brand-logo {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--purple));
    color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-tagline { font-size: 11px; color: var(--text-muted); }

.nav-section { padding: 8px 10px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); font-weight: 600; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    color: var(--text-muted); font-weight: 500; margin-bottom: 2px; font-size: 13.5px;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand); }
.nav-item .ni-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item .ni-badge {
    margin-left: auto; background: var(--danger); color: #fff;
    font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 600;
}

.main { min-width: 0; }
.topbar {
    height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 16px; padding: 0 20px;
}
.topbar__search {
    flex: 1; max-width: 560px; position: relative;
}
.topbar__search input {
    width: 100%; height: 38px; padding: 0 12px 0 38px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    outline: none; transition: border-color .15s, background .15s;
}
.topbar__search input:focus { border-color: var(--brand); background: var(--surface); }
.topbar__search::before {
    content: ''; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat;
}
.topbar__search kbd {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font: 11px monospace; color: var(--text-soft); padding: 2px 6px;
    border: 1px solid var(--border); border-radius: 4px; background: var(--surface);
}

.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px;
    color: var(--text-muted); position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn__dot {
    position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
    background: var(--danger); border-radius: 50%; border: 2px solid var(--surface);
}

.avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft);
    color: var(--brand); font-weight: 600; font-size: 12px;
    display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.page {
    padding: 24px 28px 60px;
    max-width: 1400px;
    margin: 0 auto;
}
.page__header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin-bottom: 24px; flex-wrap: wrap;
}
.page__title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page__subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.crumbs { color: var(--text-muted); font-size: 12px; margin-bottom: 4px; }
.crumbs a:hover { color: var(--brand); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 500; font-size: 13px;
    border: 1px solid transparent; transition: background .15s, border-color .15s, transform .05s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); }
.btn--outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn--outline:hover { background: var(--surface-2); }
.btn--ghost   { background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger  { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #DC2626; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; padding: 0; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 18px; box-shadow: var(--shadow-sm);
}
.card__title { font-size: 13px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card__title .link { margin-left: auto; font-size: 12px; color: var(--brand); font-weight: 500; }

/* KPI Card */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 16px 18px; position: relative; overflow: hidden;
}
.kpi__label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.kpi__value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.kpi__delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; margin-top: 6px; font-weight: 500; }
.kpi__delta.up { color: var(--success); }
.kpi__delta.down { color: var(--danger); }
.kpi__icon {
    position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
    border-radius: 8px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand);
}
.kpi--danger .kpi__icon { background: var(--danger-soft); color: var(--danger); }
.kpi--success .kpi__icon { background: var(--success-soft); color: var(--success); }
.kpi--warning .kpi__icon { background: var(--warning-soft); color: var(--warning); }
.kpi--info    .kpi__icon { background: var(--info-soft);    color: var(--info); }
.kpi--purple  .kpi__icon { background: #EDE9FE;             color: var(--purple); }
html[data-theme="dark"] .kpi--purple .kpi__icon { background: #2E1065; }

/* ---------- Grid utilities ---------- */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: 2fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 20px; }
.mt-sm { margin-top: 6px; }
.mt-md { margin-top: 12px; }
.mt-lg { margin-top: 20px; }
.text-muted { color: var(--text-muted); }
.text-soft  { color: var(--text-soft); }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
    background: var(--surface-2); color: var(--text-muted);
}
.badge--dot::before {
    content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
}
.badge--brand    { background: var(--brand-soft);   color: var(--brand); }
.badge--success  { background: var(--success-soft); color: var(--success); }
.badge--warning  { background: var(--warning-soft); color: var(--warning); }
.badge--danger   { background: var(--danger-soft);  color: var(--danger); }
.badge--info     { background: var(--info-soft);    color: var(--info); }

/* Priority pills */
.prio { padding: 1px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.prio-low      { background: #E2E8F0; color: #64748B; }
.prio-normal   { background: var(--info-soft);    color: var(--info); }
.prio-high     { background: var(--warning-soft); color: var(--warning); }
.prio-urgent   { background: var(--danger-soft);  color: var(--danger); }
.prio-critical { background: #7F1D1D; color: #FEE2E2; }

/* Status pills */
.status { padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.st-backlog     { background: #E2E8F0; color: #475569; }
.st-todo        { background: #F1F5F9; color: #334155; }
.st-in_progress { background: var(--info-soft);    color: var(--info); }
.st-review      { background: var(--warning-soft); color: var(--warning); }
.st-corrections { background: var(--danger-soft);  color: var(--danger); }
.st-validated   { background: var(--success-soft); color: var(--success); }
.st-scheduled   { background: #EDE9FE;             color: var(--purple); }
.st-published   { background: var(--info-soft);    color: var(--info); }
.st-done        { background: var(--success-soft); color: var(--success); }
.st-planned     { background: #F1F5F9;             color: #475569; }
.st-active      { background: var(--success-soft); color: var(--success); }
.st-at_risk     { background: var(--warning-soft); color: var(--warning); }
.st-blocked     { background: var(--danger-soft);  color: var(--danger); }
.st-cancelled   { background: #E2E8F0;             color: #64748B; }
.st-draft       { background: #E2E8F0;             color: #475569; }
.st-paused      { background: var(--warning-soft); color: var(--warning); }
html[data-theme="dark"] .st-backlog, html[data-theme="dark"] .st-todo, html[data-theme="dark"] .st-planned, html[data-theme="dark"] .st-cancelled, html[data-theme="dark"] .st-draft { background: #1E293B; color: #94A3B8; }
html[data-theme="dark"] .prio-low { background: #1E293B; color: #94A3B8; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.form-control {
    width: 100%; height: 38px; padding: 0 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); outline: none;
    transition: border-color .15s;
}
.form-control:focus { border-color: var(--brand); }
textarea.form-control { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-help { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.select {
    width: 100%; height: 38px; padding: 0 32px 0 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.table th { font-weight: 600; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.table tr:hover td { background: var(--surface-2); }
.table__empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ---------- Progress ---------- */
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s; }
.progress--success .progress__bar { background: var(--success); }
.progress--warning .progress__bar { background: var(--warning); }
.progress--danger  .progress__bar { background: var(--danger); }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; margin: 0 -8px; padding: 0 8px 14px; }
.kanban__col {
    flex: 0 0 300px; background: var(--surface-2); border-radius: var(--radius-lg);
    padding: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 200px);
}
.kanban__head {
    display: flex; align-items: center; gap: 8px; padding: 4px 8px 10px 8px; font-size: 12px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.kanban__head .col-dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban__head .col-count {
    background: var(--surface); color: var(--text-muted); font-size: 11px; font-weight: 600;
    padding: 1px 7px; border-radius: 999px;
}
.kanban__list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.kanban__list.is-dragging-over { background: rgba(99, 102, 241, 0.05); border-radius: 8px; }

.kcard {
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
    cursor: grab; box-shadow: var(--shadow-sm); transition: transform .1s, box-shadow .15s;
}
.kcard:hover { box-shadow: var(--shadow); }
.kcard.is-dragging { opacity: 0.4; }
.kcard__meta { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.kcard__title { font-weight: 500; font-size: 13px; margin: 4px 0; line-height: 1.35; }
.kcard__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.kcard__footer .kcard-icons { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 11px; }
.kcard__footer .kcard-icons svg { width: 12px; height: 12px; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px);
    display: grid; place-items: center; z-index: 100; padding: 24px;
}
.modal-overlay.hidden { display: none !important; }
.modal {
    background: var(--surface); border-radius: var(--radius-xl); max-width: 700px; width: 100%;
    max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal--lg { max-width: 900px; }
.modal__header {
    padding: 18px 22px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal__title { font-size: 17px; font-weight: 700; }
.modal__body { padding: 22px; }
.modal__footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown__menu {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px; padding: 6px;
    box-shadow: var(--shadow-lg); z-index: 40;
}
.dropdown__menu.hidden { display: none; }
.dropdown__item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: 6px; font-size: 13px; color: var(--text); width: 100%; text-align: left;
}
.dropdown__item:hover { background: var(--surface-2); }
.dropdown__divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
    background: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 50%, #EC4899 100%);
    color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.auth-side::after {
    content: ''; position: absolute; inset: 0; opacity: 0.15;
    background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4), transparent 40%),
                      radial-gradient(circle at 80% 70%, rgba(255,255,255,0.3), transparent 40%);
}
.auth-side__title { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; position: relative; }
.auth-side__quote { font-size: 15px; opacity: 0.9; max-width: 400px; position: relative; }
.auth-side .brand-logo { background: rgba(255,255,255,0.2); }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-form__box { width: 100%; max-width: 380px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

.alert {
    padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
    border-left: 3px solid;
}
.alert--danger  { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger); }
.alert--success { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.alert--info    { background: var(--info-soft);    color: var(--info);    border-color: var(--info); }
.alert--warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }

/* ---------- Calendar ---------- */
.calendar {
    background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden;
}
.cal-head {
    display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.cal-head > div { padding: 10px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day {
    min-height: 110px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 3px; position: relative;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day--out { background: var(--surface-2); opacity: 0.6; }
.cal-day--today .cal-day__num { background: var(--brand); color: #fff; }
.cal-day__num {
    font-size: 12px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center;
    border-radius: 6px; margin-bottom: 3px;
}
.cal-item {
    font-size: 11px; padding: 3px 6px; border-radius: 4px; cursor: pointer;
    color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500;
}
.cal-item.ch-instagram { background: #EC4899; }
.cal-item.ch-tiktok    { background: #0F172A; }
.cal-item.ch-facebook  { background: #1877F2; }
.cal-item.ch-linkedin  { background: #0A66C2; }
.cal-item.ch-email     { background: #F59E0B; }
.cal-item.ch-sms       { background: #10B981; }
.cal-item.ch-blog      { background: #6366F1; }
.cal-item.ch-youtube   { background: #DC2626; }
.cal-item.ch-website   { background: #0EA5E9; }
.cal-item.ch-meta_ads  { background: #1877F2; }
.cal-item.ch-google_ads{ background: #EA4335; }

/* ---------- Task detail ---------- */
.task-detail__grid { display: grid; grid-template-columns: 1fr 260px; gap: 24px; }
@media (max-width: 900px) { .task-detail__grid { grid-template-columns: 1fr; } }
.task-side .meta-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.task-side .meta-row:last-child { border-bottom: none; }
.task-side .meta-row .k { color: var(--text-muted); }
.checklist-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.checklist-item.is-done { text-decoration: line-through; color: var(--text-muted); }

.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment__body { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; flex: 1; font-size: 13px; }
.comment__meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.comment__meta strong { color: var(--text); font-weight: 600; }

/* ---------- Command palette ---------- */
.cmdk-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(6px);
    display: grid; place-items: flex-start center; padding-top: 12vh; z-index: 200;
}
.cmdk-overlay.hidden { display: none !important; }
.cmdk {
    width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px;
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.cmdk__input { width: 100%; height: 52px; padding: 0 18px; border: none; border-bottom: 1px solid var(--border); background: transparent; font-size: 15px; outline: none; }
.cmdk__list { max-height: 60vh; overflow-y: auto; padding: 6px; }
.cmdk__section { font-size: 10.5px; text-transform: uppercase; color: var(--text-muted); padding: 8px 10px 4px; letter-spacing: 0.06em; font-weight: 600; }
.cmdk__item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.cmdk__item:hover, .cmdk__item.is-active { background: var(--surface-2); }
.cmdk__item .item-hint { margin-left: auto; font-size: 11px; color: var(--text-muted); }

/* ---------- Content Studio ---------- */
.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.content-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
    transition: box-shadow .15s;
}
.content-card:hover { box-shadow: var(--shadow); }
.content-card__banner {
    height: 120px; background: linear-gradient(135deg, var(--brand), var(--purple));
    display: grid; place-items: center; color: rgba(255,255,255,0.5); font-size: 40px;
}
.content-card__body { padding: 14px; }
.content-card__title { font-weight: 600; font-size: 14px; }
.content-card__meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Workload ---------- */
.workload-bar {
    height: 24px; border-radius: 6px; background: var(--surface-2);
    overflow: hidden; position: relative; margin-top: 4px;
}
.workload-bar__fill { height: 100%; }
.workload-bar__fill--ok   { background: var(--success); }
.workload-bar__fill--warn { background: var(--warning); }
.workload-bar__fill--over { background: var(--danger); }

/* ---------- Utilities ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--surface-2); color: var(--text-muted); }
.tag { display: inline-flex; padding: 1px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 500; background: var(--surface-2); color: var(--text-muted); }

.morning-card {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%); color: #fff;
    border-radius: var(--radius-xl); padding: 28px; margin-bottom: 24px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px;
}
.morning-card h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.morning-card .morning-stats { display: flex; gap: 24px; }
.morning-card .m-stat { text-align: center; }
.morning-card .m-stat b { display: block; font-size: 28px; font-weight: 700; }
.morning-card .m-stat span { font-size: 12px; opacity: 0.85; }

.executive .health {
    padding: 24px; border-radius: var(--radius-xl); background: var(--surface);
    border: 1px solid var(--border); display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
}
.health__dot { width: 60px; height: 60px; border-radius: 50%; }
.health__dot--green  { background: var(--success); box-shadow: 0 0 30px rgba(16,185,129,0.4); }
.health__dot--orange { background: var(--warning); box-shadow: 0 0 30px rgba(245,158,11,0.4); }
.health__dot--red    { background: var(--danger);  box-shadow: 0 0 30px rgba(239,68,68,0.4); }

/* ---------- Icons via inline svg color ---------- */
.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Guided tour (onboarding) ---------- */
.tour-overlay {
    position: fixed; inset: 0; z-index: 9998; pointer-events: auto;
    display: none;
}
.tour-overlay .tour-mask { position: absolute; inset: 0; width: 100%; height: 100%; }

.tour-card {
    position: fixed; z-index: 10000; display: none;
    width: 340px; max-width: calc(100vw - 24px);
    background: var(--surface); color: var(--text);
    border-radius: 14px; box-shadow: 0 24px 60px rgba(15,23,42,0.35);
    padding: 18px 20px 14px; transition: left .2s, top .2s, opacity .15s;
}
.tour-card__step {
    font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--brand); font-weight: 700; margin-bottom: 6px;
}
.tour-card__title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.tour-card__body  { font-size: 13.5px; line-height: 1.55; color: var(--text-muted); margin-bottom: 16px; }
.tour-card__footer { display: flex; align-items: center; gap: 8px; }

.tour-btn {
    border: none; background: transparent; font: inherit; cursor: pointer;
    padding: 8px 14px; border-radius: 8px; font-weight: 500; font-size: 13px; transition: background .15s;
}
.tour-btn--ghost   { color: var(--text-muted); }
.tour-btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.tour-btn--outline { border: 1px solid var(--border); color: var(--text); }
.tour-btn--outline:hover { background: var(--surface-2); }
.tour-btn--primary { background: var(--brand); color: #fff; }
.tour-btn--primary:hover { background: var(--brand-hover); }

/* Floating help launcher */
.tour-help {
    position: fixed; right: 20px; bottom: 20px; z-index: 9997;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface); color: var(--brand);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    display: grid; place-items: center; font-size: 20px; font-weight: 700;
    cursor: pointer; transition: transform .1s, box-shadow .15s;
}
.tour-help:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #fff; background: var(--brand); }

/* ---------- Scrollbar polish ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }
