/* ============================================================
   SISTEM INFORMASI CONSUMABLE - Main Stylesheet
   Self-hosted, tidak bergantung CDN external
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── Layout ── */
.page-wrapper { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 20px; }

/* ── Navbar ── */
.navbar {
  background: #0f2d6e;
  color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.navbar-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 60px;
  position: relative;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px;
}
.navbar-logo {
  width: 36px; height: 36px; background: #2563eb; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900;
}
.navbar-subtitle { font-size: 11px; color: #93c5fd; }
.navbar-menu { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 6px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 500;
  color: #bfdbfe; transition: background .15s, color .15s; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { background: #1d4ed8; color: #fff; }
.navbar-right { display: flex; align-items: center; gap: 10px; }
.user-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border-radius: 8px;
  padding: 5px 12px; cursor: pointer; position: relative;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #2563eb;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.user-name { font-size: 13px; font-weight: 500; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; color: #1e293b; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); border: 1px solid #e2e8f0;
  min-width: 200px; overflow: hidden; z-index: 200;
}
.dropdown-menu.show { display: block; }
.dropdown-header {
  padding: 12px 16px; border-bottom: 1px solid #f1f5f9;
  font-size: 12px; color: #64748b;
}
.dropdown-header strong { display: block; font-size: 13px; color: #1e293b; }
.dropdown-item {
  display: block; padding: 10px 16px; font-size: 13px;
  transition: background .12s; color: #334155;
}
.dropdown-item:hover { background: #f8fafc; }
.dropdown-item.danger { color: #dc2626; }
.navbar-toggle {
  display: none; background: none; border: none; color: #fff;
  cursor: pointer; padding: 6px;
}
.mobile-menu {
  display: none; background: #0f2d6e; padding: 8px 16px 12px;
}
.mobile-menu.open { display: block; }
.mobile-menu .nav-link { display: block; padding: 9px 12px; margin: 2px 0; }
.btn-login-nav {
  background: #2563eb; color: #fff; padding: 7px 16px; border-radius: 7px;
  font-size: 13px; font-weight: 600; transition: background .15s;
}
.btn-login-nav:hover { background: #1d4ed8; }

/* ── Cards ── */
.card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  border: 1px solid #e8edf4;
}
.card-body { padding: 22px; }
.card-title { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.card-subtitle { font-size: 12.5px; color: #64748b; }

/* ── Stat Cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  border-radius: 14px; padding: 20px 22px; color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.stat-card .stat-label { font-size: 12px; opacity: .85; font-weight: 500; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-card .stat-sub { font-size: 11px; opacity: .7; margin-top: 4px; }
.stat-blue { background: linear-gradient(135deg, #1d4ed8, #2563eb); }
.stat-amber { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stat-green { background: linear-gradient(135deg, #059669, #10b981); }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-dash { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.col-span-2 { grid-column: span 2; }

/* ── Page header ── */
.page-header { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 800; color: #0f172a; }
.page-desc { font-size: 13px; color: #64748b; margin-top: 3px; }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: all .15s; white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f1f5f9; color: #334155; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger { background: #fef2f2; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }
.btn-outline { background: #fff; border: 1.5px solid #cbd5e1; color: #334155; }
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn-w100 { width: 100%; justify-content: center; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%; border: 1.5px solid #cbd5e1; border-radius: 8px;
  padding: 9px 12px; font-size: 13.5px; background: #fff; color: #1e293b;
  transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-input:disabled, .form-select:disabled { background: #f8fafc; color: #94a3b8; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }
.input-sm { padding: 5px 9px; font-size: 12.5px; border-radius: 6px; width: 80px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: -22px; margin-top: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  background: #f8fafc; text-align: left; padding: 11px 14px;
  font-weight: 700; color: #475569; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; border-bottom: 2px solid #e2e8f0; white-space: nowrap;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tfoot td { background: #f8fafc; font-weight: 700; border-top: 2px solid #e2e8f0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'Courier New', monospace; font-size: 12px; }
.font-bold { font-weight: 700; }
.text-muted { color: #94a3b8; }
.text-sm { font-size: 12px; }
.text-danger { color: #dc2626; }
.text-success { color: #059669; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* ── Alerts/Flash ── */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 500; margin-bottom: 18px; display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ── Modals ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.55); z-index: 300;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2); max-height: 90vh; overflow-y: auto;
}
.modal-lg { max-width: 860px; }
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #94a3b8; line-height: 1; }
.modal-close:hover { color: #475569; }
.modal-body { padding: 22px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f1f5f9; display: flex; gap: 10px; justify-content: flex-end; }

/* ── Filter bar ── */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.filter-bar .form-group { margin-bottom: 0; }

/* ── Flash alerts ── */
.flash-wrap { margin-bottom: 18px; }

/* ── Section divider ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.section-title { font-size: 15px; font-weight: 700; color: #1e293b; }

/* ── Pill tabs ── */
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-tab {
  padding: 6px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: none; cursor: pointer; transition: all .15s;
  background: #f1f5f9; color: #475569;
}
.pill-tab.active, .pill-tab:hover { background: #2563eb; color: #fff; }

/* ── Estimasi warning ── */
.estimasi-box { border-radius: 8px; padding: 8px 12px; font-size: 12.5px; margin: 8px 0; }
.estimasi-ok { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.estimasi-warn { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* ── Login page ── */
.login-page {
  min-height: 100vh; background: linear-gradient(135deg, #0f1f5c 0%, #1d4ed8 60%, #2563eb 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box {
  background: #fff; border-radius: 20px; padding: 40px 36px;
  width: 100%; max-width: 420px; box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.login-logo {
  width: 52px; height: 52px; background: #2563eb; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 22px; color: #fff; margin: 0 auto 16px;
}
.login-title { text-align: center; font-size: 20px; font-weight: 800; color: #0f172a; }
.login-sub { text-align: center; font-size: 13px; color: #64748b; margin-top: 4px; margin-bottom: 28px; }

/* ── Footer ── */
.site-footer {
  background: #fff; border-top: 1px solid #e2e8f0;
  text-align: center; padding: 16px; font-size: 12px; color: #94a3b8; margin-top: 40px;
}

/* ── Utilities ── */
.mt-1 { margin-top: 4px; }   .mt-2 { margin-top: 8px; }   .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }  .mt-5 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }.mb-2 { margin-bottom: 8px; }.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }.mb-5 { margin-bottom: 24px; }
.me-1 { margin-right: 4px; } .me-2 { margin-right: 8px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.d-flex { display: flex; } .align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; } .justify-between { justify-content: space-between; }
.w-100 { width: 100%; } .h-100 { height: 100%; }
.p-4 { padding: 16px; } .p-5 { padding: 20px; } .p-6 { padding: 24px; }
.rounded { border-radius: 8px; } .rounded-lg { border-radius: 12px; }
.hidden { display: none !important; }
.overflow-x-auto { overflow-x: auto; }
.whitespace-nowrap { white-space: nowrap; }
.max-w-md { max-width: 460px; }

/* ── Card hover polish ── */
.card { transition: box-shadow .18s, transform .18s; }
.card.card-hover:hover { box-shadow: 0 8px 24px rgba(15,23,42,.09); transform: translateY(-1px); }

/* ── Icon circle (dipakai di stat card, feature card, empty state) ── */
.icon-circle {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-circle svg { width: 22px; height: 22px; }
.icon-circle-sm { width: 34px; height: 34px; border-radius: 9px; }
.icon-circle-sm svg { width: 17px; height: 17px; }

/* ── Stat card v2 (dengan icon) ── */
.stat-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.stat-card .icon-circle { background: rgba(255,255,255,.18); color: #fff; }

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px; text-align: center; color: #94a3b8;
}
.empty-state .icon-circle {
  background: #f1f5f9; color: #94a3b8; width: 56px; height: 56px; border-radius: 16px; margin-bottom: 14px;
}
.empty-state .icon-circle svg { width: 26px; height: 26px; }
.empty-state-title { font-size: 14px; font-weight: 600; color: #475569; margin-bottom: 2px; }
.empty-state-sub { font-size: 12.5px; color: #94a3b8; }

/* ── Feature card (Report & Permohonan grid) ── */
.feature-card {
  background: #fff; border-radius: 16px; border: 1px solid #e8edf4;
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .18s, transform .18s;
}
.feature-card:hover { box-shadow: 0 10px 28px rgba(15,23,42,.1); transform: translateY(-2px); }
.feature-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feature-card-title { font-size: 15px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 10px; }
.feature-card-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.feature-card-empty { font-size: 12.5px; color: #94a3b8; padding: 18px 0; text-align: center; }

.doc-row {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid #f1f5f9; border-radius: 10px; padding: 10px 12px;
  transition: background .15s, border-color .15s;
}
.doc-row:hover { background: #f8fafc; border-color: #e2e8f0; }
.doc-row-title { font-size: 13px; font-weight: 600; color: #1e293b; }
.doc-row-sub { font-size: 11.5px; color: #94a3b8; margin-top: 1px; }
.doc-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Status legend cards (Request) ── */
.status-legend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.status-legend-card {
  background: #fff; border-radius: 14px; padding: 16px 18px;
  border-left: 4px solid transparent; box-shadow: 0 1px 4px rgba(0,0,0,.05);
  display: flex; gap: 12px; align-items: flex-start;
}
.status-legend-card.legend-waiting { border-left-color: #f59e0b; }
.status-legend-card.legend-estimated { border-left-color: #2563eb; }
.status-legend-card.legend-close { border-left-color: #10b981; }
.status-legend-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.legend-waiting .status-legend-icon { background: #fef3c7; color: #d97706; }
.legend-estimated .status-legend-icon { background: #dbeafe; color: #2563eb; }
.legend-close .status-legend-icon { background: #d1fae5; color: #059669; }
.status-legend-text { font-size: 12.5px; color: #64748b; margin-top: 2px; line-height: 1.5; }

/* ── Section icon badge (dipakai di judul halaman) ── */
.page-icon {
  width: 46px; height: 46px; border-radius: 13px; background: #2563eb;
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.page-icon svg { width: 22px; height: 22px; }
.page-title-row { display: flex; align-items: center; gap: 14px; }

/* ── Alert with icon ── */
.alert { align-items: center; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Divisi grouped table header ── */
.data-table thead tr:first-child th { background: #eff6ff; }
.data-table thead tr:last-child th { background: #f8fafc; }

/* ── Sticky table first column (opsional utk tabel lebar) ── */
.table-wrap { border-radius: 0 0 14px 14px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .navbar-menu { display: none; }
  .navbar-toggle { display: block; }
  .grid-dash { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr 1fr; }
  .status-legend-grid { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .page-wrapper { padding: 16px 12px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .card-body { padding: 16px; }
  .login-box { padding: 28px 20px; }
  .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .modal { border-radius: 12px; }
  .stat-value { font-size: 22px !important; }
  .page-icon { width: 38px; height: 38px; border-radius: 10px; }
  .page-icon svg { width: 18px; height: 18px; }
  .page-title { font-size: 19px; }
}
