:root {
  --lk-navy: #14213d;
  --lk-navy-2: #1d2f57;
  --lk-accent: #2563eb;
  --lk-bg: #f4f6fa;
  --lk-border: #e3e7ef;
  --lk-ok: #2f9e6e;
  --lk-warn: #e0a526;
  --lk-bad: #d64545;
  --lk-info: #3b82c4;
}

body { background: var(--lk-bg); color: #1f2937; font-size: .94rem; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--lk-navy); color: #cbd5e1;
  position: sticky; top: 0; height: 100vh; padding: 1rem .75rem;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.15rem; padding: .25rem .5rem 1.25rem;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px; background: var(--lk-accent);
  color: #fff; font-weight: 700; font-size: .9rem; letter-spacing: .5px;
}
.sidebar .nav-link {
  color: #cbd5e1; border-radius: 8px; padding: .55rem .75rem; display: flex; align-items: center; gap: .65rem;
}
.sidebar .nav-link:hover { background: var(--lk-navy-2); color: #fff; }
.sidebar .nav-link.active { background: var(--lk-accent); color: #fff; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1.5rem;
  background: #fff; border-bottom: 1px solid var(--lk-border); position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.content { padding: 1.5rem; flex: 1; }
.app-footer { padding: .9rem 1.5rem; font-size: .8rem; color: #6b7280; border-top: 1px solid var(--lk-border); background: #fff; }

@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -250px; z-index: 30; transition: left .2s; }
  .sidebar.open { left: 0; }
  .content { padding: 1rem; }
}

/* ---------- Kartu ---------- */
.card { border: 1px solid var(--lk-border); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--lk-border); font-weight: 600; border-radius: 12px 12px 0 0 !important; }

.kpi { padding: 1rem 1.1rem; border-left: 4px solid var(--lk-accent); height: 100%; }
.kpi .kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.kpi .kpi-value { font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.kpi.ok   { border-left-color: var(--lk-ok); }
.kpi.bad  { border-left-color: var(--lk-bad); }
.kpi.info { border-left-color: var(--lk-info); }
.kpi.warn { border-left-color: var(--lk-warn); }

.progress { height: .6rem; background: #e9edf5; }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .25rem; }

.chart-box { position: relative; height: 270px; }

.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; background: #f8fafc; border-bottom: 1px solid var(--lk-border); }

.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: var(--lk-accent); }
.sort-link .bi { font-size: .75rem; opacity: .4; }
.sort-link.active { color: var(--lk-accent); }
.sort-link.active .bi { opacity: 1; }

.attention { background: #fff8e6; border: 1px solid #f3dca1; border-radius: 12px; padding: .9rem 1.1rem; }

.schedule-item { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--lk-border); }
.schedule-item:last-child { border-bottom: 0; }
.schedule-time { min-width: 5.2rem; font-weight: 600; color: var(--lk-accent); }

/* ---------- Login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--lk-navy), var(--lk-navy-2)); }
.login-card { width: 100%; max-width: 380px; margin: 1rem; }

/* ---------- Kalender jadwal ---------- */
.cal-wrap { overflow-x: auto; }
.cal { width: 100%; min-width: 640px; table-layout: fixed; border-collapse: collapse; }
.cal th { text-align: center; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; padding: .4rem 0; border-bottom: 1px solid var(--lk-border); }
.cal td { border: 1px solid var(--lk-border); vertical-align: top; height: 110px; padding: .25rem; background: #fff; }
.cal-day.other { background: #f8fafc; }
.cal-day.other .cal-num { color: #b6bdc9; }
.cal-day.today { background: #eef4ff; box-shadow: inset 0 0 0 2px var(--lk-accent); }
.cal-num { font-size: .8rem; font-weight: 600; text-align: right; color: #4b5563; margin-bottom: .15rem; }
.cal-ev {
  display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--ev, var(--lk-accent));
  background: color-mix(in srgb, var(--ev, var(--lk-accent)) 14%, #fff); color: #1f2937;
  font-size: .72rem; line-height: 1.25; padding: .12rem .3rem; margin-bottom: .15rem; border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.cal-ev:hover { filter: brightness(.95); }
.cal-ev .t { font-weight: 700; }
.cal-ev.pending { border-left-style: dashed; background: repeating-linear-gradient(135deg, #fff, #fff 4px, color-mix(in srgb, var(--ev) 14%, #fff) 4px, color-mix(in srgb, var(--ev) 14%, #fff) 8px); }
.cal-more { border: 0; background: none; color: var(--lk-accent); font-size: .72rem; padding: 0 .3rem; }
.jenis-praktikum   { --ev: #2563eb; }
.jenis-ujian       { --ev: #d64545; }
.jenis-pelatihan   { --ev: #7c3aed; }
.jenis-pemeliharaan{ --ev: #e0a526; }
.jenis-lainnya     { --ev: #0f9d94; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.cal-legend .dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; background: var(--ev, #9ca3af); margin-right: .3rem; vertical-align: -1px; }
.cal-legend .dot.pending { background: repeating-linear-gradient(135deg, #fff, #fff 2px, #9ca3af 2px, #9ca3af 4px); border: 1px dashed #9ca3af; }
