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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Authentication */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #f4f7fb;
}

.auth-card {
    width: min(100%, 420px);
    padding: 32px;
    background: #fff;
    border: 1px solid #dce3ed;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(30, 45, 70, .12);
}

.auth-brand {
    color: #2563eb;
    font-weight: 800;
    letter-spacing: .03em;
    margin-bottom: 20px;
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
}

.auth-alert, .auth-success {
    margin-top: 18px;
    padding: 11px 13px;
    border-radius: 8px;
}

.auth-alert { color: #991b1b; background: #fee2e2; }
.auth-success { color: #166534; background: #dcfce7; }

.auth-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-nav form { margin: 0; }
.auth-identity { color: #64748b; font-size: 13px; }
.auth-logout {
    border: 0;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font: inherit;
    padding: 8px 0;
}
.auth-logout:hover { color: #dc2626; }

.users-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 24px;
    padding-bottom: 40px;
    align-items: start;
}

.users-panel { margin-bottom: 0; min-width: 0; }
.users-panel .auth-form { margin-top: 0; }
.users-panel .btn { justify-self: start; }
.users-list table { width: 100%; box-shadow: none; }
.users-list .table-scroll { border: 1px solid #e5e7eb; border-radius: 8px; }
.users-list .table th:last-child,
.users-list .table td:last-child { white-space: nowrap; }

@media (max-width: 860px) {
    .auth-nav { width: 100%; margin-left: 0; flex-wrap: wrap; }
    .auth-identity { margin-left: auto; }
    .users-layout { grid-template-columns: 1fr; }
}

.navbar {
    background: #1a1a2e;
    color: #fff;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    min-height: 56px;
}

.nav-brand { font-size: 18px; font-weight: 600; }

.nav-links { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }

.nav-link {
    color: #aaa;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.1); }

.container { max-width: 1200px; margin: 24px auto; padding: 0 24px; }

h1 { margin-bottom: 24px; font-size: 22px; }

.page-header, .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.page-header h1, .section-header h2 { margin-bottom: 0; }

.quick-open {
    display: flex;
    gap: 8px;
    align-items: center;
}

.quick-open .filter-input {
    width: 150px;
}

@media (max-width: 700px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .quick-open {
        flex-wrap: wrap;
    }

    .quick-open .filter-input {
        flex: 1 1 140px;
        width: auto;
    }
}

.inline-message {
    display: none;
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
    background: #eef2ff;
    color: #3730a3;
}

.inline-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

.inline-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.inline-message:not(:empty) { display: block; }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.meta-grid div {
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 6px;
}

.meta-grid span {
    display: block;
    color: #777;
    font-size: 12px;
    margin-bottom: 4px;
}

.meta-grid strong {
    color: #333;
    font-size: 14px;
}

.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.filter-select, .filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-test { background: #10b981; color: #fff; margin-left: 8px; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1px solid #ddd; color: #666; }

.table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    border-collapse: collapse;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table th {
    text-align: left;
    padding: 12px 16px;
    background: #f9fafb;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.table tbody tr:hover { background: #f9fafb; }

.status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-new { background: #dbeafe; color: #1d4ed8; }
.status-asr_processing { background: #fef3c7; color: #92400e; }
.status-asr_completed { background: #d1fae5; color: #065f46; }
.status-analyzing { background: #e0e7ff; color: #3730a3; }
.status-done { background: #d1fae5; color: #065f46; }
.status-failed { background: #fee2e2; color: #991b1b; }

.pagination {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    justify-content: center;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.pagination button.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

.settings-form { max-width: 640px; }
.settings-form-wide { max-width: none; }

.settings-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.settings-section h2 { font-size: 16px; margin-bottom: 16px; color: #555; }
.settings-section-wide { max-width: none; }
.settings-group-section > h2,
.behavior-section > h2 { margin-bottom: 14px; }

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.settings-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.settings-panel {
    min-width: 0;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fcfcfd;
}

.settings-panel h2,
.settings-panel h3 {
    color: #444;
    font-size: 14px;
    margin-bottom: 14px;
}

.section-note,
.field-hint {
    color: #777;
    font-size: 12px;
    line-height: 1.4;
}

.section-note { margin-top: 4px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.code-textarea {
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: 13px;
}

.with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    align-items: end;
}

.with-action label {
    grid-column: 1 / -1;
}

.with-action .btn {
    align-self: stretch;
    margin-left: 0;
}

.toggle-line,
.setting-switch {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.toggle-line input,
.setting-switch input {
    margin-top: 2px;
}

.setting-switch {
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}

.setting-switch strong,
.setting-switch small {
    display: block;
}

.setting-switch strong {
    color: #333;
    font-size: 14px;
}

.setting-switch small {
    color: #777;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 2px;
}

.form-actions { margin-top: 16px; }
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-savebar {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e3e5ec;
}

.stage-prompts-list {
    display: grid;
    gap: 8px;
}

.stage-workspace {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.stage-list-panel,
.stage-editor-panel {
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fcfcfd;
}

.stage-list-panel {
    padding: 10px;
}

.stage-editor-panel {
    padding: 16px;
}

.stage-list-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.stage-list-item:hover {
    background: #f3f4f6;
}

.stage-list-item.selected {
    border-color: #93c5fd;
    background: #eff6ff;
}

.stage-list-item.inactive {
    opacity: 0.62;
}

.stage-list-item strong,
.stage-list-item small,
.stage-list-item em {
    display: block;
}

.stage-list-item strong {
    color: #333;
    font-size: 14px;
}

.stage-list-item small {
    color: #777;
    font-size: 12px;
    margin-top: 2px;
}

.stage-list-item em {
    flex: 0 0 auto;
    color: #666;
    font-size: 11px;
    font-style: normal;
}

.stage-editor-placeholder {
    display: grid;
    min-height: 280px;
    place-content: center;
    text-align: center;
    color: #777;
}

.stage-editor-placeholder h3 {
    color: #444;
    font-size: 16px;
    margin-bottom: 6px;
}

.stage-editor-placeholder p {
    max-width: 360px;
    font-size: 13px;
    line-height: 1.45;
}

.stage-editor-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.stage-editor-head h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.stage-editor-head p {
    color: #777;
    font-size: 12px;
}

.hidden {
    display: none !important;
}

.stage-prompt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}

.stage-prompt-row.inactive {
    opacity: 0.65;
}

.stage-prompt-row span {
    display: block;
    color: #777;
    font-size: 12px;
    margin-top: 2px;
}

.stage-prompt-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.stage-prompt-toggle strong {
    color: #333;
}

.stage-prompt-chevron {
    flex: 0 0 auto;
    width: 16px;
    color: #777;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.15s ease;
}

.stage-prompt-row.open .stage-prompt-chevron {
    transform: rotate(90deg);
}

.stage-prompt-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.stage-prompt-body {
    display: none;
    grid-column: 1 / -1;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.stage-prompt-row.open .stage-prompt-body {
    display: grid;
}

.stage-prompt-preview h3 {
    color: #555;
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.stage-prompt-preview pre {
    max-height: 120px;
    overflow: auto;
    padding: 8px 10px;
    border-radius: 4px;
    background: #fff;
    color: #444;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.stage-prompt-empty {
    color: #777;
    font-size: 14px;
}

@media (max-width: 900px) {
    .stage-workspace {
        grid-template-columns: 1fr;
    }

    .settings-savebar {
        justify-content: stretch;
    }

    .settings-savebar .btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .with-action {
        grid-template-columns: 1fr;
    }

    .stage-editor-head {
        flex-direction: column;
    }
}

.detail-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.detail-section h2 { font-size: 16px; margin-bottom: 12px; }

.transcript-segment {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.transcript-segment .speaker { font-weight: 600; color: #3b82f6; margin-right: 8px; }
.transcript-segment .time { color: #999; font-size: 12px; margin-right: 8px; }

.script-score-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: #f9fafb;
}

.script-score-card > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
    margin-bottom: 12px;
}

.script-score-card span {
    color: #666;
    font-size: 13px;
}

.script-score-card strong {
    font-size: 28px;
    line-height: 1;
}

.script-score-card.high strong, .stage-score.high { color: #047857; }
.script-score-card.medium strong, .stage-score.medium { color: #b45309; }
.script-score-card.low strong, .stage-score.low { color: #b91c1c; }

.score-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.score-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #3b82f6;
}

.script-score-card.high .score-bar span { background: #10b981; }
.script-score-card.medium .score-bar span { background: #f59e0b; }
.script-score-card.low .score-bar span { background: #ef4444; }

.script-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 12px 0 16px;
}

.script-score-card .script-meta-grid {
    margin: 14px 0 0;
}

.script-meta-item {
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.script-meta-item span {
    display: block;
    margin-bottom: 4px;
    color: #666;
    font-size: 12px;
}

.script-meta-item strong {
    display: block;
    color: #111827;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.indicator-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.indicator-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.indicator-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.indicator-card h3 {
    min-width: 0;
    margin: 0;
    color: #111827;
    font-size: 13px;
    line-height: 1.3;
}

.indicator-card h4 {
    margin: 8px 0 3px;
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
}

.indicator-card p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.35;
}

.indicator-value {
    flex: 0 0 auto;
    min-width: 26px;
    border-radius: 999px;
    padding: 2px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.indicator-value.done {
    background: #dcfce7;
    color: #047857;
}

.indicator-value.partial {
    background: #fef3c7;
    color: #b45309;
}

.indicator-value.missed {
    background: #fee2e2;
    color: #b91c1c;
}

.indicator-value.na {
    background: #f3f4f6;
    color: #555;
}

.score-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #fff;
    font-size: 13px;
}

.score-legend h3 {
    width: 100%;
    margin: 0;
    color: #444;
    font-size: 14px;
}

.score-legend div {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.analysis-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.analysis-block {
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    background: #fff;
}

.analysis-block.good { background: #f0fdf4; border-color: #bbf7d0; }
.analysis-block.partial { background: #fffbeb; border-color: #fed7aa; }
.analysis-block.warn { background: #fffbeb; border-color: #fde68a; }
.analysis-block.danger { background: #fef2f2; border-color: #fecaca; }

.analysis-block h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #444;
}

.analysis-block p {
    font-size: 14px;
    line-height: 1.5;
}

.analysis-block ul, .stage-card ul, .indicator-card ul {
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.45;
}

.indicator-card ul {
    margin: 4px 0 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.35;
}

.indicator-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.indicator-details .script-meta-item {
    padding: 6px 8px;
}

.indicator-details .script-meta-item span {
    font-size: 11px;
}

.indicator-details .script-meta-item strong {
    font-size: 12px;
}

.indicator-detail-block {
    grid-column: 1 / -1;
}

.indicator-detail-block p {
    margin: 4px 0 0;
    color: #555;
    font-size: 13px;
    line-height: 1.35;
}

.analysis-block li, .stage-card li, .indicator-card li {
    margin: 4px 0;
}

.stage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stage-card {
    border: 1px solid #e5e7eb;
    border-left: 4px solid #9ca3af;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.stage-card.partial { border-left-color: #f59e0b; }
.stage-card.missed, .stage-card.fail { border-left-color: #ef4444; }
.stage-card.done, .stage-card.passed, .stage-card.ok { border-left-color: #10b981; }

.stage-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.stage-card h3 {
    font-size: 14px;
    margin: 0;
}

.stage-card h4 {
    font-size: 12px;
    color: #666;
    margin: 12px 0 4px;
    text-transform: uppercase;
}

.stage-card p {
    font-size: 14px;
    line-height: 1.45;
    margin-top: 10px;
}

.stage-score {
    flex: 0 0 auto;
    font-weight: 700;
}

.stage-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #555;
    font-size: 12px;
}

.evidence-list {
    color: #555;
    overflow-wrap: anywhere;
}

.timeline-item {
    padding: 8px 0;
    border-left: 3px solid #e5e7eb;
    margin-left: 8px;
    padding-left: 16px;
    font-size: 13px;
    max-width: 100%;
    overflow: hidden auto;
    max-height: 250px;
}

.timeline-item.INFO { border-left-color: #3b82f6; }
.timeline-item.WARNING { border-left-color: #f59e0b; }
.timeline-item.ERROR { border-left-color: #ef4444; }
.timeline-item .time { color: #999; font-size: 12px; }

.md-content h1, .md-content h2, .md-content h3 { margin: 16px 0 8px; font-size: 16px; }
.md-content p { margin: 8px 0; }
.md-content ul, .md-content ol { margin: 8px 0; padding-left: 24px; }
.md-content li { margin: 4px 0; }
.md-content strong { font-weight: 600; }
.md-content code { background: #f3f4f6; padding: 2px 6px; border-radius: 3px; font-size: 13px; }
.md-content pre { background: #f3f4f6; padding: 12px; border-radius: 6px; overflow-x: auto; margin: 8px 0; }
.md-content pre code { background: none; padding: 0; }
.md-content blockquote { border-left: 3px solid #3b82f6; padding-left: 12px; color: #555; margin: 8px 0; }

/* Sales dashboards */
.dashboard-container { max-width: 1380px; }
.dashboard-heading p, .panel-head p { color: #777; font-size: 13px; margin-top: 4px; }
.dashboard-filters {
    display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 14px;
    margin-bottom: 18px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.dashboard-filters label { display: grid; gap: 4px; color: #777; font-size: 11px; text-transform: uppercase; }
.period-buttons { display: flex; gap: 4px; padding: 3px; background: #f3f4f6; border-radius: 6px; }
.period-btn { padding: 7px 11px; border: 0; border-radius: 4px; background: transparent; color: #666; cursor: pointer; }
.period-btn.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-card { min-width: 0; padding: 18px; background: #fff; border: 1px solid #e5e7eb; border-top: 3px solid #94a3b8; border-radius: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.kpi-card.high { border-top-color: #10b981; }.kpi-card.medium { border-top-color: #f59e0b; }.kpi-card.low { border-top-color: #ef4444; }
.kpi-card span, .kpi-card small { display: block; color: #777; }.kpi-card span { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.kpi-card strong { display: block; margin: 7px 0 4px; font-size: 28px; line-height: 1; }.kpi-card small { font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dashboard-grid-main { grid-template-columns: repeat(2, minmax(280px, 1fr)); }.dashboard-panel-wide { grid-column: 1 / -1; }
.dashboard-panel { min-width: 0; padding: 18px; margin-bottom: 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.dashboard-grid > .dashboard-panel { margin-bottom: 0; }.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 14px; }
.panel-head h2, .detail-title h2 { color: #333; font-size: 16px; }.chart-wrap { min-height: 240px; }
.trend-chart { width: 100%; height: 260px; overflow: visible; }.chart-grid { stroke: #eef0f3; stroke-width: 1; }.chart-axis, .chart-date { fill: #888; font-size: 10px; }
.chart-axis { text-anchor: end; }.chart-line { fill: none; stroke: #3b82f6; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }.chart-point { fill: #fff; stroke: #2563eb; stroke-width: 3; }
.metric-list { display: grid; gap: 13px; }.metric-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: center; }
.metric-row strong, .metric-row span { display: block; }.metric-row strong { overflow: hidden; text-overflow: ellipsis; font-size: 13px; }.metric-row span { margin-top: 2px; color: #888; font-size: 11px; }
.metric-score { font-weight: 700; }.metric-score.high { color: #047857; }.metric-score.medium { color: #b45309; }.metric-score.low { color: #b91c1c; }
.metric-bar { grid-column: 1 / -1; height: 5px; overflow: hidden; background: #f1f5f9; border-radius: 5px; }.metric-bar span { height: 100%; margin: 0; border-radius: inherit; }.metric-bar .high { background: #10b981; }.metric-bar .medium { background: #f59e0b; }.metric-bar .low { background: #ef4444; }
.score-pill { display: inline-block; min-width: 44px; padding: 4px 9px; border-radius: 999px; text-align: center; font-size: 12px; font-weight: 700; }
.score-pill.high { color: #047857; background: #d1fae5; }.score-pill.medium { color: #92400e; background: #fef3c7; }.score-pill.low { color: #b91c1c; background: #fee2e2; }
.score-pill.neutral { color: #64748b; background: #f1f5f9; }
.table-scroll { overflow-x: auto; }.compact-table { box-shadow: none; border: 1px solid #eef0f3; }.empty-cell, .empty-state { padding: 30px !important; color: #888; text-align: center !important; }
.manager-row { cursor: pointer; }.manager-row.selected { background: #eff6ff; }.manager-row td:nth-child(2) small { display: block; margin-top: 3px; color: #b45309; font-size: 11px; }
.rank-badge { display: inline-grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #e0e7ff; color: #3730a3; font-weight: 700; }.muted { color: #9ca3af; }
.delta.positive { color: #047857; }.delta.negative { color: #b91c1c; }.detail-title { margin: 28px 0 14px; }.detail-title span { color: #777; font-size: 11px; text-transform: uppercase; }
.weak-list { display: grid; gap: 8px; }.weak-item { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }.weak-item:last-child { border-bottom: 0; }
.weak-item span, .weak-item strong, .weak-item small { display: block; }.weak-item span, .weak-item small { color: #888; font-size: 11px; }.weak-item > div:last-child { flex: 0 0 auto; color: #b45309; text-align: right; font-weight: 700; }

@media (max-width: 900px) {
    .navbar { height: auto; min-height: 56px; align-items: flex-start; padding: 12px 16px; }
    .nav-brand { padding-top: 7px; white-space: nowrap; }.nav-links { flex-wrap: wrap; justify-content: flex-end; }.nav-link { padding: 7px 9px; }
    .dashboard-grid, .dashboard-grid-main { grid-template-columns: 1fr; }.dashboard-panel-wide { grid-column: auto; }
}
@media (max-width: 600px) {
    .container { margin-top: 16px; padding: 0 12px; }.navbar { display: block; }.nav-links { margin: 10px 0 0; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }.nav-link { flex: 0 0 auto; }
    .dashboard-filters > label { flex: 1 1 130px; }.dashboard-filters select { flex: 1 1 160px; }.period-buttons { width: 100%; }.period-btn { flex: 1; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.kpi-card { padding: 14px; }.kpi-card strong { font-size: 23px; }
    .dashboard-panel { padding: 14px; }.trend-chart { min-width: 520px; }.chart-wrap { overflow-x: auto; }.toolbar { flex-wrap: wrap; }
}
