/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

:root {
  --merah: #C0392B;
  --merah-gelap: #8B1A1A;
  --merah-muda: #FDECEA;
  --putih: #FFFFFF;
  --abu-terang: #F5F6F8;
  --abu-border: #E2E5EA;
  --teks-utama: #1A1D23;
  --teks-sekunder: #5A6270;
  --hijau: #1B7F4F;
  --hijau-muda: #E8F5EE;
  --kuning: #D97706;
  --kuning-muda: #FEF3C7;
  --biru: #1D5BA6;
  --biru-muda: #EBF2FD;
  --ungu: #6D28D9;
  --ungu-muda: #EDE9FE;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--abu-terang);
  color: var(--teks-utama);
  min-height: 100vh;
  font-size: 14px;
}

/* ===== LAYOUT ===== */
.app-wrapper { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px; min-height: 100vh;
  background: linear-gradient(180deg, #8B1A1A 0%, #C0392B 100%);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 200; overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  transition: transform 0.3s;
}
.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-title { font-size: 14px; font-weight: 800; color: white; }
.sidebar-brand-sub { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 1px; }

.sidebar-section {
  padding: 14px 14px 6px;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
}
.sidebar-nav { padding: 6px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.8);
  text-decoration: none; font-size: 13.5px; font-weight: 600;
  margin-bottom: 2px; transition: all 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.15); color: white; }
.nav-item.active { background: rgba(255,255,255,0.22); color: white; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-user {
  margin: 10px; padding: 12px;
  background: rgba(0,0,0,0.2); border-radius: 10px;
}
.sidebar-user-name { font-size: 12.5px; font-weight: 700; color: white; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.sidebar-user-logout {
  display: inline-block; margin-top: 8px;
  font-size: 11.5px; color: rgba(255,255,255,0.7);
  text-decoration: none; border: 1px solid rgba(255,255,255,0.3);
  padding: 3px 10px; border-radius: 6px; transition: all 0.2s;
}
.sidebar-user-logout:hover { background: rgba(255,255,255,0.15); color: white; }

/* ===== MAIN CONTENT ===== */
.main-content { margin-left: 260px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: white; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1.5px solid var(--abu-border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 18px; font-weight: 800; color: var(--teks-utama); }
.topbar-sub { font-size: 12px; color: var(--teks-sekunder); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.page-content { padding: 28px; flex: 1; }

/* ===== CARDS ===== */
.card {
  background: white; border-radius: var(--radius);
  border: 1.5px solid var(--abu-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1.5px solid var(--abu-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 22px; }

/* ===== STAT CARDS ===== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white; border-radius: var(--radius);
  border: 1.5px solid var(--abu-border);
  padding: 18px; display: flex; align-items: flex-start; gap: 14px;
  box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-icon.red { background: var(--merah-muda); }
.stat-icon.green { background: var(--hijau-muda); }
.stat-icon.blue { background: var(--biru-muda); }
.stat-icon.yellow { background: var(--kuning-muda); }
.stat-icon.purple { background: var(--ungu-muda); }
.stat-label { font-size: 11px; font-weight: 700; color: var(--teks-sekunder); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; margin-top: 2px; }
.stat-sub { font-size: 11.5px; color: var(--teks-sekunder); margin-top: 2px; }

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl thead { background: linear-gradient(135deg, var(--merah-gelap), var(--merah)); }
table.tbl thead th {
  padding: 11px 14px; font-size: 11.5px; font-weight: 700;
  color: white; text-align: left; white-space: nowrap; letter-spacing: 0.3px;
}
table.tbl tbody tr { border-bottom: 1px solid var(--abu-border); transition: background 0.15s; }
table.tbl tbody tr:last-child { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--abu-terang); }
table.tbl tbody td { padding: 11px 14px; font-size: 13px; vertical-align: middle; }
table.tbl tfoot td { padding: 10px 14px; background: var(--abu-terang); font-weight: 700; font-size: 12.5px; border-top: 1.5px solid var(--abu-border); }

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 12.5px; font-weight: 700; color: var(--teks-utama); }
.form-label .req { color: var(--merah); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  padding: 9px 13px;
  border: 1.5px solid var(--abu-border);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px;
  color: var(--teks-utama); background: white;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--merah);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.10);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-input.mono, .form-select.mono { font-family: 'DM Mono', monospace; }
.form-hint { font-size: 11.5px; color: var(--teks-sekunder); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: all 0.2s;
  white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary { background: var(--merah); color: white; }
.btn-primary:hover { background: #A93226; transform: translateY(-1px); }
.btn-success { background: var(--hijau); color: white; }
.btn-success:hover { background: #155d3a; }
.btn-warning { background: var(--kuning); color: white; }
.btn-warning:hover { background: #b45309; }
.btn-danger { background: #DC2626; color: white; }
.btn-danger:hover { background: #B91C1C; }
.btn-danger:disabled,
.btn-danger.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-secondary { background: white; color: var(--teks-utama); border: 1.5px solid var(--abu-border); }
.btn-secondary:hover { border-color: var(--merah); color: var(--merah); }
.btn-info { background: var(--biru); color: white; }
.btn-info:hover { background: #1749a0; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700;
}
.badge-success { background: var(--hijau-muda); color: var(--hijau); }
.badge-danger { background: var(--merah-muda); color: var(--merah); }
.badge-info { background: var(--biru-muda); color: var(--biru); }
.badge-warning { background: var(--kuning-muda); color: var(--kuning); }
.badge-purple { background: var(--ungu-muda); color: var(--ungu); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 18px; font-size: 13.5px; font-weight: 600;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--hijau-muda); color: var(--hijau); border: 1px solid #a7f3d0; }
.alert-danger { background: var(--merah-muda); color: var(--merah); border: 1px solid #fecaca; }
.alert-info { background: var(--biru-muda); color: var(--biru); border: 1px solid #bfdbfe; }
.alert-warning { background: var(--kuning-muda); color: var(--kuning); border: 1px solid #fde68a; }

/* ===== MONO TEXT ===== */
.mono { font-family: 'DM Mono', monospace; }
.text-muted { color: var(--teks-sekunder); }
.text-sm { font-size: 12px; }
.fw-bold { font-weight: 700; }

/* ===== NILAI INPUT GRID ===== */
.nilai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.nilai-item { display: flex; flex-direction: column; gap: 5px; }
.nilai-label { font-size: 12px; font-weight: 700; color: var(--teks-sekunder); display: flex; align-items: center; gap: 5px; }
.nilai-label .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nilai-input {
  padding: 8px 12px; border: 1.5px solid var(--abu-border);
  border-radius: var(--radius-sm); font-family: 'DM Mono', monospace;
  font-size: 15px; font-weight: 700; text-align: center;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.nilai-input:focus { border-color: var(--merah); box-shadow: 0 0 0 3px rgba(192,57,43,0.10); }
.nilai-input:invalid { border-color: #DC2626; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh; background: linear-gradient(135deg, var(--merah-gelap) 0%, var(--merah) 60%, #E74C3C 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box {
  background: white; border-radius: 20px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-header { background: linear-gradient(135deg, var(--merah-gelap), var(--merah)); padding: 32px 36px; text-align: center; }
.login-logo { font-size: 48px; margin-bottom: 10px; }
.login-title { font-size: 20px; font-weight: 800; color: white; }
.login-sub { font-size: 13px; color: rgba(255,255,255,0.78); margin-top: 4px; }
.login-body { padding: 32px 36px; }

/* ===== BREADCRUMB ===== */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--teks-sekunder); margin-bottom: 20px; }
.breadcrumb a { color: var(--merah); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--abu-border); }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 2px solid var(--abu-border); margin-bottom: 20px; gap: 0; overflow-x: auto; }
.tab-btn {
  padding: 12px 20px; background: none; border: none;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--teks-sekunder); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: all 0.2s;
}
.tab-btn:hover { color: var(--merah); }
.tab-btn.active { color: var(--merah); border-bottom-color: var(--merah); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 50px 20px; color: var(--teks-sekunder); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 15px; font-weight: 600; }
.empty-sub { font-size: 13px; margin-top: 4px; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 999;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: var(--radius);
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 22px; border-bottom: 1.5px solid var(--abu-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--teks-sekunder); }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1.5px solid var(--abu-border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ===== PRINT (Transkrip) ===== */
@media print {
  body { background: white; }
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  .page-content { padding: 0; }
  .transkrip-print { box-shadow: none !important; border: none !important; }
}
