/* ═══════════════════════════════════════════════════════════════════════════
   Bang Montir — Stylesheet utama
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --navy-900: #12172b;
  --navy-800: #171d35;
  --navy-700: #1c2340;
  --navy-600: #232b4d;
  --gold: #f2b53c;
  --gold-dark: #d99a1f;
  --blue: #3b6fe0;
  --blue-dark: #2952b3;
  --green: #1fa971;
  --red: #e6485d;
  --cyan: #17a2b8;
  --purple: #8a5cf5;
  --gray: #6b7280;
  --bg: #f3f4f8;
  --card-bg: #ffffff;
  --text: #1f2430;
  --text-muted: #6b7280;
  --border: #e6e8f0;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
}

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

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

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-700));
  color: #cfd3e6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .icon {
  width: 36px; height: 36px;
  background: var(--gold);
  color: var(--navy-900);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.sidebar-brand .brand-text { min-width: 0; }
.sidebar-brand .brand-text b { display: block; font-size: 15px; color: #fff; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand .brand-text span { font-size: 11px; color: #9aa1c2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--purple); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.sidebar-user .u-name { font-size: 13.5px; color: #fff; font-weight: 600; }
.sidebar-user .u-role { font-size: 11px; color: #9aa1c2; }

.sidebar-nav { padding: 10px 0 20px; flex: 1; }
.nav-section-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #6f77a0; padding: 14px 18px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 18px; margin: 2px 10px; border-radius: 8px;
  color: #c3c8e0; font-size: 13.6px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item .nav-left { display: flex; align-items: center; gap: 10px; }
.nav-item i { width: 18px; text-align: center; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--gold); color: var(--navy-900); font-weight: 700; }
.nav-item.active i { opacity: 1; }
.nav-badge {
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 20px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.nav-item.active .nav-badge { background: var(--navy-900); color: #fff; }

.sidebar-footer {
  padding: 12px 18px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: #6f77a0;
}

/* ---------- Main content ---------- */
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg); padding: 14px 26px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 17px; margin: 0; }
.topbar .breadcrumb { font-size: 11.5px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-icon {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
  position: relative;
}
.topbar-icon .dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }

.page-body { padding: 24px 26px; flex: 1; }

/* ---------- Banner welcome ---------- */
.welcome-banner {
  background: linear-gradient(120deg, var(--navy-800), var(--navy-600));
  color: #fff; border-radius: var(--radius); padding: 22px 26px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  margin-bottom: 20px;
}
.welcome-banner h2 { margin: 0 0 4px; font-size: 19px; }
.welcome-banner p { margin: 0; color: #b9bedb; font-size: 13px; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; border-radius: 8px; padding: 9px 16px; font-size: 13.3px; font-weight: 600;
  cursor: pointer; transition: filter .15s, transform .05s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-gold { background: var(--gold); color: var(--navy-900); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-secondary { background: #eef0f6; color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 6px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Cards / Stats ---------- */
.card {
  background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 20px; margin-bottom: 20px;
}
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  border-radius: var(--radius); padding: 16px 18px; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.stat-card .stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { font-size: 12px; opacity: .92; margin-bottom: 4px; }
.stat-card .stat-sub { font-size: 10.5px; opacity: .8; margin-top: 3px; }
.stat-card .stat-icon { font-size: 22px; opacity: .85; }
.stat-blue { background: linear-gradient(135deg, #3b6fe0, #2952b3); }
.stat-gold { background: linear-gradient(135deg, #f7c15b, #d99a1f); }
.stat-cyan { background: linear-gradient(135deg, #22c1dc, #148aa3); }
.stat-green { background: linear-gradient(135deg, #27bd82, #178a5c); }
.stat-purple { background: linear-gradient(135deg, #9a6bf7, #6f3fd6); }
.stat-red { background: linear-gradient(135deg, #f0596d, #c9354a); }
.stat-gray { background: linear-gradient(135deg, #7c8595, #545c6b); }
.stat-teal { background: linear-gradient(135deg, #2bb3a3, #1c8579); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.3px; }
table.table th {
  text-align: left; padding: 11px 12px; background: #f7f8fc; color: var(--text-muted);
  font-weight: 700; font-size: 11.8px; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tr:hover td { background: #fafbfe; }
.table-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.3px; font-weight: 700;
}
.badge-success { background: #e2f6ec; color: #178a5c; }
.badge-warning { background: #fef3e0; color: #b3790f; }
.badge-danger { background: #fde4e7; color: #c9354a; }
.badge-info { background: #e2f0fd; color: #2563b8; }
.badge-secondary { background: #eceef4; color: #565d70; }
.badge-purple { background: #f0e9fe; color: #6f3fd6; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
label.form-label { display: block; font-size: 12.8px; font-weight: 700; margin-bottom: 6px; color: #444b5e; }
label.form-label .req { color: var(--red); }
.form-control, select.form-control, textarea.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; background: #fff; color: var(--text); font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,111,224,0.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
.input-icon-group { position: relative; }
.input-icon-group i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon-group .form-control { padding-left: 36px; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.search-select { position: relative; }
.search-select-menu {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.14);
  z-index: 50;
}
.search-select-menu.open { display: block; }
.search-select-group-label {
  padding: 8px 12px 4px; font-size: 10.8px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.search-select-option { padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--text); }
.search-select-option:hover, .search-select-option.active { background: #f7f8fc; }
.search-select-empty { padding: 12px; font-size: 12px; color: var(--text-muted); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .form-group { margin-bottom: 0; min-width: 180px; flex: 1; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.3px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: #e2f6ec; color: #178a5c; }
.alert-danger { background: #fde4e7; color: #c9354a; }
.alert-warning { background: #fef3e0; color: #b3790f; }

/* ---------- Progress ---------- */
.progress-bar-track { width: 100%; height: 8px; background: #eceef4; border-radius: 20px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 20px; }

/* ---------- Misc ---------- */
.text-muted { color: var(--text-muted); }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.mb-0 { margin-bottom: 0; }
.action-icons { display: flex; gap: 6px; }
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state .icon-circle {
  width: 70px; height: 70px; border-radius: 50%; background: #e2f6ec; color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto 16px;
}

/* ---------- Login page ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at top left, #1c2340, #0c1024 70%);
  padding: 30px;
}
.auth-card { background: #171d35; border-radius: 18px; padding: 36px 34px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo .icon { width: 56px; height: 56px; border-radius: 16px; background: var(--gold); color: var(--navy-900); display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 10px; }
.auth-logo h1 { color: #fff; font-size: 18px; margin: 0; letter-spacing: 1px; }
.auth-logo p { color: #9aa1c2; font-size: 12px; margin: 2px 0 6px; }
.auth-logo .ver-badge { display: inline-block; background: rgba(242,181,60,.15); color: var(--gold); font-size: 10.5px; padding: 2px 10px; border-radius: 20px; font-weight: 700; }
.auth-card label.form-label { color: #c3c8e0; }
.auth-card .form-control { background: #232b4d; border: 1px solid #2d3560; color: #fff; }
.auth-card .form-control::placeholder { color: #6f77a0; }
.auth-card .input-icon-group i { color: #6f77a0; }
.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: #c3c8e0; margin-bottom: 18px; }
.auth-row a { color: var(--gold); font-weight: 600; }
.btn-auth { width: 100%; background: linear-gradient(90deg, var(--blue), #5b3fd6); color: #fff; padding: 12px; border-radius: 9px; font-size: 14px; justify-content: center; }
.demo-box { margin-top: 22px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 16px; }
.demo-box .demo-title { font-size: 11px; color: #6f77a0; text-align: center; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; }
.demo-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-account-btn {
  background: #232b4d; border: 1px solid #2d3560; border-radius: 8px; padding: 8px; text-align: center; cursor: pointer;
  color: #fff; font-size: 12px;
}
.demo-account-btn b { display: block; font-size: 12.5px; }
.demo-account-btn span { color: #6f77a0; font-size: 10.5px; }
.demo-account-btn:hover { border-color: var(--gold); }

/* ---------- Topbar search & notification dropdown ---------- */
.topbar-search {
  display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 20px;
  padding: 7px 14px; width: 260px; color: var(--text-muted);
}
.topbar-search input { border: none; background: none; outline: none; font-size: 13px; width: 100%; color: var(--text); }
.dropdown-wrap { position: relative; }
.dropdown-panel {
  display: none; position: absolute; right: 0; top: 44px; width: 320px; max-height: 420px; overflow-y: auto;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14);
  z-index: 200;
}
.dropdown-panel.open { display: block; }
.dropdown-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.link-btn { background: none; border: none; color: var(--blue); font-size: 11.5px; cursor: pointer; font-weight: 600; padding: 0; }
.dropdown-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.dropdown-item { display: block; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.dropdown-item:hover { background: #f7f8fc; }
.dropdown-item.unread { background: #eef3ff; }
.dropdown-item-title { font-size: 13px; font-weight: 700; }
.dropdown-item-msg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dropdown-item-time { font-size: 10.5px; color: #9aa1c2; margin-top: 4px; }
.dropdown-footer { display: block; text-align: center; padding: 10px; font-size: 12.5px; color: var(--blue); font-weight: 600; }

.search-result-group { margin-bottom: 20px; }
.search-result-group h4 { font-size: 13px; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }

/* ---------- Pagination ---------- */
.pagination-nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pagination { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.pagination li a {
  display: flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: 7px; border: 1px solid var(--border); font-size: 12.8px; color: var(--text); background: #fff;
}
.pagination li a:hover { background: #f7f8fc; }
.pagination li a.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.pagination li a.disabled { opacity: .4; pointer-events: none; }
.pagination li .dots { padding: 0 6px; color: var(--text-muted); }
.pagination-info { font-size: 12px; color: var(--text-muted); }

/* Print */
@media print {
  .no-print { display: none !important; }
  .page-body { padding: 0; }
  .sidebar, .topbar { display: none !important; }
}

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 100; transition: left .2s; }
  .sidebar.open { left: 0; }
  .app-shell { display: block; }
}

/* ---------- Theme toggle switch (sidebar footer) ---------- */
.theme-toggle {
  display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); border-radius: 20px;
  padding: 4px; cursor: pointer; border: none;
}
.theme-toggle .seg {
  width: 26px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 16px;
  color: #9aa1c2; font-size: 12px; transition: background .15s, color .15s;
}
.theme-toggle .seg.active { background: var(--gold); color: var(--navy-900); }

/* ---------- Dark theme ---------- */
html[data-theme="dark"] {
  --bg: #0f1324;
  --card-bg: #161b30;
  --text: #e7e9f5;
  --text-muted: #9aa1c2;
  --border: #262c48;
}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] table.table th { background: #1c2340; color: #9aa1c2; }
html[data-theme="dark"] table.table tr:hover td { background: #1a1f38; }
html[data-theme="dark"] .btn-secondary { background: #232a48; color: var(--text); }
html[data-theme="dark"] .btn-outline { border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] select.form-control, html[data-theme="dark"] textarea.form-control {
  background: #1c2340; border-color: var(--border); color: var(--text);
}
html[data-theme="dark"] .dropdown-panel, html[data-theme="dark"] .dropdown-item:hover { background: var(--card-bg); }
html[data-theme="dark"] .search-select-menu { background: #1c2340; }
html[data-theme="dark"] .search-select-option:hover, html[data-theme="dark"] .search-select-option.active { background: #232a48; }
html[data-theme="dark"] .dropdown-item { border-color: var(--border); }
html[data-theme="dark"] .dropdown-item.unread { background: #1c2848; }
html[data-theme="dark"] .dropdown-header { border-color: var(--border); }
html[data-theme="dark"] .topbar-search { background: #1c2340; color: var(--text-muted); }
html[data-theme="dark"] .badge-secondary { background: #232a48; color: #c3c8e0; }
html[data-theme="dark"] .empty-state, html[data-theme="dark"] .table-empty { color: var(--text-muted); }
html[data-theme="dark"] .pagination li a { background: var(--card-bg); border-color: var(--border); color: var(--text); }
