:root {
    --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --bg: #f6efe9;
    --card-bg: rgba(255, 255, 255, 0.72);
    --row-bg: rgba(255, 255, 255, 0.6);
    --row-bg-hover: rgba(255, 255, 255, 0.95);
    --row-border: rgba(15, 10, 30, 0.06);
    --row-border-hover: rgba(15, 10, 30, 0.12);
    --hairline: rgba(15, 10, 30, 0.06);

    --black: #0c0a14;
    --text: #0c0a14;
    --text-dim: #6b6878;
    --text-faint: #a8a4b4;

    --pill-bg: rgba(15, 10, 30, 0.04);
    --pill-bg-hover: rgba(15, 10, 30, 0.08);

    --success: #1d8a3a;
    --success-soft: rgba(52, 199, 89, 0.16);
    --warn: #b87f1a;
    --warn-soft: rgba(255, 181, 71, 0.18);
    --danger: #c53055;
    --danger-soft: rgba(255, 79, 111, 0.16);
    --accent-soft: rgba(155, 130, 245, 0.18);
    --accent: #5d4ad6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100vh; }
button { font-family: inherit; }

body {
    font-family: var(--sans);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle 700px at 0% 100%, rgba(255, 195, 220, 0.55), transparent 55%),
        radial-gradient(circle 800px at 100% 0%, rgba(225, 200, 255, 0.55), transparent 55%),
        radial-gradient(circle 500px at 50% 50%, rgba(255, 220, 220, 0.35), transparent 55%);
    z-index: -1;
    pointer-events: none;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.page {
    min-height: 100vh;
    padding: 28px 28px 28px 22px;
    display: flex;
    align-items: stretch;
    gap: 16px;
}

/* ---- Sidebar (black pill) ---- */
.sidebar {
    background: var(--black);
    border-radius: 28px;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    width: 100px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    position: sticky;
    top: 28px;
    height: calc(100vh - 56px);
    z-index: 10;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    margin-bottom: 22px;
    cursor: pointer;
    text-decoration: none;
}
.brand-mark img {
    height: 20px;
    width: auto;
    display: block;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    align-items: center;
}

.side-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    position: relative;
    animation: slideInLeft 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(200ms + var(--i, 0) * 50ms);
}
.side-btn:hover { color: white; background: rgba(255, 255, 255, 0.08); }
.side-btn.active { background: white; color: var(--black); }

.side-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff4f6f;
    border: 2px solid var(--black);
}
.side-btn.active .badge-dot { border-color: white; }

/* ---- Tooltip ---- */
.side-btn::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--black);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 1000;
}
.side-btn:hover::after { opacity: 1; }

/* ---- Card ---- */
.card {
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 30px 80px rgba(155, 100, 200, 0.12), 0 8px 30px rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: 100ms;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ---- View management ---- */
.view { display: none; flex: 1; min-width: 0; }
.view.active { display: flex; }

.view.has-folders { flex-direction: row; }
.view.no-folders { flex-direction: column; }

.col-folders {
    width: 280px;
    padding: 36px 26px;
    background: rgba(255, 240, 235, 0.45);
    border-right: 1px solid var(--hairline);
    flex-shrink: 0;
    overflow-y: auto;
}

.col-main {
    padding: 36px 40px 40px;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* ---- Folders nav ---- */
.folders-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 22px;
}

.folders-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: background 0.15s;
    position: relative;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.folder-item:hover { background: rgba(255, 255, 255, 0.55); }
.folder-item.active {
    background: white;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.folder-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.folder-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    background: var(--black);
    color: white;
    padding: 3px 9px;
    border-radius: 999px;
    min-width: 28px;
    text-align: center;
}
.folder-section { margin-top: 28px; }
.folder-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 10px;
}
.folder-section-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.icon-btn-light {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.icon-btn-light:hover { background: rgba(255, 255, 255, 0.6); color: var(--text); }

/* ---- Page heading ---- */
.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.page-title {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.page-title-sm {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.page-meta {
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 500;
    margin-top: 6px;
}
.heading-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: white;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    border: 1px solid var(--row-border);
    transition: all 0.15s;
    font-family: inherit;
}
.pill:hover { border-color: var(--row-border-hover); }
.pill .pill-label { color: var(--text-dim); }
.pill svg { color: var(--text-dim); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: white;
    color: var(--text);
    border: 1px solid var(--row-border);
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover { border-color: var(--row-border-hover); }
.btn-primary {
    background: var(--black);
    color: white;
    border-color: var(--black);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    padding: 6px 12px 6px 6px;
    border-radius: 8px;
    margin-bottom: 12px;
}
.btn-back:hover { color: var(--text); background: var(--pill-bg); }

/* ---- Alert banner ---- */
.alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 14px;
}
.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--warn-soft);
    color: var(--warn);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.alert.info .alert-icon { background: var(--accent-soft); color: var(--accent); }
.alert .alert-meta { color: var(--text-dim); }

/* ---- KPIs ---- */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 36px;
}
.kpi {
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 20px;
    padding: 20px 22px 18px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}
.kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border-color: var(--row-border-hover);
}

.kpi-label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kpi-value-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
}

.kpi-value {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
}
.kpi-value small {
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 500;
    margin-left: 2px;
}

.kpi-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

.kpi-trend-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 700;
    font-size: 12px;
}
.kpi-trend-inline.up { color: var(--success); }
.kpi-trend-inline.down { color: var(--danger); }

.kpi-foot .sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-faint);
    flex-shrink: 0;
}

.kpi-spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 36px;
    flex-shrink: 0;
}
.kpi-spark span {
    display: block;
    width: 6px;
    background: var(--accent-soft);
    border-radius: 2px;
    transition: background 0.2s;
}
.kpi-spark span.last { background: var(--accent); }
.kpi-spark.success span { background: rgba(52, 199, 89, 0.22); }
.kpi-spark.success span.last { background: var(--success); }
.kpi-spark.warn span { background: rgba(255, 181, 71, 0.25); }
.kpi-spark.warn span.last { background: var(--warn); }

/* ---- Section heading ---- */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 14px;
    margin-top: 4px;
}
.section-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.section-meta {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
    font-weight: 500;
}
.section-link {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.15s;
    background: transparent;
    border: none;
    font-family: inherit;
}
.section-link:hover { color: var(--text); background: var(--pill-bg); }

/* ---- Call rows ---- */
.rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 36px; }
.row {
    display: grid;
    grid-template-columns: 44px 1fr auto auto auto;
    gap: 16px;
    align-items: center;
    padding: 13px 18px 13px 14px;
    background: var(--row-bg);
    border: 1px solid var(--row-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s;
}
.row:hover {
    background: var(--row-bg-hover);
    border-color: var(--row-border-hover);
    transform: translateY(-1px);
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.row-main { min-width: 0; }
.row-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.005em;
}
.tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 3px 8px;
    background: var(--pill-bg);
    color: var(--text-dim);
    border-radius: 6px;
}
.row-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 3px;
    font-weight: 500;
}
.outcome {
    font-size: 11px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
    white-space: nowrap;
}
.outcome.positive { background: var(--success-soft); color: var(--success); }
.outcome.neutral { background: var(--accent-soft); color: var(--accent); }
.outcome.warning { background: var(--warn-soft); color: var(--warn); }
.outcome.negative { background: var(--danger-soft); color: var(--danger); }

.row-score {
    font-size: 14px;
    font-weight: 800;
    padding: 7px 12px;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--row-border);
    min-width: 52px;
    text-align: center;
    letter-spacing: -0.01em;
}
.row-score.high { color: var(--success); border-color: rgba(52, 199, 89, 0.3); }
.row-score.mid { color: var(--warn); border-color: rgba(255, 181, 71, 0.3); }
.row-score.low { color: var(--danger); border-color: rgba(255, 79, 111, 0.3); }

.row-actions { display: flex; gap: 4px; align-items: center; }

.icon-btn-sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.icon-btn-sm:hover { background: var(--pill-bg); color: var(--text); border-color: var(--row-border); }

/* ---- Search + tabs ---- */
.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 999px;
    padding: 11px 18px;
    margin-bottom: 14px;
    border: 1px solid var(--row-border);
}
.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text);
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box svg { color: var(--text-dim); flex-shrink: 0; }

.tabs {
    display: flex;
    background: white;
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--row-border);
    gap: 2px;
}
.tab {
    flex: 1;
    padding: 8px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    border-radius: 999px;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all 0.18s;
    font-family: var(--sans);
}
.tab.active { background: var(--black); color: white; }

/* ---- Empty state ---- */
.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-dim);
}
.empty h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.empty p { font-size: 13px; }

/* ---- Top performers grid ---- */
.rank-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.rank-tile {
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 16px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 12px;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}
.rank-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
.rank-pos {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-faint);
    width: 22px;
    text-align: center;
}
.rank-pos.top1 { color: #d8a72c; }
.rank-pos.top2 { color: #6f6f8a; }
.rank-pos.top3 { color: #b07a3a; }
.rank-info { min-width: 0; }
.rank-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
    font-weight: 500;
}

/* ---- Call detail ---- */
.detail-actions {
    display: flex;
    align-items: center;
    gap: 22px;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--hairline);
    flex-wrap: wrap;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    padding: 4px 0;
    transition: color 0.15s;
}
.action-btn:hover { color: var(--accent); }

.detail-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}
.detail-header .avatar {
    width: 56px;
    height: 56px;
}
.detail-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.detail-sub {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
    font-weight: 500;
}
.detail-date {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 13px;
    margin-bottom: 26px;
}
.meta-row > span { color: var(--text); font-weight: 500; }
.meta-row .label {
    color: var(--text-faint);
    margin-right: 4px;
    font-weight: 600;
}

.summary-box {
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 22px;
}
.summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.score-overall {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.score-overall small {
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 500;
}
.summary-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
}
.stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.stat {
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 14px;
    padding: 14px 16px;
    flex: 1;
    min-width: 140px;
}
.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 18px;
    font-weight: 700;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.panel {
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 18px;
    padding: 20px 22px;
}
.panel.full { grid-column: 1 / -1; }
.panel h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.score-bars {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.score-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--hairline);
}
.score-bar:last-child { border-bottom: none; padding-bottom: 4px; }
.score-bar:first-child { padding-top: 4px; }

.score-bar-label {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.005em;
}
.score-bar-value {
    font-size: 13px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    min-width: 52px;
    text-align: center;
    background: var(--pill-bg);
    color: var(--text);
    align-self: center;
}
.score-bar-value.high { background: var(--success-soft); color: var(--success); }
.score-bar-value.mid { background: var(--warn-soft); color: var(--warn); }
.score-bar-value.low { background: var(--danger-soft); color: var(--danger); }

.score-bar-track {
    grid-column: 1 / -1;
    height: 8px;
    background: rgba(15, 10, 30, 0.05);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.score-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--black);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}
.score-bar-fill.high { background: linear-gradient(90deg, #34c759, #1d8a3a); }
.score-bar-fill.mid { background: linear-gradient(90deg, #ffcf8a, #b87f1a); }
.score-bar-fill.low { background: linear-gradient(90deg, #ff9aa8, #c53055); }

.score-bar-notes {
    grid-column: 1 / -1;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-top: 4px;
}

.bullet-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bullet-list li {
    font-size: 13px;
    line-height: 1.55;
    padding-left: 16px;
    position: relative;
}
.bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.bullet-list.pos li::before { background: var(--success); }
.bullet-list.neg li::before { background: var(--danger); }
.bullet-list.tip li::before { background: var(--accent); }

.obj-card, .quote-card, .flag-card {
    background: rgba(15, 10, 30, 0.025);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 13px;
}
.obj-card:last-child, .quote-card:last-child, .flag-card:last-child { margin-bottom: 0; }
.obj-card .lbl, .quote-card .lbl {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-faint);
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}
.obj-card .lbl + div, .quote-card .lbl + div {
    margin-bottom: 8px;
    line-height: 1.5;
}
.obj-card .lbl + div:last-child, .quote-card .lbl + div:last-child { margin-bottom: 0; }

.flag-card {
    border-left: 3px solid var(--text-faint);
}
.flag-card.high { border-left-color: var(--danger); background: var(--danger-soft); }
.flag-card.medium { border-left-color: var(--warn); background: var(--warn-soft); }
.flag-card.low { border-left-color: var(--accent); background: var(--accent-soft); }
.flag-card .severity {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 5px;
    margin-right: 8px;
}
.flag-card.high .severity { background: var(--danger); color: white; }
.flag-card.medium .severity { background: var(--warn); color: white; }
.flag-card.low .severity { background: var(--accent); color: white; }
.flag-card .ts {
    font-size: 11px;
    color: var(--text-dim);
    margin-left: 4px;
}

.quote-card .quote-text {
    font-style: italic;
    padding-left: 10px;
    border-left: 2px solid var(--row-border-hover);
    margin: 4px 0 8px;
}

/* ---- Transcript ---- */
.transcript {
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 18px;
    padding: 12px 4px;
    max-height: 60vh;
    overflow-y: auto;
}
.seg {
    display: grid;
    grid-template-columns: 48px auto 1fr;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    align-items: baseline;
    transition: background 0.1s;
}
.seg:hover { background: var(--pill-bg); }
.seg-time {
    font-size: 11px;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}
.seg-spk {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    align-self: start;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.spk-A { background: var(--accent-soft); color: var(--accent); }
.spk-B { background: var(--success-soft); color: var(--success); }
.seg-text { font-size: 13px; line-height: 1.55; color: var(--text); }

/* ---- Tabs (sub) ---- */
.subtabs {
    display: flex;
    gap: 4px;
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 22px;
    width: fit-content;
}
.subtab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.subtab.active { background: var(--black); color: white; }

/* ---- Upload area ---- */
.drop-zone {
    border: 2px dashed var(--row-border-hover);
    border-radius: 22px;
    padding: 48px 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.drop-zone-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    border: 1px solid var(--row-border);
}
.drop-zone-text { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.drop-zone-hint { font-size: 13px; color: var(--text-dim); }

.or-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin: 18px 0;
}
.or-row::before, .or-row::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--hairline);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 16px;
}
.form-grid.full > * { grid-column: 1 / -1; }

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-field.full { grid-column: 1 / -1; }
.form-field label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-dim);
}
.form-field input, .form-field select, .form-field textarea {
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 12px;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    border-color: var(--accent);
}
.form-field textarea { resize: vertical; min-height: 100px; font-family: var(--sans); }

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-top: 10px;
}
.toggle-switch {
    width: 36px;
    height: 20px;
    background: var(--pill-bg);
    border: 1px solid var(--row-border);
    border-radius: 12px;
    position: relative;
    transition: all 0.15s;
    flex-shrink: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: all 0.15s;
}
.toggle-row input { display: none; }
.toggle-row input:checked + .toggle-switch {
    background: var(--black);
    border-color: var(--black);
}
.toggle-row input:checked + .toggle-switch::after { left: 17px; }

/* ---- Progress ---- */
.progress {
    display: none;
    margin-top: 18px;
}
.progress.active { display: block; }
.progress-track {
    height: 4px;
    background: var(--pill-bg);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.progress-track::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--accent);
    border-radius: 2px;
    animation: progressSlide 1.5s ease-in-out infinite;
}
@keyframes progressSlide {
    0% { left: -30%; }
    100% { left: 100%; }
}
.progress-text {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
}

.file-info {
    display: none;
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.file-info.active { display: flex; align-items: center; gap: 12px; }
.file-info .file-meta { flex: 1; min-width: 0; }
.file-info .file-name { font-weight: 700; font-size: 14px; }
.file-info .file-stats { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.alert-msg {
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 12px;
}
.alert-msg.active { display: block; }
.alert-msg.warn { background: var(--warn-soft); color: var(--warn); }
.alert-msg.error { background: var(--danger-soft); color: var(--danger); }

/* ---- Settings ---- */
.settings-section {
    background: white;
    border: 1px solid var(--row-border);
    border-radius: 18px;
    padding: 24px 26px;
    margin-bottom: 16px;
}
.settings-section h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.settings-section .desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
}
.integration-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--hairline);
}
.integration-row:first-of-type { border-top: none; padding-top: 0; }
.integration-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--pill-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}
.integration-meta { flex: 1; min-width: 0; }
.integration-name { font-size: 14px; font-weight: 700; }
.integration-status {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-pill.connected { background: var(--success-soft); color: var(--success); }
.status-pill.connected::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulseDot 2s ease-out infinite;
}
.status-pill.mock { background: var(--warn-soft); color: var(--warn); }
.status-pill.mock::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warn);
}

/* ---- Login screen ---- */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
}

/* Floating decorative product cards in background */
.float-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 20px 50px rgba(155, 100, 200, 0.15);
    animation: floatIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    z-index: 1;
}

@keyframes floatIn {
    from { opacity: 0; transform: var(--rest-transform) translateY(30px); }
    to { opacity: 1; transform: var(--rest-transform); }
}

.float-card.f1 { top: 12%; left: 6%; --rest-transform: rotate(-7deg); transform: var(--rest-transform); animation-delay: 200ms; width: 240px; }
.float-card.f2 { top: 22%; right: 8%; --rest-transform: rotate(6deg); transform: var(--rest-transform); animation-delay: 350ms; width: 220px; }
.float-card.f3 { bottom: 14%; left: 9%; --rest-transform: rotate(5deg); transform: var(--rest-transform); animation-delay: 500ms; width: 260px; }
.float-card.f4 { bottom: 18%; right: 6%; --rest-transform: rotate(-5deg); transform: var(--rest-transform); animation-delay: 650ms; width: 230px; }

.float-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.float-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}
.float-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.float-text { flex: 1; min-width: 0; }
.float-name { font-size: 12px; font-weight: 700; color: var(--text); }
.float-meta { font-size: 11px; color: var(--text-dim); margin-top: 1px; }

.float-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 999px;
}
.float-tag.green { background: var(--success-soft); color: var(--success); }
.float-tag.lav { background: var(--accent-soft); color: var(--accent); }
.float-tag.warn { background: var(--warn-soft); color: var(--warn); }

.float-score {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.float-score small {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

.float-spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 26px;
}
.float-spark span {
    display: block;
    width: 5px;
    border-radius: 2px;
    background: rgba(155, 130, 245, 0.25);
}
.float-spark span.last { background: var(--accent); }

.float-quote {
    font-size: 12px;
    color: var(--text);
    font-style: italic;
    line-height: 1.5;
    padding-left: 8px;
    border-left: 2px solid var(--accent);
    margin: 6px 0 4px;
}

/* Central login card */
.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    padding: 36px 36px 32px;
    box-shadow: 0 40px 80px rgba(155, 100, 200, 0.25), 0 8px 30px rgba(0, 0, 0, 0.06);
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.login-brand {
    display: block;
    margin-bottom: 26px;
}
.login-brand img {
    height: 48px;
    width: auto;
    display: block;
}

.login-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 6px;
}

.login-sub {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form .form-field input {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    background: white;
}

.login-form button[type="submit"] {
    margin-top: 8px;
    width: 100%;
    justify-content: center;
    padding: 13px 18px;
    font-size: 14px;
}

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.login-link {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 0;
    font-family: inherit;
}
.login-link:hover { color: var(--text); }

.login-note {
    margin-top: 22px;
    padding: 12px 14px;
    background: var(--accent-soft);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
}
.login-note strong { font-weight: 700; color: var(--text); }

.login-error {
    font-size: 13px;
    color: var(--danger);
    font-weight: 600;
    margin-top: 4px;
    display: none;
}
.login-error.active { display: block; }

@media (max-width: 760px) {
    .float-card { display: none; }
    .login-card { padding: 30px 24px; }
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--black);
    color: white;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ---- Spinner ---- */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ---- Stagger ---- */
.col-main > *, .col-folders > * {
    animation: fadeInUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.col-folders > *:nth-child(1) { animation-delay: 100ms; }
.col-folders > *:nth-child(2) { animation-delay: 160ms; }
.col-folders > *:nth-child(3) { animation-delay: 220ms; }
.col-main > *:nth-child(1) { animation-delay: 150ms; }
.col-main > *:nth-child(2) { animation-delay: 220ms; }
.col-main > *:nth-child(3) { animation-delay: 290ms; }
.col-main > *:nth-child(4) { animation-delay: 360ms; }
.col-main > *:nth-child(5) { animation-delay: 430ms; }
.col-main > *:nth-child(6) { animation-delay: 500ms; }
.col-main > *:nth-child(7) { animation-delay: 570ms; }

.row, .rank-tile, .kpi {
    animation: fadeInUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(300ms + var(--i, 0) * 40ms);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15, 10, 30, 0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15, 10, 30, 0.22); }

/* ---- Responsive ---- */
@media (max-width: 1180px) {
    .col-folders { display: none; }
    .view.has-folders { flex-direction: column; }
}
@media (max-width: 1100px) {
    .rank-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .page { padding: 14px; gap: 12px; flex-direction: column; }
    .sidebar {
        width: 100%;
        position: static;
        height: auto;
        flex-direction: row;
        padding: 12px 16px;
        border-radius: 22px;
    }
    .sidebar .side-nav { flex-direction: row; flex: 1; justify-content: center; gap: 4px; }
    .brand-mark { margin-bottom: 0; margin-right: 8px; }
    .col-main { padding: 24px 18px; }
    .card { border-radius: 22px; }
    .page-title { font-size: 28px; }
    .kpi-strip { grid-template-columns: 1fr; }
    .rank-grid { grid-template-columns: 1fr; }
    .row { grid-template-columns: 40px 1fr auto; padding: 12px; gap: 12px; }
    .row .outcome, .row .row-actions { display: none; }
    .heading-actions { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .side-btn::after { display: none; }
}

/* Unreviewed call indicators */
.row.unreviewed { border-left: 3px solid var(--accent); background: rgba(155, 130, 245, 0.04); }
.unreviewed-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 6px;
    animation: pulseDot 2s ease-in-out infinite;
}
.row:not(.unreviewed) .unreviewed-dot { display: none; }

/* Audio player in call detail */
.call-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
}
.call-audio-player audio {
    height: 32px;
    border-radius: 16px;
}

/* Settings prompt editor */
.prompt-editor {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    font-family: var(--sans);
    font-size: 13px;
    resize: vertical;
    background: var(--row-bg);
}
.prompt-editor:focus {
    outline: none;
    border-color: var(--accent);
}
.settings-section { margin-bottom: 32px; }
.settings-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}
.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--row-bg);
}
.user-row .user-name { font-weight: 600; flex: 1; }
.user-row .user-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--pill-bg);
}
.user-row .user-role.master { background: var(--accent-soft); color: var(--accent); }
