:root {
  --navy: #071a38;
  --blue-900: #0a2a5c;
  --blue-800: #123a7a;
  --blue-700: #1a4d96;
  --blue-600: #1e6bb8;
  --blue-500: #3d8fd4;
  --sky-500: #4aa3e8;
  --sky-400: #7ec4f5;
  --sky-200: #c5e3f8;
  --sky-100: #e8f4fc;
  --gold: #c9a227;
  --gold-soft: #e8d48a;
  --ice: #f4f8fc;
  --bg: #eef4fa;
  --text: #10243f;
  --muted: #4d6480;
  --line: #d5e3f0;
  --white: #ffffff;
  --danger: #dc2626;
  --ok: #1a4d96;
  --warn: #b45309;
  --shadow: 0 18px 40px rgba(7, 26, 56, 0.14);
  --radius: 18px;
  --sidebar: 276px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
[hidden] { display: none !important; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 500px at 100% -10%, #d5e9f8 0%, transparent 50%), var(--bg);
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    linear-gradient(160deg, rgba(7,26,56,.78), rgba(18,58,122,.55)),
    url("../img/poltekbang-login-bg.png") center/cover no-repeat;
}
.login-wrap {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: #ffffff;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 28px 64px rgba(7, 26, 56, .4);
  border: 1px solid rgba(201, 162, 39, .35);
}
.login-hero {
  color: #fff;
  padding: 36px 32px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(7,26,56,.15) 0%, rgba(7,26,56,.82) 70%),
    url("../img/poltekbang-campus.png") center/cover no-repeat;
}
.kemenhub {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  font-weight: 700;
  margin-bottom: 8px;
}
.login-hero h1 {
  margin: 10px 0 8px;
  font-size: 2rem;
  letter-spacing: .04em;
}
.login-hero p { color: #e8f1fb; line-height: 1.55; max-width: 36ch; }
.login-hero ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: #e8f6ff;
}
.login-hero li {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(10, 42, 92, .45);
  border: 1px solid rgba(201, 162, 39, .35);
}
.login-card {
  background: #ffffff;
  padding: 42px 36px;
  display: grid;
  gap: 14px;
  align-content: center;
}
.login-card h2 { color: var(--blue-900); font-size: 1.55rem; }
.login-lead { color: #4d6480; margin-bottom: 6px; }
.login-card label { color: var(--blue-800); }
.login-card input {
  background: #f4f8fc;
  border: 1.5px solid #c5d7ea;
  color: var(--navy);
  min-height: 46px;
  border-radius: 12px;
}
.login-card input::placeholder { color: #8aa0b8; }
.login-card input:focus {
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, .2);
}
.login-hint { color: #4d6480; font-size: .82rem; text-align: center; }
.form-error {
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: .9rem;
  margin-bottom: 12px;
}
.flash-ok {
  background: #ecfeff;
  color: #075985;
  border: 1px solid #bae6fd;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-weight: 700;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: contain;
  padding: 4px;
  background: #fff;
  border: 1px solid rgba(201, 162, 39, .55);
  box-shadow: 0 8px 18px rgba(7, 26, 56, .18);
}
.brand-logo.sm { width: 44px; height: 44px; }
.brand-logo.tiny { width: 36px; height: 36px; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(201,162,39,.16) 0%, transparent 18%),
    linear-gradient(185deg, #041028 0%, #0a2a5c 55%, #0e3d78 100%);
  color: #eaf6ff;
  padding: 14px 10px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid rgba(201, 162, 39, .32);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.04);
}
.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin: 0 4px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,162,39,.22);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  flex-shrink: 0;
}
.sidebar-brand strong { letter-spacing: .06em; font-size: .95rem; }
.sidebar-brand small { display: block; color: var(--gold-soft); font-size: .72rem; margin-top: 2px; }
.nav-label {
  margin: 12px 12px 5px;
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(232, 212, 138, .7);
}
.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 4px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,162,39,.35) transparent;
}
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(201,162,39,.35); border-radius: 99px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  color: #d7e6f7;
  font-weight: 600;
  font-size: .88rem;
  margin: 2px 0;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.nav-ico {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--gold-soft);
}
.nav-ico svg { width: 16px; height: 16px; display: block; }
.side-nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.side-nav a:hover .nav-ico {
  background: rgba(201,162,39,.18);
  border-color: rgba(201,162,39,.35);
}
.side-nav a.active {
  background: linear-gradient(90deg, rgba(201,162,39,.24), rgba(255,255,255,.07));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}
.side-nav a.active .nav-ico {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--navy);
  border-color: transparent;
}
.sidebar-user {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin: 8px 4px 2px;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(201,162,39,.22);
  flex-shrink: 0;
}
.sidebar-user strong { font-size: .88rem; }
.sidebar-user small { display: block; color: var(--gold-soft); text-transform: capitalize; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--navy); font-weight: 800;
  box-shadow: 0 6px 14px rgba(201,162,39,.28);
}

.main { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.94), rgba(232, 244, 252, .82));
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar h2 { font-size: 1.2rem; }
.topbar p { color: var(--muted); font-size: .86rem; }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 12px; text-align: right; }
.top-user small { display: block; color: var(--muted); text-transform: capitalize; }
.icon-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--sky-100);
  color: var(--blue-700);
  cursor: pointer;
}
.content { padding: 22px 24px 40px; }

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #1e6bb8, #0a2a5c);
  box-shadow: 0 8px 16px rgba(10, 42, 92, .28);
  border: 1px solid rgba(201, 162, 39, .45);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; color: var(--blue-700); border: 1px solid var(--sky-200); }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-sky { background: var(--sky-100); color: var(--blue-800); }
.btn-sm { padding: 7px 10px; font-size: .82rem; border-radius: 10px; }
.btn-block { width: 100%; justify-content: center; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: #fff;
  border: 1px solid rgba(10, 42, 92, .08);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(7, 26, 56, .06);
  padding: 18px;
}
.card h3 { margin-bottom: 12px; font-size: 1rem; }
.stat {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
}
.stat::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(125,211,252,.5), rgba(21,101,192,.12));
}
.stat b { display: block; font-size: 1.45rem; color: var(--blue-800); margin-top: 6px; }
.stat span { color: var(--muted); font-size: .86rem; }

.campus-hero {
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 168px;
  margin-bottom: 16px;
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 22px 24px;
  background:
    linear-gradient(90deg, rgba(7,26,56,.82), rgba(10,42,92,.35)),
    url("../img/poltekbang-banner.png") center/cover no-repeat;
  border: 1px solid rgba(201, 162, 39, .4);
  box-shadow: var(--shadow);
}
.campus-hero small {
  display: block;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  font-weight: 700;
  font-size: .72rem;
  margin-bottom: 6px;
}
.campus-hero h3 { font-size: 1.35rem; margin-bottom: 4px; }
.campus-hero p { color: #dce8f5; font-size: .92rem; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar .grow { flex: 1; min-width: 180px; }
.search, input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
}
.search:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, .18);
}
label { display: grid; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--blue-800); }
textarea { min-height: 84px; resize: vertical; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 11px 10px; text-align: left; border-bottom: 1px solid #e7f3fb; vertical-align: middle; }
th { color: var(--muted); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; background: #f7fbff; }
tr:hover td { background: #f4fbff; }
.num { text-align: right; white-space: nowrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-ok { background: #e0f2fe; color: #075985; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-off { background: #f1f5f9; color: #475569; }
.badge-in { background: #dcfce7; color: #166534; }
.badge-out { background: #fee2e2; color: #991b1b; }
.badge-sky { background: #e0f2fe; color: #0369a1; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: .86rem; }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); }

.bar { height: 10px; background: #e0f2fe; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #c9a227, #0a2a5c); }

.doc-head {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
  margin-bottom: 16px;
}
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; font-size: .92rem; }
.kv b { color: var(--muted); font-weight: 600; }

.lines { width: 100%; }
.line-tools { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 12px; }

.modal-root {
  position: fixed;
  inset: 0;
  background: rgba(9, 40, 82, .42);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 30;
}
.modal {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(13,71,161,.25);
  overflow: hidden;
}
.modal.wide { width: min(980px, 100%); }
.modal header, .modal footer { padding: 16px 18px; }
.modal header { background: linear-gradient(90deg, #e0f2fe, #fff); border-bottom: 1px solid var(--line); }
.modal .body { padding: 18px; max-height: min(70vh, 640px); overflow: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 40;
}
.toast {
  background: #0d47a1;
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  min-width: 240px;
  box-shadow: var(--shadow);
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #0369a1; }

.timeline { display: grid; gap: 12px; }
.tl-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(90deg, #f0f9ff, #fff);
}
.dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: linear-gradient(180deg, #7dd3fc, #1565c0); }

.diff-plus { color: #047857; font-weight: 700; }
.diff-min { color: #b91c1c; font-weight: 700; }

.settings-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 22px 24px;
  border-radius: 22px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(7,26,56,.92), rgba(18,58,122,.72)),
    url("../img/poltekbang-banner.png") center/cover no-repeat;
  border: 1px solid rgba(201,162,39,.4);
  box-shadow: var(--shadow);
}
.settings-hero small {
  display: block;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  font-weight: 700;
  font-size: .7rem;
  margin-bottom: 6px;
}
.settings-hero h3 { font-size: 1.28rem; margin-bottom: 6px; }
.settings-hero p { color: #dce8f5; font-size: .9rem; max-width: 52ch; }
.settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: fit-content;
  box-shadow: 0 8px 22px rgba(7,26,56,.05);
}
.settings-tabs button {
  border: 0;
  background: transparent;
  color: var(--blue-800);
  border-radius: 12px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}
.settings-tabs button.active {
  background: linear-gradient(180deg, #1e6bb8, #0a2a5c);
  color: #fff;
  box-shadow: 0 8px 16px rgba(10,42,92,.22);
}
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.logo-preview {
  width: 180px;
  height: 180px;
  border-radius: 22px;
  object-fit: contain;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(7, 26, 56, .12);
}
.logo-preview.sm { width: 72px; height: 72px; border-radius: 14px; padding: 4px; flex-shrink: 0; }
.drop {
  border: 1.5px dashed #b9d0e6; border-radius: 18px; padding: 18px;
  background: #f7fbff; color: var(--muted);
}
.drop input[type="file"] {
  background: #fff;
  padding: 10px;
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .doc-head { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 20;
    transform: translateX(-110%);
    transition: .2s ease;
    width: var(--sidebar);
  }
  .sidebar.open { transform: none; }
  .icon-btn { display: grid; place-items: center; }
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 24px 20px; min-height: 280px; }
  .login-card { padding: 28px 24px 32px; }
  .settings-hero { flex-direction: column; align-items: flex-start; }
  .settings-tabs { width: 100%; }
}

@media print {
  .sidebar, .topbar, .toolbar, .btn, .toasts, .modal-root { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}
