/* ==========================================================================
   Monitor POGI Cabang — design tokens
   Palet: petrol teal (klinis, tenang) + raspberry (aksen, urgensi data)
   Tipografi: Fraunces (display) + Plus Jakarta Sans (UI) + IBM Plex Mono (data)
   Motif tanda tangan: hub-and-satellite — merepresentasikan jejaring Cabang -> RS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #F5F8F7;
  --surface: #FFFFFF;
  --surface-sunken: #EFF4F2;
  --primary: #0F4C4A;
  --primary-dark: #0A3634;
  --primary-tint: #E4EEEC;
  --accent: #B23A6B;
  --accent-tint: #F7E7EE;
  --success: #2E7D5B;
  --success-tint: #E4F3EC;
  --warning: #C97A2B;
  --warning-tint: #FBEEE0;
  --danger: #C13B3B;
  --danger-tint: #FBE7E7;
  --text: #16211F;
  --text-muted: #5C6B68;
  --border: #E2E8E6;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(15,76,74,0.04), 0 8px 24px -12px rgba(15,76,74,0.18);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--primary-dark);
  margin: 0;
}

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Auth screen ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(178,58,107,0.10), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(15,76,74,0.12), transparent 45%),
    var(--primary-dark);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
}
.auth-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-mark svg { width: 34px; height: 34px; }
.auth-mark span {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--primary-dark);
}
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }

/* ---------- Form controls ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  outline: none;
}
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.field.has-error input, .field.has-error select { border-color: var(--danger); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 13px; }

/* ---------- App shell ---------- */
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--primary-dark);
  color: #EAF2F0;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.sidebar::before {
  /* signature hub-and-satellite motif, faint, top-right */
  content: '';
  position: absolute;
  top: -40px; right: -60px;
  width: 220px; height: 220px;
  background-image:
    radial-gradient(circle at 60% 40%, rgba(178,58,107,0.55) 0 4px, transparent 5px),
    radial-gradient(circle at 30% 70%, rgba(234,242,240,0.35) 0 3px, transparent 4px),
    radial-gradient(circle at 80% 75%, rgba(234,242,240,0.35) 0 3px, transparent 4px),
    radial-gradient(circle at 20% 20%, rgba(234,242,240,0.35) 0 3px, transparent 4px);
  opacity: 0.5;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; position: relative; z-index: 1; }
.brand svg { width: 28px; height: 28px; flex-shrink: 0; }
.brand-text { line-height: 1.2; }
.brand-text strong { font-family: var(--font-display); font-size: 15.5px; display: block; }
.brand-text small { color: #9FB8B4; font-size: 11.5px; }

.nav-group { margin-bottom: 18px; position: relative; z-index: 1; }
.nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: #7FA09B; padding: 0 10px; margin-bottom: 6px; font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: #D3E5E2; font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,0.06); text-decoration: none; color: #fff; }
.nav-link.active { background: rgba(178,58,107,0.85); color: #fff; }
.nav-link svg { width: 16px; height: 16px; opacity: .9; }

.sidebar-foot {
  margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12.5px; color: #9FB8B4; position: relative; z-index: 1;
}

.main-col { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 19px; }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-muted); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; font-family: var(--font-display);
}

.content { padding: 26px 28px 60px; }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 26px; }
.kpi-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 18px 20px; box-shadow: var(--shadow-card);
  border-left: 3px solid var(--primary);
}
.kpi-card.accent { border-left-color: var(--accent); }
.kpi-card.warn { border-left-color: var(--warning); }
.kpi-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.kpi-value { font-family: var(--font-display); font-size: 30px; color: var(--primary-dark); }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); margin-bottom: 22px; overflow: hidden;
}
.panel-head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-head h2 { font-size: 16.5px; }
.panel-body { padding: 20px 22px; }

/* ---------- Tables ---------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); padding: 10px 22px; background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}
.data-table tbody td { padding: 13px 22px; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-sunken); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
}
.badge-success { background: var(--success-tint); color: var(--success); }
.badge-warning { background: var(--warning-tint); color: var(--warning); }
.badge-danger  { background: var(--danger-tint); color: var(--danger); }
.badge-muted   { background: var(--surface-sunken); color: var(--text-muted); }

/* ---------- Alerts / flash ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px; }
.alert-success { background: var(--success-tint); color: var(--success); }
.alert-danger { background: var(--danger-tint); color: var(--danger); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state svg { width: 44px; height: 44px; opacity: .35; margin-bottom: 12px; }
.empty-state p { margin: 4px 0; }

/* ---------- Utility ---------- */
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 18px; }
}
