/* ============================================================
   Tim Multimedia GKRS — Modern UI
   Palette from logo: royal blue, emerald, gold, soft neutrals
   ============================================================ */
:root {
  --brand: #0b3d91;
  --brand-deep: #062a66;
  --brand-soft: #e8f0fe;
  --accent: #c9a227;
  --accent-soft: #fbf3d5;
  --emerald: #1a9b5c;
  --emerald-soft: #e6f7ef;
  --danger: #dc2626;
  --body-bg: #f0f4f8;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --sidebar-w: 268px;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(11, 61, 145, 0.08);
  --shadow-lg: 0 12px 40px rgba(11, 61, 145, 0.12);
  --font: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--text);
  min-height: 100vh;
  margin: 0;
  line-height: 1.5;
}

a { color: var(--brand); }

/* ---------- Auth / Landing ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(26,155,92,.18), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(201,162,39,.15), transparent 45%),
    linear-gradient(145deg, #062a66 0%, #0b3d91 40%, #0e4db5 70%, #1565c0 100%);
  position: relative;
  overflow: hidden;
}
.auth-wrap::before {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -120px; right: -80px;
}
.auth-wrap::after {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(201,162,39,.08);
  bottom: -60px; left: -40px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem 1.75rem;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.5);
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-brand .logo-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(11,61,145,.15);
  margin-bottom: .75rem;
}
.auth-brand h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand);
  margin: 0 0 .25rem;
  letter-spacing: -.02em;
}
.auth-brand p {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
}

.btn-brand {
  background: linear-gradient(135deg, var(--brand) 0%, #1565c0 100%);
  border: none;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  padding: .6rem 1.1rem;
  transition: transform .15s, box-shadow .15s;
}
.btn-brand:hover {
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 100%);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(11,61,145,.3);
}
.btn-google {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text) !important;
  font-weight: 600;
  border-radius: 10px;
  padding: .6rem 1.1rem;
}
.btn-google:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--muted);
  font-size: .8rem;
  margin: 1rem 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--border);
  padding: .55rem .85rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11,61,145,.15);
}
.form-label {
  font-weight: 600;
  font-size: .85rem;
  color: #334155;
  margin-bottom: .3rem;
}

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

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--brand-deep) 0%, var(--brand) 55%, #0e4db5 100%);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1040;
  transition: transform .25s ease;
  box-shadow: 4px 0 24px rgba(6,42,102,.25);
}

.sidebar-brand {
  padding: 1.15rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sidebar-brand .logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sidebar-brand span {
  font-size: .88rem;
  line-height: 1.25;
  font-weight: 700;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.1rem;
  color: rgba(255,255,255,.88);
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-left-color: var(--accent);
}
.sidebar nav a i {
  width: 1.25rem;
  text-align: center;
  opacity: .95;
}

.sidebar .nav-section {
  padding: .85rem 1.1rem .3rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.45);
  font-weight: 600;
}

/* Gangguan details submenu */
.sidebar nav details.nav-details { margin: 0; padding: 0; border: 0; }
.sidebar nav details.nav-details > summary.nav-details-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem 1.1rem;
  color: rgba(255,255,255,.88);
  font-size: .9rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  user-select: none;
}
.sidebar nav details.nav-details > summary::-webkit-details-marker { display: none; }
.sidebar nav details.nav-details > summary::marker { content: ''; display: none; }
.sidebar nav details.nav-details > summary:hover,
.sidebar nav details.nav-details > summary.active,
.sidebar nav details.nav-details[open] > summary {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-left-color: var(--accent);
}
.nav-details-label { display: flex; align-items: center; gap: .65rem; }
.nav-details-label i { width: 1.25rem; text-align: center; }
.nav-details-caret { font-size: .7rem; opacity: .65; transition: transform .2s; }
.sidebar nav details.nav-details[open] > summary .nav-details-caret { transform: rotate(180deg); }
.nav-details-menu { background: rgba(0,0,0,.18); padding: .15rem 0 .4rem; }
.sidebar nav .nav-details-menu a {
  padding: .48rem 1.1rem .48rem 2.55rem;
  font-size: .82rem;
  color: rgba(255,255,255,.8);
}
.sidebar nav .nav-details-menu a.active {
  background: rgba(201,162,39,.28);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--accent);
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}

.content { padding: 1.35rem 1.35rem 2rem; }

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brand);
  margin: 0 0 .2rem;
  letter-spacing: -.02em;
}
.page-sub {
  color: var(--muted);
  font-size: .875rem;
  margin-bottom: 1.25rem;
}

.card-soft {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stat-card, .stat-tile {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.table { margin-bottom: 0; }
.table thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  font-weight: 700;
  border-bottom-width: 1px;
  background: #f8fafc !important;
}
.table-hover tbody tr:hover { background: #f1f5f9; }

.badge { font-weight: 600; letter-spacing: .01em; }

.modal-content {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.modal-footer {
  border-top: 1px solid var(--border);
  padding: .85rem 1.25rem;
}

.sidebar-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--brand);
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6,42,102,.45);
    z-index: 1035;
  }
  .sidebar-backdrop.show { display: block; }
}

.stat-tile { cursor: pointer; }

/* Print QR */
@media print {
  body * { visibility: hidden !important; }
  .card-soft, .card-soft * { visibility: visible !important; }
  .card-soft { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none !important; border: none !important; }
  .btn, .btn-group, .sidebar, .topbar, .sidebar-backdrop { display: none !important; }
}
