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

:root { --accent: #6366f1; }

body {
  font-family: 'Inter', sans-serif;
  background: #ffffff;
  color: #111111;
  height: 100vh;
  overflow: hidden;
}

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  height: 100vh;
  padding: 12px 12px 12px 12px;
  gap: 12px;
  opacity: 1;  /* langsung visible — tidak perlu tunggu auth check */
}
.layout.loaded { opacity: 1; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: #111111;
  height: 100%;
  flex-shrink: 0;
  border-radius: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  overflow: visible;
  font-family: 'Arimo', Arial, system-ui, sans-serif;
}
.sidebar.collapsed { width: 56px; }

/* Clip hanya bagian dalam sidebar (bukan tombol toggle) */
.sidebar-logo,
.sidebar-nav,
.sidebar-footer { overflow: hidden; }

/* Hapus focus outline di seluruh sidebar */
.sidebar *, .sidebar *:focus, .sidebar *:focus-visible { outline: none !important; }


html.pre-collapsed .sidebar { width: 56px; transition: none !important; }
html.pre-collapsed .sidebar .sidebar-logo,
html.pre-collapsed .sidebar .nav-label,
html.pre-collapsed .sidebar .nav-section { opacity: 0; pointer-events: none; }
html.pre-collapsed .sidebar .nav-item span { opacity: 0; max-width: 0; overflow: hidden; }
html.pre-collapsed .sidebar .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
html.pre-collapsed .sidebar .sidebar-nav { padding: 12px 0 0; }
html.pre-collapsed .arrow-collapse { display: block !important; }
html.pre-collapsed .arrow-expand { display: none !important; }

.sidebar.collapsed .sidebar-logo { opacity: 0; pointer-events: none; }
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section { opacity: 0; max-width: 0; overflow: hidden; white-space: nowrap; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; gap: 0; width: 100%; }
.sidebar.collapsed .sidebar-nav { padding: 12px 0 0; }

/* Toggle button */
.toggle-btn {
  position: absolute;
  right: -18px;
  top: 144px;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #111111;
  border: 2px solid #c0c0c0;
  cursor: pointer;
  z-index: 20;
  display: flex; align-items: center; justify-content: center;
  color: #c0c0c0;
  transition: border-color 0.2s;
}
.toggle-btn:hover { border-color: #888888; }
.arrow-collapse { display: none; }
.arrow-expand { display: block; }
.sidebar.collapsed .arrow-collapse { display: block; }
.sidebar.collapsed .arrow-expand { display: none; }

/* Logo */
.sidebar-logo {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 0;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.sidebar-logo img { width: 100%; max-width: 200px; height: auto; object-fit: contain; border-radius: 0; }
.sidebar-logo-text { font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; }
.sidebar-logo-sub { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 1px; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px 0;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25);
  padding: 14px 6px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.5);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
  outline: none;
  margin-bottom: 2px;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.nav-item.active { background: #ffffff; color: #111111; }
.nav-item:focus, .nav-item:focus-visible { outline: none; }

/* Active item saat collapsed - jangan kelebaran ke pinggir */
.sidebar.collapsed .nav-item.active,
html.pre-collapsed .nav-item.active {
  width: calc(100% - 16px);
  margin: 2px 8px;
  padding: 11px 0;
  justify-content: center;
  align-self: unset;
}



.nav-item svg { flex-shrink: 0; }
.nav-item span { transition: opacity 0.2s, max-width 0.3s; max-width: 180px; overflow: hidden; }

/* Nav Group (collapsible) */
.nav-group { display: flex; flex-direction: column; }
.nav-item-parent { position: relative; }
.nav-chevron { margin-left: auto; flex-shrink: 0; transition: transform 0.25s ease; color: rgba(255,255,255,0.35); }
.nav-group.open .nav-chevron { transform: rotate(180deg); }

/* Submenu */
.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 0;
  padding-left: 8px;
  margin-left: 22px;
  margin-top: 4px;
  border-left: 1.5px solid rgba(255,255,255,0.12);
}
.nav-group.open .nav-submenu {
  max-height: 200px;
  opacity: 1;
}
.sidebar.collapsed .nav-submenu,
html.pre-collapsed .nav-submenu { max-height: 0 !important; opacity: 0 !important; }
.sidebar.collapsed .nav-chevron,
html.pre-collapsed .nav-chevron { display: none; }

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 12px;
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  border-radius: 8px;
  color: rgba(255,255,255,0.45);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s ease;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.nav-subitem:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
.nav-subitem.active { background: #ffffff; color: #111111; }
.nav-subitem.active .subitem-icon { color: var(--accent); }
.subitem-icon { flex-shrink: 0; width: 20px; height: 20px; color: rgba(255,255,255,0.3); transition: color 0.18s ease; }

/* Sidebar footer */
.sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.07); }
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.8); white-space: nowrap; overflow: hidden; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.35); }

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  min-width: 0;
  min-height: 0;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  min-height: 60px;
}
.topbar-left { display: flex; flex-direction: column; gap: 1px; }
.page-title { font-size: 17px; font-weight: 700; color: #111; letter-spacing: -0.3px; }
.page-subtitle { font-size: 12px; color: #999; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Notif bell */
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #111;
  transition: all 0.15s;
}
.notif-btn:hover { background: #f5f5f5; border-color: #ccc; }
.notif-badge {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
  display: none;
}
.notif-badge.show { display: block; }

/* Logout btn */
.logout-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #eee;
  background: #fff;
  color: #666;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.logout-btn:hover { background: #fef2f2; color: #ef4444; border-color: #fecaca; }

/* ===== PAGE BODY ===== */
.page-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.18s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-info { min-width: 0; }
.stat-label { font-size: 12px; color: #999; font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 800; color: #111; letter-spacing: -0.5px; line-height: 1; }
.stat-sub { font-size: 11px; color: #bbb; margin-top: 4px; }

/* ===== GRID LAYOUT ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.col-span-2 { grid-column: span 2; }

/* ===== CARDS ===== */
.card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f5f5f5;
}
.card-title { font-size: 14px; font-weight: 700; color: #111; }
.card-body { padding: 20px; }
.card-body-scroll { padding: 0; max-height: 320px; overflow-y: auto; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: #f8f8f8;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f7f7f7;
  color: #333;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafafa; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #7c3aed; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-primary { background: #111; color: #fff; }
.btn-primary:hover { background: #222; }
.btn-secondary { background: #f5f5f5; color: #333; }
.btn-secondary:hover { background: #eee; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-outline { background: transparent; border: 1px solid #e5e5e5; color: #555; }
.btn-outline:hover { background: #f5f5f5; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: #444; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 13.5px;
  color: #111;
  background: #fff;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: #aaa; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== SEARCH BAR ===== */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 280px;
}
.search-bar input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.search-bar input:focus { border-color: #bbb; }
.search-bar svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #bbb; }

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }

/* ===== FILTER TABS ===== */
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  color: #888;
  background: #f5f5f5;
  font-family: inherit;
}
.filter-tab:hover { color: #333; }
.filter-tab.active { background: #111; color: #fff; border-color: #111; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid #f5f5f5;
  font-size: 12.5px;
  color: #888;
}
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #555;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: all 0.15s;
}
.page-btn:hover { background: #f5f5f5; }
.page-btn.active { background: #111; color: #fff; border-color: #111; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: 14px;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-lg { width: 680px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.modal-head-title { font-size: 15px; font-weight: 700; color: #111; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  background: #f5f5f5;
  color: #888;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: #fee2e2; color: #ef4444; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-radius: 10px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  pointer-events: all;
  animation: toastIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 240px;
  max-width: 360px;
}
.toast.toast-out { animation: toastOut 0.2s ease forwards; }
.toast-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.toast.success .toast-icon { background: rgba(16,185,129,0.2); color: #10b981; }
.toast.error   .toast-icon { background: rgba(239,68,68,0.2);  color: #ef4444; }
.toast.warning .toast-icon { background: rgba(245,158,11,0.2); color: #f59e0b; }
.toast.info    .toast-icon { background: rgba(59,130,246,0.2); color: #3b82f6; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(-10px) scale(0.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px) scale(0.95); } }

/* ===== NOTIF PANEL ===== */
.notif-panel {
  position: absolute;
  top: 52px; right: 0;
  width: 320px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  z-index: 500;
  display: none;
  overflow: hidden;
}
.notif-panel.open { display: block; animation: fadeIn 0.18s ease; }
.notif-panel-head { padding: 14px 16px; border-bottom: 1px solid #f5f5f5; font-size: 13px; font-weight: 700; color: #111; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f7f7f7;
  transition: background 0.15s;
  cursor: default;
}
.notif-item:hover { background: #fafafa; }
.notif-item:last-child { border-bottom: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; flex-shrink: 0; margin-top: 5px; }
.notif-text { font-size: 12.5px; color: #333; line-height: 1.4; }
.notif-time { font-size: 11px; color: #aaa; margin-top: 2px; }

/* ===== CHART CONTAINER ===== */
.chart-container { position: relative; height: 240px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px;
  color: #bbb;
  text-align: center;
}
.empty-state svg { margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 13px; }

/* ===== LOADING ===== */
.loading-spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  color: #bbb;
}
.spinner {
  width: 24px; height: 24px;
  border: 2.5px solid #eee;
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== STOK INDICATOR ===== */
.stok-bar { display: flex; align-items: center; gap: 8px; }
.stok-bar-bg { flex: 1; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.stok-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }

/* ===== FLASH SALE CARD ===== */
.fs-card {
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow 0.15s;
}
.fs-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.fs-status-active { color: #10b981; }
.fs-status-inactive { color: #aaa; }

/* ===== PEAK HOUR HEATMAP ===== */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  margin-top: 8px;
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: #f0f0f0;
  transition: background 0.2s;
  cursor: default;
}

/* ===== TOPBAR WRAPPER (relative for notif) ===== */
.topbar-wrap { position: relative; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c0c0c0; }

/* ===== AVATAR BUTTON ===== */
.avatar-wrap { position: relative; }
.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  color: #111;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.avatar-btn:hover { background: #f5f5f5; border-color: #ccc; }

.avatar-popup {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 500;
  overflow: hidden;
}
.avatar-popup.open { display: block; animation: fadeIn 0.15s ease; }

.avatar-popup-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 12px;
}
.avatar-popup-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
  color: #666;
  flex-shrink: 0;
}
.avatar-popup-name { font-size: 13px; font-weight: 700; color: #111; }
.avatar-popup-role { font-size: 11px; color: #aaa; margin-top: 1px; }
.avatar-popup-divider { height: 1px; background: #f5f5f5; }
.avatar-popup-logout {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: #ef4444;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  text-align: left;
}
.avatar-popup-logout:hover { background: #fef2f2; }

.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  overflow: auto;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 380px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-logo img { width: 40px; height: 40px; border-radius: 10px; }
.login-title { font-size: 20px; font-weight: 800; color: #111; }
.login-sub { font-size: 12.5px; color: #999; margin-top: 2px; }
.login-btn {
  width: 100%;
  padding: 11px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.login-btn:hover { background: #222; }
.login-error { color: #ef4444; font-size: 12.5px; margin-top: 8px; display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .layout { padding: 8px; gap: 0; }
  .sidebar {
    position: absolute;
    left: 8px; top: 8px; bottom: 8px;
    z-index: 100;
    transform: translateX(-110%);
    transition: transform 0.3s ease, width 0.3s ease;
    width: 240px !important;
    border-radius: 12px;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main { border-radius: 12px; }
  .mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
  }
  .mobile-overlay.active { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* -- Kemitraan / Supplier shared styles -- */
.stat-sub       { font-size:8px;color:#cbd5e1;margin-top:1px; }
.stat-value     { font-size:28px;font-weight:800;color:#0f172a;letter-spacing:-.5px; }
.stat-footer    { display:flex;align-items:center;justify-content:space-between;padding-top:8px;border-top:1px solid #f1f5f9;margin-top:auto; }
.stat-footer-label { font-size:9px;color:#64748b;font-weight:500; }
.stat-footer-value { font-size:9px;font-weight:700; }

.table-card     { background:#fff;border-radius:10px;border:1px solid #e8edf2;box-shadow:0 2px 12px rgba(0,0,0,0.06);overflow:hidden; }
.table-header   { padding:16px 20px;border-bottom:1px solid #f1f5f9;display:flex;align-items:center;justify-content:space-between; }
.table-title    { font-size:14px;font-weight:700;color:#0f172a; }
.table-sub      { font-size:11px;color:#94a3b8;margin-top:2px; }
