/* ═══════════════════════════════════════════════════
   SIGAP Web App — Premium CSS
   Color palette matches UNY SIGAP screenshots exactly
   ═══════════════════════════════════════════════════ */

:root {
  /* Level colors — Exactly as in UNY SIPP screenshots */
  --l1: #1a1e43;   /* Navy Blue      - Level 1: Menu Utama */
  --l2: #4a1a3e;   /* Deep Maroon    - Level 2: Menu Tambahan */
  --l3: #7b2351;   /* Burgundy       - Level 3: Menu Pendukung */
  --l4: #9e3050;   /* Dark Rose      - Level 4 */
  --l5: #c0474d;   /* Crimson        - Level 5 */
  --l6: #d4724a;   /* Rust Orange    - Level 6 */
  --l7: #e8a06a;   /* Peach          - Level 7 */
  --l8: #f5cca8;   /* Light Peach    - Level 8 */

  --primary:     #1a1e43;
  --accent:      #7b2351;
  --blue:        #0284c7;
  --green:       #16a34a;
  --red:         #dc2626;
  --orange:      #ea580c;
  --purple:      #7c3aed;

  --bg:          #f0f2f7;
  --white:       #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --muted:       #64748b;

  --sidebar-w:   250px;
  --topbar-h:    58px;
  --radius:      10px;
  --shadow:      0 4px 12px rgba(0,0,0,.08);
  --transition:  .25s ease;
  --surface:     #f8fafc;
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4 { font-family: 'Outfit', sans-serif; }

/* ── ROLE ENGINE ─────────────────────────────────────── */
body.role-user .admin-only { display: none !important; }

/* ── LAYOUT ──────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: #f0f1f5;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
}

/* Collapsed sidebar behavior on desktop */
@media (min-width: 901px) {
  .sidebar.collapsed {
    width: 70px;
  }
  .sidebar.collapsed:hover {
    width: 250px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
  }
  
  /* When collapsed and not hovered, hide labels and card, center icons */
  .sidebar.collapsed:not(:hover) .logo-sip {
    font-size: 1.25rem;
    letter-spacing: 0;
  }
  .sidebar.collapsed:not(:hover) .sidenav span,
  .sidebar.collapsed:not(:hover) .sidenav .caret,
  .sidebar.collapsed:not(:hover) .sidebar-card {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: none !important;
  }
  .sidebar.collapsed:not(:hover) .nav-sub {
    display: none !important;
  }
  .sidebar.collapsed:not(:hover) .nav-item a,
  .sidebar.collapsed:not(:hover) .nav-group-header {
    justify-content: center;
    padding: 12px 0;
  }
  .sidebar.collapsed:not(:hover) .nav-item a i,
  .sidebar.collapsed:not(:hover) .nav-group-header i:first-child {
    margin-right: 0;
    font-size: 1.2rem;
  }
  .sidebar.collapsed:not(:hover) .sidebar-logo {
    padding: 18px 0;
  }
}

.sidebar-logo {
  background: var(--white);
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  position: relative;
}

.sidebar-close-btn {
  display: none;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 190;
}

.logo-sip {
  font-family: 'Outfit', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  font-style: italic;
  color: var(--primary);
  letter-spacing: -2px;
  line-height: 1;
}

/* ── SIDENAV ─────────────────────────────────────────── */
.sidenav { flex: 1; padding: 10px 0; }
.sidenav ul { list-style: none; }

.nav-item, .nav-group {
  margin: 2px 0;
}

.nav-item a, .nav-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: all .18s;
}

.nav-item a i, .nav-group-header i:first-child { width: 18px; font-size: 1rem; color: #6b7280; }

.nav-item a .caret, .nav-group-header .caret {
  margin-left: auto;
  font-size: .75rem;
  transition: transform var(--transition);
}

.nav-item:hover a, .nav-group-header:hover {
  background: rgba(26,30,67,.05);
  color: var(--primary);
}

.nav-item.active > a {
  background: var(--white);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-item.active > a i { color: var(--accent); }

/* Sub nav */
.nav-sub {
  display: block;
  max-height: 0;
  overflow: hidden;
  background: rgba(0,0,0,.02);
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: max-height;
}
.nav-group.open .nav-sub {
  max-height: 120px;
}
.nav-group.open .caret { transform: rotate(180deg); }

.nav-sub li {
  list-style: none;
}

.nav-sub li a {
  display: block;
  padding: 9px 18px 9px 50px;
  color: #4b5563;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 400;
  border-left: 4px solid transparent;
  transition: all .15s;
}

.nav-sub li:hover a { background: rgba(26,30,67,.04); color: var(--primary); }
.nav-sub li.active a { color: #b91c1c; font-weight: 600; }

/* ── SIDEBAR CARD ────────────────────────────────────── */
.sidebar-card {
  margin: 12px;
  padding: 14px;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: .8rem;
}

.sc-row { display: flex; justify-content: space-between; color: var(--muted); font-weight: 500; }
.sc-val { font-size: 1.05rem; font-weight: 700; margin: 2px 0 4px; }
.mt8 { margin-top: 8px; }
.c-blue { color: var(--blue); }
.c-red { color: var(--red); }
.c-green { color: var(--green); }
.c-purple { color: var(--purple); }

.sc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: .75rem;
}

.sc-table th {
  background: var(--primary);
  color: var(--white);
  padding: 5px 6px;
  text-align: left;
  font-weight: 600;
}

.sc-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #f1f5f9;
}

.sc-table .tr { text-align: right; }
.sc-table .bold { font-weight: 700; }

/* ── MAIN ────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ── TOPBAR ──────────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: 6px;
  transition: all .15s;
}

.icon-btn:hover { background: var(--bg); color: var(--primary); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
}

.breadcrumb i { color: var(--muted); font-size: .85rem; }

.topbar-right { display: flex; align-items: center; gap: 18px; }

/* Role Switcher */
.role-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px 10px 4px 8px;
  border-radius: 30px;
  border: 1px solid var(--border);
}

.role-label { font-size: .78rem; font-weight: 600; color: var(--muted); }

.role-btn {
  border: none;
  background: none;
  padding: 5px 12px;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  color: #475569;
  letter-spacing: .3px;
  transition: all .2s;
}

.role-btn[data-role="admin"].active { background: #dc2626; color: var(--white); }
.role-btn[data-role="user"].active  { background: #16a34a; color: var(--white); }

/* User Chip */
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
}

.user-name { font-size: .85rem; font-weight: 600; line-height: 1.2; }
.user-role-text { font-size: .72rem; color: var(--muted); }

/* ── FILTER BAR ──────────────────────────────────────── */
.filter-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}

.filter-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }

.fg { display: flex; flex-direction: column; gap: 4px; }
.fg label { font-size: .78rem; font-weight: 600; color: var(--muted); }

.flt-select, .fg input[type="text"], .fg input[type="number"],
.fg input[type="url"], .fg input[type="date"] {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .88rem;
  background: #f8fafc;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}

.flt-select:focus, .fg input:focus { border-color: var(--blue); background: var(--white); }
.flt-select.wide { min-width: 180px; }
.flt-select { min-width: 120px; cursor: pointer; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 7px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .18s;
  white-space: nowrap;
}

.btn-primary   { background: var(--blue);   color: #fff; }
.btn-primary:hover   { background: #0369a1; }
.btn-success   { background: var(--green);  color: #fff; }
.btn-success:hover   { background: #15803d; }
.btn-danger    { background: var(--red);    color: #fff; }
.btn-danger:hover    { background: #b91c1c; }
.btn-secondary { background: #f1f5f9; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-sm { padding: 4px 9px; font-size: .75rem; border-radius: 5px; }
.btn-icon { padding: 6px 8px; }

/* ── CONTENT ─────────────────────────────────────────── */
.content { flex: 1; padding: 24px; overflow-y: auto; }
.view { animation: fadeIn .25s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── DASHBOARD ───────────────────────────────────────── */
.dash-banner {
  background: linear-gradient(135deg, #1a1e43 0%, #4a1a3e 100%);
  color: #fff;
  padding: 28px 32px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 6px 20px rgba(26,30,67,.2);
}

.dash-banner h2 { font-size: 1.6rem; margin-bottom: 6px; }
.dash-banner p { font-weight: 300; opacity: .85; }
.dash-banner-icon { font-size: 4rem; opacity: .15; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.si-blue   { background: rgba(2,132,199,.1);   color: var(--blue); }
.si-green  { background: rgba(22,163,74,.1);   color: var(--green); }
.si-purple { background: rgba(124,58,237,.1);  color: var(--purple); }
.si-orange { background: rgba(234,88,12,.1);   color: var(--orange); }

.stat-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat-val   { font-size: 1.25rem; font-weight: 700; margin-top: 3px; }

.info-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.info-box h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-box ul { list-style: none; }
.info-box li {
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .88rem;
  line-height: 1.5;
}
.info-box li:last-child { border: none; }
.info-box li i { flex-shrink: 0; margin-top: 2px; }

/* ── TABLE WRAPPER ───────────────────────────────────── */
.tbl-wrap {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tbl-scroll { overflow-x: auto; }

/* ── HIERARCHICAL TABLE ──────────────────────────────── */
.htable {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}

.htable thead th {
  background: #1e3a8a;
  color: var(--white);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  border-right: 1px solid rgba(255,255,255,.15);
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}
.htable thead th:last-child { border-right: none; }

.htable tbody td {
  padding: 16px 16px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  line-height: 1.5;
}

.htable tbody td:last-child { border-right: none; }

/* ─ Level Row Colors (clean slate/blue modern theme) ─ */
.htable .r1  { background: #e2e8f0; color: #0f172a; font-weight: 700; }
.htable .r2  { background: #f1f5f9; color: #1e293b; font-weight: 600; }
.htable .r3  { background: #f8fafc; color: #334155; font-weight: 600; }
.htable .r4  { background: #ffffff; color: #475569; }
.htable .r5  { background: #fafaf9; color: #44403c; }
.htable .r6  { background: #fff7ed; color: #7c2d12; }
.htable .r7  { background: #fffbeb; color: #78350f; }
.htable .r8  { background: #f0fdf4; color: #166534; }
.htable .r9  { background: #ecfdf5; color: #065f46; }

/* Setup borders for rows */
.htable .r1 td, .htable .r2 td {
  border-right-color: #cbd5e1;
  border-bottom-color: #cbd5e1;
}

/* Hover effects */
.htable tbody tr { transition: background-color 0.15s ease; }
.htable .r1:hover { background: #cbd5e1; }
.htable .r2:hover { background: #e2e8f0; }
.htable .r3:hover { background: #f1f5f9; }
.htable .r4:hover { background: #f8fafc; }
.htable .r5:hover { background: #f5f5f4; }
.htable .r6:hover { background: #ffedd5; }
.htable .r7:hover { background: #fef3c7; }
.htable .r8:hover { background: #dcfce7; }
.htable .r9:hover { background: #d1fae5; }

/* Tree node indent */
.tree-cell {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}
.tree-cell .toggle-btn,
.tree-cell .no-toggle {
  margin-top: 2px;
}
.indent { display: inline-block; flex-shrink: 0; }
.toggle-btn {
  background: none; border: none;
  cursor: pointer;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  font-size: .75rem;
  color: inherit;
  opacity: .8;
  transition: transform .2s, opacity .2s, background-color 0.15s;
  flex-shrink: 0;
}
.toggle-btn:hover { opacity: 1; background-color: rgba(0, 0, 0, 0.05); }
.toggle-btn.collapsed { transform: rotate(-90deg); }
.no-toggle { width: 18px; display: inline-block; flex-shrink: 0; }

/* Drive link badge */
.dlbadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.dlbadge.has-link {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.dlbadge.has-link:hover {
  background: #059669;
  color: #fff;
  border-color: #059669;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.15);
}

.dlbadge.no-link {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
  cursor: pointer;
}

.dlbadge.no-link:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #94a3b8;
}

/* Action buttons in table */
.act-cell { display: flex; gap: 5px; align-items: center; justify-content: center; }

/* ── FLAT TABLE (Transactions) ───────────────────────── */
.ftable { width: 100%; border-collapse: collapse; font-size: .83rem; }

.ftable thead th {
  background: #2d3748;
  color: #fff;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.2);
  border-bottom: 2px solid #e2e8f0;
}
.ftable thead th:last-child { border-right: none; }

.ftable tbody td {
  padding: 14px 14px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
  line-height: 1.5;
}

.ftable tbody td:last-child { border-right: none; }

.ftable tbody tr:nth-child(even) { background: #f8fafc; }
.ftable tbody tr:hover { background: #edf2f7; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-warn    { background: #fef3c7; color: #b45309; }
.badge-success { background: #dcfce7; color: #15803d; }

/* ── SECTION HEAD ────────────────────────────────────── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-head h2 { font-size: 1.25rem; color: var(--primary); }
.sub-text { font-size: .82rem; color: var(--muted); margin-top: 3px; }

/* ── PRODI DRIVE LINKS PAGE ──────────────────────────── */
.drive-folders-ref {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.dfr-title {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dfr-list { display: flex; flex-wrap: wrap; gap: 8px; }

.folder-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--white);
  border: 1px solid #fcd34d;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 500;
  color: #78350f;
}

.folder-badge i { color: #f59e0b; }

/* Prodi Cards Grid */
.prodi-cards { display: grid; grid-template-columns: 1fr; gap: 16px; }

.prodi-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s;
}

.prodi-card:hover { transform: translateY(-2px); }

.prodi-card-header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prodi-card-header h3 { font-size: 1rem; }
.prodi-card-code {
  background: rgba(255,255,255,.2);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
}

.prodi-card-body { padding: 14px 18px; }

.prodi-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}

.prodi-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.prodi-link-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.prodi-link-info { flex: 1; min-width: 0; }
.prodi-link-label { font-size: .75rem; color: var(--muted); font-weight: 500; }
.prodi-link-action { flex-shrink: 0; }

.prodi-card-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.progress-dots { display: flex; gap: 5px; align-items: center; }
.prog-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: background .2s;
}
.prog-dot.filled { background: var(--green); }

/* ── MODAL ───────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  will-change: opacity, backdrop-filter;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,.15);
  transform: translateY(-16px);
  transition: transform .2s;
  overflow: hidden;
  will-change: transform;
}

.modal.open .modal-box { transform: translateY(0); }
.modal-box.modal-lg { max-width: 820px; }

.modal-hdr {
  background: var(--primary);
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-hdr h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }

.close-x {
  background: none; border: none;
  font-size: 1.5rem; color: rgba(255,255,255,.7);
  cursor: pointer; line-height: 1;
  transition: color .15s;
}

.close-x:hover { color: #fff; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-ftr {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Alerts */
.alert-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 7px;
  padding: 11px 14px;
  color: #92400e;
  font-size: .84rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.alert-warn i { flex-shrink: 0; margin-top: 1px; }

/* Form helpers */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 13px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; margin-bottom: 13px; }

.fg { margin-bottom: 13px; }
.fg label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.req { color: var(--red); }

.fg small { display: block; margin-top: 4px; font-size: .74rem; color: var(--muted); }

.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > i { position: absolute; left: 10px; color: var(--green); font-size: 1.05rem; pointer-events: none; }
.input-icon input { padding-left: 34px !important; }

/* Drive Links Form (7 items) */
.drive-links-form {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.dlf-header {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-size: .82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dlf-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0 !important;
}

.dlf-item:last-child { border-bottom: none; }

.folder-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  margin-right: 4px;
}

/* Current link display */
.current-link {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: .82rem;
  color: #14532d;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-link a { color: var(--green); font-weight: 600; }

/* ── RESPONSIVENESS ──────────────────────────────────── */

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    position: fixed;
    left: -260px;
    width: 260px;
    transition: left var(--transition);
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }

  .sidebar.open { left: 0; }

  .sidebar.open + .sidebar-overlay {
    display: block;
  }

  .sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--muted);
    cursor: pointer;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    transition: color var(--transition);
  }

  .sidebar-close-btn:hover {
    color: var(--accent);
  }

  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dash-banner { flex-direction: column; gap: 10px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }


/* ── AUTH STATE CONTROL ─────────────────────────────── */
body.not-logged-in .layout {
  display: none !important;
}
body:not(.not-logged-in) .login-screen {
  display: none !important;
}

/* ── LOGIN SCREEN ───────────────────────────────────── */
.login-screen {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: linear-gradient(135deg, #0072ff 0%, #00bfff 100%) !important;
  font-family: 'Inter', sans-serif;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* SVG circle pattern overlay — sama persis dengan FilterBar banner */
.login-screen::before {
  content: none;
}

.login-screen::after {
  content: none;
}


.login-card {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  width: 100%;
  max-width: 460px;
  padding: 44px 40px;
  box-shadow: 0 24px 64px rgba(0, 50, 150, 0.25), 0 8px 24px rgba(0, 114, 255, 0.15);
  color: #1e293b;
  animation: loginFadeIn 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.logo-sip-large {
  font-family: 'Inter', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #0072ff 0%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  display: inline-block;
  line-height: 1.2;
  padding: 0 4px 4px 0; /* Mencegah font terpotong di tepi karena background-clip */
  filter: drop-shadow(0 2px 8px rgba(0, 114, 255, 0.2));
}

.logo-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
  margin-top: 6px;
  line-height: 1.4;
}

.logo-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.login-error {
  background: rgba(220, 38, 38, 0.07);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.83rem;
  color: #dc2626;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: shake 0.3s ease-in-out;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.06);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.form-group-login {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group-login label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.02em;
}

.form-group-login input {
  padding: 13px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

.form-group-login input::placeholder {
  color: #94a3b8;
}

.form-group-login input:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 48px;
}

.toggle-password-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: color 0.2s;
  border-radius: 6px;
}

.toggle-password-btn:hover {
  color: #3b82f6;
}

.btn-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(135deg, #0072ff 0%, #00bfff 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: 'Outfit', inherit;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 12px;
  box-shadow: 0 8px 24px rgba(0, 114, 255, 0.45), 0 0 0 1px rgba(255,255,255,0.1);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
}

.btn-login:hover::before {
  opacity: 1;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 114, 255, 0.55), 0 0 0 1px rgba(255,255,255,0.15);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 114, 255, 0.4);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Credentials Helper styling */
.credentials-helper {
  margin-top: 25px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  padding-top: 15px;
}

.ch-trigger {
  font-size: 0.8rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color 0.2s;
}

.ch-trigger:hover {
  color: #334155;
}

.ch-chevron {
  transition: transform 0.2s;
}

.ch-trigger.open .ch-chevron {
  transform: rotate(180deg);
}

.ch-content {
  margin-top: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.75rem;
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.ch-divider {
  font-weight: 600;
  color: #94a3b8;
  margin: 10px 0 6px 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: #ffffff;
  border-radius: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.18s;
  border: 1px solid #e2e8f0;
}

.ch-item:hover {
  background: #f0f9ff;
  border-color: #bfdbfe;
}

.ch-role {
  font-weight: 500;
}

.ch-creds {
  font-family: monospace;
  color: #94a3b8;
}

.ch-prodi-list {
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
}

.ch-prodi-list::-webkit-scrollbar {
  width: 4px;
}
.ch-prodi-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
}

/* ── PRODI BADGE ────────────────────────────────────────── */
.badge-prodi {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

.badge-prodi-fac {
  background: var(--muted);
}

/* ── TABLE INPUT ────────────────────────────────────────── */
.table-input {
  width: 100%;
  max-width: 80px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  text-align: center;
  background: #ffffff;
  color: #1e293b;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  box-sizing: border-box;
  transition: all 0.2s ease;
}
.table-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15), inset 0 1px 2px rgba(0,0,0,0.05);
  outline: none;
  background: #ffffff;
}


/* Helper classes for text alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* ── LAPORAN PROGRESS BAR ───────────────────────────────────── */
.progress-bar-wrap {
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  width: 100%;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .5s ease;
  min-width: 2px;
}

/* Laporan breakdown table rows */
.lap-row-bidang {
  background: var(--surface);
}
.lap-row-bidang td {
  padding: 10px 12px !important;
  border-top: 2px solid var(--border) !important;
}
.lap-row-subbidang td {
  padding: 7px 12px !important;
  background: #f8fafc;
}
.lap-row-iku {
  opacity: 0.88;
}
.lap-row-iku td {
  padding: 5px 12px !important;
  font-size: 0.82rem;
  border-bottom: none !important;
}

/* Premium Laporan Layout & Card Enhancements */
.lap-tw-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lap-tw-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

/* SVG circle loader animations */
@keyframes circleFill {
  to {
    stroke-dashoffset: 0;
  }
}

.circular-progress-wrap svg {
  display: block;
}

.lap-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  transform: rotate(-15deg);
  pointer-events: none;
  z-index: 1;
}

.badge-tw-active {
  animation: pulse-pink 2s infinite;
}


@keyframes pulse-pink {
  0% {
    box-shadow: 0 0 0 0 rgba(219, 39, 119, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(219, 39, 119, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(219, 39, 119, 0);
  }
}

/* ── MOBILE RESPONSIVE ADAPTATIONS ─────────────────────── */

@media (max-width: 768px) {
  .lap-banner {
    padding: 20px 20px !important;
    border-radius: 16px !important;
    gap: 12px !important;
  }
  .lap-banner h2 {
    font-size: 1.35rem !important;
  }
  .lap-banner p {
    font-size: 0.85rem !important;
  }
  .lap-banner > div:last-child {
    width: 100% !important;
    margin-left: 0 !important;
  }
  .filter-bar-inner {
    padding: 12px 16px !important;
    border-radius: 16px !important;
    gap: 12px !important;
  }
  /* Table wrapping for mobile */
  .tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  /* Topbar tweaks: hide user text, keep avatar */
  .user-name, .user-role-text { display: none !important; }
  .topbar { padding: 0 14px !important; }
}


