* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f2f5; color: #333; line-height: 1.6; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Navbar */
.navbar { background: #2c3e50; color: #fff; padding: 15px 0; }
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.navbar-brand a { color: #fff; text-decoration: none; font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.navbar-nav a { color: #ecf0f1; text-decoration: none; margin-left: 20px; font-size: 14px; transition: color 0.3s; }
.navbar-nav a:hover { color: #3498db; }

/* Main */
main { min-height: 70vh; padding: 30px 0; }

/* Card */
.card {
    background: #fff; border-radius: 10px; padding: 25px; margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.card h2 { color: #2c3e50; margin-bottom: 15px; }

/* Messages */
.message { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-weight: 500; }
.message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.message.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Buttons */
.btn {
    display: inline-block; padding: 10px 22px; border: none; border-radius: 6px;
    cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none;
    transition: all 0.3s;
}
.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover { background: #2980b9; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-warning:hover { background: #d68910; }

/* Table */
table { width: 100%; border-collapse: collapse; }
thead th {
    background: #2c3e50; color: #fff; padding: 12px 15px;
    text-align: left; font-size: 14px;
}
thead th:first-child { border-radius: 8px 0 0 0; }
thead th:last-child { border-radius: 0 8px 0 0; }
tbody tr { border-bottom: 1px solid #eee; }
tbody tr:hover { background: #f8f9fa; }
tbody td { padding: 11px 15px; font-size: 14px; }
.empty-row td { text-align: center; color: #999; padding: 30px; }

/* Form */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; color: #555; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd;
    border-radius: 6px; font-size: 15px; transition: border-color 0.3s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #3498db;
}

/* Footer */
.footer { background: #2c3e50; color: #ecf0f1; text-align: center; padding: 20px 0; margin-top: 40px; }
.footer p { font-size: 13px; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: #fff; padding: 50px 30px; border-radius: 10px; text-align: center; margin-bottom: 30px;
}
.hero h1 { font-size: 32px; margin-bottom: 10px; }
.hero p { font-size: 16px; opacity: 0.9; }

/* Grid */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature-card {
    background: #fff; border-radius: 10px; padding: 25px; text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: transform 0.3s;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-card h3 { color: #2c3e50; margin-bottom: 10px; }
.feature-card p { color: #666; font-size: 14px; }

/* Pelaksanaan SPMI */
.pelaksanaan-page h2 { margin-bottom: 20px; color: #2c3e50; }
.pelaksanaan-controls { margin-bottom: 15px; }
.pelaksanaan-controls .form-group { max-width: 280px; }

.tab-nav {
    display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 0;
    border-bottom: 3px solid #2c3e50;
}
.tab-link {
    display: inline-block; padding: 10px 18px; font-size: 13px; font-weight: 600;
    background: #e9ecef; color: #495057; text-decoration: none;
    border-radius: 8px 8px 0 0; transition: all 0.2s; white-space: nowrap;
}
.tab-link:hover { background: #dee2e6; }
.tab-link.active { background: #2c3e50; color: #fff; }

.tab-content {
    border-radius: 0 8px 8px 8px; margin-top: 0;
    overflow-x: auto;
}

.table-wrapper { overflow-x: auto; }
.table-info { margin-top: 12px; font-size: 13px; color: #6c757d; text-align: right; }

/* Group header rows */
.group-header td {
    background: #f8f9fa; font-weight: 700; color: #2c3e50;
    padding: 10px 15px; border-bottom: 2px solid #2c3e50;
    font-size: 14px; letter-spacing: 0.5px;
}

/* Cell wrapping for long text */
.cell-standar { max-width: 200px; word-wrap: break-word; }
.cell-indikator { max-width: 250px; word-wrap: break-word; }
.cell-dokumen { max-width: 200px; word-wrap: break-word; }
.cell-target { max-width: 200px; word-wrap: break-word; }
.cell-capaian { max-width: 200px; word-wrap: break-word; }

/* responsive tabs */
@media (max-width: 768px) {
    .tab-nav { flex-direction: column; border-bottom: none; }
    .tab-link { border-radius: 6px; }
    .tab-content { border-radius: 8px; }
}

@media (max-width: 600px) {
    .navbar .container { flex-direction: column; gap: 10px; }
    .navbar-nav a { margin: 0 8px; }
    table { font-size: 12px; }
    thead th, tbody td { padding: 8px 10px; }
}

/* ===== Tambahan SPMI terkonsolidasi ===== */
.navbar-brand small { display: block; color: #bdc3c7; font-size: 12px; letter-spacing: 0; }
.navbar-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 0; }
.navbar-nav a.aktif { color: #3498db; font-weight: 700; }
.navbar-user { margin-left: 20px; font-size: 12px; color: #95a5a6; }
main.lebar { max-width: 100%; padding-left: 14px; padding-right: 14px; }
.redup { color: #8a94a6; }
.btn-small { padding: 4px 9px; font-size: 12px; }
.btn-light { background: #e9ecef; color: #2c3e50; }
.btn-light:hover { background: #dee2e6; }
.btn-view { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }
.btn-edit { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; }
.btn-export { background: #27ae60; color: #fff; }
.btn-export:hover { background: #219a52; }

/* filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 15px; }
.filter-bar .form-group { margin-bottom: 0; min-width: 160px; }
.filter-bar .form-group.lebar { min-width: 320px; flex: 1; max-width: 460px; }
.filter-bar input, .filter-bar select { padding: 8px 10px; font-size: 14px; }

/* lencana status */
.lencana { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-belum  { background: #fde2d3; color: #9a3412; }
.st-capai  { background: #d1fae5; color: #065f46; }
.st-lampau { background: #dbeafe; color: #1e40af; }
.st-kosong { background: #e5e7eb; color: #4b5563; }
.lencana-sumber { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #ede9fe; color: #5b21b6; font-weight: 700; margin-top: 4px; }
.lencana-sumber.ami { background: #fce7f3; color: #9d174d; }

/* batang bertumpuk */
.batang { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #e5e7eb; }
.batang span { display: block; height: 100%; }
.batang .st-lampau { background: #2563eb; }
.batang .st-capai { background: #16a34a; }
.batang .st-belum { background: #f97316; }
.batang .st-kosong { background: #d1d5db; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #555; margin: 8px 0 14px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* kartu statistik */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.stat b { display: block; font-size: 26px; color: #2c3e50; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: #6c757d; }

/* kartu unit */
.seksi-judul { color: #2c3e50; margin: 26px 0 12px; font-size: 20px; border-bottom: 2px solid #2c3e50; padding-bottom: 6px; }
.seksi-sub { color: #2c3e50; margin: 14px 0 8px; font-size: 15px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.unit-card { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; transition: transform .2s, box-shadow .2s; border-top: 4px solid #3498db; }
.unit-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.unit-card.jenis-prodi { border-top-color: #27ae60; }
.unit-card.jenis-fakultas { border-top-color: #8e44ad; }
.unit-card.jenis-direktorat, .unit-card.jenis-pimpinan { border-top-color: #2c3e50; }
.unit-card.jenis-divisi { border-top-color: #f39c12; }
.unit-card h4 { color: #2c3e50; font-size: 15px; line-height: 1.35; }
.unit-card .kode { font-size: 11px; font-weight: 700; color: #7f8c8d; letter-spacing: .5px; }
.unit-card .angka { display: flex; justify-content: space-between; font-size: 12px; color: #555; font-variant-numeric: tabular-nums; }
.unit-card .persen { font-size: 22px; font-weight: 700; color: #2c3e50; }

/* halaman pelaksanaan */
.unit-kepala { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.unit-kepala h2 { color: #2c3e50; margin: 0; }
.unit-kepala .jenis { font-size: 13px; color: #6c757d; }
.tab-nav { gap: 3px; }
.tab-link { padding: 8px 13px; font-size: 12.5px; }
.tab-link .n { display: inline-block; margin-left: 5px; font-size: 10px; background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 6px; }
.tab-link.active .n { background: rgba(255,255,255,.2); }
.tab-link.tab-aksi { background: #27ae60; color: #fff; }
.tab-content { padding: 15px 12px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.tabel-ppepp { table-layout: fixed; width: 100%; min-width: 1250px; }
.tabel-ppepp thead th { font-size: 12px; padding: 8px 6px; position: sticky; top: 0; z-index: 1; }
.tabel-ppepp tbody td { font-size: 12px; padding: 6px 6px; vertical-align: top; word-break: break-word; overflow-wrap: anywhere; }
.tabel-ppepp td a { color: #2563eb; }
.tabel-ppepp .col-aksi { width: 62px; } .tabel-ppepp .col-no { width: 34px; }
.tabel-ppepp .col-ind { width: 15%; } .tabel-ppepp .col-dok { width: 8%; } .tabel-ppepp .col-tgt { width: 10%; }
.tabel-ppepp .col-aud { width: 7%; } .tabel-ppepp .col-cap { width: 13%; } .tabel-ppepp .col-st { width: 88px; }
.tabel-ppepp .col-ev, .tabel-ppepp .col-pg, .tabel-ppepp .col-pn { width: 11%; }
.potong { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.aksi-tumpuk { display: flex; flex-direction: column; gap: 5px; }
.tabel-gulir { overflow: auto; max-height: 78vh; border-radius: 8px; }

/* rekap PPEPP */
.matrix-table { table-layout: fixed; }
.matrix-table th:first-child { width: 22%; }
.cell-matrix { text-align: center; vertical-align: top; }
.cell-matrix .nilai { display: block; font-size: 20px; font-weight: 700; color: #2c3e50; }
.cell-matrix .dari { font-size: 11px; color: #6c757d; }
.cell-matrix .analisis { font-size: 11.5px; text-align: left; color: #475569; margin-top: 6px; white-space: pre-wrap; }
.cell-matrix.ada-analisis { background: #f0fdf4; }
.cell-matrix .ubah-analisis { margin-top: 6px; }

/* rekap status (kartu histogram) */
.status-histogram-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.status-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; background: #f8fafc; }
.status-card h4 { margin: 0 0 10px; font-size: 14px; color: #2c3e50; }
.histogram-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 8px; align-items: center; font-size: 12.5px; margin-bottom: 6px; }
.histogram-row .track { height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.histogram-row .track span { display: block; height: 100%; border-radius: 999px; }
.histogram-row .track .st-belum { background: #f97316; } .histogram-row .track .st-capai { background: #16a34a; }
.histogram-row .track .st-lampau { background: #2563eb; } .histogram-row .track .st-kosong { background: #9ca3af; }
.histogram-row small { text-align: right; color: #475569; font-variant-numeric: tabular-nums; }
.radar-wrap { position: relative; height: 560px; max-width: 900px; margin: 0 auto; }

/* rekap universitas */
.rekap-tabel th, .rekap-tabel td { font-size: 12px; padding: 6px 6px; text-align: center; }
.rekap-tabel th:first-child, .rekap-tabel td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 210px; }
.rekap-tabel thead th:first-child { background: #2c3e50; }
.rekap-tabel thead th { vertical-align: bottom; font-size: 11px; }
.rekap-tabel .grup td { background: #f1f5f9; font-weight: 700; color: #2c3e50; text-align: left; }
.rekap-tabel td.sel { font-variant-numeric: tabular-nums; }
.rekap-tabel td.sel a { color: inherit; text-decoration: none; display: block; }
.h0 { background: #fee2e2; } .h1 { background: #ffedd5; } .h2 { background: #fef9c3; } .h3 { background: #dcfce7; } .h4 { background: #bbf7d0; } .hk { background: #f3f4f6; color: #9ca3af; }

/* modal */
.modal-latar { position: fixed; inset: 0; background: rgba(17,24,39,.55); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 12px; }
.modal-latar.buka { display: flex; }
.modal { width: 100%; max-width: 1100px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 12px; padding: 22px; position: relative; box-shadow: 0 10px 30px rgba(15,23,42,.25); }
.modal h3 { color: #2c3e50; margin-bottom: 4px; padding-right: 30px; }
.modal-tutup { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 26px; cursor: pointer; color: #555; line-height: 1; }
.rinci-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.rinci-kartu { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #f8fafc; font-size: 13.5px; }
.rinci-kartu.penuh { grid-column: 1 / -1; }
.rinci-kartu strong { display: block; color: #0f172a; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.rinci-kartu a { color: #2563eb; word-break: break-all; }
.form-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 12px; }
.form-edit .penuh { grid-column: 1 / -1; }
.form-edit label { font-weight: 600; font-size: 13px; color: #0f172a; display: block; margin-bottom: 3px; }
.form-edit input, .form-edit select, .form-edit textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px; font: inherit; font-size: 13.5px; }
.form-edit textarea { min-height: 80px; resize: vertical; }
.form-edit .petunjuk { font-size: 11.5px; color: #64748b; }
.modal-aksi { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.modal-aksi .kanan { display: flex; gap: 8px; margin-left: auto; }

.form-kartu label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; color: #555; }
.form-kartu input, .form-kartu select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 15px; margin-bottom: 14px; }

@media (max-width: 768px) {
    .form-edit { grid-template-columns: 1fr; }
    .navbar-user { display: block; margin: 6px 0 0; width: 100%; text-align: center; }
    .filter-bar .form-group, .filter-bar .form-group.lebar { min-width: 100%; }
    .histogram-row { grid-template-columns: 90px 1fr 60px; }
}

/* Renstra */
.tabel-renstra { table-layout: fixed; width: 100%; min-width: 1200px; }
.tabel-renstra thead th { font-size: 12px; padding: 8px 6px; position: sticky; top: 0; z-index: 1; }
.tabel-renstra tbody td { font-size: 12px; padding: 6px; vertical-align: top; overflow-wrap: anywhere; }
.chip-spmi, .chip-unit, .chip-renstra { display: inline-block; font-size: 11px; line-height: 1.5; padding: 0 6px; border-radius: 4px; margin: 1px 0; text-decoration: none; white-space: nowrap; }
.chip-spmi { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.chip-spmi.asumsi { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.chip-spmi.longgar { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }
.chip-unit { background: #2c3e50; color: #fff; }
.chip-renstra { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; font-weight: 700; }
.chip-spmi:hover, .chip-unit:hover, .chip-renstra:hover { filter: brightness(.93); }
