/* =====================================================================
   POLAK — Portal Layanan Akademik FKIP UNSA
   Identitas visual: akademik, elegan, profesional.
   Palet: navy institusional + aksen emas seremonial.
   ===================================================================== */

:root {
  --navy-900: #0a2a4a;
  --navy-800: #0d3a63;
  --navy-700: #0f4c81;   /* primary */
  --navy-600: #14639e;
  --navy-100: #e8f0f8;
  --gold-500: #c8a04a;   /* aksen */
  --gold-400: #d8b76a;
  --ink:      #1f2733;
  --muted:    #6b7686;
  --surface:  #f5f7fb;
  --card:     #ffffff;
  --line:     #e6e9f0;
  --radius:   16px;
  --shadow-sm: 0 1px 2px rgba(16,32,58,.06), 0 1px 3px rgba(16,32,58,.05);
  --shadow:    0 6px 20px rgba(16,32,58,.08);
  --sidebar-w: 262px;

  --bs-primary: var(--navy-700);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .display-font, .navbar-brand, .sidebar-brand {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

a { text-decoration: none; }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 60%, var(--navy-700) 100%);
  color: #cfe0f0;
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .7rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
}
.sidebar-brand .logo-badge {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  display: grid; place-items: center; color: var(--navy-900);
  font-weight: 800; font-size: 1.05rem; flex: none;
  box-shadow: 0 4px 12px rgba(200,160,74,.35);
}
.sidebar-brand .brand-text b { display: block; font-size: 1.05rem; line-height: 1.1; color: #fff; }
.sidebar-brand .brand-text small { color: #9db9d4; font-size: .72rem; }

.sidebar-scroll { overflow-y: auto; padding: .75rem .75rem 1.5rem; flex: 1; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.nav-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: #7f9dbd; padding: 1rem .85rem .4rem; font-weight: 700;
}
.sidebar .nav-link {
  display: flex; align-items: center; gap: .75rem;
  color: #cfe0f0; padding: .62rem .85rem; border-radius: 10px;
  font-weight: 500; font-size: .92rem; margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active {
  background: rgba(200,160,74,.16);
  color: #fff; position: relative;
}
.sidebar .nav-link.active::before {
  content: ""; position: absolute; left: -6px; top: 8px; bottom: 8px;
  width: 4px; border-radius: 4px; background: var(--gold-500);
}
.sidebar .nav-link .badge { margin-left: auto; }

/* ---------- Main ---------- */
.main {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-width: 0;
}
.topbar {
  height: 64px; background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem; position: sticky; top: 0; z-index: 1030;
}
.topbar .page-title { font-weight: 700; font-size: 1.05rem; margin: 0; }
.topbar .page-sub { font-size: .78rem; color: var(--muted); }
.content { padding: 1.5rem; flex: 1; }
.content-narrow { max-width: 1080px; }

.btn-hamburger { border: 0; background: transparent; font-size: 1.4rem; color: var(--navy-700); display: none; }

/* ---------- User chip ---------- */
.user-chip { display: flex; align-items: center; gap: .6rem; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  background: var(--navy-100); color: var(--navy-700);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.avatar-lg { width: 84px; height: 84px; font-size: 1.8rem; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); background: var(--card);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--line);
  font-weight: 700; padding: 1rem 1.25rem; font-family: 'Plus Jakarta Sans', sans-serif;
}
.card-body { padding: 1.25rem; }

.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.4rem;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1; font-family: 'Plus Jakarta Sans', sans-serif; }
.stat-card .stat-label { color: var(--muted); font-size: .82rem; font-weight: 500; }
.tint-navy   { background: var(--navy-100);  color: var(--navy-700); }
.tint-gold   { background: #f7efd9;          color: #9a7620; }
.tint-green  { background: #e3f4ea;          color: #1a7a45; }
.tint-amber  { background: #fdf0dc;          color: #b5720a; }
.tint-red    { background: #fbe6e6;          color: #b02a37; }
.tint-info   { background: #e2f1f7;          color: #16758f; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; font-size: .9rem; }
.btn-primary { background: var(--navy-700); border-color: var(--navy-700); }
.btn-primary:hover { background: var(--navy-800); border-color: var(--navy-800); }
.btn-gold { background: var(--gold-500); border-color: var(--gold-500); color: #fff; }
.btn-gold:hover { background: #b78e37; border-color: #b78e37; color: #fff; }
.btn-outline-primary { color: var(--navy-700); border-color: var(--navy-700); }
.btn-outline-primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-soft { background: var(--navy-100); color: var(--navy-700); border: 0; }
.btn-soft:hover { background: #d8e6f4; color: var(--navy-800); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .85rem; color: #38424f; margin-bottom: .35rem; }
.form-control, .form-select {
  border-radius: 10px; border: 1px solid #d6dce6; padding: .55rem .8rem; font-size: .92rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--navy-600); box-shadow: 0 0 0 .2rem rgba(15,76,129,.12);
}
.input-group-text { border-radius: 10px 0 0 10px; background: #f1f4f9; border-color: #d6dce6; }

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: #f3f6fb; margin: 0; }
.table thead th {
  background: #f4f7fb; color: #4a5666; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; border-bottom: 1px solid var(--line); font-weight: 700;
  white-space: nowrap; padding: .75rem 1rem;
}
.table tbody td { padding: .8rem 1rem; vertical-align: middle; border-color: #eef1f6; }
.table-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

.badge-status { font-weight: 600; font-size: .72rem; padding: .4em .7em; }

/* ---------- Badges kode ---------- */
.kode-chip {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  background: #eef2f8; color: var(--navy-700); border-radius: 6px;
  padding: .15rem .45rem; font-size: .8rem; font-weight: 600;
}

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.8rem; color: #c2cbd8; }

/* ---------- Timeline (status permohonan) ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content:""; position:absolute; left:14px; top:6px; bottom:6px; width:2px; background:var(--line); }
.timeline li { position: relative; padding: 0 0 1.1rem 2.4rem; }
.timeline li .dot {
  position:absolute; left:6px; top:2px; width:18px; height:18px; border-radius:50%;
  background:#fff; border:3px solid #c2cbd8;
}
.timeline li.done .dot { border-color: var(--navy-700); background: var(--navy-700); }
.timeline li.reject .dot { border-color: #b02a37; background:#b02a37; }
.timeline li .t-title { font-weight:600; font-size:.9rem; }
.timeline li .t-time { font-size:.78rem; color:var(--muted); }

/* ---------- Pengumuman ---------- */
.announce-item { border-left: 3px solid var(--gold-500); padding: .5rem 0 .5rem 1rem; }
.announce-item + .announce-item { margin-top: 1rem; border-top: 1px dashed var(--line); padding-top: 1rem; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-brand {
  flex: 1; background:
    radial-gradient(120% 120% at 100% 0%, rgba(200,160,74,.18) 0%, transparent 45%),
    linear-gradient(160deg, var(--navy-900), var(--navy-700));
  color: #fff; padding: 3.5rem; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content:""; position:absolute; right:-80px; bottom:-80px; width:320px; height:320px;
  border-radius:50%; background: rgba(255,255,255,.04);
}
.auth-brand .brand-badge {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  display:grid; place-items:center; color: var(--navy-900); font-weight:800; font-size:1.5rem;
  box-shadow: 0 8px 24px rgba(200,160,74,.4);
}
.auth-brand h1 { font-size: 2rem; margin: 1.5rem 0 .5rem; }
.auth-brand .feature { display:flex; gap:.8rem; align-items:flex-start; margin-top: 1rem; }
.auth-brand .feature i { color: var(--gold-400); font-size: 1.2rem; margin-top:2px; }
.auth-form { width: 460px; max-width: 100%; padding: 3rem; display:flex; flex-direction:column; justify-content:center; background:#fff; }

/* ---------- Public verify ---------- */
.verify-hero { background: linear-gradient(160deg, var(--navy-900), var(--navy-700)); color:#fff; }

/* ---------- Utilities ---------- */
.text-navy { color: var(--navy-700) !important; }
.text-gold { color: var(--gold-500) !important; }
.bg-navy { background: var(--navy-700) !important; }
.fw-800 { font-weight: 800; }
.divider-soft { height:1px; background: var(--line); margin: 1rem 0; }
.section-title { font-family:'Plus Jakarta Sans',sans-serif; font-weight:700; font-size:1.05rem; margin:0; }

/* ---------- Sidebar overlay (mobile) ---------- */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(10,20,35,.45); z-index: 1035; display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .btn-hamburger { display: inline-flex; }
  .auth-brand { display: none; }
  .auth-form { width: 100%; }
}
@media (max-width: 575.98px) {
  .content { padding: 1rem; }
  .auth-form { padding: 1.75rem; }
}

/* Print (untuk halaman cetak surat via browser) */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin-left: 0; }
}
