@import url('./vendor/fonts.css');

/* PowerMarketing design system.
   Dark is the product default; [data-theme="light"] flips the palette.
   Both sets are complete — never define a colour only inside the light block. */

:root {
    /* Surfaces */
    --ground:        #06090F;
    --bg:            #0A0E1C;
    --surface:       #121A2E;
    --surface2:      #18223C;
    --surface3:      #1F2A48;
    --sidebar-bg:    #0C1224;
    --border:        #243157;
    --border-soft:   #1B2440;
    --border-strong: #33436F;

    /* Interaction */
    --hover:         rgba(168, 180, 212, 0.07);
    --hover-strong:  rgba(168, 180, 212, 0.11);
    --scroll:        rgba(168, 180, 212, 0.18);
    --scroll-hover:  rgba(168, 180, 212, 0.30);

    /* Ink */
    --text:          #E8EDFA;
    --text-muted:    #A8B4D4;
    --text-faint:    #6E7CA0;

    /* Accent — the one brand colour, plus its gradient partner */
    --accent:        #4C8DFF;
    --accent-hover:  #6BA1FF;
    --accent2:       #2DE3C4;
    --violet:        #7C6BFF;
    --accent-ink:    #0A0E1C;
    --accent-wash:   rgba(76, 141, 255, 0.13);
    --primary:       #4C8DFF;

    /* Semantic — deliberately separate from the accent, so "needs you"
       never reads as "this is a button". */
    --success:       #2DD48F;
    --warning:       #FFB454;
    --danger:        #FF6B7A;
    --success-bg:    rgba(45, 212, 143, 0.13);
    --warning-bg:    rgba(255, 180, 84, 0.13);
    --danger-bg:     rgba(255, 107, 122, 0.13);
    --info-bg:       rgba(76, 141, 255, 0.13);

    /* Depth */
    --glow:          0 0 28px rgba(76, 141, 255, 0.30);
    --glow-soft:     0 0 18px rgba(45, 227, 196, 0.22);
    --shadow-sm:     0 1px 0 rgba(255, 255, 255, 0.04) inset;
    --shadow-md:     0 12px 32px rgba(0, 0, 0, 0.45);

    /* Type */
    --font:          'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --display:       'Sora', 'Manrope', sans-serif;
    --mono:          'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

    /* Metrics */
    --radius:        10px;
    --radius-sm:     8px;
    --sidebar-w:     250px;
    --topbar-h:      58px;
}

[data-theme="light"] {
    --ground:        #E4E8F2;
    --bg:            #F4F6FC;
    --surface:       #FFFFFF;
    --surface2:      #EEF2FB;
    --surface3:      #E3EAF8;
    --sidebar-bg:    #FFFFFF;
    --border:        #D8E0F1;
    --border-soft:   #E6EBF7;
    --border-strong: #BCC8E2;

    --hover:         rgba(77, 88, 118, 0.06);
    --hover-strong:  rgba(77, 88, 118, 0.10);
    --scroll:        rgba(77, 88, 118, 0.20);
    --scroll-hover:  rgba(77, 88, 118, 0.34);

    --text:          #111729;
    --text-muted:    #4D5876;
    --text-faint:    #7C87A6;

    --accent:        #2F6FE4;
    --accent-hover:  #2560CC;
    --accent2:       #0E9E8A;
    --violet:        #6354E8;
    --accent-ink:    #FFFFFF;
    --accent-wash:   rgba(47, 111, 228, 0.09);
    --primary:       #2F6FE4;

    --success:       #12996B;
    --warning:       #B4720C;
    --danger:        #D64354;
    --success-bg:    rgba(18, 153, 107, 0.11);
    --warning-bg:    rgba(180, 114, 12, 0.12);
    --danger-bg:     rgba(214, 67, 84, 0.11);
    --info-bg:       rgba(47, 111, 228, 0.10);

    --glow:          0 4px 16px rgba(47, 111, 228, 0.20);
    --glow-soft:     0 4px 14px rgba(14, 158, 138, 0.18);
    --shadow-sm:     0 1px 2px rgba(24, 38, 74, 0.05);
    --shadow-md:     0 8px 24px rgba(24, 38, 74, 0.10);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; }
.mono, .pm-mono { font-family: var(--mono); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── Shell layout ─────────────────────────────────────────────────────────── */

.pm-shell { display: flex; min-height: 100vh; }

.pm-sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-x: hidden;
    z-index: 200;
}

/* A soft wash at the top of the rail, so the brand mark sits in light. */
.pm-sidebar::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 200px;
    pointer-events: none;
    background: radial-gradient(120% 90% at 12% 0%, var(--accent-wash), transparent 70%);
}
.pm-sidebar > * { position: relative; z-index: 1; }

.pm-main { flex: 1; min-width: 0; overflow-x: hidden; }

/* ── Topbar ───────────────────────────────────────────────────────────────── */

.pm-topbar {
    display: flex;
    align-items: center;
    gap: 13px;
    height: var(--topbar-h);
    padding: 0 20px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 150;
}

.pm-crumb { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.pm-crumb h2 { font-size: 15px; font-weight: 600; white-space: nowrap; }
.pm-crumb span {
    font-size: 12px; color: var(--text-faint);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pm-omni {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 9px;
    width: min(320px, 36%);
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--border-soft);
    color: var(--text-faint);
    font-size: 12.5px;
    font-family: var(--font);
    cursor: pointer;
    text-align: left;
}
.pm-omni:hover { border-color: var(--accent); color: var(--text-muted); }
.pm-omni-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-omni kbd {
    font-family: var(--mono); font-size: 10px; padding: 1px 5px;
    border-radius: 4px; border: 1px solid var(--border); color: var(--text-faint);
    flex-shrink: 0;
}

.pm-icon-btn {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    display: grid; place-items: center; flex-shrink: 0;
    color: var(--text-muted); background: none; border: none; cursor: pointer;
    position: relative; transition: background .12s, color .12s;
}
.pm-icon-btn:hover { background: var(--surface2); color: var(--text); }
.pm-dot-badge {
    position: absolute; top: 6px; right: 6px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--danger); box-shadow: 0 0 0 2px var(--bg);
}

.pm-who {
    display: flex; align-items: center; gap: 9px; flex-shrink: 0;
    padding: 4px 11px 4px 4px; border-radius: 999px;
    border: 1px solid var(--border-soft); background: none;
    cursor: pointer; color: inherit; font-family: var(--font);
    transition: border-color .12s;
}
.pm-who:hover { border-color: var(--accent); }
.pm-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center;
    background: linear-gradient(145deg, var(--violet), var(--accent));
    color: #fff; font-family: var(--display); font-size: 11px; font-weight: 600;
}
.pm-who-n { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.pm-who-r { font-size: 10px; color: var(--text-faint); line-height: 1.2; }

@media (max-width: 760px) {
    .pm-omni { width: auto; }
    .pm-omni-label, .pm-omni kbd, .pm-who-n, .pm-who-r { display: none; }
}

/* ── Sidebar internals ────────────────────────────────────────────────────── */

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 18px 18px 14px;
    color: var(--text);
    text-decoration: none;
}
.sidebar-brand-icon {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, var(--accent), var(--violet));
    color: #fff;
    display: grid; place-items: center;
    box-shadow: var(--glow);
}
.sidebar-brand-name { font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.15; }
.sidebar-brand-sub {
    font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
    color: var(--text-faint);
}

.sidebar-brand-selector { padding: 0 14px 12px; }
.sidebar-brand-selector label {
    display: block;
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: .16em;
    margin-bottom: 6px;
}

.sidebar-section { padding: 2px 10px 10px; flex: 1; overflow-y: auto; }
.sidebar-section-label {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: .16em;
    padding: 12px 8px 6px;
    display: block;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .14s, color .14s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    margin-bottom: 1px;
    position: relative;
    font-family: var(--font);
}

.sidebar-nav-link:hover { background: var(--surface2); color: var(--text); }

.sidebar-nav-link.active {
    background: linear-gradient(90deg, var(--accent-wash), transparent 85%);
    color: var(--text);
    font-weight: 600;
}
/* The glowing rail marker that says "you are here". */
.sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: -10px; top: 7px; bottom: 7px;
    width: 3px; border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    box-shadow: var(--glow);
}
.sidebar-nav-link .nav-icon { flex-shrink: 0; color: var(--text-faint); transition: color .14s; display: block; }
.sidebar-nav-link:hover .nav-icon { color: var(--text-muted); }
.sidebar-nav-link.active .nav-icon { color: var(--accent); }

.nav-count {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
}
.nav-count.nav-count-quiet { background: var(--surface3); color: var(--text-muted); }

/* ── Sidebar collapsible groups ───────────────────────────────────────────── */

.sidebar-group { margin-bottom: 1px; }

.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--font);
    text-align: left;
    border-radius: var(--radius-sm);
    transition: background .14s, color .14s;
}
.sidebar-group-header:hover { background: var(--surface2); color: var(--text); }
.sidebar-group-header .nav-icon { flex-shrink: 0; color: var(--text-faint); display: block; }
.sidebar-group-label { flex: 1; }
.sidebar-group-chevron { color: var(--text-faint); transition: transform .18s; display: block; flex-shrink: 0; }
.sidebar-group.open > .sidebar-group-header .sidebar-group-chevron { transform: rotate(90deg); }
.sidebar-group-items {
    display: none;
    padding: 2px 0 4px 14px;
    margin: 1px 0 4px 11px;
    border-left: 1px solid var(--border-soft);
}
.sidebar-group.open > .sidebar-group-items { display: block; }
.sidebar-group-items .sidebar-nav-link { padding: 6px 10px; font-size: 13px; }
.sidebar-group-items .sidebar-nav-link.active::before { left: -15px; }

.sidebar-system { padding: 8px 10px; border-top: 1px solid var(--border-soft); }

/* ── Sidebar foot: autopilot gauge + status ───────────────────────────────── */

.sidebar-gauge { padding: 10px 14px 0; }
.sidebar-gauge-card {
    border-radius: var(--radius);
    padding: 13px;
    border: 1px solid var(--border-soft);
    background: linear-gradient(160deg, var(--surface2), var(--surface));
    display: flex;
    align-items: center;
    gap: 12px;
}
.pm-ring { position: relative; flex-shrink: 0; }
.pm-ring figcaption {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-family: var(--display); font-weight: 600;
}
.sidebar-gauge-meta { min-width: 0; }
.sidebar-gauge-k { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.sidebar-gauge-v { font-family: var(--display); font-size: 13px; font-weight: 600; margin-top: 2px; }
.sidebar-gauge-n { font-size: 10.5px; color: var(--text-faint); margin-top: 1px; }

.sidebar-status {
    display: flex; align-items: center; gap: 7px;
    padding: 11px 18px 12px; margin-top: 10px;
    border-top: 1px solid var(--border-soft);
    font-family: var(--mono); font-size: 10px; color: var(--text-faint);
}
.sidebar-status-pulse {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
    background: var(--success); box-shadow: 0 0 0 3px var(--success-bg);
}

.sidebar-footer { padding: 10px; border-top: 1px solid var(--border-soft); }

.sidebar-signout {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .12s, color .12s;
    font-family: var(--font);
}
.sidebar-signout:hover { border-color: var(--danger); color: var(--danger); }

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 17px;
    box-shadow: var(--shadow-sm);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    border: none; transition: background .12s, border-color .12s, color .12s, filter .12s;
    font-family: var(--font);
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--violet));
    color: #fff;
    box-shadow: var(--glow);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: none; color: var(--text-muted); border: 1px solid var(--border); }
.btn-secondary:hover { color: var(--text); border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

/* ── Inputs ───────────────────────────────────────────────────────────────── */

input, select, textarea {
    background: var(--surface2); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); color: var(--text);
    padding: 8px 11px; font-size: 13.5px; width: 100%;
    font-family: var(--font);
}
input[type="checkbox"], input[type="radio"] {
    width: auto; padding: 0; background: none;
    border: none; border-radius: 0; flex-shrink: 0;
    accent-color: var(--accent);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

/* ── Badges ───────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
    border: 1px solid transparent;
}
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }
.badge-muted   { background: var(--surface2);   color: var(--text-faint); border-color: var(--border-soft); }
.badge-info    { background: var(--info-bg);    color: var(--accent);  border-color: var(--accent); }

/* ── Tables ───────────────────────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; }
th {
    text-align: left; padding: 0 12px 9px 0;
    color: var(--text-faint); font-size: 9.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .13em;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 11px 12px 11px 0; font-size: 12.5px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }
.pm-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Page structure ───────────────────────────────────────────────────────── */

.page { max-width: 1320px; margin: 0 auto; padding: 22px; }
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 26px; font-weight: 600; }
.page-header p { color: var(--text-faint); margin-top: 4px; font-size: 13px; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-faint); }

/* ── Brand selector ───────────────────────────────────────────────────────── */

#brand-selector {
    background: var(--surface2); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); color: var(--text);
    padding: 8px 10px; font-size: 13px; width: 100%; font-weight: 600;
}
#brand-selector:hover { border-color: var(--accent); }

/* ── Settings tabs ────────────────────────────────────────────────────────── */

.settings-tab-bar {
    display: flex;
    gap: 26px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 22px;
    overflow-x: auto;
}
.settings-tab-bar button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 12px 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-faint);
    cursor: pointer;
    white-space: nowrap;
    transition: color .12s, border-color .12s;
    font-family: var(--font);
}
.settings-tab-bar button:hover { color: var(--text-muted); }
.settings-tab-bar button.tab-active { color: var(--text); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.tab-active { display: block; }

/* ── Owner card ───────────────────────────────────────────────────────────── */

.owner-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-soft);
    gap: 12px;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }

/* ── Elevated components ──────────────────────────────────────────────────── */

.eyebrow {
    font-family: var(--mono);
    text-transform: uppercase; letter-spacing: .22em;
    color: var(--accent2); font-size: 9.5px; font-weight: 500;
    margin-bottom: 5px;
}
.section-title { font-size: 13.5px; font-weight: 600; margin-bottom: 13px; display: flex; align-items: center; gap: 8px; font-family: var(--display); }
.section-title .st-accent { color: var(--accent); }

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius); padding: 15px;
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(80% 120% at 100% 0%, var(--accent-wash), transparent 60%);
}
.stat-card > * { position: relative; }
.stat-card .stat-label { text-transform: uppercase; letter-spacing: .12em; font-size: 9.5px; color: var(--text-faint); font-weight: 600; }
.stat-card .stat-value { font-family: var(--display); font-size: 26px; font-weight: 600; margin-top: 4px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-card .stat-sub { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* A stat tile carrying a ring gauge beside the figure. */
.stat-card.stat-ring { display: flex; align-items: center; gap: 13px; }
.stat-card.stat-ring .stat-body { min-width: 0; }

/* Status pill */
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 999px; padding: 4px 11px;
    font-weight: 600; font-size: 11px;
    background: var(--info-bg); color: var(--accent);
    border: 1px solid var(--accent);
}
.status-pill.pill-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.status-pill.pill-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.status-pill.pill-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }
.status-pill.pill-muted   { background: var(--surface2);   color: var(--text-faint); border-color: var(--border-soft); }

/* Funnel / flow */
.pm-flow { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.pm-flow-step {
    flex: 1; min-width: 130px;
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius); padding: 14px 16px;
    margin-right: 30px; position: relative; box-shadow: var(--shadow-sm);
}
.pm-flow-step:last-child { margin-right: 0; }
.pm-flow-step::after {
    content: '\2192'; position: absolute; right: -22px; top: 50%;
    transform: translateY(-50%); color: var(--text-faint); font-size: 18px;
}
.pm-flow-step:last-child::after { display: none; }
.pm-flow-step .flow-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); font-weight: 600; }
.pm-flow-step .flow-count { font-family: var(--display); font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pm-flow-step.flow-hot { border-color: var(--accent); box-shadow: var(--glow); }

/* Segmented control */
.seg {
    display: inline-flex; background: var(--surface2);
    border: 1px solid var(--border-soft); border-radius: 999px;
    padding: 3px; gap: 3px;
}
.seg button {
    background: none; border: none; color: var(--text-faint);
    padding: 5px 13px; border-radius: 999px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    font-family: var(--font); transition: background .12s, color .12s;
}
.seg button:hover { color: var(--text-muted); }
.seg button.seg-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Activity feed */
.activity-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 12px; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--accent); }
.activity-dot.dot-success { background: var(--success); }
.activity-dot.dot-warning { background: var(--warning); }
.activity-dot.dot-danger  { background: var(--danger); }
.activity-time { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 2px; }

/* Approval row */
.approval-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-soft);
}
.approval-row:last-child { border-bottom: none; }

/* Progress bars — used by the distribution stack and anything with a share */
.pm-bar-row { display: flex; flex-direction: column; gap: 5px; }
.pm-bar-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.pm-bar-head b { font-weight: 600; }
.pm-bar-head .pm-bar-v { margin-left: auto; font-family: var(--mono); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pm-track { height: 7px; border-radius: 999px; background: var(--surface3); overflow: hidden; }
.pm-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: var(--glow-soft); }
.pm-fill.pm-fill-alt { background: linear-gradient(90deg, var(--violet), var(--accent)); }
.pm-bar-note { font-size: 11px; color: var(--text-faint); }

/* Card hover lift for interactive cards */
.card-lift { transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease; }
.card-lift:hover { box-shadow: var(--shadow-md); border-color: var(--accent); transform: translateY(-1px); }

/* fade-in */
@keyframes pmFadeIn { from { opacity: .01; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pm-fade { animation: pmFadeIn .25s ease; }

/* ── Workflow page (living pipeline) ─────────────────────────────────────── */

.wf-canvas { display: flex; align-items: stretch; gap: 0; flex-wrap: nowrap; overflow-x: auto; margin: 24px 0; padding-bottom: 6px; }
.wf-node {
    flex: 1; min-width: 155px; max-width: 220px;
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 14px 16px; margin-right: 36px; position: relative;
    cursor: pointer; box-shadow: var(--shadow-sm);
    transition: box-shadow .15s, border-color .15s;
}
.wf-node:hover { box-shadow: var(--shadow-md); }
.wf-node.wf-selected { border-color: var(--accent); box-shadow: var(--glow); }
.wf-node:last-child { margin-right: 0; }
.wf-node::after {
    content: ''; position: absolute; right: -36px; top: 50%; width: 36px; height: 2px;
    background: var(--border);
}
.wf-node:last-child::after { display: none; }
.wf-node-head { display: flex; align-items: center; gap: 8px; }
.wf-node-icon { color: var(--accent); display: block; flex-shrink: 0; }
.wf-node-label { font-weight: 600; font-size: 13.5px; flex: 1; }
.wf-node-summary { font-size: 12px; color: var(--text-faint); margin-top: 6px; line-height: 1.45; }
.wf-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.wf-dot.ok        { background: var(--success); }
.wf-dot.active    { background: var(--accent); animation: wfPulse 1.6s ease-in-out infinite; }
.wf-dot.attention { background: var(--warning); animation: wfPulse 1.6s ease-in-out infinite; }
.wf-dot.idle      { background: var(--border-strong); }
@keyframes wfPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.wf-detail {
    background: var(--surface2); border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 18px 20px; margin-top: 8px;
}
.wf-detail h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wf-detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; }
.wf-detail-row:last-child { border-bottom: none; }
.wf-detail-row .k { color: var(--text-faint); }
.wf-detail-row .v { font-weight: 500; text-align: right; }

@media (max-width: 900px) {
    .wf-canvas { flex-direction: column; }
    .wf-node { max-width: none; margin-right: 0; margin-bottom: 24px; }
    .wf-node::after { right: auto; left: 50%; top: auto; bottom: -24px; width: 2px; height: 24px; }
}

/* ── Narrow screens: the rail steps aside ─────────────────────────────────── */

@media (max-width: 860px) {
    .pm-shell { flex-direction: column; }
    .pm-sidebar {
        width: 100%; min-width: 0; height: auto; position: static;
        border-right: none; border-bottom: 1px solid var(--border-soft);
    }
    .sidebar-section { max-height: 320px; }
    .page { padding: 16px; }
}

/* ── Pagination ───────────────────────────────────────────────────────────── */

.pm-pager {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid var(--border-soft);
}
.pm-pager-count { font-size: 11.5px; color: var(--text-faint); margin-right: auto; }
.pm-pager-pos {
    font-family: var(--mono); font-size: 11.5px; color: var(--text-muted);
    font-variant-numeric: tabular-nums; min-width: 48px; text-align: center;
}
.pm-page-btn {
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    display: grid; place-items: center; flex-shrink: 0;
    border: 1px solid var(--border); background: none;
    color: var(--text-muted); cursor: pointer;
    transition: border-color .12s, color .12s;
}
.pm-page-btn:hover { border-color: var(--accent); color: var(--text); }
.pm-page-btn-off { opacity: .35; cursor: default; }
.pm-page-btn-off:hover { border-color: var(--border); color: var(--text-muted); }

/* ── Approval row — a list, not a stack of cards ──────────────────────────── */

.appr-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid var(--border-soft);
}
.appr-row:last-of-type { border-bottom: none; }
.appr-row .appr-icon { color: var(--accent); flex-shrink: 0; }
.appr-row .appr-body { flex: 1; min-width: 0; }
.appr-row .appr-title {
    font-size: 13px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.appr-row .appr-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.appr-row .appr-acts { display: flex; gap: 6px; flex-shrink: 0; }
.appr-mini {
    padding: 5px 11px; border-radius: var(--radius-sm);
    font-size: 11.5px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border); background: none; color: var(--text-muted);
    font-family: var(--font);
}
.appr-mini:hover { border-color: var(--accent); color: var(--text); }
.appr-mini.appr-yes { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.appr-mini.appr-yes:hover { filter: brightness(1.1); color: var(--accent-ink); }
.appr-mini:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 620px) {
    .appr-row { flex-wrap: wrap; }
    .appr-row .appr-acts { margin-left: auto; }
}

/* ── LinkedIn preview card ────────────────────────────────────────────────────
   A picture of the feed, not a piece of PowerMarketing. Its colours are fixed
   rather than themed: a dark "preview" of a light feed would misrepresent the
   very thing it exists to show. Everything drawn here comes from the preview
   endpoint, which shares its rules with the publisher. */

.li-post {
    background: #ffffff;
    color: #000000e6;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px 6px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 560px;
}
.li-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.li-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    background: #0a66c2; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600; letter-spacing: .02em;
}
.li-who { min-width: 0; }
.li-name { font-size: 14px; font-weight: 600; color: #000000e6; }
.li-sub { font-size: 12px; color: #00000099; }

.li-body { white-space: normal; word-wrap: break-word; margin-bottom: 10px; }
.li-body + .li-body { border-top: 1px solid #e9e9e9; padding-top: 10px; }
.li-seg-index { font-size: 11px; color: #00000099; margin-bottom: 4px; }
.li-entity { color: #0a66c2; }
.li-url { word-break: break-all; }
.li-fold { color: #000000e6; }
.li-more { color: #00000099; cursor: default; }

.li-image {
    display: block; width: calc(100% + 32px); margin: 0 -16px;
    border-top: 1px solid #e9e9e9;
}
.li-card { margin: 0 -16px; border-top: 1px solid #e9e9e9; background: #f3f2ef; }
.li-card-img { display: block; width: 100%; }
.li-card-meta { padding: 8px 16px 10px; }
.li-card-title { font-size: 14px; font-weight: 600; color: #000000e6; line-height: 1.35; }
.li-card-domain { font-size: 12px; color: #00000099; margin-top: 2px; }

.li-actions {
    display: flex; justify-content: space-between;
    border-top: 1px solid #e9e9e9; margin-top: 8px; padding: 6px 4px;
    font-size: 13px; font-weight: 600; color: #00000099;
}

/* Warnings belong to PowerMarketing, not to the feed, so they stay themed. */
.li-warning {
    margin-top: 10px; padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface2);
    font-size: 12px; color: var(--text-muted);
}
.li-warning-hard { border-color: var(--danger); color: var(--danger); }

@media (max-width: 620px) {
    .li-post { padding: 10px 12px 4px; }
    .li-image, .li-card { width: calc(100% + 24px); margin-left: -12px; margin-right: -12px; }
    .li-card { width: auto; }
    .li-card-meta { padding: 8px 12px 10px; }
}

/* Platforms PowerMarketing does not draw a likeness of: the text, folded and
   split exactly as it will publish, in the app's own skin. */
.pv-plain {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface2);
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
}
.pv-plain .li-body { margin-bottom: 0; }
.pv-plain .li-body + .li-body { border-top-color: var(--border-soft); margin-top: 10px; }
.pv-plain .li-entity { color: var(--accent); }
.pv-plain .li-more { color: var(--text-muted); }
/* The fold marker and thread index carry LinkedIn's ink; here they take the
   app's, or they would be black text on a dark panel. */
.pv-plain .li-fold { color: var(--text); }
.pv-plain .li-seg-index { color: var(--text-muted); }

/* The document a post carries: the real PDF, in the reader LinkedIn shows it in. */
.li-doc { margin: 0 -16px; border-top: 1px solid #e9e9e9; background: #f3f2ef; }
.li-doc-frame {
    display: block; width: 100%; height: 320px; border: 0; background: #fff;
}
.li-doc-meta { padding: 8px 16px 10px; }
.li-doc-title { font-size: 14px; font-weight: 600; color: #000000e6; line-height: 1.35; }
.li-doc-pages { font-size: 12px; color: #00000099; margin-top: 2px; }
.li-doc-wait, .li-doc-error {
    padding: 22px 16px; font-size: 12.5px; color: #00000099; text-align: center;
}
.li-doc-error { color: #b3261e; }

@media (max-width: 620px) {
    .li-doc { width: auto; margin-left: -12px; margin-right: -12px; }
    .li-doc-frame { height: 260px; }
    .li-doc-meta { padding: 8px 12px 10px; }
}
