/* users.css — authenticated / dashboard page styles */

/* Dashboard body layout — font/color/bg from link_theme.css */
body {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Zone heading color override */
h1, h2, h3, h4 {
    color: var(--primary);
}

/* Indent sidenav sub-links */
ul a {
    font-size: 0.9em !important;
    padding-left: 15px !important;
}
ul ul a {
    font-size: 0.9em !important;
    padding-left: 30px !important;
}

/* ---------------------------------------------------
    APP SHELL — modern flow-based layout
    No fixed-header offsets, no permanent left rail.
    Header is sticky (occupies its own flex space), main flows full-width,
    footer at natural bottom, drawer is off-canvas (slides over main).
----------------------------------------------------- */

main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
    overflow-y: visible;
    background-color: var(--bg-color);
}

content {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 1rem;                 /* platform default gutter — pages no longer need .p-1r */
}
/* Full-bleed opt-out: pages that want edge-to-edge content add class="p-0". */
/* Self-padded full wrappers (e.g. .dashboard-page) opt out to avoid a double gutter. */
content:has(> .dashboard-page) { padding: 0; }

/* Dashboard wrapper — fills main content area (no centering gap when drawer is present)
   Inline style="max-width:1280px;margin:0 auto" is being phased out of dashboard.xml seed. */
.dashboard-page {
    width: 100%;
    padding: 1.5rem;
    box-sizing: border-box;
    min-width: 0;
}

footer {
    color: var(--nav-color);
    background: var(--bg-footer);
}
footer a       { color: var(--secondary); }
footer a:hover { color: var(--highlight); }
footer ul      { display: inline-flex; }

.footer-column  { text-align: center; }
.footer-foot    { background-color: var(--bg-footer-foot); }
.footer-info    { color: var(--nav-color); }

/* Condensed authenticated-zone footer — single info bar (no big columns) */
.users-footer { color: var(--nav-color); background: var(--bg-footer); }
.users-footer .footer-foot {
    border-top: 1px solid rgba(255,255,255,.04);
    padding: 0.75rem 1.5rem;
    font-size: .8rem;
    opacity: .85;
}
.users-footer .footer-foot-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.users-footer .footer-foot strong { color: var(--secondary); font-weight: 600; }
.users-footer .footer-meta { opacity: .7; }


/* ---------------------------------------------------
    MEDIA QUERIES — widget margins only; no layout shifts
----------------------------------------------------- */

@media only screen and (max-width: 576px) { .widget { margin: 10px 0; } }
@media only screen and (max-width: 768px) { .widget { margin: 15px 0; } }
@media only screen and (min-width: 768px) {
    .footer-wrap   { flex-direction: row; justify-content: space-between; }
    .footer-column { flex: 1; text-align: center; border-bottom: none; }
}
@media only screen and (max-width: 992px) { .widget { margin: 20px 0; } }
@media only screen and (min-width: 992px) { .widget { margin: 15px 0; } }

/* ---------------------------------------------------
    COLLAPSIBLE SIDEBAR
----------------------------------------------------- */

.sidenav-toggle-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: var(--on-primary);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition-fast);
}
.sidenav-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.logo-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

@media only screen and (min-width: 768px) {
    /* Smooth transition on the sidebar itself */
    #hidenav {
        transition: width var(--transition-base), flex-basis var(--transition-base), max-width var(--transition-base);
    }
    /* Ensure nav lists stack vertically — leave .collapse alone so submenus still hide/show */
    #hidenav ul:not(.collapse),
    #hidenav ul li {
        display: block;
    }

    /* Collapsed state — 60px icon rail */
    .nav-collapsed #hidenav {
        width: 60px !important;
        flex-basis: 60px !important;
        max-width: 60px !important;
    }
    .nav-collapsed header {
        margin-left: 60px !important;
        width: calc(100vw - 60px) !important;
    }
    .nav-collapsed main,
    .nav-collapsed footer {
        margin-left: 60px !important;
        width: calc(100vw - 60px) !important;
    }

    /* Hide logo and clock in collapsed state */
    .nav-collapsed #hidenav #sidenav-logo { display: none; }
    .nav-collapsed #hidenav .logo-wrap    { justify-content: center; }
    .nav-collapsed #hidenav .clock        { display: none; }

    /* Icon-only nav links: hide text via font-size trick, keep icon visible */
    .nav-collapsed #hidenav .nav-link {
        justify-content: center;
        padding: 0.875rem 0;
        font-size: 0 !important;
        overflow: hidden;
        white-space: nowrap;
    }
    .nav-collapsed #hidenav .nav-link i {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }

    /* Hide sub-link indent overrides so collapsed items look right */
    .nav-collapsed #hidenav ul a,
    .nav-collapsed #hidenav ul ul a {
        font-size: 0 !important;
        padding-left: 0 !important;
    }

    /* Flyout submenu on hover */
    .nav-collapsed #hidenav > ul > .nav-item {
        position: relative;
    }
    .nav-collapsed #hidenav > ul > .nav-item:hover > .collapse {
        display: block !important;
        position: absolute;
        left: 60px;
        top: 0;
        min-width: 210px;
        background: var(--chrome-bg);
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        box-shadow: var(--shadow-xl);
        z-index: 400;
        padding: 0.5rem 0;
    }
    .nav-collapsed #hidenav > ul > .nav-item:hover > .collapse .nav-link {
        display: flex;
        justify-content: flex-start;
        font-size: 0.8125rem !important;
        padding: 0.5rem 1rem !important;
        overflow: visible;
        white-space: nowrap;
    }
    .nav-collapsed #hidenav > ul > .nav-item:hover > .collapse .nav-link i {
        font-size: 0.8125rem !important;
        margin-right: 0.5rem !important;
    }
}

/* ── Form controls (shared with public zone) ── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color-dark);
    margin-bottom: 0.375rem;
}

.form-control {
    width: 100%;
    height: 44px;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.875rem;
    font-size: 1rem;
    font-family: var(--font-family-sans-serif);
    color: var(--text-color);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring-color);
}

textarea.form-control {
    height: auto;
    resize: vertical;
}

select.form-control {
    height: 44px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

/* ── Data table ────────────────────────────────────────────────────────────── */
.data-table {
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th,
.data-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: var(--surface-3);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-color-light);
}
.data-table tr:hover td { background: var(--surface-3); }
.data-table tr.row-highlight td { background: var(--primary-soft); }
.td-actions { white-space: nowrap; }

/* ── Status badges ──────────────────────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-draft    { background: var(--border); color: var(--text-color); }
.badge-pending  { background: var(--warning-bg); color: var(--warning-text); }
.badge-active   { background: var(--success-bg); color: var(--success-text); }
.badge-featured { background: var(--info-bg); color: var(--info-text); }
.badge-archived { background: var(--surface-3); color: var(--text-color-light); }
.badge-secondary { background: var(--surface-3); color: var(--text-color-light); }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn { display: inline-block; padding: 0.4rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn-primary   { background: var(--primary); color: var(--on-primary); }
.btn-secondary { background: var(--surface-3); color: var(--text-color); border-color: var(--border); }
.btn-danger    { background: var(--danger-text); color: var(--on-dark); border-color: var(--danger-text); }
.btn-danger:hover { background: var(--danger-text); border-color: var(--danger-text); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.78rem; }

/* ── Project dashboard ──────────────────────────────────────────────────────── */
.project-dash { max-width: 1200px; margin: 0 auto; }

.project-dash-breadcrumb { font-size: 0.85rem; margin-bottom: 0.5rem; }
.project-dash-breadcrumb a { color: var(--primary); text-decoration: none; }
.project-dash-breadcrumb a:hover { text-decoration: underline; }

.project-dash-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.project-dash-title { margin: 0 0 0.25rem; font-size: 1.75rem; }
.project-dash-subtitle { margin: 0 0 0.5rem; color: var(--text-color-light); }
.project-dash-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }

.project-stats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }

/* Two-column grid */
.project-dash-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 860px) {
    .project-dash-grid { grid-template-columns: 1fr; }
}

/* Panel cards */
.dash-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.dash-panel:last-child { margin-bottom: 0; }
.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}
.dash-panel-header h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.dash-sidebar { display: flex; flex-direction: column; gap: 0; }
.dash-empty { color: var(--text-color-light); font-size: 0.9rem; margin: 0; }

/* Detail list */
.project-detail-list { margin: 0 0 0.75rem; padding: 0; }
.project-detail-list dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-color-light); margin-top: 0.75rem; }
.project-detail-list dt:first-child { margin-top: 0; }
.project-detail-list dd { margin: 0.15rem 0 0; font-size: 0.9rem; color: var(--text-color); }

/* Social links */
.project-social-links { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.project-social-links a { color: var(--text-color-light); font-size: 1.1rem; }
.project-social-links a:hover { color: var(--primary); }

/* Team list */
.team-list { list-style: none; margin: 0; padding: 0; }
.team-list-item { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.team-list-item:last-child { border-bottom: none; }
.team-name { font-weight: 500; }
.team-role { font-size: 0.8rem; color: var(--text-color-light); }

/* Quick links grid */
.quick-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quick-link { display: inline-block; padding: 0.3rem 0.75rem; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.82rem; color: var(--text-color); text-decoration: none; }
.quick-link:hover { background: var(--primary-soft); border-color: var(--secondary); color: var(--primary); }

/* ── Dashboard tabs ──────────────────────────────────────────────────────────── */
.dash-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
}
.dash-tab {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.dash-tab:hover { color: var(--primary); }
.dash-tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ── Priority / severity badge variants ──────────────────────────────────────── */
.badge-priority-low      { background: var(--success-bg); color: var(--success-text); }
.badge-priority-medium   { background: var(--warning-bg); color: var(--warning-text); }
.badge-priority-high     { background: var(--danger-bg); color: var(--danger-text); }
.badge-priority-critical { background: var(--primary-soft); color: var(--primary-strong); }
.badge-severity-minor    { background: var(--info-bg); color: var(--info-text); }
.badge-severity-moderate { background: var(--warning-bg); color: var(--warning-text); }
.badge-severity-major    { background: var(--danger-bg); color: var(--danger-text); }
.badge-severity-blocker  { background: var(--danger-bg); color: var(--danger-text); }

/* ── Kanban board ─────────────────────────────────────────────────────────────── */
.kanban-board {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.kanban-col {
    flex: 0 0 220px;
    min-width: 200px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}
.kanban-col.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-color-light);
    margin-bottom: 0.75rem;
}
.kanban-count {
    display: inline-block;
    background: var(--border);
    color: var(--text-color-light);
    border-radius: var(--radius-full);
    padding: 0.05rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
}
.kanban-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: box-shadow 0.15s;
}
.kanban-card:last-of-type { margin-bottom: 0; }
.kanban-card:hover { box-shadow: var(--shadow-xs); }
.kanban-card.dragging { opacity: 0.5; cursor: grabbing; }
.kanban-card-title {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.35rem;
}
.kanban-card-title a { color: var(--text-color); text-decoration: none; flex: 1; }
.kanban-card-title a:hover { color: var(--primary); }
.kanban-priority-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    margin-top: 0.35rem;
}
.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-color-light);
}
.kanban-due { font-size: 0.72rem; }
.kanban-overdue { color: var(--danger-text); font-weight: 600; }
.kanban-card-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.4rem;
    justify-content: flex-end;
}
.kanban-add-btn {
    display: block;
    margin-top: 0.6rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    color: var(--text-color-light);
    text-decoration: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: background 0.15s, color 0.15s;
}
.kanban-add-btn:hover { background: var(--surface); color: var(--primary); border-color: var(--secondary); }

/* ── Gantt / Schedule bars ────────────────────────────────────────────────────── */
.gantt-container {
    position: relative;          /* needed for today overlay */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* Full-height today line (JS positioned) */
.gantt-today-overlay {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--danger);
    opacity: 0.55;
    pointer-events: none;
    z-index: 4;
}

.gantt-header {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border);
    background: var(--surface-3);
    min-height: 2.25rem;
    position: sticky;
    top: 0;
    z-index: 3;
}

/* Project row */
.gantt-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    min-height: 2.5rem;
}
.gantt-row:last-child { border-bottom: none; }
.gantt-row-project {
    background: var(--surface-3);
    min-height: 2.75rem;
}
.gantt-row-undated {
    min-height: 1.75rem;
    background: transparent;
    opacity: 0.7;
}

/* Label column */
.gantt-label-col {
    flex: 0 0 220px;
    min-width: 160px;
    padding: 0.3rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    overflow: hidden;
    border-right: 1px solid var(--border);
}

/* Expand/collapse button */
.gantt-group-btn {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.65rem;
    color: var(--text-color-light);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.gantt-group-btn:hover { background: var(--border); color: var(--text-color); }
.gantt-group-btn-spacer { visibility: hidden; pointer-events: none; }

/* Task count badge on project row */
.gantt-task-count {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-color-light);
    background: var(--border);
    border-radius: var(--radius-full);
    padding: 0.05rem 0.4rem;
    margin-left: auto;
    white-space: nowrap;
}

/* Labels */
.gantt-project-label {
    flex: 1;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gantt-project-label:hover { text-decoration: underline; }

.gantt-task-label {
    flex: 1;
    color: var(--text-color);
    font-size: 0.8rem;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gantt-task-label:hover { color: var(--primary); }

.gantt-priority-dot-sched {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
}

.gantt-undated-note {
    font-size: 0.72rem;
    color: var(--text-color-light);
    font-style: italic;
    padding-left: 1.75rem;
}

/* Bar column */
.gantt-bar-col {
    flex: 1;
    position: relative;
    align-self: stretch;   /* fill full row height for abs-positioned bars */
    min-height: 2.5rem;
}
.gantt-header .gantt-bar-col { min-height: 2.25rem; }
.gantt-row-project .gantt-bar-col { min-height: 2.75rem; }

/* Bars */
.gantt-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 13px;
    border-radius: var(--radius-xs);
    min-width: 4px;
    transition: opacity 0.15s;
    overflow: hidden;            /* clips the fill and text */
}
.gantt-bar:hover { filter: brightness(1.1); }
.gantt-bar-overdue { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }

/* Project bar: light background + darker progress fill */
.gantt-bar-project {
    height: 22px;
    border-radius: var(--radius-xs);
    background: rgba(109, 40, 217, 0.18) !important;
    border: 1px solid rgba(109, 40, 217, 0.55);
}

/* Progress fill inside the project bar */
.gantt-bar-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: rgba(109, 40, 217, 0.65);
    border-radius: var(--radius-xs) 0 0 3px;
    pointer-events: none;
}

/* Text label inside the project bar */
.gantt-bar-text {
    position: absolute;
    left: 6px; top: 50%;
    transform: translateY(-50%);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    max-width: calc(100% - 12px);
    pointer-events: none;
    z-index: 1;
}

/* Month markers in header */
.gantt-month-mark {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    color: var(--text-color-light);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* ── Cross-project schedule page ─────────────────────────────────────────────── */
.schedule-page { max-width: 1200px; margin: 0 auto; }
.schedule-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.schedule-page-title { margin: 0 0 0.2rem; font-size: 1.5rem; }
.schedule-filter {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.schedule-filter-btn {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color-light);
    background: var(--surface-3);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.schedule-filter-btn:hover { color: var(--primary); background: var(--primary-soft); border-color: var(--secondary); }
.schedule-filter-btn.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

.schedule-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: var(--text-color-light);
    align-items: center;
}
.schedule-legend-item { display: flex; align-items: center; gap: 0.4rem; }
.schedule-legend-bar {
    display: inline-block;
    width: 22px;
    height: 10px;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
}
.gantt-today-line-sample {
    display: inline-block;
    width: 2px;
    height: 14px;
    background: var(--danger);
    border-radius: var(--radius-xs);
    opacity: 0.7;
    flex-shrink: 0;
}

/* Per-project task section (collapsible via JS) */
.gantt-group-tasks { }

@media (max-width: 700px) {
    .gantt-label-col { flex: 0 0 130px; min-width: 100px; font-size: 0.75rem; }
    .gantt-task-count { display: none; }
    .kanban-board { gap: 0.5rem; }
    .kanban-col { flex: 0 0 180px; min-width: 165px; }
}

/* ==========================================================
   CALENDARS MODULE
   ========================================================== */

/* Calendar month grid */
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; background:var(--border); border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.cal-day-header { background:var(--surface-2); text-align:center; padding:.35rem; font-size:.75rem; font-weight:700; color:var(--text-color-light); text-transform:uppercase; }
.cal-day { background:var(--surface); padding:.4rem; min-height:5rem; cursor:pointer; }
.cal-day:hover { background:var(--surface-2); }
.cal-day.other-month { color:var(--border-strong); background:var(--surface-2); }
.cal-day.today { outline:2px solid var(--primary); outline-offset:-2px; }
.cal-day-num { font-size:.82rem; font-weight:600; margin-bottom:.2rem; }
.cal-dot { display:inline-block; width:8px; height:8px; border-radius:var(--radius-full); margin:.1rem; }

/* Slot grid */
.slot-grid { display:flex; flex-wrap:wrap; gap:.4rem; margin:.5rem 0; }
.slot-btn { padding:.35rem .75rem; border-radius:var(--radius-xs); border:1px solid var(--border); cursor:pointer; font-size:.85rem; transition:background .15s; background:var(--surface); }
.slot-btn.available { background:var(--success-bg); border-color:var(--success-text); color:var(--success-text); }
.slot-btn.available:hover { background:var(--success-bg); }
.slot-btn.taken { background:var(--surface-3); color:var(--text-muted); cursor:not-allowed; border-color:var(--border); }
.slot-btn.selected { background:var(--blue); color:var(--on-dark); border-color:var(--info-accent); }

/* Booking status badges */
.booking-s1 { background:var(--warning-bg); color:var(--warning-text); }
.booking-s2 { background:var(--info-bg); color:var(--info-text); }
.booking-s3 { background:var(--primary-soft); color:var(--primary-strong); }
.booking-s4 { background:var(--success-bg); color:var(--success-text); }
.booking-s5 { background:var(--danger-bg); color:var(--danger-text); }
.booking-s6 { background:var(--surface-3); color:var(--text-color-light); }

/* Availability editor */
.avail-row { display:flex; align-items:center; gap:1rem; padding:.4rem 0; border-bottom:1px solid var(--surface-3); }
.avail-day-label { width:90px; font-weight:600; font-size:.9rem; }

/* Public booking steps */
.book-steps { display:flex; gap:0; margin-bottom:1.5rem; }
.book-step { flex:1; text-align:center; padding:.5rem; background:var(--surface-3); font-size:.8rem; font-weight:600; color:var(--text-muted); border-bottom:3px solid var(--border); }
.book-step.active { color:var(--primary); border-bottom-color:var(--primary); background:var(--surface); }
.book-step.done { color:var(--success-text); border-bottom-color:var(--success-text); }

/* Service cards on public form */
.service-card { border:2px solid var(--border); border-radius:var(--radius-md); padding:1rem; cursor:pointer; transition:border-color .15s; }
.service-card:hover, .service-card.selected { border-color:var(--primary); background:var(--info-bg); }

/* ──────────────────────────────────────────────────────────────
   Help Centre
   ────────────────────────────────────────────────────────────── */

/* ── Chatbot Bubble ──────────────────────────────────────────────────────── */
.cb-bubble { position:fixed; bottom:1.5rem; right:1.5rem; width:56px; height:56px; border-radius:var(--radius-full);
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow-sm); z-index:9000; transition:transform .2s; }
.cb-bubble:hover { transform:scale(1.08); }
.cb-badge { position:absolute; top:-4px; right:-4px; background:var(--danger); color:var(--on-dark);
  border-radius:var(--radius-full); width:18px; height:18px; font-size:.7rem;
  display:flex; align-items:center; justify-content:center; }
/* Panel */
.cb-panel { position:fixed; bottom:5rem; right:1.5rem; width:340px; max-height:500px;
  background:var(--surface); border-radius:var(--radius-lg); box-shadow: var(--shadow-md);
  display:flex; flex-direction:column; z-index:8999; overflow:hidden; }
.cb-header { display:flex; align-items:center; gap:.75rem; padding:.75rem 1rem; color:var(--on-primary); }
.cb-bot-name { font-weight:600; font-size:.95rem; }
.cb-status-dot { font-size:.75rem; opacity:.85; }
.cb-close { margin-left:auto; background:none; border:none; color:var(--on-primary); font-size:1.3rem; cursor:pointer; line-height:1; }
/* Messages */
.cb-messages { flex:1; overflow-y:auto; padding:.75rem; display:flex; flex-direction:column; gap:.5rem; }
.cb-msg { max-width:82%; padding:.55rem .85rem; border-radius:var(--radius-lg); font-size:.875rem; line-height:1.5; word-break:break-word; }
.cb-msg.bot { align-self:flex-start; background:var(--surface-3); border-bottom-left-radius:var(--radius-xs); }
.cb-msg.user { align-self:flex-end; color:var(--on-primary); border-bottom-right-radius:var(--radius-xs); }
.cb-quick-replies { display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.3rem; }
.cb-chip { padding:.25rem .65rem; border-radius:var(--radius-xl); border:1px solid var(--border-strong);
  font-size:.8rem; cursor:pointer; background:var(--surface); transition:background .1s; }
.cb-chip:hover { background:var(--surface-3); }
/* Typing indicator */
.cb-typing { display:flex; gap:4px; padding:.55rem .85rem; align-self:flex-start; }
.cb-typing span { width:7px; height:7px; border-radius:var(--radius-full); background:var(--text-muted); animation:cbBounce .9s infinite; }
.cb-typing span:nth-child(2) { animation-delay:.15s; }
.cb-typing span:nth-child(3) { animation-delay:.3s; }
@keyframes cbBounce { 0%,60%,100% { transform:translateY(0); } 30% { transform:translateY(-6px); } }
/* Escalation / Lead bar */
.cb-escalate-bar { padding:.75rem; border-top:1px solid var(--surface-3); background:var(--surface-2); font-size:.85rem; }
.cb-escalate-bar input,.cb-escalate-bar select,.cb-escalate-bar textarea { width:100%; margin-bottom:.4rem;
  border:1px solid var(--border); border-radius:var(--radius-sm); padding:.35rem .6rem; font-size:.85rem; box-sizing:border-box; }
.cb-escalate-bar textarea { resize:vertical; min-height:60px; }
.cb-fallback-link { font-size:.78rem; color:var(--text-color-light); text-align:center; margin-top:.4rem; display:block; }
/* Input bar */
.cb-input-bar { display:flex; gap:.5rem; padding:.6rem; border-top:1px solid var(--surface-3); }
.cb-input-bar input { flex:1; border:1px solid var(--border); border-radius:var(--radius-xl);
  padding:.4rem .85rem; font-size:.875rem; outline:none; }
.cb-input-bar button { border:none; border-radius:var(--radius-full); width:36px; height:36px;
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--on-primary); flex-shrink:0; }
@media (max-width:420px) { .cb-panel { width:calc(100vw - 2rem); right:1rem; } }


/* ── Flows Dashboard ──────────────────────────────────────── */
.flows-dash { padding:1.5rem; }
.flows-page-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:1.5rem; flex-wrap:wrap; gap:1rem; }
.flows-page-title { font-size:1.35rem; font-weight:700; margin:0 0 .2rem; }
.flows-page-actions { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; }

/* Stat cards */
.flows-stat-cards { display:grid; grid-template-columns:repeat(4,1fr); gap:1rem; margin-bottom:1.5rem; }
.flows-stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); padding:1.1rem 1.25rem; }
.flows-stat-card--warn { border-color:var(--danger-bg); background:var(--danger-bg); }
.flows-stat-value { font-size:1.75rem; font-weight:700; line-height:1; }
.flows-val-active { color:var(--success-text); }
.flows-stat-label { font-size:.75rem; color:var(--text-color-light); margin-top:.3rem; display:flex; align-items:center; gap:.4rem; }
.flows-fail-count { font-size:.7rem; background:var(--danger-bg); color:var(--danger-text); border-radius:var(--radius-md); padding:.1rem .45rem; font-weight:600; text-decoration:none; }
.flows-fail-count:hover { background:var(--danger-bg); }

/* Layout */
.flows-layout { display:grid; grid-template-columns:1fr 280px; gap:1.25rem; align-items:start; }
.flows-main {}
.flows-sidebar {}

/* Trigger badges */
.flows-trigger-badge { display:inline-flex; align-items:center; gap:.3rem; font-size:.75rem; font-weight:600;
  padding:.2rem .55rem; border-radius:var(--radius-xs); }
.ft-uri     { background:var(--info-bg); color:var(--info-text); }
.ft-webhook { background:var(--primary-soft); color:var(--primary); }
.ft-cron    { background:var(--warning-bg); color:var(--warning-text); }
.ft-manual  { background:var(--surface-3); color:var(--text-color); }

/* Traveller mode badge */
.flows-mode-badge { display:inline-block; font-size:.72rem; font-weight:600; padding:.15rem .45rem;
  border-radius:var(--radius-xs); background:var(--info-bg); color:var(--info-text); }

/* Empty state */
.flows-empty { text-align:center; padding:3rem 1rem; color:var(--text-muted); }
.flows-empty-icon { font-size:2.5rem; display:block; margin-bottom:.75rem; color:var(--border-strong); }
.flows-empty p { margin-bottom:1rem; }

/* Recent executions */
.flows-exec-list { padding:.25rem 0; }
.flows-exec-row { display:flex; align-items:center; gap:.6rem; padding:.5rem 1rem;
  text-decoration:none; color:inherit; font-size:.85rem; border-bottom:1px solid var(--surface-3); }
.flows-exec-row:last-child { border-bottom:none; }
.flows-exec-row:hover { background:var(--surface-2); }
.flows-exec-dot { width:8px; height:8px; border-radius:var(--radius-full); flex-shrink:0; }
.es-ok   { background:var(--success-text); }
.es-run  { background:var(--info-accent); animation:flowsPulse 1.2s infinite; }
.es-err  { background:var(--danger-text); }
.es-wait { background:var(--warning-text); }
@keyframes flowsPulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }
.flows-exec-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }
.flows-exec-meta { flex-shrink:0; color:var(--text-muted); font-size:.78rem; }

/* Quick links */
.flows-quick-links { display:flex; flex-direction:column; }
.flows-quick-link { display:flex; align-items:center; gap:.6rem; padding:.6rem 1rem; font-size:.875rem;
  color:var(--text-color); text-decoration:none; border-bottom:1px solid var(--surface-3); }
.flows-quick-link:last-child { border-bottom:none; }
.flows-quick-link:hover { background:var(--surface-2); color:var(--text-color-dark); }
.flows-quick-link i { color:var(--text-muted); width:14px; text-align:center; }

@media (max-width:900px) {
  .flows-stat-cards { grid-template-columns:repeat(2,1fr); }
  .flows-layout { grid-template-columns:1fr; }
}
@media (max-width:500px) {
  .flows-stat-cards { grid-template-columns:1fr 1fr; }
  .flows-dash { padding:.75rem; }
}

/* ── Cross-project schedule additions ───────────────────────────────────── */
.gantt-task-row       { opacity: 0.9; }
.gantt-task-row:hover { opacity: 1; background: var(--surface-2); }
.gantt-label-indent   { padding-left: 1.5rem !important; font-size: 0.8rem; }
.gantt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-color-light);
}
.gantt-legend-item   { display: flex; align-items: center; gap: 0.4rem; }
.gantt-legend-dot    { display: inline-block; width: 12px; height: 12px; border-radius: var(--radius-xs); flex-shrink: 0; }
.gantt-legend-project { background: var(--primary) !important; opacity: 0.45; }

/* ── Project edit form ────────────────────────────────────────────────── */
.proj-form-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    padding: 0 1.5rem;
}
.proj-form-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.6rem 1.1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color-light);
    transition: color 0.15s, border-color 0.15s;
}
.proj-form-tab:hover   { color: var(--text-color); }
.proj-form-tab.active  { color: var(--primary); border-bottom-color: var(--primary); }
.proj-form-panel       { padding: 1.5rem; }
.proj-form-row         { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1.1rem; }
.proj-form-label       { font-size: 0.85rem; font-weight: 600; color: var(--text-color-light); }
.proj-form-input       { width: 100%; max-width: 520px; padding: 0.45rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 0.95rem; box-sizing: border-box; }
.proj-form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(25,118,210,.15); }
textarea.proj-form-input { resize: vertical; }
.proj-form-hint        { font-size: 0.8rem; color: var(--text-color-light); }
.proj-form-section-head { font-size: 0.8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-color-light); margin: 0 0 0.75rem; }
.proj-form-footer      { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

/* Active context select (projects, sites, etc.) */
.select-active {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: white !important;
    background-color: limegreen !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffffff' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.5rem center !important;
    padding-right: 1.75rem !important;
}
.select-active option  { color: initial; background: white; }

/* ===== Project Graph Tab ===== */
.graph-tab-wrap        { display: flex; flex-direction: column; height: calc(100vh - 260px); min-height: 520px; }
.graph-toolbar         { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.graph-filters         { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.graph-filter-label    { font-size: 0.8rem; font-weight: 600; color: var(--text-color-light); margin-right: 0.2rem; }
.graph-filter-btn      { padding: 0.2rem 0.65rem; border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 0.8rem; background: transparent; cursor: pointer; color: var(--text-color-light); transition: all 0.15s; }
.graph-filter-btn.graph-filter-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.graph-meta            { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; color: var(--text-color-light); }
.graph-reset-btn       { font-size: 0.75rem; }
.graph-stage           { position: relative; flex: 1; background: #0f1117; border-radius: 0 0 6px 6px; overflow: hidden; }
.graph-stage svg       { display: block; width: 100%; height: 100%; }
.graph-node circle     { transition: filter 0.15s; }
.graph-node:hover circle { filter: brightness(1.25); }
.graph-info-card       { position: absolute; top: 1rem; right: 1rem; width: 240px; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 1rem; z-index: 10; }
.graph-card-close      { position: absolute; top: 0.5rem; right: 0.6rem; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-color-light); line-height: 1; }
.graph-card-type       { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-color-light); margin-bottom: 0.3rem; }
.graph-card-title      { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 600; word-break: break-word; }
.graph-card-desc       { font-size: 0.82rem; color: var(--text-color-light); margin-bottom: 0.75rem; max-height: 60px; overflow: hidden; }
.graph-card-link       { font-size: 0.8rem; }
.graph-minimap         { position: absolute; bottom: 0.75rem; right: 0.75rem; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.1); pointer-events: none; }
.graph-edge-tip        { position: absolute; background: rgba(0,0,0,0.75); color: var(--on-primary); font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: var(--radius-xs); pointer-events: none; z-index: 20; }

/* ── AI Engine Room (project dashboard) ─────────────────────────────────────── */
.engine-room-panel       { border-top: 3px solid var(--primary); }
.engine-room-agent-name  { font-size: 0.9rem; color: var(--text-color-light); margin: 0 0 0.75rem; }
.engine-room-compose     { display: flex; flex-direction: column; gap: 0.5rem; }
.engine-room-compose .btn { align-self: flex-start; }
.engine-room-response    { margin-top: 1rem; padding: 0.75rem 1rem; background: var(--surface-3); border-radius: var(--radius-sm); font-size: 0.88rem; white-space: pre-wrap; word-break: break-word; border-left: 3px solid var(--primary); }

/* ── Kanban AI agent indicators ─────────────────────────────────────────────── */
.kanban-agent-icon       { display: inline-block; font-size: 0.9rem; margin-right: 3px; cursor: default; color: var(--primary); vertical-align: middle; }
.kanban-agent-active     { animation: spin-agent 2s linear infinite; display: inline-block; }
@keyframes spin-agent    { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.kanban-card-agent       { border-left: 3px solid var(--primary); }

/* ── Task form: agent output box ────────────────────────────────────────────── */
.agent-output-box        { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 0.87rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow-y: auto; }

/* ── Project Comments Widget ────────────────────────────────────────────── */
.proj-comments {
    margin-top: 1.25rem;
}
.proj-comments-header {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-color-light);
    padding: 0 0 0.5rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}
.proj-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.proj-comments-empty {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin: 0;
}
.proj-comment {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}
.proj-comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-color-light);
    margin-bottom: 0.3rem;
}
.proj-comment-who {
    font-weight: 600;
    color: var(--text-color);
}
.proj-comment-when {
    flex: 1;
}
.proj-comment-del {
    padding: 0 0.3rem;
    font-size: 0.7rem;
    line-height: 1.4;
    opacity: 0.5;
}
.proj-comment-del:hover { opacity: 1; color: var(--danger-text); }
.proj-comment-body {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-color);
    white-space: pre-wrap;
    word-break: break-word;
}
.proj-comment-compose {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}
.proj-comment-input {
    flex: 1;
    font-size: 0.88rem;
    resize: vertical;
    min-height: 2.4rem;
}

/* ── Social Discussion Widget (embedded context threads) ────────────────── */
.social-discussion {
    container-type: inline-size;
}
.social-discussion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-color-light);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}
.social-discussion-more {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
}
.social-discussion-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.social-discussion-empty {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin: 0 0 0.75rem;
}
.social-discussion-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.4rem 0;
    border-top: 1px solid var(--border);
    margin-bottom: 0.75rem;
}
.social-discussion-newtopic {
    font-size: 0.8rem;
    color: var(--text-color-light);
}
.social-discussion-newtopic:hover { color: var(--primary); }
.social-discussion-compose {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}
.social-discussion-body {
    flex: 1;
    font-size: 0.88rem;
    resize: vertical;
    min-height: 2.4rem;
}
.social-discussion-login {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin: 0;
}
.social-discussion-unavailable {
    font-size: 0.85rem;
    color: var(--text-color-light);
}

/* ── Engine Room Tab ─────────────────────────────────────────────────────── */
.engine-tab-wrap { padding: 1rem; }

.er-input-panel .er-hint {
    color: var(--text-color-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.er-goal-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    background: var(--bg-color);
    color: var(--text-color);
}
.er-input-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; }
.er-agent-badge { font-size: 0.85rem; color: var(--text-color-light); }

/* Previous goals */
.er-goals-list { margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.er-goals-list-heading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-color-light); margin: 0 0 0.4rem; }
.er-goal-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.55rem 0.75rem; background: var(--bg-color); }
.er-goal-card--active { border-color: var(--primary); background: #f9f8ff; }
.er-goal-card-main { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.35rem; }
.er-goal-card-text { flex: 1; font-size: 0.88rem; color: var(--text-color); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.er-goal-card-text:hover { color: var(--primary); }
.er-goal-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.er-goal-card-date { font-size: 0.78rem; color: var(--text-color-light); }
.er-goal-card-actions { display: flex; gap: 0.35rem; }

/* Planning spinner */
.er-planning-panel { display: flex; justify-content: center; align-items: center; min-height: 220px; }
.er-planning-spinner { text-align: center; }
.er-spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: er-spin 0.9s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes er-spin { to { transform: rotate(360deg); } }
.er-planning-msg { font-weight: 600; margin: 0 0 0.3rem; }
.er-planning-sub { color: var(--text-color-light); font-size: 0.88rem; margin: 0; }

/* Review plan */
.er-review-goal-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-light); margin: 0 0 0.25rem; }
.er-review-goal-text  { font-weight: 600; font-size: 1rem; margin: 0 0 1rem; }
.er-plan-summary { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; }
.er-tasks-heading { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-light); margin: 0 0 0.5rem; }
.er-task-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.er-task-row { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.er-task-num  { width: 22px; height: 22px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); font-size: 0.75rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.er-task-title { flex: 1; font-size: 0.9rem; }
.er-task-output { width: 100%; margin-top: 0.4rem; font-size: 0.82rem; color: var(--text-color-light); white-space: pre-wrap; }
.er-task-list--exec .er-task-row { background: var(--bg-color); border: 1px solid var(--border); }
.er-review-actions { display: flex; gap: 0.6rem; }

/* Task status badges */
.er-task-status { font-size: 0.75rem; font-weight: 600; border-radius: var(--radius-xl); padding: 2px 8px; white-space: nowrap; }
.er-status-backlog  { background: var(--border); color: var(--text-color-light); }
.er-status-queued   { background: var(--info-bg); color: var(--info-accent); }
.er-status-running  { background: var(--warning-bg); color: var(--warning-text); }
.er-status-review   { background: var(--primary-soft); color: var(--primary-strong); }
.er-status-done     { background: var(--success-bg); color: var(--success-text); }

/* Progress bar */
.er-exec-note { color: var(--text-color-light); font-size: 0.9rem; margin-bottom: 1rem; }
.er-progress-bar-wrap { height: 8px; background: var(--border); border-radius: var(--radius-xs); overflow: hidden; margin-bottom: 0.4rem; }
.er-progress-bar { height: 100%; background: var(--primary); border-radius: var(--radius-xs); transition: width 0.4s ease; }
.er-progress-label { font-size: 0.85rem; color: var(--text-color-light); margin-bottom: 1rem; }

/* Done phase */
.er-done-msg { margin-bottom: 1rem; }
.er-done-results { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.er-result-card { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.75rem 1rem; }
.er-result-card strong { display: block; margin-bottom: 0.4rem; }
.er-result-card p { margin: 0; font-size: 0.88rem; color: var(--text-color); white-space: pre-wrap; }
.er-done-actions { display: flex; gap: 0.6rem; }
.er-no-output { color: var(--text-color-light); font-style: italic; }

/* ── Engine Room: Step blocks ──────────────────────────────────────────────── */
.er-steps-heading { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-light); margin: 0 0 0.75rem; }
.er-step-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.er-step-block { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.er-step-block.er-step-done    { border-color: var(--success-bg); background: var(--success-bg); }
.er-step-block.er-step-running { border-color: var(--info-bg); background: var(--info-bg); }
.er-step-header { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.85rem; background: rgba(0,0,0,0.02); }
.er-step-done   .er-step-header { background: rgba(134,239,172,0.15); }
.er-step-running .er-step-header { background: rgba(147,197,253,0.15); }
.er-step-icon   { font-size: 0.95rem; width: 20px; text-align: center; flex-shrink: 0; color: var(--text-color-light); }
.er-step-done   .er-step-icon { color: var(--success-text); }
.er-step-running .er-step-icon { color: var(--info-text); }
.er-step-num    { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-light); white-space: nowrap; flex-shrink: 0; }
.er-step-heading { font-weight: 600; font-size: 0.9rem; flex: 1; }
.er-step-objective { font-size: 0.82rem; color: var(--text-color-light); display: none; }
@media (min-width: 600px) { .er-step-objective { display: inline; } }
.er-step-progress { font-size: 0.78rem; color: var(--text-color-light); white-space: nowrap; flex-shrink: 0; }
.er-step-tasks  { padding: 0.5rem 0.85rem 0.6rem 2.8rem; display: flex; flex-direction: column; gap: 0.3rem; }
.er-step-summary { padding: 0.4rem 0.85rem 0.5rem 2.8rem; font-size: 0.85rem; color: var(--text-color); font-style: italic; border-top: 1px dashed var(--border); }

/* Done phase step cards */
.er-done-steps { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.er-result-step-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.er-result-icon { font-size: 1rem; color: var(--success-text); }

/* ── AI Team Members (associates) ──────────────────────────────────────────── */
.assoc-type-toggle { display: flex; gap: 1rem; padding: 0.35rem 0; }
.assoc-type-opt { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.9rem; }
.assoc-type-opt input { accent-color: var(--primary); }
.assoc-ai-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; background: var(--primary-soft); color: var(--primary-strong); border-radius: var(--radius-xl); padding: 1px 7px; letter-spacing: 0.03em; }
.assoc-agent-icon { color: var(--primary); margin-right: 2px; }
.assoc-agent-tasks { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.assoc-agent-task { font-size: 0.8rem; color: var(--text-color-light); }
.assoc-agent-task em { font-style: normal; font-weight: 600; color: var(--primary); margin-left: 4px; font-size: 0.75rem; }
.assoc-row-agent td:first-child { padding-top: 6px; padding-bottom: 6px; }

/* Team sidebar AI rows */
.team-list-item--agent { flex-direction: column; align-items: flex-start; padding: 0.5rem 0; }
.team-agent-icon { color: var(--primary); font-size: 0.9rem; margin-right: 4px; }
.team-agent-tasks { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; padding-left: 1.1rem; }
.team-agent-task { font-size: 0.8rem; color: var(--text-color-light); }
.team-agent-task em { font-style: normal; font-weight: 600; color: var(--primary); margin-left: 4px; font-size: 0.73rem; }
.team-list-item--agent .team-name { font-weight: 600; }
.team-list-item--agent .team-role { font-size: 0.78rem; }

/* ── Kanban AI report toggle ────────────────────────────────────────────────── */
.kanban-ai-toggle { font-size: 0.75rem; color: var(--primary); cursor: pointer; padding: 3px 0 0; user-select: none; }
.kanban-ai-toggle.expanded { color: var(--text-color-light); }
.kanban-ai-output { display: none; font-size: 0.78rem; color: var(--text-color-light); background: var(--primary-soft); border-left: 3px solid var(--primary); padding: 6px 8px; margin-top: 5px; border-radius: 0 4px 4px 0; white-space: pre-wrap; max-height: 160px; overflow-y: auto; line-height: 1.5; }
.kanban-ai-output.open { display: block; }

/* ── AI Work Log (overview tab) ─────────────────────────────────────────────── */
.ai-work-log { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.25rem 0; }
.ai-work-entry { border: 1px solid var(--primary-soft); border-radius: var(--radius-md); overflow: hidden; }
.ai-work-entry-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: #f9f8ff; flex-wrap: wrap; }
.ai-work-icon { color: var(--primary); font-size: 0.9rem; flex-shrink: 0; }
.ai-work-title { font-weight: 600; font-size: 0.9rem; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-work-date { font-size: 0.78rem; color: var(--text-color-light); flex-shrink: 0; }
.ai-work-toggle { font-size: 0.75rem; color: var(--primary); background: none; border: 1px solid var(--primary-soft); border-radius: var(--radius-xs); padding: 2px 8px; cursor: pointer; flex-shrink: 0; white-space: nowrap; }
.ai-work-toggle:hover { background: var(--primary-soft); }
.ai-work-output { display: none; font-size: 0.82rem; color: var(--text-color); padding: 0.65rem 0.75rem; white-space: pre-wrap; line-height: 1.6; border-top: 1px solid var(--primary-soft); max-height: 280px; overflow-y: auto; }
.ai-work-output.open { display: block; }

/* ── Goals List Widget ───────────────────────────────────────────────────────── */
.goals-toolbar { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.goals-search { flex: 1 1 0; min-width: 0; }
.goals-filter { flex: 0 0 auto; min-width: 0; }
.goals-th { white-space: nowrap; }
.goals-th.sortable { cursor: pointer; user-select: none; }
.goals-th.sortable:hover { background: var(--surface-2); }
.sort-icon { font-size: 0.75rem; color: var(--text-color-light); margin-left: 3px; }
.goals-goal-link { font-weight: 500; text-decoration: none; color: var(--text-color); }
.goals-goal-link:hover { color: var(--primary); }
.goals-count { font-size: 0.8rem; color: var(--text-color-light); margin: 0.5rem 0 0; text-align: right; }

/* ── Goal View Page ──────────────────────────────────────────────────────────── */
.goal-view { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem; }
.goal-view-header { margin-bottom: 1rem; }
.goal-view-breadcrumb { font-size: 0.82rem; color: var(--text-color-light); margin-bottom: 0.4rem; }
.goal-view-breadcrumb a { color: var(--text-color-light); text-decoration: none; }
.goal-view-breadcrumb a:hover { color: var(--primary); }
.goal-view-sep { margin: 0 0.35rem; opacity: 0.5; }
.goal-view-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.goal-view-topbar-left { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.goal-view-agent { font-size: 0.82rem; color: var(--primary); font-weight: 600; }
.goal-view-date { font-size: 0.8rem; color: var(--text-color-light); }
.goal-view-actions { flex-shrink: 0; }
.goal-view-body { display: block; }
.goal-view-main { min-width: 0; }
.goal-view-sidebar { }

/* Goal sidebar list */
.goal-sidebar-list { display: flex; flex-direction: column; gap: 0.25rem; }
.goal-sidebar-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.4rem; padding: 0.45rem 0.5rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-color); font-size: 0.83rem; }
.goal-sidebar-item:hover { background: var(--surface-2); }
.goal-sidebar-item--active { background: var(--primary-soft); }
.goal-sidebar-badge { font-size: 0.68rem; padding: 1px 5px; white-space: nowrap; }
.goal-sidebar-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-sidebar-date { font-size: 0.75rem; color: var(--text-color-light); white-space: nowrap; }

@media (max-width: 700px) {
    .goal-view-body { grid-template-columns: 1fr; }
    .goal-view-sidebar { order: -1; }
}

/* ── Engine Room Activity Feed ───────────────────────────────────────────────── */
.engine-tab-wrap { display: flex; flex-direction: column; min-height: 0; }
.er-feed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.65rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.er-feed-toolbar-left { display: flex; align-items: center; gap: 0.75rem; }
.er-feed-toolbar-right { display: flex; align-items: center; gap: 0.5rem; }
.er-feed-title { font-weight: 700; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-color); }
.er-feed-agent { font-size: 0.82rem; color: var(--text-color-light); }
.er-feed-live { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 700; color: var(--success-text); text-transform: uppercase; letter-spacing: 0.05em; }
.er-live-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--success-text); animation: er-live-pulse 1.4s ease-in-out infinite; }
@keyframes er-live-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.85); } }

.er-feed { display: flex; flex-direction: column; gap: 0; padding: 0.5rem 0; max-height: 60vh; overflow-y: auto; font-family: 'JetBrains Mono', 'Fira Mono', 'Menlo', monospace; font-size: 0.82rem; background: #1e1e2e; color: #cdd6f4; }
.er-feed-empty { padding: 2rem 1.25rem; color: #7f849c; text-align: center; font-style: italic; }
.er-feed-empty a { color: #89b4fa; }
.er-feed-date-sep { padding: 0.5rem 1rem 0.25rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #585b70; border-top: 1px solid #313244; margin-top: 0.25rem; }

.er-feed-entry { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.45rem 1rem; border-left: 3px solid transparent; }
.er-feed-entry:hover { background: rgba(255,255,255,0.03); }
.er-feed-queued  { border-left-color: #585b70; }
.er-feed-running { border-left-color: #fab387; background: rgba(250,179,135,0.05); }
.er-feed-done    { border-left-color: #a6e3a1; }
.er-feed-other   { border-left-color: #313244; }

.er-feed-entry-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.er-feed-icon { width: 1rem; text-align: center; color: #585b70; flex-shrink: 0; }
.er-feed-running .er-feed-icon { color: #fab387; }
.er-feed-done    .er-feed-icon { color: #a6e3a1; }
.er-feed-time  { color: #585b70; flex-shrink: 0; }
.er-feed-agent-name { color: #89b4fa; font-weight: 600; flex-shrink: 0; }
.er-feed-task-title { color: #cdd6f4; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.er-feed-status-badge { font-size: 0.72rem; padding: 1px 6px; border-radius: var(--radius-xs); background: #313244; color: #cdd6f4; flex-shrink: 0; }
.er-feed-running .er-feed-status-badge { background: #fab387; color: #1e1e2e; }
.er-feed-done    .er-feed-status-badge { background: #a6e3a1; color: #1e1e2e; }
.er-feed-pulse { width: 7px; height: 7px; border-radius: var(--radius-full); background: #fab387; animation: er-live-pulse 1s ease-in-out infinite; flex-shrink: 0; }

.er-feed-goal { padding: 0.1rem 0 0 1.5rem; font-size: 0.78rem; color: #7f849c; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.er-feed-output-wrap { padding: 0.1rem 0 0 1.5rem; }
.er-feed-output-toggle { background: none; border: none; color: #89b4fa; cursor: pointer; font-size: 0.78rem; font-family: inherit; padding: 0; }
.er-feed-output-toggle:hover { text-decoration: underline; }
.er-feed-output { display: none; margin-top: 0.3rem; padding: 0.5rem 0.75rem; background: #181825; border-radius: var(--radius-xs); white-space: pre-wrap; font-size: 0.78rem; color: #a6adc8; max-height: 200px; overflow-y: auto; }
.er-feed-output-wrap.open .er-feed-output { display: block; }

.er-feed-polling-note { padding: 0.4rem 1rem; font-size: 0.75rem; color: #585b70; background: #181825; margin: 0; border-top: 1px solid #313244; font-family: 'JetBrains Mono','Fira Mono',monospace; }

/* ── Editable step builder ───────────────────────────────────────────────────── */
.er-step-editable { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem; margin-bottom: 0.75rem; background: var(--bg-color); }
.er-step-edit-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.er-step-num-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-light); flex-shrink: 0; }
.er-step-edit-controls { display: flex; gap: 0.3rem; margin-left: auto; }
.er-step-edit-controls button { background: none; border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 2px 7px; cursor: pointer; font-size: 0.8rem; color: var(--text-color-light); }
.er-step-edit-controls button:hover { background: var(--surface-2); }
.er-step-remove-btn { color: var(--danger-text) !important; border-color: var(--danger-bg) !important; }
.er-step-remove-btn:hover { background: var(--danger-bg) !important; }
.er-step-edit-fields { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.6rem; }
.er-step-heading-input, .er-step-objective-input { width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 0.88rem; font-family: inherit; background: var(--surface-2); box-sizing: border-box; }
.er-step-heading-input { font-weight: 600; }
.er-step-objective-input { resize: vertical; min-height: 2.4rem; line-height: 1.45; }
.er-step-heading-input:focus, .er-step-objective-input:focus { outline: none; border-color: var(--primary); background: var(--surface); }

.er-step-tasks-editable { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.4rem; }
.er-task-editable { display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-color); }
.er-task-drag-handle { color: var(--text-color-light); cursor: grab; flex-shrink: 0; font-size: 1rem; }
.er-task-title-input { flex: 1; border: none; background: none; font-size: 0.88rem; font-family: inherit; color: var(--text-color); padding: 0; }
.er-task-title-input:focus { outline: none; }
.er-task-agent-select { border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 0.78rem; padding: 2px 4px; background: var(--surface-2); color: var(--text-color-light); max-width: 140px; }
.er-task-remove-btn { background: none; border: none; color: var(--text-color-light); cursor: pointer; font-size: 0.85rem; padding: 0 2px; flex-shrink: 0; }
.er-task-remove-btn:hover { color: var(--danger-text); }
.er-add-task-btn { background: none; border: 1px dashed var(--border); border-radius: var(--radius-xs); padding: 3px 10px; font-size: 0.8rem; color: var(--text-color-light); cursor: pointer; width: 100%; margin-top: 0.25rem; }
.er-add-task-btn:hover { border-color: var(--primary); color: var(--primary); background: #f9f8ff; }
.er-add-step-btn { margin-top: 0.25rem; }

/* ── Plan review two-column layout ──────────────────────────────────────────── */
.er-review-layout { display: grid; grid-template-columns: 3fr 2fr; gap: 1.25rem; align-items: start; padding: 1.25rem; }
.er-review-steps-col { min-width: 0; }
.er-review-sidebar { display: flex; flex-direction: column; gap: 0.75rem; position: sticky; top: 1rem; min-width: 0; }
.er-review-sidebar-section { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem; }
.er-review-actions { display: flex; flex-direction: column; gap: 0.4rem; }
.er-review-actions .btn { justify-content: center; }
@media (max-width: 700px) {
    .er-review-layout { grid-template-columns: 1fr; }
    .er-review-sidebar { position: static; }
}

/* ── AI Revision panel ───────────────────────────────────────────────────────── */
.er-revise-panel { margin-top: 1rem; padding: 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.er-revise-label { font-size: 0.82rem; font-weight: 600; margin: 0 0 0.4rem; color: var(--text-color-light); }
.er-revise-textarea { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem; resize: vertical; box-sizing: border-box; }
.er-revise-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.er-revise-spinner { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; font-size: 0.85rem; color: var(--text-color-light); }
.er-spinner-sm { width: 16px; height: 16px; border-width: 2px; flex-shrink: 0; }

/* ── New Goal form ───────────────────────────────────────────────────────────── */
.goal-new-wrap { max-width: 680px; margin: 0 auto; padding: 1.25rem 1rem; }

/* ── Analytics / Tracking Dashboard ─────────────────────────────────────────── */
.trk-main { max-width: 900px; margin: 0 auto; padding: 1.25rem 1rem; }
.trk-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.trk-stat-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem 1rem; text-align: center; }
.trk-stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 0.35rem; }
.trk-stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-color-light); font-weight: 600; }
@media (max-width: 540px) { .trk-stats-row { grid-template-columns: 1fr; } }

/* filters panel */
.trk-filters-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.5rem 1rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0; }
.trk-filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.trk-filter-row:last-child { border-bottom: none; }
.trk-filter-group-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-color-light); min-width: 62px; flex-shrink: 0; }
.trk-filter-pills { display: flex; gap: 0.3rem; flex-wrap: wrap; flex: 1; }
.trk-filter-pill { padding: 0.22rem 0.65rem; border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--bg-color); color: var(--text-color); font-size: 0.76rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.trk-filter-pill:hover { background: var(--border); }
.trk-pill-active { background: var(--primary) !important; color: var(--on-primary) !important; border-color: var(--primary) !important; }

/* search row */
.trk-search-row { align-items: center; }
.trk-filter-search { position: relative; flex: 1 1 200px; min-width: 160px; }
.trk-search-icon { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); color: var(--text-color-light); font-size: 0.78rem; pointer-events: none; }
.trk-search-input { width: 100%; padding: 0.35rem 1.8rem 0.35rem 1.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; background: var(--bg-color); box-sizing: border-box; }
.trk-search-input:focus { outline: none; border-color: var(--primary); }
.trk-search-clear { position: absolute; right: 0.45rem; top: 50%; transform: translateY(-50%); color: var(--text-color-light); text-decoration: none; font-size: 1rem; line-height: 1; }
.trk-search-clear:hover { color: var(--text-color); }

.trk-active-filters { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; flex: 1; }
.trk-active-tag { background: var(--warning-bg); border: 1px solid var(--warning); color: var(--warning-text); border-radius: var(--radius-xs); padding: 0.12rem 0.45rem; font-size: 0.73rem; display: flex; align-items: center; gap: 0.3rem; }
.trk-active-tag a { color: var(--warning-text); text-decoration: none; font-weight: 700; }
.trk-active-tag a:hover { color: var(--danger-text); }
.trk-clear-all { font-size: 0.73rem; color: var(--text-color-light); text-decoration: underline; margin-left: 0.25rem; }
.trk-clear-all:hover { color: var(--danger); }

/* result count */
.trk-result-count { font-size: 0.8rem; color: var(--text-color-light); text-align: right; margin-top: 0.5rem; }

/* URL table */
.trk-url-table { background: var(--bg-color); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.trk-url-header, .trk-url-row { display: grid; grid-template-columns: 1fr 80px 70px; align-items: center; padding: 0.6rem 1rem; gap: 0.75rem; }
.trk-url-header { background: var(--surface-2); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-light); border-bottom: 1px solid var(--border); }
.trk-th.sortable { cursor: pointer; user-select: none; }
.trk-th.sortable:hover { color: var(--primary); }
.trk-th .sort-icon { font-style: normal; margin-left: 0.25rem; opacity: 0.6; }
.trk-url-row { border-bottom: 1px solid var(--border); }
.trk-url-row:last-child { border-bottom: none; }
.trk-url-row:hover { background: var(--surface-2); }
.trk-col-url { min-width: 0; overflow: hidden; }
.trk-col-hits { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.trk-col-action { text-align: right; }
.trk-url-link { color: var(--primary); text-decoration: none; font-size: 0.88rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-url-link:hover { text-decoration: underline; }

/* ── Analytics URL detail (VIEW mode) ───────────────────────────────────────── */
.trk-view { max-width: 900px; margin: 0 auto; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.trk-back-link { font-size: 0.85rem; color: var(--text-color-light); text-decoration: none; }
.trk-back-link:hover { color: var(--primary); }
.trk-view-header { display: flex; flex-direction: column; gap: 0.25rem; }
.trk-view-url { font-size: 0.9rem; font-weight: 600; color: var(--text-color); word-break: break-all; }
.trk-view-total { font-size: 0.85rem; color: var(--text-color-light); }
.trk-date-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.trk-filter-btn { padding: 0.35rem 0.85rem; border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-color); font-size: 0.82rem; text-decoration: none; transition: all 0.15s; }
.trk-filter-btn:hover { background: var(--border); }
.trk-filter-active { background: var(--primary) !important; color: var(--on-primary) !important; border-color: var(--primary) !important; }
.trk-chart-card { display: block; width: 100%; box-sizing: border-box; padding: 1.25rem; }
.trk-chart-area { width: 100%; }

.trk-method-table { overflow: hidden; }
.trk-method-row, .trk-method-header { display: grid; grid-template-columns: 1fr 80px 180px; align-items: center; padding: 0.5rem 1rem; gap: 1rem; border-bottom: 1px solid var(--border); }
.trk-method-row:last-child { border-bottom: none; }
.trk-method-header { background: var(--surface-2); font-size: 0.73rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-light); }
.trk-method-row:hover { background: var(--surface-2); }
.trk-method-badge { display: inline-block; padding: 0.1rem 0.4rem; border-radius: var(--radius-xs); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; }
.trk-method-local  { background: var(--success-bg); color: var(--success-text); }
.trk-method-serve  { background: var(--info-bg); color: var(--info-text); }
.trk-method-pixel  { background: var(--warning-bg); color: var(--warning-text); }
.trk-method-ping   { background: var(--primary-soft); color: var(--primary-strong); }
.trk-method-bar-wrap { display: flex; align-items: center; gap: 0.5rem; }
.trk-method-bar { height: 6px; border-radius: var(--radius-xs); background: var(--primary); min-width: 2px; flex-shrink: 0; }
.trk-method-pct { font-size: 0.8rem; color: var(--text-color-light); white-space: nowrap; }

/* ── Marketplace ─────────────────────────────────────────────────────────────── */
.mkt-wrap { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem; }
.mkt-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; }
.mkt-page-header h2 { margin: 0; font-size: 1.4rem; }

/* Filter bar */
.mkt-filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; padding: 0.75rem 1rem; background: var(--surface-2); border-radius: var(--radius-md); border: 1px solid var(--border); }
.mkt-filter-group { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.mkt-sort-group { margin-left: auto; }
.mkt-pill { padding: 0.3rem 0.85rem; border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--bg-color); color: var(--text-color); font-size: 0.82rem; text-decoration: none; transition: all 0.15s; white-space: nowrap; }
.mkt-pill:hover { background: var(--border); }
.mkt-pill-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.mkt-pill-selling { background: var(--success-bg); color: var(--success-text); border-color: var(--success-bg); }
.mkt-pill-wanted  { background: var(--info-bg); color: var(--info-text); border-color: var(--info-bg); }
.mkt-select { padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-color); font-size: 0.85rem; color: var(--text-color); cursor: pointer; }
.mkt-search-form { flex: 1; min-width: 200px; }
.mkt-search-wrap { position: relative; display: flex; align-items: center; }
.mkt-search-icon { position: absolute; left: 0.6rem; color: var(--text-color-light); font-size: 0.85rem; }
.mkt-search-input { width: 100%; padding: 0.35rem 2rem 0.35rem 1.9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; }
.mkt-search-clear { position: absolute; right: 0.5rem; color: var(--text-color-light); text-decoration: none; font-size: 1rem; line-height: 1; }
.mkt-search-clear:hover { color: var(--text-color); }

/* Active filter tags */
.mkt-active-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.mkt-active-tag { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.6rem; background: var(--warning-bg); border: 1px solid var(--warning); border-radius: var(--radius-xl); font-size: 0.8rem; color: var(--warning-text); }
.mkt-active-tag a { color: var(--warning-text); text-decoration: none; font-weight: 700; }
.mkt-clear-all { font-size: 0.8rem; color: var(--text-color-light); text-decoration: none; margin-left: 0.25rem; }
.mkt-clear-all:hover { color: var(--primary); }
.mkt-result-count { font-size: 0.82rem; color: var(--text-color-light); margin-bottom: 0.5rem; }

/* Card grid */
.mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.mkt-card { background: var(--bg-color); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.15s; }
.mkt-card:hover { box-shadow: var(--shadow-sm); }
.mkt-card-img-wrap { display: block; aspect-ratio: 4/3; overflow: hidden; background: var(--surface-2); }
.mkt-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mkt-card-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--border); font-size: 2.5rem; }
.mkt-card-body { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.mkt-card-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.mkt-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: var(--radius-xs); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; }
.mkt-badge-selling { background: var(--success-bg); color: var(--success-text); }
.mkt-badge-wanted  { background: var(--info-bg); color: var(--info-text); }
.mkt-cat-tag { display: inline-block; padding: 0.15rem 0.5rem; border-radius: var(--radius-xs); font-size: 0.7rem; background: var(--surface-2); color: var(--text-color-light); }
.mkt-card-title { font-size: 0.92rem; font-weight: 600; color: var(--text-color); text-decoration: none; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-card-title:hover { color: var(--primary); }
.mkt-price { font-size: 1rem; font-weight: 700; color: var(--primary); }
.mkt-neg { font-weight: 400; font-size: 0.8rem; color: var(--text-color-light); }
.mkt-card-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--text-color-light); margin-top: auto; }
.mkt-empty { text-align: center; padding: 3rem 1rem; }

/* View (single listing) */
.mkt-breadcrumb { font-size: 0.82rem; color: var(--text-color-light); margin-bottom: 1rem; }
.mkt-breadcrumb a { color: var(--primary); text-decoration: none; }
.mkt-breadcrumb span { margin: 0 0.35rem; }
.mkt-view-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 1.5rem; }
@media (max-width: 700px) { .mkt-view-layout { grid-template-columns: 1fr; } }
.mkt-view-img-wrap { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.mkt-view-img { width: 100%; height: auto; display: block; }
.mkt-view-img-placeholder { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: var(--radius-md); color: var(--border); font-size: 4rem; }
.mkt-view-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.mkt-view-title { margin: 0 0 0.5rem; font-size: 1.5rem; line-height: 1.3; }
.mkt-view-price { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; }
.mkt-view-location { font-size: 0.88rem; color: var(--text-color-light); margin-bottom: 0.5rem; }
.mkt-view-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-color-light); margin-bottom: 1rem; }
.mkt-contact-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.mkt-contact-seller { font-size: 0.9rem; color: var(--text-color); }
.mkt-contact-btn { align-self: flex-start; }
.mkt-contact-ref { font-size: 0.88rem; color: var(--text-color-light); }
.mkt-login-prompt { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.85rem; color: var(--text-color-light); }
.mkt-owner-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mkt-view-desc-section { border-top: 1px solid var(--border); padding-top: 1.25rem; margin-bottom: 1.25rem; }
.mkt-view-desc-section h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.mkt-view-desc { font-size: 0.9rem; line-height: 1.7; color: var(--text-color); white-space: pre-wrap; }
.mkt-view-back { margin-top: 1rem; }

/* Edit form */
.mkt-edit-form { max-width: 1000px; }
.mkt-form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; margin-bottom: 1.25rem; }
@media (max-width: 800px) { .mkt-form-grid { grid-template-columns: 1fr; } }
.mkt-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mkt-desc-area { resize: vertical; }
.mkt-type-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mkt-type-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border: 2px solid var(--border); border-radius: var(--radius-md); cursor: pointer; font-size: 0.88rem; background: var(--bg-color); transition: all 0.15s; }
.mkt-type-btn input { display: none; }
.mkt-type-btn.active { border-color: var(--primary); background: var(--info-bg); color: var(--primary); font-weight: 600; }
.mkt-img-preview { margin-top: 0.5rem; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); max-height: 160px; }
.mkt-img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mkt-form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.mkt-delete-btn { margin-left: auto; }

/* My Listings table */
.mkt-mine-table { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.mkt-mine-header, .mkt-mine-row { display: grid; grid-template-columns: 2fr 90px 130px 90px 60px 90px 100px; gap: 0.75rem; align-items: center; padding: 0.65rem 1rem; }
.mkt-mine-header { background: var(--surface-2); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-light); border-bottom: 1px solid var(--border); }
.mkt-mine-row { border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.mkt-mine-row:last-child { border-bottom: none; }
.mkt-mine-row:hover { background: var(--surface-2); }
.mkt-mine-title a { color: var(--text-color); text-decoration: none; font-weight: 500; }
.mkt-mine-title a:hover { color: var(--primary); }
.mkt-mine-actions { display: flex; gap: 0.35rem; }
.mkt-status-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: var(--radius-xs); font-size: 0.7rem; font-weight: 700; }
.mkt-s0 { background: var(--danger-bg); color: var(--danger-text); }
.mkt-s1 { background: var(--primary-soft); color: var(--primary-strong); }
.mkt-s2 { background: var(--warning-bg); color: var(--warning-text); }
.mkt-s3 { background: var(--success-bg); color: var(--success-text); }
.mkt-s4 { background: var(--info-bg); color: var(--info-text); }
.mkt-s5 { background: var(--surface-2); color: var(--text-color-light); }

/* Admin table */
.mkt-admin-table { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; overflow-x: auto; }
.mkt-admin-header, .mkt-admin-row { display: grid; grid-template-columns: 2fr 120px 80px 100px 110px 90px 50px 90px 80px; gap: 0.5rem; align-items: center; padding: 0.6rem 0.85rem; }
.mkt-admin-header { background: var(--surface-2); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-light); border-bottom: 1px solid var(--border); }
.mkt-admin-row { border-bottom: 1px solid var(--border); font-size: 0.83rem; }
.mkt-admin-row:last-child { border-bottom: none; }
.mkt-admin-row:hover { background: var(--surface-2); }
.mkt-admin-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.mkt-admin-count { font-size: 0.85rem; color: var(--text-color-light); }
.mkt-admin-owner a { color: var(--text-color-light); text-decoration: none; font-family: monospace; font-size: 0.78rem; }
.mkt-admin-owner a:hover { color: var(--primary); }


/* ── Ads Manager Dashboard ─────────────────────────────────── */
.ads-layout {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
}
.ads-sidebar {
    flex: 0 0 200px;
}
.ads-content {
    flex: 1 1 0;
    min-width: 0;
}

/* Dashboard header row */
.ads-dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.ads-quick-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.ads-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.15rem;
}
.ads-sub-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* Stats cards */
.ads-stats-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.ads-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    flex: 1 1 140px;
    min-width: 130px;
}
.ads-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: rgba(100,116,139,0.12);
    color: var(--text-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.ads-stat-green { background: rgba(34,197,94,0.12); color: var(--success-text); }
.ads-stat-red   { background: var(--ring-color-danger);  color: var(--danger-text); }
.ads-stat-blue  { background: var(--ring-color); color: var(--info-accent); }
.ads-stat-purple{ background: rgba(139,92,246,0.12); color: var(--primary); }
.ads-stat-orange{ background: var(--ring-color); color: var(--orange); }
.ads-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.1;
}
.ads-stat-sub {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}
.ads-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Campaigns list header */
.ads-campaigns-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

/* Empty state */
.ads-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.ads-empty-state i { display: block; margin-bottom: 1rem; opacity: 0.4; }
.ads-empty-state h4 { margin-bottom: 0.5rem; }

/* Campaign cards */
.ads-campaign-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.ads-campaign-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.ads-campaign-card-head {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}
.ads-campaign-name-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}
.ads-campaign-name {
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--text-color);
}
.ads-campaign-name:hover { text-decoration: underline; }
.ads-campaign-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Campaign status badges */
.ads-campaign-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ads-cs1 { background: var(--warning-bg); color: var(--warning-text); }
.ads-cs2 { background: var(--surface-3); color: var(--text-color-light); }
.ads-cs3 { background: var(--success-bg); color: var(--success-text); }
.ads-cs4 { background: var(--primary-soft); color: var(--primary-strong); }
.ads-cs5 { background: var(--danger-bg); color: var(--danger-text); }

/* Campaign mini stats */
.ads-campaign-stats {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}
.ads-cstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 1.2rem;
    flex: 1;
    border-right: 1px solid var(--border);
}
.ads-cstat:last-child { border-right: none; }
.ads-cstat-val {
    font-size: 1rem;
    font-weight: 700;
}
.ads-cstat-lbl {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Ad rows inside a campaign */
.ads-ad-list {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
}
.ads-ad-list.ads-ad-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
}
.ads-ad-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    flex-wrap: wrap;
}
.ads-ad-row:last-child { border-bottom: none; }
.ads-ad-type { color: var(--text-muted); flex-shrink: 0; }
.ads-ad-name { flex: 1 1 160px; min-width: 0; }
.ads-ad-name a { color: var(--text-color); text-decoration: none; }
.ads-ad-name a:hover { text-decoration: underline; }
.ads-ad-stat { color: var(--text-muted); white-space: nowrap; }
.ads-ad-actions { display: flex; gap: 0.35rem; margin-left: auto; flex-shrink: 0; }
.btn-xs { padding: 0.15rem 0.45rem; font-size: 0.72rem; }

/* Ad status badges */
.ads-ad-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-lg);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}
.ads-as-1{ background: var(--primary-soft); color: var(--primary-strong); }
.ads-as0 { background: var(--danger-bg); color: var(--danger-text); }
.ads-as1 { background: var(--warning-bg); color: var(--warning-text); }
.ads-as2 { background: var(--warning-bg); color: var(--warning-text); }
.ads-as3 { background: var(--success-bg); color: var(--success-text); }
.ads-as4 { background: var(--surface-3); color: var(--text-color-light); }
.ads-as5 { background: var(--danger-bg); color: var(--danger-text); }

/* Campaign card footer actions */
.ads-campaign-card-foot {
    display: flex;
    gap: 1.25rem;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    background: var(--surface-2);
}
.ads-campaign-card-foot a {
    color: var(--link);
    text-decoration: none;
}
.ads-campaign-card-foot a:hover { text-decoration: underline; }

/* Notice banner (USE_THEM_DAMMIT case) */
.ads-notice-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning-bg);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--warning-text);
}

@media (max-width: 768px) {
    .ads-layout { flex-direction: column; padding: 1rem; }
    .ads-sidebar { flex: none; width: 100%; }
    .ads-campaign-stats { flex-wrap: wrap; }
    .ads-cstat { flex: 1 1 80px; }
    .ads-stats-row { gap: 0.5rem; }
    .ads-stat-card { flex: 1 1 120px; }
}

/* ── Ads: Publisher sidebar menu ──────────────────────────── */
.ads-pub-menu { padding: 0.5rem 0; }
.ads-pub-menu-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
}
.ads-pub-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ads-pub-menu-list li a {
    display: block;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius-sm);
}
.ads-pub-menu-list li a:hover {
    background: var(--surface-2);
    color: var(--primary);
}

/* ── Ads: Report form ─────────────────────────────────────── */
.ads-report-url {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    word-break: break-all;
}
.ads-report-url-label {
    font-weight: 600;
    margin-right: 0.5rem;
    color: var(--text-muted);
}
.ads-report-form { margin-top: 1rem; }
.ads-report-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}
.ads-report-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.88rem;
}
.ads-report-option:hover { border-color: var(--primary); }
.ads-report-option input[type="radio"] { margin-top: 2px; flex-shrink: 0; }
.ads-report-surf-on {
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Ads: Shared form layout (form partials) ──────────────── */
.ads-form { max-width: 640px; }
.ads-form-section {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
    margin: 1.25rem 0 0.85rem;
}
.ads-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.85rem;
}
.ads-form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
}
.ads-form-label .req { color: var(--danger-text); margin-left: 0.2rem; }
.ads-form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}
.ads-form-info {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}
.ads-form-info p { margin: 0.25rem 0; }
.ads-form-info strong { font-weight: 600; }
.ads-form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.ads-form-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.ads-credits-input {
    font-size: 1.5rem;
    font-weight: 700;
    width: 180px;
    padding: 0.4rem 0.75rem;
}
.ads-warn-box {
    background: var(--warning-bg);
    border: 1px solid var(--warning-bg);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--warning-text);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

/* ── Ads: Transaction history table ──────────────────────── */
.ads-txn-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.ads-txn-header,
.ads-txn-row {
    display: grid;
    grid-template-columns: 160px 1fr 90px 90px 90px;
    align-items: center;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    gap: 0.5rem;
}
.ads-txn-header {
    background: var(--surface-2);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.ads-txn-row {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.ads-txn-row:last-child { border-bottom: none; }
.ads-txn-row:hover { background: var(--surface-2); }
.ads-txn-num { text-align: right; font-variant-numeric: tabular-nums; }
.ads-txn-date { color: var(--text-muted); white-space: nowrap; }
.ads-txn-ref { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-txn-credit { color: var(--success-text); font-weight: 600; }
.ads-txn-debit  { color: var(--danger-text); font-weight: 600; }

@media (max-width: 600px) {
    .ads-txn-header,
    .ads-txn-row {
        grid-template-columns: 1fr 70px 70px 70px;
    }
    .ads-txn-date { display: none; }
}

/* ── Ads: Media Picker (amp = ads media picker) ──────────── */
.amp-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: var(--surface);
}
.amp-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.amp-tab {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: var(--text-muted);
    white-space: nowrap;
}
.amp-tab:hover { color: var(--text-color); }
.amp-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--surface);
}
.amp-panel { display: none; padding: 1rem; }
.amp-panel.active { display: block; }

/* Upload drop zone */
.amp-upload-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.amp-upload-drop:hover,
.amp-upload-drop.dragover {
    border-color: var(--primary);
    background: var(--ring-color);
    color: var(--primary);
}
.amp-upload-progress { margin-top: 0.75rem; }
.amp-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
    margin-bottom: 0.35rem;
}
.amp-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width .1s;
}
.amp-progress-label { font-size: 0.75rem; color: var(--text-muted); }

/* Fetch row */
.amp-fetch-row {
    display: flex;
    gap: 0.5rem;
}
.amp-fetch-row .form-control { flex: 1; }
.amp-fetch-status {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    min-height: 1.2em;
}
.amp-fetch-status.error { color: var(--danger-text); }
.amp-fetch-status.ok    { color: var(--success-text); }

/* Hint text */
.amp-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    margin-bottom: 0;
}

/* Library */
.amp-lib-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.amp-lib-count { font-size: 0.78rem; color: var(--text-muted); margin-left: auto; }
.amp-lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.5rem;
}
.amp-lib-item {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 16/9;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.amp-lib-item:hover { border-color: var(--primary); }
.amp-lib-item.selected { border-color: var(--primary); background: var(--ring-color); }
.amp-lib-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.amp-lib-item .amp-lib-video-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
}
.amp-lib-filename {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.2rem 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    position: absolute;
    bottom: 0;
    background: rgba(255,255,255,0.85);
}
.amp-lib-loading,
.amp-lib-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 1rem 0;
    text-align: center;
}

/* Preview */
.amp-preview {
    border-top: 1px solid var(--border);
    padding: 0.85rem 1rem;
    background: var(--surface-2);
}
.amp-preview-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.amp-preview-media { margin-bottom: 0.4rem; }
.amp-preview-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 0.5rem;
}

/* Error */
.amp-error {
    margin: 0.5rem 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--danger-bg);
    border-radius: var(--radius-sm);
    color: var(--danger-text);
    font-size: 0.82rem;
}

/* ── Course Builder — Sections Tree ──────────────────────────────────────── */
.cb-sections-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.cb-sections-tree {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cb-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
}
/* Section card */
.cb-section {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.cb-section.cb-drag-over-item {
    border-color: var(--info-accent);
    box-shadow: 0 0 0 2px rgba(52,152,219,0.25);
}
.cb-section.cb-dragging { opacity: 0.45; }

.cb-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.cb-drag-handle {
    color: var(--border-strong);
    cursor: grab;
    padding: 0 3px;
    font-size: 0.8rem;
    flex-shrink: 0;
    user-select: none;
}
.cb-drag-handle:active { cursor: grabbing; }
.cb-section-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color-dark);
    outline: none;
    border: none;
    background: transparent;
    padding: 2px 5px;
    border-radius: var(--radius-xs);
    min-width: 0;
}
.cb-section-name:focus { background: var(--info-bg); }
.cb-section-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* Lesson rows */
.cb-lessons-list {
    padding: 0.3rem 0;
    min-height: 2rem;
}
.cb-lessons-empty {
    padding: 0.45rem 2.25rem;
    color: var(--border-strong);
    font-size: 0.82rem;
    font-style: italic;
}
.cb-lesson {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem 0.35rem 2rem;
    border-radius: var(--radius-xs);
    cursor: default;
    transition: background 0.1s;
}
.cb-lesson:hover { background: var(--surface-2); }
.cb-lesson.cb-drag-over-item { background: var(--info-bg); outline: 1px dashed var(--info-accent); }
.cb-lesson.cb-dragging { opacity: 0.4; }
.cb-lesson-title {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.cb-lesson-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.cb-lesson-actions {
    display: flex;
    gap: 0.2rem;
    opacity: 0;
    transition: opacity 0.12s;
    flex-shrink: 0;
}
.cb-lesson:hover .cb-lesson-actions { opacity: 1; }

/* Danger-outline button variant */
.btn-danger-outline {
    color: var(--danger-text);
    border-color: var(--danger-bg);
    background: transparent;
}
.btn-danger-outline:hover { background: var(--danger-bg); border-color: var(--danger-text); }

/* ── Lesson Drawer ────────────────────────────────────────────────────────── */
.cb-lesson-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1049;
}
.cb-lesson-drawer {
    position: fixed;
    top: 0;
    right: -520px;
    width: 500px;
    max-width: 100vw;
    height: 100vh;
    background: var(--surface);
    box-shadow: -4px 0 24px rgba(0,0,0,0.14);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.25s ease;
}
.cb-lesson-drawer.cb-drawer-open { right: 0; }

.cb-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    flex-shrink: 0;
}
.cb-drawer-header h4 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text-color-dark); }

.cb-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}
.cb-drawer-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cb-dtabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1rem;
}
.cb-dtab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-color-light);
    transition: color 0.15s, border-color 0.15s;
}
.cb-dtab.active {
    color: var(--text-color-dark);
    border-bottom-color: var(--info-accent);
    font-weight: 600;
}
.cb-drawer-field { margin-bottom: 1rem; }
.cb-drawer-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-color-light);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cb-drawer-field input,
.cb-drawer-field select,
.cb-drawer-field textarea {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    box-sizing: border-box;
    font-family: inherit;
}
.cb-drawer-field input:focus,
.cb-drawer-field select:focus,
.cb-drawer-field textarea:focus {
    border-color: var(--info-accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}
.cb-drawer-field textarea { resize: vertical; }

/* ── Publisher Network Portal ───────────────────────────────────────────────── */
.pub-menu { padding: 0.5rem 0; }
.pub-menu-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 0.5rem 0.75rem 0.25rem; }
.pub-menu-list { list-style: none; margin: 0; padding: 0; }
.pub-menu-list li a { display: block; padding: 0.45rem 0.75rem; font-size: 0.87rem; color: var(--text-color); text-decoration: none; border-radius: var(--radius-xs); }
.pub-menu-list li a:hover { background: var(--surface-2); color: var(--info-text); }
.pub-menu-balance { margin: 1rem 0.75rem 0.5rem; padding: 0.75rem; background: var(--success-bg); border: 1px solid var(--success-bg); border-radius: var(--radius-sm); text-align: center; }
.pub-menu-balance-label { font-size: 0.72rem; color: var(--success-text); font-weight: 600; text-transform: uppercase; }
.pub-menu-balance-value { font-size: 1.4rem; font-weight: 700; color: var(--success-text); }

.pub-hero { text-align: center; padding: 2.5rem 1rem 2rem; }
.pub-hero-title { font-size: 2rem; font-weight: 700; color: var(--text-color-dark); margin-bottom: 0.5rem; }
.pub-hero-sub { font-size: 1.1rem; color: var(--text-color-light); max-width: 600px; margin: 0 auto; }

.pub-register-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 768px) { .pub-register-grid { grid-template-columns: 1fr; } }
.pub-register-form { padding: 1.5rem; }
.pub-form-title { font-size: 1.05rem; font-weight: 700; color: var(--text-color-dark); margin-bottom: 1rem; }
.pub-form-subtitle { font-size: 0.92rem; font-weight: 700; color: var(--text-color); margin: 1.25rem 0 0.75rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.pub-register-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pub-benefit-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; text-align: center; }
.pub-benefit-card h4 { font-size: 0.92rem; font-weight: 700; color: var(--text-color-dark); margin: 0.5rem 0 0.35rem; }
.pub-benefit-card p { font-size: 0.82rem; color: var(--text-color-light); margin: 0; }
.pub-benefit-icon { color: var(--info-accent); margin-bottom: 0.25rem; }

.pub-dash-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem; }
.pub-section-title { font-size: 0.95rem; font-weight: 700; color: var(--text-color); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 0.75rem; }

.pub-notice { background: var(--warning-bg); border: 1px solid var(--warning-bg); border-radius: var(--radius-sm); padding: 0.85rem 1rem; font-size: 0.88rem; color: var(--warning-text); margin-bottom: 1.25rem; }

.pub-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .pub-stats-row { grid-template-columns: 1fr 1fr; } }
.pub-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; text-align: center; }
.pub-stat-highlight { background: var(--success-bg); border-color: var(--success-bg); }
.pub-stat-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.04em; margin-bottom: 0.35rem; }
.pub-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-color-dark); }
.pub-payout-progress { height: 6px; background: var(--border); border-radius: var(--radius-xs); margin: 0.5rem 0 0.25rem; overflow: hidden; }
.pub-payout-bar { height: 100%; background: var(--success-text); border-radius: var(--radius-xs); transition: width 0.3s; }
.pub-payout-min { font-size: 0.72rem; color: var(--text-color-light); }

.pub-zones-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.pub-zone-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; }
.pub-zone-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; gap: 0.5rem; }
.pub-zone-title { font-size: 0.95rem; font-weight: 700; color: var(--text-color-dark); }
.pub-zone-meta { font-size: 0.77rem; color: var(--text-muted); margin-top: 0.15rem; }
.pub-zone-stats { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.pub-zone-stat { text-align: center; }
.pub-zone-stat span { display: block; font-size: 1.1rem; font-weight: 700; color: var(--text-color); }
.pub-zone-stat small { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.pub-zone-earnings span { color: var(--success-text); }
.pub-zone-site { font-size: 0.77rem; color: var(--text-muted); margin-top: 0.6rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.pub-empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.pub-empty-icon { display: block; margin-bottom: 0.75rem; }

.pub-embed-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 1.25rem; }
.pub-embed-code { position: relative; background: #1e293b; color: var(--border); border-radius: var(--radius-sm); padding: 1rem 3rem 1rem 1rem; font-size: 0.8rem; margin: 0.75rem 0; }
.pub-embed-code pre { margin: 0; white-space: pre-wrap; word-break: break-all; font-family: monospace; }
.pub-copy-btn { position: absolute; top: 0.6rem; right: 0.6rem; color: var(--text-muted); border-color: #475569; background: transparent; }
.pub-copy-btn:hover { color: var(--border); background: #334155; }
.pub-embed-note { font-size: 0.78rem; color: var(--text-muted); margin: 0.5rem 0 0; }

.pub-form { max-width: 640px; }
.pub-form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 640px) { .pub-form-row { grid-template-columns: 1fr; } }
.pub-form-actions { margin-top: 1.25rem; display: flex; gap: 0.5rem; }

.pub-payout-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; max-width: 480px; }
.pub-payout-form { padding: 1.25rem; max-width: 480px; margin-bottom: 1.5rem; }
.pub-payout-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.pub-payout-table th, .pub-payout-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.pub-payout-table th { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); }

.pub-admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.pub-admin-table th, .pub-admin-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.pub-admin-table th { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); }
.pub-admin-table tr:hover td { background: var(--surface-2); }

/* Publisher status badges */
.badge-pub-active    { background: var(--success-bg); color: var(--success-text); font-size: 0.72rem; padding: 0.2rem 0.5rem; border-radius: var(--radius-md); font-weight: 600; }
.badge-pub-pending   { background: var(--warning-bg); color: var(--warning-text); font-size: 0.72rem; padding: 0.2rem 0.5rem; border-radius: var(--radius-md); font-weight: 600; }
.badge-pub-suspended { background: var(--danger-bg); color: var(--danger-text); font-size: 0.72rem; padding: 0.2rem 0.5rem; border-radius: var(--radius-md); font-weight: 600; }

/* ── Publisher Network — Public Landing Page ──────────────────────────────── */
.pub-landing-page { padding-bottom: 0; }

.pub-landing-hero { background: linear-gradient(135deg, #1a1f36 0%, #2d3561 100%); color: var(--on-primary); padding: 5rem 0 4rem; text-align: center; }
.pub-landing-hero h1 { font-size: 2.6rem; font-weight: 800; margin: 0 0 1rem; }
.pub-landing-tagline { font-size: 1.2rem; opacity: 0.85; max-width: 580px; margin: 0 auto 2rem; }
.pub-landing-cta-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.pub-landing-stats { background: var(--info-bg); border-bottom: 1px solid var(--primary-soft); padding: 2rem 0; }
.pub-landing-stats-inner { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.pub-landing-stat { text-align: center; }
.pub-landing-stat-value { display: block; font-size: 1.6rem; font-weight: 800; color: #2d3561; }
.pub-landing-stat-label { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-color-light); margin-top: 0.2rem; }

.pub-landing-section { padding: 4rem 0; }
.pub-landing-section h2 { font-size: 1.9rem; font-weight: 800; margin: 0 0 2rem; text-align: center; }
.pub-landing-section-alt { background: var(--surface-2); }

.pub-landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.pub-landing-step { text-align: center; padding: 1.5rem; }
.pub-landing-step-num { width: 48px; height: 48px; border-radius: var(--radius-full); background: #2d3561; color: var(--on-dark); font-size: 1.3rem; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.pub-landing-step h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.5rem; }
.pub-landing-step p { color: var(--text-color-light); font-size: 0.93rem; line-height: 1.6; }

.pub-landing-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.pub-landing-benefit { padding: 1.5rem; background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border); }
.pub-landing-benefit-icon { font-size: 0.9rem; color: #2d3561; margin-bottom: 0.75rem; }
.pub-landing-benefit h4 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.4rem; }
.pub-landing-benefit p { font-size: 0.88rem; color: var(--text-color-light); line-height: 1.6; margin: 0; }

.pub-landing-cta-section { background: linear-gradient(135deg, #2d3561 0%, #1a1f36 100%); color: var(--on-primary); }
.pub-landing-cta-section h2 { color: var(--on-primary); }
.pub-landing-cta-center { text-align: center; max-width: 620px; margin: 0 auto; }
.pub-landing-cta-center p { opacity: 0.85; margin-bottom: 1.75rem; }
.pub-landing-signin-note { margin-top: 1.25rem; font-size: 0.9rem; opacity: 0.75; }
.pub-landing-signin-note a { color: var(--on-primary); text-decoration: underline; }

@media (max-width: 768px) {
    .pub-landing-hero h1 { font-size: 1.8rem; }
    .pub-landing-steps { grid-template-columns: 1fr; }
    .pub-landing-benefits { grid-template-columns: 1fr; }
    .pub-landing-stats-inner { gap: 1.5rem; }
}

/* /engine uses framework components only — see components.css for
   .page-header*, .stat-grid + .stat-card*, .filter-bar + .filter-pill,
   .status-badge*, .list-empty, .d-table-row--running, .d-table-cell--fill */


/* ── Creative Tools Page ────────────────────────────────────────────────────── */
.tools-page-header { padding: 2rem 0 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tools-page-title { font-size: 1.8rem; font-weight: 700; margin: 0 0 .4rem; color: #1a1a2e; }
.tools-page-subtitle { color: var(--text-color-light); margin: 0; font-size: .95rem; }

.tools-tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: 0; }
.tools-tab { background: none; border: none; border-bottom: 3px solid transparent; padding: .7rem 1.2rem; font-size: .95rem; font-weight: 500; color: var(--text-color-light); cursor: pointer; margin-bottom: -2px; transition: color .15s, border-color .15s; }
.tools-tab:hover { color: var(--text-color-dark); }
.tools-tab.active { color: var(--primary-2); border-bottom-color: var(--primary-2); }

.tools-panel { display: none; }
.tools-panel.active { display: block; }

.tools-two-col { display: grid; grid-template-columns: 420px 1fr; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .tools-two-col { grid-template-columns: 1fr; } }

.tools-form-section { margin-bottom: 1rem; }
.tools-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.tools-form-group { display: flex; flex-direction: column; gap: .3rem; }
.tools-label { font-size: .85rem; font-weight: 600; color: var(--text-color); }
.tools-textarea { width: 100%; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .9rem; resize: vertical; }
.tools-select { font-size: .9rem; }
.tools-hint { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.tools-slider { width: 100%; margin-top: .3rem; }
.tools-checkbox-row { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.tools-generate-btn { width: 100%; padding: .75rem; font-size: 1rem; font-weight: 600; margin-top: .5rem; }

.tools-status { padding: .5rem .75rem; border-radius: var(--radius-xs); font-size: .85rem; margin-top: .5rem; }
.tools-status-info  { background: var(--info-bg); color: var(--info-text); }
.tools-status-error { background: var(--danger-bg); color: var(--danger-text); }

.tools-progress-bar { background: var(--border); border-radius: var(--radius-xs); height: 8px; overflow: hidden; margin-top: .5rem; }
.tools-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--primary)); border-radius: var(--radius-xs); transition: width .4s; width: 0%; }

.tools-output-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; min-height: 300px; background: var(--surface-2); border: 2px dashed var(--border); border-radius: var(--radius-md); color: var(--text-muted); font-size: .9rem; }
.tools-output-icon { color: var(--border-strong); }

.tools-result-image { max-width: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.tools-result-video { max-width: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.tools-audio-player { width: 100%; margin: 1rem 0; }
.tools-result-actions { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.tools-revised-prompt { font-size: .8rem; color: var(--text-muted); font-style: italic; margin-top: .5rem; padding: .4rem .6rem; background: var(--surface-2); border-radius: var(--radius-xs); }

.tools-info-box { background: var(--info-bg); border: 1px solid var(--info-bg); border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .85rem; color: var(--info-accent); margin-bottom: 1rem; }
.tools-info-box code { background: rgba(255,255,255,.6); padding: .1rem .3rem; border-radius: var(--radius-xs); font-size: .82rem; }

/* ── Promo tools page ────────────────────────────────────────────────────────── */
.promo-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.promo-tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.promo-tool-card-coming { opacity: .7; }
.promo-tool-icon { color: var(--primary-2); }
.promo-tool-title { font-weight: 700; font-size: 1rem; color: #1a1a2e; }
.promo-tool-body { font-size: .9rem; color: var(--text-color-light); }
.promo-ref-link-wrap { display: flex; gap: .5rem; }
.promo-ref-link-input { font-size: .85rem; }

/* ── amp-picker Generate tab ────────────────────────────────────────────────── */
.amp-gen-form { padding: .5rem 0; display: flex; flex-direction: column; gap: .6rem; }
.amp-gen-prompt { width: 100%; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: .88rem; resize: vertical; min-height: 70px; }
.amp-gen-row { display: flex; gap: .5rem; }
.amp-gen-row select { flex: 1; font-size: .85rem; padding: .3rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-xs); }
.amp-gen-enhance-row { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--text-color-light); }
.amp-gen-btn { width: 100%; padding: .45rem; font-size: .9rem; }
.amp-gen-status { font-size: .82rem; color: var(--text-muted); margin-top: .3rem; }
.amp-gen-preview-wrap { margin-top: .5rem; }
.amp-gen-result-img { max-width: 100%; max-height: 180px; border-radius: var(--radius-xs); display: block; }
.amp-gen-use-btn { margin-top: .4rem; width: 100%; }

/* ── Memberships admin ────────────────────────────────────────────────────── */
.mem-admin-wrap { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.mem-page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.mem-page-header h2 { margin: 0 0 0.25rem; }
.mem-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1.5rem; margin-top: 1rem; }
.mem-hint { color: var(--text-color-light); font-size: 0.9rem; margin-bottom: 1.25rem; }
.mem-plan-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.mem-plan-row:last-child { border-bottom: none; }
.mem-plan-fields { display: grid; grid-template-columns: 1fr 100px 1fr 2fr; gap: 0.5rem; flex: 1; }
.mem-level-input { text-align: center; }
.mem-plan-actions { padding: 0.75rem 0 0; }
.mem-form-footer { padding-top: 1rem; border-top: 1px solid var(--border); margin-top: 1rem; }
.mem-search-form { margin-bottom: 1rem; }
.mem-search-row { display: flex; gap: 0.5rem; }
.mem-search-row .form-control { flex: 1; }
.mem-members-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.mem-members-table th { text-align: left; padding: 0.5rem 0.75rem; background: var(--surface-2); border-bottom: 2px solid var(--border); color: var(--text-color); font-weight: 600; }
.mem-members-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mem-levels-badge { font-family: monospace; background: var(--surface-3); padding: 0.1rem 0.4rem; border-radius: 0.25rem; font-size: 0.85rem; }
.badge-plan { display: inline-block; background: var(--primary); color: var(--on-primary); font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 0.25rem; margin-left: 0.4rem; vertical-align: middle; }
.badge-active { color: var(--success-text); font-weight: 600; }
.badge-inactive { color: var(--text-muted); }
.mem-inline-row { display: flex; gap: 0.4rem; align-items: center; }
.mem-level-edit { width: 140px; }
.mem-inline-edit { margin: 0; }
.mem-empty { color: var(--text-muted); padding: 1rem 0; text-align: center; }
.mem-grant-form { max-width: 480px; }

/* ── Upgrade / plans page ─────────────────────────────────────────────────── */
.upgrade-wrap { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
.upgrade-gate-notice { background: var(--warning-bg); border: 1px solid var(--warning); border-radius: 0.5rem; padding: 1rem 1.25rem; margin-bottom: 2rem; color: var(--warning-text); font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; }
.upgrade-header { text-align: center; margin-bottom: 2.5rem; }
.upgrade-header h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.upgrade-header p { color: var(--text-color-light); }
.upgrade-plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.upgrade-plan-card { position: relative; background: var(--surface); border: 2px solid var(--border); border-radius: 0.75rem; padding: 2rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.upgrade-plan-card.upgrade-plan-highlighted { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.upgrade-plan-card.upgrade-plan-owned { border-color: var(--green); background: var(--success-bg); }
.upgrade-plan-badge { position: absolute; top: -0.75rem; left: 50%; transform: translateX(-50%); background: var(--primary); color: var(--on-primary); font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.75rem; border-radius: 1rem; white-space: nowrap; letter-spacing: 0.05em; text-transform: uppercase; }
.upgrade-plan-badge.upgrade-plan-badge-owned { background: var(--green); }
.upgrade-plan-name { font-size: 1.25rem; font-weight: 700; }
.upgrade-plan-level { font-size: 0.8rem; color: var(--text-muted); }
.upgrade-plan-desc { font-size: 0.9rem; color: var(--text-color); flex: 1; }
.upgrade-plan-price { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.upgrade-plan-price::before { content: '$'; font-size: 1rem; vertical-align: super; }
.upgrade-plan-tagline { font-size: 0.8rem; color: var(--text-muted); margin-top: -0.5rem; }
.upgrade-plan-action { margin-top: auto; }
.upgrade-plan-action .btn { width: 100%; justify-content: center; }
.upgrade-footer { text-align: center; margin-top: 1rem; }
.upgrade-no-plans { text-align: center; padding: 3rem 1rem; color: var(--text-color-light); }

/* ── Affiliate Network ────────────────────────────────────────────────────── */
.net-wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.net-page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.net-page-header h2 { margin: 0 0 0.25rem; }
.net-browse-intro { color: var(--text-color-light); margin-bottom: 1.25rem; }
.net-empty { padding: 2rem; text-align: center; color: var(--text-muted); }

/* Product grid */
.net-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.net-product-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.6rem; overflow: hidden; display: flex; flex-direction: column; }
.net-product-img img { width: 100%; height: 160px; object-fit: cover; display: block; }
.net-product-body { padding: 1rem; flex: 1; }
.net-supplier-name { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
.net-product-name { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.net-product-line { font-size: 0.85rem; color: var(--text-color-light); margin-bottom: 0.5rem; }
.net-product-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.net-price { font-weight: 700; font-size: 1.1rem; }
.net-price::before { content: '$'; font-size: 0.8rem; }
.net-commission-badge { background: var(--success-bg); color: var(--success-text); font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 1rem; font-weight: 600; }
.net-product-actions { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
.net-link-box { display: flex; gap: 0.4rem; }
.net-link-input { flex: 1; font-size: 0.75rem; }

/* Stats */
.net-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; margin-bottom: 1rem; }
.net-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem 1.25rem; }
.net-stat-label { font-size: 0.8rem; color: var(--text-color-light); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
.net-stat-value { font-size: 1.6rem; font-weight: 700; }
.net-stat-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Supplier onboarding */
.net-onboard-card { max-width: 600px; background: var(--surface); border: 1px solid var(--border); border-radius: 0.6rem; padding: 2rem; margin: 0 auto; }
.net-onboard-header { text-align: center; margin-bottom: 1.5rem; }
.net-onboard-header i { font-size: 2rem; color: var(--primary); display: block; margin-bottom: 0.5rem; }
.net-onboard-header h3 { margin: 0 0 0.5rem; }
.net-onboard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.net-onboard-form .form-group { margin-bottom: 1rem; }

/* Product listing table */
.net-product-listing { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 0.5rem; overflow: hidden; }
.net-list-row { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.net-list-row:last-child { border-bottom: none; }
.net-list-row-active { background: var(--success-bg); }
.net-list-check { flex-shrink: 0; }
.net-list-info { flex: 1; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.net-list-name { font-weight: 500; }
.net-list-price { color: var(--text-color-light); font-size: 0.85rem; }
.net-list-price::before { content: '$'; }
.net-list-badge { font-size: 0.7rem; }
.net-list-rate { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.net-rate-input { width: 90px; }
.net-rate-label { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

.net-supplier-dashboard { }
.net-supplier-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.net-admin-panel { }

/* ── Affiliate referrals table ────────────────────────────────────────────── */
.ref-filter-bar { padding: 0.85rem 0.85rem 0; }
#ref-table {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 0.875rem;
}
#ref-table-header,
#ref-table > div[data-statusgroup] {
    display: grid;
    grid-template-columns: 1.6fr 1.8fr 1.2fr 1fr 1.1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
}
#ref-table-header {
    background: var(--bg-color-distinct);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-color-light);
    border-bottom: 1px solid var(--border);
}
#ref-table > div[data-statusgroup] {
    border-bottom: 1px solid var(--surface-3);
    transition: background var(--transition-fast);
}
#ref-table > div[data-statusgroup]:last-of-type { border-bottom: none; }
#ref-table > div[data-statusgroup]:hover { background: var(--surface-2); }
#ref-no-results { padding: 1.5rem; text-align: center; color: var(--text-color-light); }
.aff-search-input { min-width: 180px; }
@media (max-width: 640px) {
    #ref-table-header,
    #ref-table > div[data-statusgroup] {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    #ref-table-header > span:nth-child(n+3),
    #ref-table > div[data-statusgroup] > span:nth-child(n+3) {
        display: none;
    }
}

/* ── Community Module ──────────────────────────────────────────────────────── */
.comm-wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.comm-page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.comm-page-header h2 { margin: 0 0 0.25rem; }

/* Feed layout */
.comm-feed-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .comm-feed-layout { grid-template-columns: 1fr; } }

/* Compose */
.comm-compose-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem; margin-bottom: 1rem; }
.comm-compose-input { width: 100%; border: 1px solid var(--border); border-radius: 0.375rem; padding: 0.625rem 0.75rem; font-size: 0.95rem; resize: vertical; background: var(--surface); color: var(--text-color); box-sizing: border-box; }
.comm-compose-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.comm-compose-actions { display: flex; justify-content: flex-end; margin-top: 0.5rem; }

/* Dispatch cards */
.comm-dispatch-card { display: flex; gap: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem; margin-bottom: 0.75rem; transition: opacity 0.3s; }
.comm-avatar-circle { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.comm-avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; margin: 0 auto 0.5rem; }
.comm-dispatch-body { flex: 1; min-width: 0; }
.comm-dispatch-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; margin-bottom: 0.4rem; }
.comm-dispatch-name { font-weight: 600; font-size: 0.95rem; }
.comm-dispatch-handle, .comm-dispatch-age { font-size: 0.8rem; }
.comm-dispatch-text { line-height: 1.6; word-break: break-word; margin-bottom: 0.5rem; }
.comm-dispatch-actions { display: flex; gap: 0.5rem; align-items: center; }
.comm-react-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius-full); padding: 0.2rem 0.65rem; font-size: 0.82rem; cursor: pointer; color: var(--text-muted); transition: all 0.15s; display: flex; align-items: center; gap: 0.25rem; }
.comm-react-btn:hover, .comm-react-btn.reacted { border-color: var(--danger); color: var(--danger); background: var(--ring-color-danger); }
.comm-follow-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius-full); padding: 0.2rem 0.65rem; font-size: 0.82rem; cursor: pointer; color: var(--text-muted); transition: all 0.15s; }
.comm-follow-btn:hover { border-color: var(--primary); color: var(--primary); }
.comm-delete-btn { background: none; border: none; cursor: pointer; padding: 0.2rem 0.4rem; font-size: 0.82rem; opacity: 0.5; }
.comm-delete-btn:hover { opacity: 1; color: var(--danger); }

/* Aside */
.comm-feed-aside { position: sticky; top: 1rem; }
.comm-aside-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem; }
.comm-aside-title { font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.75rem; }
.comm-aside-link { display: block; padding: 0.4rem 0; font-size: 0.9rem; color: var(--text-color); text-decoration: none; border-bottom: 1px solid var(--border); }
.comm-aside-link:last-child { border-bottom: none; }
.comm-aside-link:hover { color: var(--primary); }

/* Groups grid */
.comm-groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1rem; }
.comm-group-card { display: flex; gap: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem; text-decoration: none; color: var(--text-color); transition: border-color 0.15s, box-shadow 0.15s; }
.comm-group-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(99,102,241,0.1); }
.comm-group-icon { width: 48px; height: 48px; border-radius: 0.375rem; background: var(--surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: var(--text-muted); }
.comm-group-icon img { width: 100%; height: 100%; object-fit: cover; }
.comm-group-body { flex: 1; min-width: 0; }
.comm-group-name { font-weight: 600; margin-bottom: 0.2rem; }
.comm-group-desc { font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0.4rem; }
.comm-group-meta { display: flex; gap: 0.75rem; font-size: 0.8rem; color: var(--text-muted); }

/* Group header banner */
.comm-group-header-banner { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1.5rem; margin-bottom: 1.5rem; overflow: hidden; }
.comm-group-banner-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.12; }
.comm-group-header-info { position: relative; display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.comm-group-header-icon { width: 64px; height: 64px; border-radius: 0.5rem; background: var(--surface); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; color: var(--text-muted); }
.comm-group-header-icon img { width: 100%; height: 100%; object-fit: cover; }
.comm-group-header-info h2 { margin: 0 0 0.25rem; }
.comm-group-header-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; }
.comm-group-header-actions { display: flex; gap: 0.5rem; align-items: center; margin-left: auto; }

/* Group layout */
.comm-group-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .comm-group-layout { grid-template-columns: 1fr; } }
.comm-group-aside { position: sticky; top: 1rem; }

/* Thread list */
.comm-thread-list { border: 1px solid var(--border); border-radius: 0.5rem; overflow: hidden; }
.comm-thread-row { display: flex; gap: 0.75rem; align-items: center; padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text-color); transition: background 0.1s; }
.comm-thread-row:last-child { border-bottom: none; }
.comm-thread-row:hover { background: var(--surface); }
.comm-thread-icon { color: var(--text-muted); flex-shrink: 0; }
.comm-thread-info { flex: 1; min-width: 0; }
.comm-thread-heading { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-thread-detail { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-thread-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }

/* Thread header card */
.comm-thread-header-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1.25rem; margin-bottom: 1.5rem; }
.comm-thread-header-card h3 { margin: 0 0 0.5rem; }
.comm-thread-header-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.75rem; }

/* Breadcrumb */
.comm-breadcrumb { font-size: 0.85rem; margin-bottom: 1rem; color: var(--text-muted); }
.comm-breadcrumb a { color: var(--primary); text-decoration: none; }
.comm-breadcrumb a:hover { text-decoration: underline; }

/* Members grid */
.comm-members-toolbar { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; }
.comm-search-form { display: flex; gap: 0.5rem; }
.comm-search-input { min-width: 200px; }
.comm-members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 1rem; }
.comm-member-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1.25rem 1rem; text-align: center; }
.comm-member-name { font-weight: 600; margin-bottom: 0.15rem; font-size: 0.95rem; word-break: break-word; }
.comm-member-handle, .comm-member-active { font-size: 0.8rem; margin-bottom: 0.25rem; }
.comm-member-card .btn { margin-top: 0.5rem; font-size: 0.8rem; }

/* Join prompt */
.comm-join-prompt { text-align: center; padding: 1.5rem; }
.comm-new-thread-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1.25rem; }
.comm-new-thread-card h4 { margin: 0 0 1rem; }

/* Empty state */
.comm-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.comm-empty p { margin-top: 0.75rem; }

/* ── Notifications ─────────────────────────────────────────────────────────── */
.notif-bell-btn, .header-icon-btn { position: relative; display: inline-flex; align-items: center; color: var(--nav-color); text-decoration: none; padding: 0.25rem 0.35rem; background: none; border: 0; font: inherit; cursor: pointer; }
.notif-bell-btn:hover, .header-icon-btn:hover { color: var(--primary); }
.notif-icon { position: relative; display: inline-flex; align-items: center; }
.notif-bell-badge { position: absolute; top: -5px; right: -7px; background: var(--danger); color: var(--on-dark); font-size: 0.65rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; pointer-events: none; }

.notif-page-wrap { max-width: 680px; margin: 2rem auto; padding: 0 1rem; }
.notif-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.notif-page-header h2 { margin: 0; }

.notif-list { border: 1px solid var(--border); border-radius: 0.5rem; overflow: hidden; }
.notif-item { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); transition: opacity 0.25s; background: var(--surface); }
.notif-item:last-child { border-bottom: none; }
.notif-item.notif-unread { background: var(--primary-soft); }
.notif-item-icon { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary); }
.notif-type-message .notif-item-icon, .notif-type-chat .notif-item-icon { background: var(--primary-soft); color: var(--primary); }
.notif-type-order .notif-item-icon { background: var(--success-bg); color: var(--success); }
.notif-type-commission .notif-item-icon { background: var(--warning-bg); color: var(--warning-text); }
.notif-type-follow .notif-item-icon, .notif-type-reaction .notif-item-icon { background: var(--danger-bg); color: var(--pink); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-weight: 600; font-size: 0.93rem; color: var(--text-color); text-decoration: none; display: block; }
a.notif-item-title:hover { color: var(--primary); text-decoration: underline; }
.notif-item-desc { font-size: 0.83rem; margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-age { font-size: 0.78rem; margin-top: 0.25rem; }
.notif-item-dismiss { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0.2rem 0.3rem; flex-shrink: 0; opacity: 0.5; }
.notif-item-dismiss:hover { opacity: 1; color: var(--danger); }
.notif-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.notif-empty p { margin-top: 0.75rem; }

/* ── Messages / DM Chat ────────────────────────────────────────────────────── */
.msg-main { display: flex; flex-direction: column; height: calc(100vh - 60px); overflow: hidden; }
.msg-layout { display: grid; grid-template-columns: 300px 1fr; flex: 1; overflow: hidden; }
@media (max-width: 640px) { .msg-layout { grid-template-columns: 1fr; } }

/* Sidebar */
.msg-sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.msg-sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); }
.msg-sidebar-title { font-weight: 700; font-size: 1rem; }
.msg-new-btn { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 1rem; padding: 0.25rem 0.4rem; border-radius: 0.375rem; }
.msg-new-btn:hover { background: var(--surface); }
.msg-thread-list { flex: 1; overflow-y: auto; }
.msg-thread-row { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text-color); cursor: pointer; }
.msg-thread-row:hover, .msg-thread-row.active { background: var(--primary-soft); }
.msg-thread-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; flex-shrink: 0; }
.msg-thread-info { flex: 1; min-width: 0; }
.msg-thread-name { font-weight: 600; font-size: 0.9rem; }
.msg-thread-preview { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-thread-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; flex-shrink: 0; }
.msg-thread-age { font-size: 0.75rem; color: var(--text-muted); }
.msg-thread-badge { background: var(--primary); color: var(--on-primary); font-size: 0.7rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.msg-empty-sidebar { padding: 1.5rem 1rem; text-align: center; }

/* Conversation */
.msg-conversation { display: flex; flex-direction: column; overflow: hidden; background: var(--bg-color); }
.msg-conv-header { display: flex; gap: 0.75rem; align-items: center; padding: 0.875rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.msg-conv-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.msg-conv-name { font-weight: 600; }
.msg-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }

/* Bubbles */
.msg-bubble { max-width: 65%; display: flex; flex-direction: column; }
.msg-mine { align-self: flex-end; align-items: flex-end; }
.msg-theirs { align-self: flex-start; align-items: flex-start; }
.msg-bubble-text { padding: 0.6rem 0.875rem; border-radius: 1rem; font-size: 0.93rem; line-height: 1.5; word-break: break-word; }
.msg-mine .msg-bubble-text { background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 0.2rem; }
.msg-theirs .msg-bubble-text { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 0.2rem; color: var(--text-color); }
.msg-bubble-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; padding: 0 0.25rem; }

/* Input bar */
.msg-input-bar { display: flex; gap: 0.5rem; align-items: flex-end; padding: 0.75rem 1rem; background: var(--surface); border-top: 1px solid var(--border); }
.msg-input { flex: 1; border: 1px solid var(--border); border-radius: 1.25rem; padding: 0.5rem 0.875rem; font-size: 0.93rem; resize: none; overflow: hidden; line-height: 1.5; background: var(--surface); color: var(--text-color); }
.msg-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.msg-send-btn { width: 38px; height: 38px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s; }
.msg-send-btn:hover { background: var(--primary-strong); }

/* Empty / no thread */
.msg-no-thread { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 0.75rem; color: var(--text-muted); }

/* New conversation modal */
.msg-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.msg-modal-panel { background: var(--surface); border-radius: 0.75rem; width: 400px; max-width: 90vw; overflow: hidden; box-shadow: var(--shadow-xl); }
.msg-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.msg-modal-close { background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--text-muted); }
.msg-modal-body { padding: 1rem; }
.msg-modal-search-row { display: flex; gap: 0.5rem; margin: 0.5rem 0 0.75rem; }
.msg-search-results { max-height: 240px; overflow-y: auto; }
.msg-search-row { display: flex; gap: 0.75rem; align-items: center; padding: 0.6rem 0.5rem; border-radius: 0.375rem; cursor: pointer; }
.msg-search-row:hover { background: var(--surface); }

/* ═══════════════════════════════════════════════════════════════════════════
   WEBINARS / MEETPRESENT
   ═══════════════════════════════════════════════════════════════════════════ */

/* Layout wrapper */
.webinar-wrap { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* Page header */
.webinar-page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; }
.webinar-header-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* Cards grid */
.webinar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.webinar-section { margin-top: 1rem; }
.webinar-section-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.875rem; display: flex; align-items: center; gap: 0.5rem; }

/* Card */
.webinar-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.15s; }
.webinar-card:hover { box-shadow: var(--shadow-sm); }
.webinar-card-thumb { position: relative; height: 160px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%); display: flex; align-items: center; justify-content: center; }
.webinar-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.webinar-card-thumb-placeholder { color: rgba(255,255,255,0.5); font-size: 2.5rem; }
.webinar-card-badges { position: absolute; top: 0.625rem; left: 0.625rem; display: flex; gap: 0.35rem; }
.webinar-card-body { padding: 0.875rem 1rem; flex: 1; display: flex; flex-direction: column; }
.webinar-card-title { font-weight: 600; font-size: 0.97rem; margin-bottom: 0.25rem; color: var(--text-color); }
.webinar-card-meta { font-size: 0.82rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 0.75rem; }
.webinar-card-actions { margin-top: auto; display: flex; gap: 0.5rem; }

/* Status badges */
.webinar-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.55rem; border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 600; }
.webinar-badge-draft     { background: var(--surface-3); color: var(--text-color-light); }
.webinar-badge-scheduled { background: var(--info-bg); color: var(--info-accent); }
.webinar-badge-live      { background: var(--danger-bg); color: var(--danger-text); animation: webinar-live-pulse 1.6s ease-in-out infinite; }
.webinar-badge-ended     { background: var(--surface-3); color: var(--text-color-light); }
.webinar-badge-ondemand  { background: var(--success-bg); color: var(--success-text); }
.webinar-type-label { display: inline-block; font-size: 0.8rem; color: var(--text-muted); }

/* Live dot + pulsing */
.webinar-live-dot { width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--danger-text); display: inline-block; animation: webinar-live-pulse 1.6s ease-in-out infinite; }
@keyframes webinar-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Empty state */
.webinar-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; padding: 4rem 1rem; color: var(--text-muted); text-align: center; }

/* Edit form */
.webinar-edit-form {}
.webinar-edit-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; }
.webinar-edit-main {}
.webinar-edit-aside { display: flex; flex-direction: column; gap: 1rem; }
.webinar-form-section { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1.25rem; }
.webinar-form-section h4 { margin: 0 0 1rem; font-size: 0.95rem; font-weight: 600; color: var(--text-color); }
.webinar-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* View page */
.webinar-view-hero { position: relative; min-height: 260px; border-radius: 0.75rem; overflow: hidden; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%); display: flex; align-items: flex-end; margin-bottom: 1.5rem; }
.webinar-view-hero-img { background-size: cover; background-position: center; }
.webinar-view-hero-img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 60%, transparent 100%); }
.webinar-view-hero-content { position: relative; z-index: 1; padding: 1.5rem; color: var(--on-primary); width: 100%; }
.webinar-view-badges { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.webinar-view-title { font-size: 1.75rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--on-primary); }
.webinar-view-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.88rem; opacity: 0.9; }
.webinar-view-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; }
.webinar-view-description { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1rem; line-height: 1.7; }
.webinar-view-notes { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1rem; font-size: 0.92rem; }
.webinar-replay-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem; }
.webinar-replay-wrap h4 { margin: 0 0 0.875rem; font-size: 0.95rem; }
.webinar-replay-video { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 0.5rem; }
.webinar-replay-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Aside */
.webinar-aside-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem; }
.webinar-aside-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.875rem; }
.webinar-aside-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--text-color); margin-bottom: 0.4rem; }
.webinar-registered-notice { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-bg); border-radius: 0.5rem; padding: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }

/* Room (full-screen) */
.webinar-room-body { margin: 0; padding: 0; background: #0f0f11; overflow: hidden; height: 100vh; }
.webinar-room-layout { display: grid; grid-template-columns: 1fr 320px; height: 100vh; }
.webinar-room-main { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0f0f11; position: relative; overflow: hidden; }
.webinar-remote-tracks { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 1rem; }
.webinar-video-el { max-width: 100%; max-height: 100%; border-radius: 0.5rem; background: var(--text-color-dark); }
.webinar-host-preview { position: absolute; bottom: 0.75rem; right: 0.75rem; width: 200px; height: 130px; background: var(--text-color-dark); border-radius: 0.5rem; overflow: hidden; z-index: 10; box-shadow: var(--shadow-sm); }
.webinar-host-preview .webinar-video-el { width: 100%; height: 100%; object-fit: cover; }
.webinar-room-placeholder { color: rgba(255,255,255,0.6); text-align: center; padding: 2rem; }
.webinar-room-placeholder h3 { color: var(--on-primary); margin-bottom: 0.75rem; }
.webinar-video-connecting { display: flex; flex-direction: column; align-items: center; gap: 1rem; color: var(--nav-color); }
.webinar-spinner { width: 48px; height: 48px; border: 4px solid rgba(255,255,255,0.15); border-top-color: var(--primary); border-radius: var(--radius-full); animation: webinar-spin 0.8s linear infinite; }
@keyframes webinar-spin { to { transform: rotate(360deg); } }

/* Room panel */
.webinar-room-panel { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.webinar-room-panel-header { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem; }
.webinar-room-panel-title { font-weight: 600; font-size: 0.93rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Host controls */
.webinar-host-controls { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.webinar-ctrl-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-color); transition: background 0.15s; }
.webinar-ctrl-btn:hover { background: var(--border); }
.webinar-ctrl-muted { background: var(--danger-bg) !important; color: var(--danger-text) !important; border-color: var(--danger-bg) !important; }
.webinar-ctrl-end { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-bg); }
.webinar-ctrl-end:hover { background: var(--danger-bg); }

/* Chat */
.webinar-chat { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.webinar-chat-messages { flex: 1; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.webinar-chat-msg { font-size: 0.87rem; line-height: 1.45; color: var(--text-color); }
.webinar-chat-mine { color: var(--primary); }
.webinar-chat-input-row { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
.webinar-chat-input { flex: 1; border: 1px solid var(--border); border-radius: 1.25rem; padding: 0.45rem 0.875rem; font-size: 0.87rem; background: var(--surface); }
.webinar-chat-send { background: var(--primary); color: var(--on-primary); border: none; border-radius: var(--radius-full); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

/* Manage table */
.webinar-manage-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; }
.webinar-manage-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.webinar-manage-table thead th { background: var(--surface); padding: 0.75rem 1rem; text-align: left; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.webinar-manage-row td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.webinar-manage-row:last-child td { border-bottom: none; }
.webinar-manage-title-cell { display: flex; align-items: center; gap: 0.75rem; }
.webinar-manage-thumb { width: 70px; height: 46px; border-radius: 0.375rem; object-fit: cover; flex-shrink: 0; }
.webinar-manage-thumb-placeholder { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.5); }
.webinar-manage-name { font-weight: 600; }
.webinar-manage-name a { color: var(--text-color); text-decoration: none; }
.webinar-manage-name a:hover { color: var(--primary); }
.webinar-manage-type { font-size: 0.8rem; }
.webinar-manage-date { white-space: nowrap; }
.webinar-manage-count { font-weight: 600; text-align: center; }
.webinar-manage-actions { display: flex; gap: 0.375rem; flex-wrap: nowrap; }

/* Responsive */
@media (max-width: 768px) {
    .webinar-edit-grid { grid-template-columns: 1fr; }
    .webinar-view-layout { grid-template-columns: 1fr; }
    .webinar-room-layout { grid-template-columns: 1fr; grid-template-rows: 60vh 1fr; height: auto; }
    .webinar-room-body { height: auto; overflow: auto; }
    .webinar-manage-table thead { display: none; }
    .webinar-manage-row td { display: block; padding: 0.5rem 1rem; }
    .webinar-manage-title-cell { padding-top: 0.875rem; }
    .webinar-manage-actions { padding-bottom: 0.875rem; }
    .webinar-edit-row { grid-template-columns: 1fr; }
}


/* ── Account / Wallet transaction table ─────────────────────────────────────── */
#tx-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 0.875rem;
}
#tx-table-header,
.tx-row {
    display: grid;
    grid-template-columns: 7rem 1fr 7rem 7rem 7rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
}
#tx-table-header {
    background: var(--bg-color-distinct);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-color-light);
    border-bottom: 1px solid var(--border);
}
.tx-row {
    border-bottom: 1px solid var(--surface-3);
    transition: background var(--transition-fast);
}
.tx-row:last-child { border-bottom: none; }
.tx-row:hover { background: var(--surface-2); }
.tx-pagination {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.text-right { text-align: right; }
@media (max-width: 640px) {
    #tx-table-header,
    .tx-row {
        grid-template-columns: 6rem 1fr 6rem;
    }
    #tx-table-header > span:nth-child(3),
    #tx-table-header > span:nth-child(4),
    .tx-row > span:nth-child(3),
    .tx-row > span:nth-child(4) { display: none; }
}

/* ── Checkout inline address form ───────────────────────────────────────────── */
.checkout-addr-inline-form { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; margin-bottom: .75rem; }
.checkout-addr-inline-fields { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .75rem; }
.checkout-addr-inline-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 480px) { .checkout-addr-inline-row { grid-template-columns: 1fr; } }

/* ── USERS zone header + responsive drawer ──────────────────────────────
   Three-state pattern based on viewport:
     • Mobile (<768px)   off-canvas drawer, hamburger toggles overlay
     • Tablet (768-1023) icon-only rail, always visible, main shifted right
     • Desktop (≥1024)   full sidebar, always visible, main shifted right;
                          a collapse button toggles to rail (sets body.drawer-collapsed)
   ─────────────────────────────────────────────────────────────────────── */

/* Width tokens (kept here to make tweaks easy) */
:root {
    --drawer-width-full: 280px;
    --drawer-width-rail: 64px;
}

/* Header bar — always sticky, full-bleed */
.users-header {
    color: var(--nav-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-sizing: border-box;
    background: var(--chrome-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--chrome-border);
    transition: padding-left var(--transition-base);
}
.users-header .header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    padding: 0.5rem 1.5rem;
    width: 100%;
}
.users-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Header title — truncate with ellipsis when the URI title is long
   (blog article URIs use the full <title> string; this keeps the chrome bar tidy). */
.users-header .header-wrap > .fs-1_5r {
    min-width: 0;
}
.users-header .header-wrap > .fs-1_5r > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.users-header-actions a { color: var(--nav-color); text-decoration: none; font-size: 0.9rem; }
.users-header-actions a:hover { color: var(--nav-color-hover); }
/* Dropdowns rendered inside the header (e.g. user menu) drop onto a white
   panel — restore dark text so they're readable. The header's pale --nav-color
   is right for links on the dark header bar but unreadable on white. */
.users-header-actions .dropdown-menu a,
.users-header-actions .dropdown-menu a:hover { color: var(--text-color); }


/* Rail mode: center the chevron toggle in the drawer head (logo img is hidden). */
body.drawer-collapsed .users-drawer .users-drawer-head,
.users-drawer.is-rail .users-drawer-head {
    justify-content: center;
    padding: 0.75rem 0;
}
body.drawer-collapsed .users-drawer .users-drawer-logo,
.users-drawer.is-rail .users-drawer-logo { display: none; }

/* Drawer (the "aside") — base shape; per-breakpoint position/width below */
.users-drawer {
    position: fixed;
    top: 0;
    height: 100vh;
    background: var(--chrome-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: width var(--transition-base), left var(--transition-base);
    z-index: 200;
    overflow-y: auto;
    box-shadow: 2px 0 16px rgba(0,0,0,0.3);
}

.users-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--chrome-border);
    background: var(--chrome-overlay);
}
.users-drawer-logo { display: inline-flex; align-items: center; overflow: hidden; }
.users-drawer-logo img { height: 36px; width: auto; max-width: 200px; display: block; }

.users-drawer-toggle {
    background: transparent;
    border: 0;
    color: var(--nav-color);
    font-size: 1.1rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}
.users-drawer-toggle:hover { background: var(--chrome-overlay); color: var(--nav-color-hover); }

.drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}
.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--nav-color);
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.drawer-link:hover { background: var(--chrome-overlay); color: var(--nav-color-hover); }
.drawer-link i.fa { width: 1.25rem; text-align: center; opacity: 0.85; flex-shrink: 0; }
.drawer-link-text { display: inline; }
.drawer-link.active {
    background: var(--chrome-overlay);
    color: var(--nav-color-hover);
    box-shadow: inset 3px 0 0 var(--highlight);
}
.drawer-link.active i.fa { opacity: 1; }
.drawer-sep {
    border: 0;
    border-top: 1px solid var(--chrome-border);
    margin: 0.5rem 0;
}

/* Section group headings between Workspace / Modules / Account */
.drawer-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--chrome-text-muted);
    padding: 1rem 1rem 0.4rem;
}
.drawer-section + .drawer-section,
.drawer-nav > .drawer-section:first-child { padding-top: 0.5rem; }

/* Backdrop — only used on mobile */
.users-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: 150;
}
.users-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* Reusable "rail" form — labels hidden, icons centred, section titles hidden,
   custom hover tooltip popping out to the right via ::after data-label */
.users-drawer.is-rail,
body.drawer-collapsed .users-drawer { width: var(--drawer-width-rail); }
.users-drawer.is-rail .drawer-link-text,
.users-drawer.is-rail .drawer-section,
.users-drawer.is-rail .users-drawer-logo img,
body.drawer-collapsed .users-drawer .drawer-link-text,
body.drawer-collapsed .users-drawer .drawer-section,
body.drawer-collapsed .users-drawer .users-drawer-logo img { display: none; }
.users-drawer.is-rail .drawer-link,
body.drawer-collapsed .users-drawer .drawer-link {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    gap: 0;
    position: relative;
}
.users-drawer.is-rail .drawer-link::after,
body.drawer-collapsed .users-drawer .drawer-link::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--chrome-bg);
    color: var(--nav-color-hover);
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    border-radius: var(--radius-xs);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
    box-shadow: var(--shadow-xs);
    z-index: 250;
}
.users-drawer.is-rail .drawer-link:hover::after,
body.drawer-collapsed .users-drawer .drawer-link:hover::after { opacity: 1; }

/* Toggle chevron — points "in" (« collapse) when full, "out" (» expand) when collapsed */
.users-drawer-toggle .fa { transition: transform .2s ease; }
body.drawer-collapsed .users-drawer-toggle .fa { transform: rotate(180deg); }

/* ── DESKTOP (≥1024px): full sidebar by default ───────────────────────── */
/* main / .users-header / footer all need the same drawer-width left-padding
   so none of them slide under the fixed drawer. box-sizing:border-box on
   them all (per feedback_box_sizing_layout_containers) so width:100% +
   padding doesn't overflow viewport. */
@media (min-width: 1024px) {
    .users-drawer { left: 0; width: var(--drawer-width-full); }
    main, .users-header, footer { padding-left: var(--drawer-width-full); box-sizing: border-box; }
    body.drawer-collapsed main,
    body.drawer-collapsed .users-header,
    body.drawer-collapsed footer { padding-left: var(--drawer-width-rail); }
    /* Hide both the hamburger and its wrapper so the empty wrap doesn't claim
       a flex slot + gap, pushing the header title to the right. */
    .navbar-toggler#users-drawer-toggler,
    .users-header .logo-toggle-wrap { display: none; }
}

/* ── TABLET (768-1023px): icon-only rail; toggle expands to full overlay ─ */
@media (min-width: 768px) and (max-width: 1023px) {
    .users-drawer {
        left: 0;
        width: var(--drawer-width-rail);
    }
    .users-drawer .drawer-link-text,
    .users-drawer .drawer-section,
    .users-drawer .users-drawer-logo img { display: none; }
    .users-drawer .drawer-link {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        gap: 0;
    }
    main, .users-header, footer { padding-left: var(--drawer-width-rail); box-sizing: border-box; }
    .navbar-toggler#users-drawer-toggler,
    .users-header .logo-toggle-wrap { display: none; }

    /* Expanded state: drawer overlays at full width; main padding stays at rail
       so the expansion is non-destructive to layout */
    body.drawer-expanded .users-drawer { width: var(--drawer-width-full); }
    body.drawer-expanded .users-drawer .drawer-link-text { display: inline; }
    body.drawer-expanded .users-drawer .drawer-section { display: block; }
    body.drawer-expanded .users-drawer .users-drawer-logo img { display: block; }
    body.drawer-expanded .users-drawer .drawer-link {
        justify-content: flex-start;
        padding-left: 1rem;
        padding-right: 1rem;
        gap: 0.75rem;
    }
    body.drawer-expanded .users-drawer .drawer-link::after { display: none; }
    /* When expanded, rotate the chevron the other way to suggest "collapse" */
    body.drawer-expanded .users-drawer-toggle .fa { transform: rotate(0deg); }
    .users-drawer-toggle .fa { transform: rotate(180deg); }
}

/* ── MOBILE (<768px): off-canvas; hamburger opens overlay ─────────────── */
@media (max-width: 767px) {
    .users-drawer {
        left: calc(-1 * var(--drawer-width-full));
        width: var(--drawer-width-full);
    }
    .users-drawer.open { left: 0; }
    main, .users-header, footer { padding-left: 0; }
    /* hamburger visible. Toggle in drawer head visible too — acts as close (×) */
    .navbar-toggler#users-drawer-toggler { display: flex; }
    .users-drawer-toggle .fa-chevron-left::before { content: "\f00d"; } /* fa-times */
}


/* ── Funnelly drawer: legacy accordion nav inside .users-drawer ─────────
   Keeps the legacy <ul class="list-unstyled"> + <a class="nav-link">
   menu items legible (white) inside the modern drawer chrome. */
.users-drawer ul.list-unstyled { padding: 0 0 0.75rem 0; margin: 0; list-style: none; }
.users-drawer .nav-item { transition: all var(--transition-fast); }
.users-drawer .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-radius: var(--radius-md);
    margin: 0.125rem 0.5rem;
    color: var(--nav-color);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.users-drawer .nav-link:hover {
    color: var(--nav-color-hover);
    background: var(--chrome-overlay);
}
.users-drawer .nav-item.active > .nav-link,
.users-drawer .nav-link[aria-expanded="true"] {
    color: var(--nav-color-hover);
    background: var(--chrome-overlay);
    font-weight: 600;
}
.users-drawer ul ul .nav-link { padding-left: 2.25rem; font-size: 0.875rem; opacity: 0.9; }
.users-drawer ul ul .nav-link:hover { opacity: 1; }

/* ── Rail mode: icons only + hover fly-out submenus (rail-flyout) ─────
   Three contexts trigger rail mode:
   (1) body.drawer-collapsed — desktop, user clicked chevron
   (2) .users-drawer.is-rail — manual rail class
   (3) tablet viewport 768-1023px (handled inside the existing media query
       lower in this file; the same rules are emitted there too)
   All three share identical CSS so any rail context behaves the same. */
body.drawer-collapsed .users-drawer .nav-link,
.users-drawer.is-rail .nav-link {
    justify-content: center !important;
    padding: 0.5rem 0 !important;
    gap: 0 !important;
    font-size: 0 !important;
    position: relative;
}
body.drawer-collapsed .users-drawer .nav-link i.fa,
.users-drawer.is-rail .nav-link i.fa { font-size: 1rem !important; }
body.drawer-collapsed .users-drawer .nav-link span,
.users-drawer.is-rail .nav-link span { display: none !important; }
body.drawer-collapsed .users-drawer .nav-link.dropdown-toggle::after,
.users-drawer.is-rail .nav-link.dropdown-toggle::after { display: none !important; }

/* Tooltip for items in the rail (icon → small label panel to the right). */
body.drawer-collapsed .users-drawer > ul > .nav-item > .nav-link[data-label]::after,
.users-drawer.is-rail > ul > .nav-item > .nav-link[data-label]::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--chrome-bg);
    color: var(--nav-color-hover);
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    border-radius: var(--radius-xs);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
    box-shadow: var(--shadow-xs);
    z-index: 250;
}
body.drawer-collapsed .users-drawer > ul > .nav-item > .nav-link:hover::after,
.users-drawer.is-rail > ul > .nav-item > .nav-link:hover::after { opacity: 1; }

/* Submenu flyout — pops out beside the icon on parent hover. */
body.drawer-collapsed .users-drawer > ul > .nav-item,
.users-drawer.is-rail > ul > .nav-item { position: relative; }

body.drawer-collapsed .users-drawer > ul > .nav-item > .collapse,
body.drawer-collapsed .users-drawer > ul > .nav-item > .collapse.show,
.users-drawer.is-rail > ul > .nav-item > .collapse,
.users-drawer.is-rail > ul > .nav-item > .collapse.show {
    display: none !important;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 220px;
    background: var(--chrome-bg);
    padding: 0.5rem 0;
    margin-left: 4px;
    border-radius: var(--radius-sm);
    box-shadow: 2px 4px 16px rgba(0,0,0,0.4);
    z-index: 250;
    list-style: none;
}
body.drawer-collapsed .users-drawer > ul > .nav-item:hover > .collapse,
.users-drawer.is-rail > ul > .nav-item:hover > .collapse {
    display: block !important;
}
/* Submenu links inside flyout: re-show text, normal padding. */
body.drawer-collapsed .users-drawer > ul > .nav-item > .collapse .nav-link,
.users-drawer.is-rail > ul > .nav-item > .collapse .nav-link {
    justify-content: flex-start !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    gap: 0.625rem !important;
}
body.drawer-collapsed .users-drawer > ul > .nav-item > .collapse .nav-link span,
.users-drawer.is-rail > ul > .nav-item > .collapse .nav-link span { display: inline !important; }

/* Flyout panel header (parent's name in caps). */
body.drawer-collapsed .users-drawer > ul > .nav-item:hover > .collapse::before,
.users-drawer.is-rail > ul > .nav-item:hover > .collapse::before {
    content: attr(data-flyout-title);
    display: block;
    padding: 0.4rem 1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--chrome-text-muted);
    border-bottom: 1px solid var(--chrome-border);
    margin-bottom: 0.25rem;
}



/* In rail mode nothing in the drawer chain may clip horizontally — the
   flyout panel sits outside the rail width. Also override the body-level
   overflow-x:hidden via a wrapping rule. */
body.drawer-collapsed,
body.drawer-collapsed .users-drawer,
body.drawer-collapsed .users-drawer > ul.list-unstyled,
.users-drawer.is-rail,
.users-drawer.is-rail > ul.list-unstyled { overflow: visible !important; }
/* Clock layout — two lines: time on top, date below. */
.users-drawer #server_time { display: block; }
.users-drawer .clock-line { display: block; text-align: center; }
.users-drawer .clock-time-line { font-size: 0.95rem; font-weight: 600; color: var(--nav-color); }
.users-drawer .clock-date { font-size: 0.7rem; opacity: 0.7; margin-top: 0.15rem; }

/* Rail mode: clock shows only H:i, no GMT prefix, seconds, or date */
body.drawer-collapsed .users-drawer .clock-prefix,
body.drawer-collapsed .users-drawer .clock-secs,
body.drawer-collapsed .users-drawer .clock-date,
.users-drawer.is-rail .clock-prefix,
.users-drawer.is-rail .clock-secs,
.users-drawer.is-rail .clock-date { display: none; }
body.drawer-collapsed .users-drawer .clock,
.users-drawer.is-rail .clock {
    text-align: center;
    padding: 0.5rem 0;
    margin: 0;
}
/* Clock at the bottom of the drawer */
.users-drawer .clock { color: var(--chrome-text-muted); font-size: 0.78rem; padding: 0.5rem 1rem; }

/* Title in users-header — keep on one line, ellipsis on overflow */
.users-header .header-wrap > .d-flex.flex-grow {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.users-header .header-wrap .users-header-actions { flex-shrink: 0; }

/* Engine Room — blocked/stuck task + stall banner + heartbeat (extends .er-feed-*) */
.er-feed-blocked  { border-left-color: #f38ba8; background: rgba(243,139,168,0.06); }
.er-feed-blocked .er-feed-icon { color: #f38ba8; }
.er-feed-blocked .er-feed-status-badge { background: #f38ba8; color: #1e1e2e; }
.er-stalled-banner { display: none; margin: 0.5rem 1rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-xs); background: rgba(243,139,168,0.12); color: #f38ba8; font-size: 0.82rem; font-weight: 600; }
.er-stalled-banner.show { display: block; }
.er-feed-heartbeat { font-size: 0.74rem; color: #6c7086; }

/* Engine Room cog — live run-state indicator (green running / amber paused / red stopped) */
.engine-cog          { transition: color .3s ease; }
.engine-cog--running { color: var(--success-text); }
.engine-cog--paused  { color: var(--warning-text); }
.engine-cog--stopped { color: var(--danger-text); }
.engine-cog--spin    { animation: engine-cog-spin 2.4s linear infinite; }
@keyframes engine-cog-spin { to { transform: rotate(360deg); } }


/* ── Task dependency overlay on the schedule Gantt ───────────────────────────
   Critical-path highlight, stage badges, and SVG dependency connectors drawn by
   section_project_schedule.php. (feature CSS lives with the other .gantt-* rules) */
.gantt-connectors {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: visible;
}
.gantt-dep-line {
    fill: none;
    stroke: var(--border-strong, #9aa0a6);
    stroke-width: 1.5;
    opacity: 0.55;
}
.gantt-dep-line--crit {
    stroke: var(--danger, #f44336);
    stroke-width: 2;
    opacity: 0.85;
}
.gantt-bar--crit {
    box-shadow: 0 0 0 2px var(--danger, #f44336);
    z-index: 2;
}
.gantt-row--crit .gantt-task-label { color: var(--danger, #f44336); font-weight: 600; }
.gantt-stage-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    line-height: 1.35;
    border-radius: var(--radius-xs, 3px);
    background: var(--surface-3, #eceff1);
    color: var(--text-muted, #607d8b);
    vertical-align: middle;
}
.gantt-legend-crit { background: var(--danger, #f44336) !important; }
.gantt-legend-line {
    display: inline-block; width: 18px; height: 0;
    border-top: 2px solid var(--border-strong, #9aa0a6);
    vertical-align: middle;
}


/* ── Gantt goal→step→task hierarchy + leaf detail (dependency schedule) ─────── */
.gantt-row-goal  { background: var(--surface-3); font-weight: 600; }
.gantt-row-step  { background: var(--surface-2); }
.gantt-label-indent-2 { padding-left: 3rem !important; font-size: 0.8rem; }
.gantt-bar-goal {
    height: 22px; border-radius: var(--radius-xs);
    background: rgba(109, 40, 217, 0.18) !important;
    border: 1px solid rgba(109, 40, 217, 0.55);
}
.gantt-bar-step {
    height: 18px; border-radius: var(--radius-xs);
    background: rgba(38, 166, 154, 0.16) !important;
    border: 1px solid rgba(38, 166, 154, 0.5);
}
.gantt-bar-goal .gantt-bar-fill { background: rgba(109, 40, 217, 0.55); }
.gantt-bar-step .gantt-bar-fill { background: rgba(38, 166, 154, 0.5); }
.gantt-bar-step .gantt-bar-text { color: var(--teal, #26a69a); }
.gantt-bar-est {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    font-size: 0.62rem; line-height: 1; color: #fff; opacity: 0.9;
    pointer-events: none; white-space: nowrap;
}
.gantt-slack-tail {
    position: absolute; height: 8px; top: 50%; transform: translateY(-50%);
    border-radius: 3px; opacity: 0.55; pointer-events: none;
    background: repeating-linear-gradient(90deg, var(--border-strong, #9aa0a6) 0 4px, transparent 4px 8px);
}

/* A .brand-lockup sitting in the drawer is on CHROME, not on the page canvas, so
   its wordmark follows the chrome token. --text-color-dark (the component default)
   is a page-text colour and goes wrong on any theme whose chrome is a saturated
   brand gradient rather than a dark surface. */
.users-drawer-logo .brand-lockup-text { color: var(--nav-color-hover); }
/* `.users-drawer-logo img` is (0,1,1) and sizes the LEGACY logo.png at 36px, so
   it would otherwise win over .brand-lockup-mark (0,1,0) and blow the mark up to
   three times the wordmark. Two classes = (0,2,0), which takes it back. */
.users-drawer-logo .brand-lockup-mark { height: 1.15em; width: auto; }
