/* Sistem Audit Mutu Internal (AMI) */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

    /* Warna Slate */
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50:  #f8fafc;
    --surface:   #ffffff;

    /* Aksen Emerald */
    --accent-emerald-900: #064e3b;
    --accent-emerald-800: #065f46;
    --accent-emerald-700: #047857;
    --accent-emerald-600: #059669;
    --accent-emerald-100: #d1fae5;
    --accent-emerald-50:  #ecfdf5;

    /* Grid & Spreadsheet */
    --grid-border: #cbd5e1;
    --grid-border-subtle: #e2e8f0;
    --grid-header-bg: #f8fafc;
    --row-hover-bg: #f8fafc;
    --row-selected-bg: #f0fdf4;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-pill: 9999px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--slate-100);
    color: var(--slate-900);
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tabular Numbers for Data Integrity */
.font-tabular, 
.excel-table td, 
.matrix-pill-btn,
.score-value-badge,
.quick-score-btn {
    font-variant-numeric: tabular-nums;
}

/* Clean Institutional Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--slate-100);
}
::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* ============================================================
   NAVBAR & HEADER BAR
   ============================================================ */
.app-header {
    background-color: var(--slate-900);
    color: #ffffff;
    border-bottom: 1px solid var(--slate-800);
}

.brand-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-tab-btn {
    position: relative;
    padding: 10px 16px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--slate-600);
    transition: color 0.15s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-tab-btn:hover {
    color: var(--slate-900);
}
.nav-tab-btn.excel-tab-active {
    color: var(--slate-900);
    font-weight: 700;
}
.nav-tab-btn.excel-tab-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent-emerald-700);
}

/* ============================================================
   EXCEL RIBBON & FORMULA BAR
   ============================================================ */
.excel-ribbon-card {
    background: var(--surface);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.excel-meta-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 16px;
    padding: 10px 14px;
    background: var(--slate-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: 1px solid var(--slate-200);
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 11.5px;
}
.meta-label {
    color: var(--slate-500);
    width: 115px;
    flex-shrink: 0;
    font-weight: 500;
}
.meta-val {
    color: var(--slate-900);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   SPREADSHEET TABLE GRID
   ============================================================ */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--grid-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.excel-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12.5px;
    line-height: 1.5;
    min-width: 0;
    background: var(--surface);
}

/* Lebar minimum mengikuti kolom yang tampil per peran */
body.role-auditee .excel-table { min-width: 720px; }
body.role-auditor .excel-table { min-width: 1480px; }
body.role-admin .excel-table { min-width: 1540px; }

/* Kolom # dan Aspek tetap terlihat saat tabel digeser ke kanan */
.excel-table th.row-num-cell { width: 38px; min-width: 38px; }
.excel-table .col-aspek { width: 620px; min-width: 520px; }
@media (min-width: 1024px) {
    .excel-table td.row-num-cell,
    .excel-table th.row-num-cell {
        position: sticky;
        left: 0;
        z-index: 6;
    }
    .excel-table th.row-num-cell { z-index: 12; }
    .excel-table td.col-aspek,
    .excel-table th.col-aspek {
        position: sticky;
        left: 38px;
        z-index: 5;
        background-color: var(--surface);
        box-shadow: 1px 0 0 var(--grid-border), 6px 0 8px -6px rgba(15, 23, 42, 0.22);
    }
    .excel-table th.col-aspek { z-index: 12; background-color: var(--slate-50); }
}

/* Judul standar mutu: satu baris per kelompok (A, B, C, ...) */
.excel-table tbody tr.group-row td {
    padding: 0;
    background: var(--accent-emerald-50);
    border-top: 2px solid var(--accent-emerald-700);
    border-bottom: 1px solid rgba(5, 150, 105, 0.3);
}
.group-row-inner {
    position: sticky;
    left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: 94vw;
    padding: 7px 12px;
}
.group-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--accent-emerald-700);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
}
.group-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent-emerald-900);
    letter-spacing: -0.01em;
}
.group-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-600);
    white-space: nowrap;
}

.excel-table th, 
.excel-table td {
    border: 1px solid var(--grid-border);
    padding: 8px 10px;
    vertical-align: middle;
}

/* Sticky Excel Table Header */
.excel-table thead th {
    background: var(--slate-50);
    color: var(--slate-700);
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    padding: 7px 6px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 var(--grid-border);
}

/* Header Categories (Restrained, Institutional Tones) */
.excel-table thead th.th-auditee {
    background: #f0f7ff;
    color: #1e40af;
    border-bottom: 2px solid #93c5fd;
}
.excel-table thead th.th-auditor {
    background: #f0fdf4;
    color: #065f46;
    border-bottom: 2px solid #86efac;
}
.excel-table thead th.th-kondisi {
    background: #fbfbfb;
    color: var(--slate-700);
    border-bottom: 2px solid var(--slate-400);
}
.excel-table thead th.th-temuan {
    background: #fbfbfb;
    color: var(--slate-700);
    border-bottom: 2px solid var(--slate-400);
}
.excel-table thead th.th-status {
    background: #fbfbfb;
    color: var(--slate-700);
    border-bottom: 2px solid var(--slate-400);
}

/* Excel Row Numbers */
.excel-table td.row-num-cell {
    vertical-align: top;
    padding-top: 11px;
    background-color: var(--slate-100);
    color: var(--slate-500);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
    text-align: center;
    width: 38px;
    min-width: 38px;
    user-select: none;
    border-right: 2px solid var(--slate-300);
}

/* Row Hover */
.excel-table tbody tr.item-row:hover td {
    background-color: var(--slate-50);
}
.excel-table tbody tr.item-row:hover td.row-num-cell {
    background-color: var(--slate-200);
    color: var(--slate-900);
}

/* Standar Mutu Tag & Aspect Title */
.standar-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    color: var(--slate-700);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    border: 1px solid var(--slate-200);
    letter-spacing: -0.01em;
}

.aspect-id-tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--slate-400);
    margin-top: 3px;
}

.aspect-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-900);
    line-height: 1.55;
    letter-spacing: -0.01em;
}

/* Rubrik Penilaian Toggle Per-Baris */
.rubrik-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3.5px 8.5px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-emerald-800);
    background: var(--accent-emerald-50);
    border: 1px solid rgba(5, 150, 105, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 5px;
}
.rubrik-toggle-btn:hover {
    background: #d1fae5;
    color: var(--accent-emerald-950);
    border-color: rgba(5, 150, 105, 0.45);
}
.rubrik-toggle-btn.is-open {
    background: #047857;
    color: #ffffff;
    border-color: #065f46;
}
.rubrik-toggle-btn.is-open:hover {
    background: #064e3b;
    color: #ffffff;
    border-color: #022c22;
}
.rubrik-toggle-btn.is-open .rubrik-chevron {
    color: #ffffff;
}
.rubrik-chevron {
    width: 12px;
    height: 12px;
    color: var(--accent-emerald-700);
    transition: transform 0.2s ease, color 0.15s ease;
    flex-shrink: 0;
}
.rubrik-chevron.is-expanded {
    transform: rotate(180deg);
}

/* Tombol Toggle Semua Rubrik di Toolbar Atas */
.btn-rubrik-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-rubrik-toggle svg {
    color: #059669;
    transition: color 0.15s ease;
}
.btn-rubrik-toggle:hover {
    background: #d1fae5;
    color: #064e3b;
    border-color: #6ee7b7;
}
/* Saat Status Terbuka (Tutup Rubrik): Hijau tua solid dengan teks putih kontras tinggi */
.btn-rubrik-toggle.is-expanded {
    background: #047857 !important;
    color: #ffffff !important;
    border-color: #065f46 !important;
    box-shadow: 0 1px 3px rgba(4, 120, 87, 0.3) !important;
}
.btn-rubrik-toggle.is-expanded svg {
    color: #ffffff !important;
}
.btn-rubrik-toggle.is-expanded:hover {
    background: #064e3b !important;
    color: #ffffff !important;
    border-color: #022c22 !important;
}

.rubrik-box {
    margin-top: 8px;
    background: #f8fafc;
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: var(--radius-md);
    padding: 6px;
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    box-shadow: 0 1px 4px rgba(5, 150, 105, 0.04);
}

.rubrik-item {
    flex: 1;
    min-width: 115px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.45;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 3.5px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rubrik-item:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Gradasi Skor Rubrik (0 - 4) */
.rubrik-item.score-4 {
    border-top-color: #064e3b;
    background: #ffffff;
}
.rubrik-item.score-3 {
    border-top-color: #059669;
    background: #ffffff;
}
.rubrik-item.score-2 {
    border-top-color: #10b981;
    background: #ffffff;
}
.rubrik-item.score-1 {
    border-top-color: #34d399;
    background: #ffffff;
}
.rubrik-item.score-0 {
    border-top-color: #94a3b8;
    background: #ffffff;
}

/* Status Rubrik Terpilih */
.rubrik-item.is-active-score {
    box-shadow: 0 0 0 2px #059669, 0 3px 8px rgba(5, 150, 105, 0.22) !important;
    background: #ecfdf5 !important;
    border-top-color: #059669 !important;
}

.rubrik-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    font-weight: 800;
    font-size: 12.5px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.rubrik-item.score-4 .rubrik-score-badge { background: #064e3b; color: #ffffff; }
.rubrik-item.score-3 .rubrik-score-badge { background: #059669; color: #ffffff; }
.rubrik-item.score-2 .rubrik-score-badge { background: #10b981; color: #ffffff; }
.rubrik-item.score-1 .rubrik-score-badge { background: #a7f3d0; color: #064e3b; font-weight: 800; }
.rubrik-item.score-0 .rubrik-score-badge { background: #e2e8f0; color: #475569; font-weight: 800; }

.rubrik-item-content {
    width: 100%;
    min-width: 0;
}

.rubrik-score-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 3px;
    width: 100%;
}

.rubrik-score-name {
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--accent-emerald-900);
}
.rubrik-item.score-4 .rubrik-score-name { color: #064e3b; }
.rubrik-item.score-3 .rubrik-score-name { color: #059669; }
.rubrik-item.score-2 .rubrik-score-name { color: #047857; }
.rubrik-item.score-1 .rubrik-score-name { color: #059669; }
.rubrik-item.score-0 .rubrik-score-name { color: #475569; }

.rubrik-deskripsi {
    color: var(--slate-700);
    font-size: 11.5px;
    line-height: 1.48;
}

/* Textarea Cell - Simple, Auto-growing, Modern Institutional */
.excel-textarea {
    width: 100%;
    min-height: 38px;
    max-height: 160px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    padding: 7px 9px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--slate-800);
    background: #fbfcfd;
    resize: none;
    outline: none;
    field-sizing: content;
    box-sizing: border-box;
    display: block;
    font-family: inherit;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--slate-300) transparent;
}

.excel-textarea:hover:not(:disabled) {
    border-color: var(--slate-300);
    background: #ffffff;
}

.excel-textarea:focus {
    border-color: var(--accent-emerald-600);
    background: #ffffff;
    box-shadow: 0 0 0 2.5px rgba(5, 150, 105, 0.14);
}

.excel-textarea.has-content:not(:focus),
.excel-textarea:not(:placeholder-shown):not(:focus) {
    border-color: rgba(5, 150, 105, 0.28);
    background: #ffffff;
}

.excel-textarea::placeholder {
    color: var(--slate-400);
    font-size: 11.5px;
    font-style: normal;
    font-weight: 400;
}

.excel-textarea:disabled {
    background: var(--slate-50);
    color: var(--slate-600);
    border-color: var(--slate-200);
    cursor: not-allowed;
    opacity: 0.9;
}

.excel-textarea.border-rose-500 {
    border-color: #f43f5e !important;
    background-color: #fff1f2 !important;
}
.excel-textarea.border-rose-500:focus {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15) !important;
}

/* ============================================================
   SKOR AUDITOR & AUDITEE
   ============================================================ */
.score-card-widget {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    width: 100%;
    max-width: 108px;
    margin: 0 auto;
}

/* Input skor numerik (0 - 4, boleh desimal) */
.score-field {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    height: 36px;
    background: var(--surface);
    border: 1.5px solid var(--slate-300);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.score-field:hover { border-color: var(--slate-400); }
.score-field:focus-within {
    border-color: var(--accent-emerald-700);
    box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.18);
}
.score-field.has-val {
    background: var(--accent-emerald-50);
    border-color: var(--accent-emerald-600);
}
.score-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 0 0 6px;
    border: none;
    background: transparent;
    outline: none;
    text-align: right;
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--slate-900);
}
.score-input::placeholder { color: var(--slate-400); font-weight: 500; font-size: 12px; }
.score-input:disabled { cursor: not-allowed; color: var(--slate-700); }
.score-max {
    padding: 0 6px 0 3px;
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--slate-400);
    user-select: none;
    white-space: nowrap;
}
.score-field.has-val .score-max {
    color: var(--accent-emerald-800);
}

/* Tombol geser nilai atas-bawah (stepper buttons) */
.score-stepper {
    display: flex;
    flex-direction: column;
    width: 24px;
    height: 100%;
    border-left: 1.5px solid var(--slate-200);
    flex-shrink: 0;
    background: var(--slate-50);
}
.score-field.has-val .score-stepper {
    border-left-color: rgba(5, 150, 105, 0.25);
    background: rgba(5, 150, 105, 0.08);
}

.score-spin-btn {
    flex: 1;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--slate-500);
    padding: 0;
    line-height: 1;
    transition: background-color 0.1s ease, color 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
}
.score-spin-btn:hover {
    background: var(--slate-200);
    color: var(--slate-900);
}
.score-spin-btn:active {
    background: var(--slate-300);
}
.score-field.has-val .score-spin-btn {
    color: var(--accent-emerald-800);
}
.score-field.has-val .score-spin-btn:hover {
    background: rgba(5, 150, 105, 0.2);
    color: var(--accent-emerald-950);
}
.score-field.has-val .score-spin-btn:active {
    background: rgba(5, 150, 105, 0.3);
}

.score-spin-up {
    border-bottom: 0.5px solid var(--slate-200);
}
.score-spin-down {
    border-top: 0.5px solid var(--slate-200);
}
.score-field.has-val .score-spin-up {
    border-bottom-color: rgba(5, 150, 105, 0.2);
}
.score-field.has-val .score-spin-down {
    border-top-color: rgba(5, 150, 105, 0.2);
}

.spin-icon {
    width: 10px;
    height: 10px;
    pointer-events: none;
}


.score-pills-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    padding: 2px;
    background: var(--slate-100);
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
    transition: all 0.15s ease;
}

.score-card-widget.score-missing .score-pills-bar,
.score-card-widget.score-missing .score-field,
.auditee-score-container.score-missing .excel-score-select {
    background-color: #fff1f2;
    border-color: #f43f5e;
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.15);
}

/* ============================================================
   BADGE NILAI (SKOR MANDIRI, BOBOT, NILAI AKHIR)
   ============================================================ */
.cell-fill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 26px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}

/* Bobot */
.cell-fill-badge.fill-badge-bobot {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-weight: 700;
}

/* Nilai Akhir */
.cell-fill-badge.fill-badge-nilai {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    min-width: 52px;
    font-weight: 800;
}

/* Empty State */
.cell-fill-badge.fill-empty {
    background: #f8fafc;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    font-weight: 500;
}

/* Selector Skor Auditee */
.excel-score-select {
    width: 48px;
    height: 26px;
    padding: 0 4px;
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: center;
    text-align-last: center;
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}
.excel-score-select.has-val {
    background: #334155;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(51, 65, 85, 0.25);
}
.excel-score-select.is-empty {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.excel-score-select option {
    background: #ffffff;
    color: var(--slate-900);
    font-weight: 600;
}

.score-pill-btn {
    flex: 1;
    height: 24px;
    min-width: 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    color: var(--slate-600);
    border: none;
    transition: all 0.12s ease;
}
.score-pill-btn:hover:not(:disabled) {
    background: var(--surface);
    color: var(--slate-900);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.score-pill-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Tombol Skor Aktif */
.score-pill-btn.active-4 { background: #064e3b; color: #ffffff; box-shadow: 0 1px 2px rgba(6, 78, 59, 0.3); }
.score-pill-btn.active-3 { background: #059669; color: #ffffff; box-shadow: 0 1px 2px rgba(4, 120, 87, 0.3); }
.score-pill-btn.active-2 { background: #10b981; color: #ffffff; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25); }
.score-pill-btn.active-1 { background: #a7f3d0; color: #064e3b; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25); font-weight: 800; }
.score-pill-btn.active-0 { background: #d1fae5; color: #065f46; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2); font-weight: 800; }

/* ============================================================
   KONTROL MATRIKS (KONDISI, TEMUAN, STATUS)
   ============================================================ */
.matrix-card-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
}

.matrix-segmented-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    padding: 2px;
    background: var(--slate-100);
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
}

.matrix-seg-btn {
    flex: 1;
    height: 24px;
    border-radius: var(--radius-sm);
    font-size: 10.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--slate-600);
    transition: all 0.12s ease;
    user-select: none;
    padding: 0 2px;
}
.matrix-seg-btn:hover:not(:disabled) {
    background: var(--surface);
    color: var(--slate-900);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.matrix-seg-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* 1. Kondisi (Kesesuaian) */
.matrix-seg-btn.seg-bm.selected { background: #a7f3d0; color: #064e3b; font-weight: 800; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25); }
.matrix-seg-btn.seg-me.selected { background: #10b981; color: #ffffff; font-weight: 700; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25); }
.matrix-seg-btn.seg-m.selected  { background: #059669; color: #ffffff; font-weight: 700; box-shadow: 0 1px 2px rgba(4, 120, 87, 0.25); }
.matrix-seg-btn.seg-mp.selected { background: #064e3b; color: #ffffff; font-weight: 700; box-shadow: 0 1px 2px rgba(6, 78, 59, 0.3); }

/* 2. Kategori Temuan */
.matrix-seg-btn.seg-ob.selected  { background: #a7f3d0; color: #064e3b; font-weight: 800; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25); }
.matrix-seg-btn.seg-min.selected { background: #059669; color: #ffffff; font-weight: 700; box-shadow: 0 1px 2px rgba(4, 120, 87, 0.25); }
.matrix-seg-btn.seg-may.selected { background: #064e3b; color: #ffffff; font-weight: 700; box-shadow: 0 1px 2px rgba(6, 78, 59, 0.3); }

/* 3. Status Temuan */
.matrix-seg-btn.seg-open.selected  { background: #10b981; color: #ffffff; font-weight: 700; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25); }
.matrix-seg-btn.seg-close.selected { background: #064e3b; color: #ffffff; font-weight: 700; box-shadow: 0 1px 2px rgba(6, 78, 59, 0.3); }

/* Sub-labels under segmented buttons */
.matrix-sub-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--slate-400);
    text-align: center;
    line-height: 1.2;
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    min-height: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.matrix-sub-label.has-val {
    color: var(--slate-700);
    font-weight: 600;
}

/* ============================================================
   PAGINASI HALAMAN
   ============================================================ */
.step-nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.step-circle-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--slate-300);
    background: var(--surface);
    color: var(--slate-600);
    transition: all 0.15s ease;
    user-select: none;
    position: relative;
}
.step-circle-btn:hover {
    border-color: var(--slate-700);
    color: var(--slate-900);
}
.step-circle-btn.active {
    border-color: var(--slate-900);
    background: var(--slate-900);
    color: #ffffff;
    font-weight: 700;
}
.step-circle-btn.completed:not(.active) {
    border-color: var(--accent-emerald-600);
    background: var(--accent-emerald-50);
    color: var(--accent-emerald-800);
}
.step-circle-btn.completed::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 6px;
    background: var(--accent-emerald-600);
    border-radius: var(--radius-pill);
    border: 1px solid #ffffff;
}

/* ============================================================
   BADGE STATUS
   ============================================================ */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}
.badge-draft   { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-waiting { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-review  { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.badge-hold    { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-done    { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

.badge-dot {
    width: 5px;
    height: 5px;
    border-radius: var(--radius-pill);
    display: inline-block;
}
.badge-draft .badge-dot   { background: #f59e0b; }
.badge-waiting .badge-dot { background: #3b82f6; }
.badge-review .badge-dot  { background: #ea580c; }
.badge-hold .badge-dot    { background: #ef4444; }
.badge-done .badge-dot    { background: #10b981; }


/* ============================================================
   COMBOBOX PROGRAM STUDI
   ============================================================ */
.prodi-input.is-invalid {
    border-color: #e11d48;
    box-shadow: 0 0 0 1px #e11d48;
}
.prodi-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    z-index: 30;
    background: var(--surface);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    box-shadow: 0 14px 28px -10px rgba(15, 23, 42, 0.3);
    overflow: hidden;
}
.prodi-dropdown.hidden { display: none; }
.prodi-list {
    max-height: 216px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
}
.prodi-option {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.4;
    color: var(--slate-800);
    cursor: pointer;
}
.prodi-option.is-selected {
    background: var(--accent-emerald-50);
    color: var(--accent-emerald-800);
    font-weight: 600;
}
.prodi-option.is-active { background: var(--slate-100); }
.prodi-option.is-selected.is-active { background: var(--accent-emerald-100); }
.prodi-option mark {
    background: #a7f3d0;
    color: var(--accent-emerald-900);
    border-radius: 2px;
    padding: 0 1px;
}
.prodi-empty {
    padding: 12px 10px;
    font-size: 12px;
    color: var(--slate-600);
}
.prodi-meta {
    padding: 5px 10px;
    border-top: 1px solid var(--slate-100);
    background: var(--slate-50);
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--slate-600);
}

/* Print Clean */
@media print {
    .no-print { display: none !important; }
    body { background: #ffffff !important; }
    .excel-table { font-size: 9px !important; }
    .excel-table th, .excel-table td { padding: 3px !important; }
    .table-container { overflow: visible !important; border: none !important; box-shadow: none !important; }
}


/* ============================================================
   FLOATING HORIZONTAL SLIDER (Mengikuti Layar Pengguna / Fixed)
   ============================================================ */
.floating-h-slider {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 9999px;
    box-shadow: 0 14px 32px -4px rgba(0, 0, 0, 0.38), 0 4px 12px -2px rgba(0, 0, 0, 0.2);
    padding: 7px 16px;
    width: calc(100% - 36px);
    max-width: 580px;
    color: #ffffff;
    user-select: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-h-slider:hover {
    background: rgba(15, 23, 42, 0.97);
    box-shadow: 0 18px 40px -4px rgba(0, 0, 0, 0.48);
}

.floating-h-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 13px;
    font-size: 11.5px;
    font-weight: 700;
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 9999px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.floating-h-btn:hover {
    background: rgba(255, 255, 255, 0.26);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
}
.floating-h-btn:active {
    transform: translateY(0);
}

.floating-h-range-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.floating-h-icon {
    font-size: 13px;
    color: #94a3b8;
    user-select: none;
}

/* Custom Styled Range Slider */
.floating-h-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.22);
    outline: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.floating-h-range:hover {
    background: rgba(255, 255, 255, 0.32);
}
.floating-h-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #38bdf8;
    border: 2.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.12s ease, background-color 0.12s ease;
}
.floating-h-range::-webkit-slider-thumb:hover {
    background: #0ea5e9;
    transform: scale(1.15);
}
.floating-h-range::-webkit-slider-thumb:active {
    cursor: grabbing;
    background: #0284c7;
    transform: scale(1.22);
}
.floating-h-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #38bdf8;
    border: 2.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.12s ease, background-color 0.12s ease;
}
