@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --navy-900: #061426;
  --navy-800: #0B2345;
  --navy-700: #111C33;
  --primary-dark: #0B3B82;
  --primary: #1261C9;
  --cyan: #00AEEF;
  --bg: #F4F7FB;
  --panel: #ffffff;
  --border: rgba(15, 23, 42, 0.07);
  --text: #111827;
  --muted: #64748B;
  --success: #16A34A;
  --success-bg: #E7F7EC;
  --warning: #F59E0B;
  --warning-bg: #FEF3E2;
  --danger: #DC2626;
  --danger-bg: #FDEAEA;
  --info-bg: #E8F3FD;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 32px rgba(15, 23, 42, 0.09);
  --ease: 200ms ease;
}

* { box-sizing: border-box; }

.kpi-grid > *, .network-grid > *, .quick-grid > *, .chart-grid > *, .grid-side > *,
.bandwidth-grid > * { min-width: 0; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

.app { display: flex; min-height: 100vh; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: 252px;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #a9b4cc;
  display: flex;
  flex-direction: column;
  padding: 22px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 20px 14px;
  padding: 4px;
}
.sidebar .brand .brand-logo {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
}
.sidebar .brand-caption {
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #7686a8;
  margin: 0 20px 20px;
  line-height: 1.6;
  text-transform: uppercase;
}
.sidebar .brand-caption strong { display: block; color: #c9d3e6; font-size: 11px; }

.sidebar nav { display: flex; flex-direction: column; flex: 1; gap: 3px; padding: 0 14px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10.5px 13px;
  color: #93a0bd;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background var(--ease), color var(--ease);
}
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.sidebar nav a.active {
  background: linear-gradient(120deg, #0B5ED7, #00AEEF);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(0,174,239,0.25), 0 6px 18px -6px rgba(0, 174, 239, 0.5);
}
.sidebar nav a.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 16px 0;
  margin: 14px 14px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 4px 3px 12px; }
.sidebar-user .avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
}
.sidebar-user .who { min-width: 0; }
.sidebar-user .admin-name { color: #e7ebf5; font-weight: 700; font-size: 13px; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .status-line { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #7cd992; font-weight: 600; margin-top: 1px; }
.sidebar-user .status-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.22); }
.logout-link {
  display: flex; align-items: center; gap: 8px;
  color: #f4a3a3 !important; font-weight: 600; font-size: 12.5px;
  padding: 8px 3px 4px;
}
.logout-link svg { width: 15px; height: 15px; }

/* ============ TOPBAR ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 38px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-left h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.topbar-left p { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-date {
  font-size: 12.5px; color: var(--muted); font-weight: 600;
  padding: 7px 13px; background: var(--bg); border-radius: 999px; border: 1px solid var(--border);
  white-space: nowrap;
}
.icon-btn {
  position: relative;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; transition: background var(--ease), color var(--ease);
}
.icon-btn:hover { background: var(--info-bg); color: var(--primary); }
.icon-btn svg { width: 17px; height: 17px; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
  border: 2px solid var(--panel);
}
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff;
}
.menu-toggle { display: none; }

/* ============ CONTENT ============ */
.content { flex: 1; min-width: 0; }
.content-inner { padding: 28px 38px 44px; max-width: 1320px; overflow-x: hidden; }

h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 20px; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 14px; letter-spacing: -0.01em; }
body { font-size: 14px; }
.hint { font-size: 13px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 14px; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { margin: 0; }
.section-head .section-hint { font-size: 12px; color: var(--muted); font-weight: 500; }

.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: #106b34; border-color: #bfe8cd; }
.alert-danger { background: var(--danger-bg); color: #a01f1f; border-color: #f5c6c6; }
.alert-warning { background: var(--warning-bg); color: #92600a; border-color: #f6ddaa; }

/* ============ KPI CARDS ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), box-shadow var(--ease);
  min-width: 0;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.kpi-icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 19px; height: 19px; }
.kpi-icon.tone-blue { background: var(--info-bg); color: var(--primary); }
.kpi-icon.tone-green { background: var(--success-bg); color: var(--success); }
.kpi-icon.tone-red { background: var(--danger-bg); color: var(--danger); }
.kpi-icon.tone-orange { background: var(--warning-bg); color: var(--warning); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 8px; flex-shrink: 0; }
.status-dot.tone-green { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.status-dot.tone-red { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.status-dot.tone-orange { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }
.status-dot.tone-blue { background: var(--primary); box-shadow: 0 0 0 3px var(--info-bg); }
.kpi-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; margin-top: 3px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-trend { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: 9px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend svg { width: 11px; height: 11px; }
.kpi-trend .trend-note { color: var(--muted); font-weight: 500; }

.kpi-hero {
  background: linear-gradient(135deg, #071A35, #1261C9);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}
.kpi-hero::after {
  content: "";
  position: absolute; right: -24px; top: -24px; width: 110px; height: 110px;
  background: radial-gradient(circle, rgba(0,174,239,0.35), transparent 70%);
}
.kpi-hero .kpi-icon.tone-blue { background: rgba(255,255,255,0.16); color: #fff; }
.kpi-hero .kpi-label { color: #b9c9ea; }
.kpi-hero .kpi-trend.up { color: #7ee6a8; }
.kpi-hero .kpi-trend .trend-note { color: #9fb1d6; }
.kpi-hero .kpi-value { font-size: 22px; }

/* ============ NETWORK STATUS ============ */
.network-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.network-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.network-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.network-title { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.network-led { width: 9px; height: 9px; border-radius: 50%; background: var(--success); position: relative; }
.network-led::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  background: var(--success); opacity: 0.35; animation: pulse-ring 1.8s ease-out infinite;
}
.network-led.led-muted { background: #cbd3e1; }
.network-led.led-muted::before { display: none; }
@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(1.8); opacity: 0; }
}
.network-value { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.network-value.muted-value { color: var(--muted); font-size: 15px; font-weight: 700; }
.network-sub { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.network-bar { height: 5px; border-radius: 999px; background: var(--bg); margin-top: 12px; overflow: hidden; }
.network-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--cyan)); }

/* ============ CHART PANELS ============ */
.chart-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: stretch; }
.grid-side { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: stretch; margin-top: 30px; }
.kpi-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.bandwidth-grid.stacked { grid-template-columns: 1fr; margin-top: 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.range-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 999px; padding: 3px; border: 1px solid var(--border); }
.range-tabs button {
  border: none; background: transparent; font-family: inherit; cursor: pointer;
  font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 5px 12px; border-radius: 999px;
  transition: background var(--ease), color var(--ease);
}
.range-tabs button.active { background: var(--panel); color: var(--primary); box-shadow: var(--shadow-sm); }
.chart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 34px 20px; color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--bg) 0 10px, #fff 10px 20px);
  border-radius: var(--radius-sm); border: 1px dashed var(--border);
}
.chart-empty svg { width: 30px; height: 30px; opacity: 0.5; margin-bottom: 10px; }
.chart-empty .t1 { font-size: 13px; font-weight: 700; color: #475569; }
.chart-empty .t2 { font-size: 11.5px; margin-top: 4px; max-width: 260px; }
.chart-canvas-wrap { position: relative; height: 220px; }
.chart-canvas-wrap.tall { height: 300px; }

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
}
.live-badge.is-live { background: var(--danger-bg); color: var(--danger); }
.live-badge.is-muted { background: #EEF1F7; color: #5c6685; }
.live-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.live-badge.is-live .dot { animation: pulse-ring-solid 1.4s ease-out infinite; }
@keyframes pulse-ring-solid {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.bandwidth-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.bandwidth-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; text-align: center;
}
.bandwidth-item .bw-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.bandwidth-item .bw-value { font-size: 19px; font-weight: 700; margin-top: 4px; color: var(--text); }
.bandwidth-item .bw-unit { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ============ TABLE ============ */
table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius-sm); overflow: hidden; }
th, td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #FAFBFE; font-weight: 700; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr { transition: background var(--ease); }
tbody tr:hover { background: #F9FBFE; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.actions-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; margin-bottom: 16px;
}
.search-bar svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.search-bar input {
  flex: 1; min-width: 0; border: none; background: transparent; font-family: inherit;
  font-size: 13.5px; outline: none; color: var(--text);
}
.search-clear {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--border);
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; text-decoration: none;
}
.search-clear:hover { background: var(--danger-bg); color: var(--danger); text-decoration: none; }
.search-bar .btn-sm { flex-shrink: 0; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-block;
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  transition: transform var(--ease), box-shadow var(--ease), opacity var(--ease);
  box-shadow: 0 4px 12px -4px rgba(18, 97, 201, 0.5);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -6px rgba(18, 97, 201, 0.55); text-decoration: none; opacity: 0.97; }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}
.btn-sm { padding: 5px 12px; font-size: 12px; box-shadow: none; }
.btn-danger { background: linear-gradient(120deg, #a01f1f, var(--danger)); box-shadow: 0 4px 12px -4px rgba(220, 38, 38, 0.5); }
.btn-secondary { background: var(--bg); color: #45526b; box-shadow: none; border: 1px solid var(--border); }
.btn-secondary:hover { background: #EBEFF6; color: var(--text); }

/* ============ BADGES ============ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
.badge-active { background: var(--success-bg); color: #12703a; }
.badge-isolir { background: var(--danger-bg); color: #a11f1f; }
.badge-nonaktif { background: #EEF1F7; color: #5c6685; }
.badge-unpaid { background: var(--warning-bg); color: #92600a; }
.badge-paid { background: var(--success-bg); color: #12703a; }
.badge-overdue { background: var(--danger-bg); color: #a11f1f; }
.badge-cancelled { background: #EEF1F7; color: #5c6685; }

/* ============ QUICK ACTIONS ============ */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.quick-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 17px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.quick-action:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; text-decoration: none; }
.quick-action .qa-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--info-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.quick-action .qa-icon svg { width: 18px; height: 18px; }
.quick-action .qa-label { font-size: 13px; font-weight: 700; color: var(--text); }
.quick-action.disabled { opacity: 0.55; cursor: not-allowed; }
.quick-action.disabled:hover { transform: none; box-shadow: none; border-color: var(--border); }
.quick-action .qa-soon { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: -8px; }

/* ============ ACTIVITY FEED (vertical timeline) ============ */
.activity-feed { display: flex; flex-direction: column; }
.activity-item { position: relative; padding: 0 0 20px 40px; }
.activity-item:last-child { padding-bottom: 0; }
.activity-item::before {
  content: "";
  position: absolute; left: 14px; top: 30px; bottom: 4px; width: 2px;
  background: var(--border);
}
.activity-item:last-child::before { display: none; }
.activity-dot {
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.activity-dot svg { width: 14px; height: 14px; }
.activity-body { min-width: 0; padding-top: 5px; }
.activity-text { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; }
.activity-text b { font-weight: 700; }
.activity-time { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.activity-empty { color: var(--muted); font-size: 13px; padding: 10px 0; }

/* ============ EMPTY STATE (table) ============ */
.table-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--muted); text-align: center;
}
.table-empty svg { width: 34px; height: 34px; opacity: 0.4; margin-bottom: 12px; }
.table-empty .te-text { font-size: 13.5px; font-weight: 600; color: #475569; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: #45526b; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  background: #FBFCFE;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 97, 201, 0.12);
}
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* ============ LOGIN ============ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 15%, rgba(18, 97, 201, 0.4), transparent 45%),
    radial-gradient(circle at 82% 85%, rgba(0, 174, 239, 0.32), transparent 45%),
    var(--navy-900);
}
.login-box {
  background: rgba(255, 255, 255, 0.99);
  border-radius: 20px;
  padding: 38px 34px;
  width: 340px;
  box-shadow: 0 26px 64px -18px rgba(0, 0, 0, 0.55);
}
.login-logo {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
  margin: 0 auto 22px;
  border-radius: 12px;
}
.login-box .btn { width: 100%; margin-top: 8px; padding: 11px; font-size: 14px; }

/* ============ FOOTER ============ */
.app-footer {
  text-align: center;
  padding: 26px 20px 34px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}
.app-footer strong { color: #475569; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d7deeb; border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ MOBILE DRAWER ============ */
.sidebar-overlay { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .chart-grid, .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--panel); color: var(--text); cursor: pointer; margin-right: 6px;
  }
  .menu-toggle svg { width: 18px; height: 18px; }
  .topbar { padding: 14px 18px; }
  .topbar-left h1 { font-size: 17px; }
  .topbar-date { display: none; }
  .content-inner { padding: 18px 16px 32px; }

  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; width: 252px;
    transform: translateX(-100%); transition: transform 220ms ease; z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(7,20,38,0.5); z-index: 90;
  }
  .sidebar-overlay.show { display: block; }

  .kpi-grid, .kpi-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .network-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; gap: 0; }
  .grid-side { grid-template-columns: 1fr; }
  th, td { padding: 9px 10px; font-size: 12.5px; }
  .btn-sm { padding: 4px 8px; font-size: 11px; }

  /* Tabel jadi kartu di HP (untuk tabel yang dikasih class table-cards) */
  .table-cards { border: none; background: transparent; }
  .table-cards tr:first-child { display: none; }
  .table-cards tr {
    display: block; background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 10px; padding: 4px 14px; box-shadow: var(--shadow-sm);
  }
  .table-cards td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; text-align: right;
  }
  .table-cards td:last-child { border-bottom: none; }
  .table-cards td::before {
    content: attr(data-label); font-weight: 700; color: var(--muted); font-size: 10.5px;
    text-transform: uppercase; letter-spacing: 0.03em; text-align: left; flex-shrink: 0;
  }
  /* Cell yang isinya banyak tombol (Aksi) ditumpuk vertikal, tombol wrap rapi di bawah label */
  .table-cards td:has(.actions-wrap) {
    flex-direction: column; align-items: flex-start; gap: 8px;
  }
  .table-cards td .actions-wrap { justify-content: flex-start; width: 100%; }
}
@media (max-width: 480px) {
  .kpi-grid, .kpi-grid.cols-3 { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 24px; }
  .kpi-hero .kpi-value { font-size: 19px; }
  .content-inner { padding: 14px 12px 28px; }
  .panel { padding: 16px; }
  .activity-item { padding-left: 34px; }
  .activity-dot { width: 26px; height: 26px; }
}

/* ============ PRINT ============ */
.print-only { display: none; }
@media print {
  body * { visibility: hidden; }
  #rekapPanel, #rekapPanel * { visibility: visible; }
  #rekapPanel {
    position: absolute; left: 0; top: 0; width: 100%;
    box-shadow: none; border: none; padding: 0; margin: 0;
  }
  .no-print { display: none !important; }
  .print-only { display: block; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .kpi-card { box-shadow: none; border: 1px solid #ddd; }
  .kpi-hero { background: #fff !important; color: #111 !important; border: 1px solid #ddd; }
  .kpi-hero .kpi-label, .kpi-hero .kpi-icon { color: #111 !important; background: transparent !important; }
  table { box-shadow: none; }
  th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
