/* ==============================================
   RESTOK Design System
   Matched to: dashboard-pro-eight.vercel.app
   ============================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap");

:root {
  --color-white:      #ffffff;
  --color-gray-50:    #f9fafb;
  --color-gray-100:   #f3f4f6;
  --color-gray-200:   #e5e7eb;
  --color-gray-300:   #d1d5db;
  --color-gray-400:   #9ca3af;
  --color-gray-500:   #6b7280;
  --color-gray-600:   #4b5563;
  --color-gray-700:   #374151;
  --color-gray-800:   #1f2937;
  --color-gray-900:   #111827;
  --color-blue-600:   #193cb8;
  --color-blue-50:    #eff6ff;
  --color-green-500:  #22c55e;
  --color-green-50:   #f0fdf4;
  --color-red-500:    #ef4444;
  --color-red-50:     #fef2f2;
  --color-yellow-500: #eab308;
  --color-yellow-50:  #fefce8;
  --color-indigo-500: #6366f1;
  --color-indigo-50:  #eef2ff;

  --sidebar-width:  256px;
  --navbar-height:  56px;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;

  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);

  --font:      "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* ── RESTOK Design Token Aliases (dari DESIGN_RESTOK.md) ── */
  --restok-surface:      #ffffff;
  --restok-surface-dim:  #f9fafb;
  --restok-surface-low:  #f3f4f6;
  --restok-surface-mid:  #e5e7eb;
  --restok-surface-high: #e9ecef;

  --restok-text:       #111827;
  --restok-text-muted: #4b5563;
  --restok-text-soft:  #6b7280;

  --restok-border:        #d1d5dc;
  --restok-border-strong: #9ca3af;

  --restok-primary:        #1447e6;
  --restok-primary-hover:  #1039c8;
  --restok-primary-active: #0d2fa8;
  --restok-primary-soft:   #dbeafe;
  --restok-primary-text:   #193cb8;

  --restok-success:      #007a55;
  --restok-success-soft: #d0fae5;
  --restok-success-text: #006045;

  --restok-warning:      #b45309;
  --restok-warning-soft: #fef3c7;
  --restok-warning-text: #92400e;

  --restok-danger:      #dc2626;
  --restok-danger-soft: #fee2e2;
  --restok-danger-text: #991b1b;

  --restok-purple:      #a855f7;
  --restok-purple-soft: #f3e8ff;
  --restok-purple-text: #7e22ce;

  --restok-radius:      8px;
  --restok-radius-md:   12px;
  --restok-radius-lg:   16px;
  --restok-radius-pill: 9999px;

  --restok-shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --restok-shadow-md: 0 3px 8px rgba(0,0,0,0.15);
  --restok-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

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

html { font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }

body {
  background: var(--color-gray-50);
  color: var(--color-gray-900);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
img, svg { display: block; }

/* LAYOUT */
.app-wrapper { display: flex; min-height: 100vh; }

.app-main {
  flex: 1;
  min-width: 0;
  padding: 24px;
  padding-left: calc(var(--sidebar-width) + 24px);
  padding-bottom: 120px; /* ruang untuk quick chat widget floating */
  margin-top: var(--navbar-height);
  background: var(--color-gray-50);
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: var(--navbar-height); left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  background: var(--color-white);
  border-right: 1px solid var(--color-gray-200);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1035;
  transition: transform .2s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-200) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--color-gray-200); border-radius: 4px; }

.sidebar-brand {
  display: none;
}

/* Tampilkan brand di navbar kiri */
.navbar-brand-link { display: flex; }

.sidebar-brand-icon {
  width: 28px; height: 28px;
  background: var(--color-blue-600);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.sidebar-brand-name { font-size: 14px; font-weight: 600; color: var(--color-gray-900); }

.sidebar-nav { flex: 1; padding: 8px; }
.sidebar-group { margin-bottom: 0; }

.sidebar-group-label {
  padding: 12px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-gray-400);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  color: var(--color-gray-600);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background .12s, color .12s;
  position: relative;
  line-height: 1.25;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--color-gray-100); color: var(--color-gray-900); }
.sidebar-link.active { background: var(--color-gray-50); color: var(--color-blue-600); }
.sidebar-link.active .nav-icon { color: var(--color-blue-600); }

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--color-gray-500); }
.sidebar-link:hover .nav-icon { color: var(--color-gray-700); }

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--color-gray-200);
  flex-shrink: 0;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  width: 100%;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--color-gray-500);
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.sidebar-collapse-btn:hover { background: var(--color-gray-100); color: var(--color-gray-900); }
.sidebar-collapse-btn svg { width: 16px; height: 16px; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1025;
}

/* NAVBAR */
.app-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 24px;
  gap: 0;
  z-index: 1040;
}

/* ── Navbar Search Trigger Button ─────────────────────────────────────────── */
.navbar-search {
  flex: 0 1 200px;
  min-width: 120px;
  position: relative;
  display: flex;
  align-items: center;
}
.navbar-search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--color-gray-400);
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.navbar-search-trigger:hover {
  border-color: var(--color-gray-300);
  background: var(--color-white);
  color: var(--color-gray-500);
}
.navbar-search-trigger-icon { display: inline-flex; align-items: center; color: var(--color-gray-400); flex-shrink: 0; }
.navbar-search-trigger-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; }
.navbar-search-kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--color-gray-400);
  font-size: 10px;
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar-search-kbd kbd {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-gray-400);
  line-height: 1.4;
  box-shadow: none;
}

/* ── Global Search Overlay ────────────────────────────────────────────────── */
.gs-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.45);
  backdrop-filter: blur(2px);
  z-index: 2000;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.gs-backdrop.gs-open {
  opacity: 1;
  pointer-events: auto;
}
.gs-modal {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(600px, calc(100vw - 32px));
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
  border: 1px solid var(--color-gray-200);
  z-index: 2001;
  opacity: 0;
  transition: opacity .15s, transform .15s;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}
.gs-modal.gs-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Search input area */
.gs-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-gray-100);
  flex-shrink: 0;
}
.gs-input-wrap svg { flex-shrink: 0; color: var(--color-gray-400); }
.gs-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: var(--font);
  color: var(--color-gray-900);
  background: transparent;
  min-width: 0;
}
.gs-input::placeholder { color: var(--color-gray-400); }
.gs-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--color-gray-200);
  color: var(--color-gray-500);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background .1s;
}
.gs-clear-btn:hover { background: var(--color-gray-300); }
.gs-clear-btn.gs-visible { display: flex; }

/* Results body */
.gs-body {
  overflow-y: auto;
  flex: 1;
}
.gs-body::-webkit-scrollbar { width: 5px; }
.gs-body::-webkit-scrollbar-thumb { background: var(--color-gray-200); border-radius: 4px; }

/* Empty / hint state */
.gs-hint {
  padding: 32px 24px 28px;
  text-align: center;
  color: var(--color-gray-400);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.gs-hint-icon {
  margin-bottom: 14px;
  color: var(--color-gray-300);
  line-height: 0;
}
.gs-hint-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-700);
  margin: 0 0 5px;
  letter-spacing: -.01em;
}
.gs-hint-sub {
  font-size: 12.5px;
  color: var(--color-gray-400);
  margin: 0 0 16px;
  line-height: 1.5;
  max-width: 280px;
}
.gs-hint-tips {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-100);
  border-radius: 8px;
  padding: 6px 12px;
}
.gs-hint-tip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-gray-400);
}
.gs-hint-tip kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--color-gray-500);
  line-height: 1.4;
}
.gs-hint-tip-sep {
  color: var(--color-gray-200);
  font-size: 14px;
  user-select: none;
}
/* legacy strong support (fallback) */
.gs-hint strong { display: block; font-size: 14px; font-weight: 600; color: var(--color-gray-700); margin-bottom: 4px; }

.gs-no-result {
  padding: 32px 16px;
  text-align: center;
  color: var(--color-gray-400);
  font-size: 13px;
}
.gs-no-result svg { display: block; margin: 0 auto 8px; color: var(--color-gray-300); }
.gs-no-result strong { display: block; font-size: 14px; color: var(--color-gray-600); margin-bottom: 4px; }

/* Category group */
.gs-group { padding: 8px 0; }
.gs-group:not(:last-child) { border-bottom: 1px solid var(--color-gray-100); }
.gs-group-label {
  padding: 4px 16px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-gray-400);
}

/* Result item */
.gs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-gray-700);
  font-size: 13.5px;
  transition: background .08s;
  border-radius: 0;
  position: relative;
}
.gs-item:hover,
.gs-item.gs-active {
  background: var(--color-blue-50);
  color: var(--color-blue-600);
}
.gs-item.gs-active { outline: none; }
.gs-item-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  background: var(--color-gray-100);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--color-gray-500);
  transition: background .08s, color .08s;
}
.gs-item:hover .gs-item-icon,
.gs-item.gs-active .gs-item-icon {
  background: rgba(25,60,184,.1);
  color: var(--color-blue-600);
}
.gs-item-text { flex: 1; min-width: 0; }
.gs-item-name { font-weight: 500; line-height: 1.3; }
.gs-item-desc { font-size: 12px; color: var(--color-gray-400); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-item:hover .gs-item-desc,
.gs-item.gs-active .gs-item-desc { color: var(--color-blue-600); opacity: .7; }
.gs-item-arrow {
  color: var(--color-gray-300);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .08s;
}
.gs-item:hover .gs-item-arrow,
.gs-item.gs-active .gs-item-arrow { opacity: 1; }

/* highlight matched text */
.gs-hl { background: rgba(25,60,184,.12); color: var(--color-blue-600); border-radius: 2px; padding: 0 1px; font-weight: 600; }

/* Footer */
.gs-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--color-gray-100);
  background: var(--color-gray-50);
  flex-shrink: 0;
}
.gs-footer-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--color-gray-400);
}
.gs-footer-hint kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--color-gray-500);
  box-shadow: 0 1px 0 var(--color-gray-200);
}

/* Navbar page title (setelah logo) */
.navbar-page-title {
  display: flex;
  align-items: center;
  padding-left: 0;
  flex: 1;
  min-width: 0;
  margin-left: 32px;
  overflow: hidden;
}

/* Navbar left: logo + breadcrumb */
.navbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  flex-shrink: 0;
}
.navbar-brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-gray-900);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}
.navbar-brand-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.navbar-brand-name { font-size: 18px; font-weight: 700; color: var(--color-gray-900); }

/* Breadcrumb — single quoted chip */
.navbar-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-gray-600);
  background: var(--color-gray-50, #f9fafb);
  border: 1px solid var(--color-gray-200, #e5e7eb);
  border-radius: 8px;
  padding: 3px 10px 3px 8px;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.5;
  transition: background .15s, border-color .15s, color .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.navbar-breadcrumb:hover {
  background: var(--color-gray-100, #f3f4f6);
  border-color: var(--color-gray-300, #d1d5db);
  color: var(--color-gray-800);
}
.navbar-breadcrumb-home-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-gray-400);
  flex-shrink: 0;
}
.navbar-breadcrumb:hover .navbar-breadcrumb-home-icon {
  color: var(--color-gray-600);
}
.navbar-breadcrumb-sep {
  color: var(--color-gray-300);
  font-size: 13px;
  font-weight: 400;
  user-select: none;
  line-height: 1;
}
.navbar-breadcrumb-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--color-blue-100, #dbeafe);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--color-blue-700, #1d4ed8);
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}
.navbar-breadcrumb-label {
  color: var(--color-gray-700, #374151);
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

/* Navbar right: search + actions */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  min-width: 0;
}

.navbar-actions { display: flex; align-items: center; gap: 4px; }

/* Online users indicator */
.navbar-online-wrapper {
  position: relative;
}
.navbar-online-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 5px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--color-gray-600);
  font-size: 12px;
  font-weight: 600;
  transition: background .12s;
}
.navbar-online-btn:hover { background: var(--color-gray-100); }
.navbar-online-dot {
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
}
.navbar-online-count {
  color: var(--color-gray-700);
}
.navbar-online-dropdown {
  position: fixed;
  min-width: 180px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-top: 2px solid var(--color-blue-600);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  z-index: 2000;
  overflow: hidden;
}
.navbar-online-header {
  padding: 8px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--color-gray-100);
}
.navbar-online-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 200px;
  overflow-y: auto;
}
.navbar-online-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--color-gray-700);
}
.navbar-online-list li::before {
  content: '';
  width: 7px; height: 7px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Shared custom dropdown wrapper ───────────────────────── */
.navbar-custom-dropdown-wrapper {
  position: relative;
}
.navbar-custom-dropdown {
  position: fixed;
  min-width: 200px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-top: 2px solid var(--color-blue-600);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  z-index: 2000;
  overflow: hidden;
}
.navbar-dropdown-header {
  padding: 10px 14px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--color-gray-100);
}
.navbar-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gray-900);
  text-transform: none;
  letter-spacing: 0;
}
.navbar-dropdown-role {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-gray-500);
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
}
.navbar-dropdown-divider {
  height: 1px;
  background: var(--color-gray-100);
  margin: 0;
}
.navbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--color-gray-700);
  text-decoration: none;
  transition: background .1s;
}
.navbar-dropdown-item:hover { background: var(--color-gray-50); color: var(--color-gray-900); }
.navbar-dropdown-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 14px;
  font-size: 12px;
  color: var(--color-gray-400);
}
.navbar-dropdown-empty svg { opacity: .4; }

/* Notif dropdown lebih lebar dari profil */
#notifDropdown {
  min-width: 320px;
  max-width: 360px;
}

/* Notification button — icon only, no border box */
.navbar-notif-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--color-gray-500);
  transition: background .12s, color .12s;
  padding: 6px;
  cursor: pointer;
}
.navbar-notif-btn:hover { background: var(--color-gray-100); color: var(--color-gray-700); }
.navbar-notif-dot {
  display: none; /* ditampilkan oleh JS saat ada unread */
  position: absolute;
  top: 5px; right: 5px;
  width: 9px; height: 9px;
  background: var(--color-red-500);
  border-radius: 50%;
  border: 2px solid var(--color-white);
}

/* User avatar button (circle, no border, no caret) */
.user-avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
}
.user-avatar-btn::after { display: none !important; }

/* Avatar size in navbar */
.user-avatar-btn .user-avatar {
  width: 32px; height: 32px;
  font-size: 13px;
}

.navbar-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: none;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  color: var(--color-gray-600);
  transition: background .12s, border-color .12s;
}
.navbar-icon-btn:hover { background: var(--color-gray-100); border-color: var(--color-gray-300); }
.navbar-icon-btn svg { width: 15px; height: 15px; }

.sidebar-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--color-gray-600);
  cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
}
.sidebar-toggle:hover { background: var(--color-gray-100); color: var(--color-gray-900); }
/* Icon hamburger dan X */
.sidebar-toggle .icon-menu,
.sidebar-toggle .icon-close {
  position: absolute;
  transition: opacity .15s, transform .15s;
}
.sidebar-toggle .icon-close { opacity: 0; transform: rotate(-90deg) scale(.8); }
.sidebar-toggle.active .icon-menu { opacity: 0; transform: rotate(90deg) scale(.8); }
.sidebar-toggle.active .icon-close { opacity: 1; transform: rotate(0deg) scale(1); }
.sidebar-toggle.active { color: var(--color-gray-900); }

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--color-gray-200);
  border-radius: 9999px;
  padding: 4px 10px 4px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-700);
  font-family: var(--font);
  transition: background .12s, border-color .12s;
}
.user-menu-btn:hover { background: var(--color-gray-50); border-color: var(--color-gray-300); }
.user-menu-btn::after { display: none !important; }

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-blue-600);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0 0 2px;
  letter-spacing: -.02em;
  line-height: 1.3;
}
.page-subtitle { font-size: 13px; color: var(--color-gray-500); margin: 0; }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* BUTTONS — sistem tombol global */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
}
.btn:focus-visible { outline: 2px solid var(--color-blue-600); outline-offset: 2px; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Variants */
.btn-primary { background: var(--color-blue-600); border-color: var(--color-blue-600); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: #1535a0; border-color: #1535a0; color: #fff; }

.btn-outline { background: var(--color-white); border-color: var(--color-gray-200); color: var(--color-gray-700); }
.btn-outline:hover { background: var(--color-gray-50); border-color: var(--color-gray-300); color: var(--color-gray-900); }

.btn-danger { background: var(--color-red-50); border-color: #fca5a5; color: #dc2626; }
.btn-danger:hover { background: #fee2e2; border-color: #f87171; color: #b91c1c; }

/* btn-danger + btn-outline: ghost destructive button */
.btn-danger.btn-outline { background: transparent; border-color: #fca5a5; color: #dc2626; }
.btn-danger.btn-outline:hover { background: var(--color-red-50); border-color: #f87171; color: #b91c1c; }

.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #fff; font-weight: 600; }
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; }

.btn-secondary { background: var(--color-gray-100); border-color: var(--color-gray-200); color: var(--color-gray-700); }
.btn-secondary:hover { background: var(--color-gray-200); border-color: var(--color-gray-300); color: var(--color-gray-900); }

.btn-print { background: #fff; border: 1px solid var(--color-gray-300); color: var(--color-gray-700); margin-bottom: 12px; }
.btn-print:hover { background: var(--color-gray-50); }

/* Icon-only close button (modal header ×) */
.btn-icon-close { background: none; border: none; font-size: 20px; color: #6b7280; cursor: pointer; padding: 0 4px; line-height: 1; }
.btn-icon-close:hover { color: #111827; }

/* Sizes */
.btn-sm { padding: 7px 16px; font-size: 12px; }
.btn-lg { padding: 9px 20px; font-size: 14px; }

/* Legacy aliases — sama persis dengan .btn + variant */
.btn-restok { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 13px; font-weight: 500; font-family: var(--font); border-radius: var(--radius); border: 1px solid var(--color-blue-600); cursor: pointer; transition: background .12s, border-color .12s; line-height: 1.25; white-space: nowrap; text-decoration: none; background: var(--color-blue-600); color: #fff; vertical-align: middle; }
.btn-restok:hover { background: #1535a0; border-color: #1535a0; color: #fff; }
.btn-restok svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-restok-outline { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 13px; font-weight: 500; font-family: var(--font); border-radius: var(--radius); border: 1px solid var(--color-gray-200); cursor: pointer; transition: background .12s, border-color .12s; line-height: 1.25; white-space: nowrap; text-decoration: none; background: var(--color-white); color: var(--color-gray-700); vertical-align: middle; }
.btn-restok-outline:hover { background: var(--color-gray-50); border-color: var(--color-gray-300); color: var(--color-gray-900); }
.btn-restok-outline svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Bootstrap btn-primary override */
.btn-primary.btn { background: var(--color-blue-600); border-color: var(--color-blue-600); }

/* STAT CARD */
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 16px;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); }
.stat-card-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--color-gray-500); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--color-gray-900); line-height: 1; letter-spacing: -.03em; margin-bottom: 4px; }
.stat-meta { font-size: 12px; color: var(--color-gray-400); }
.stat-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon-primary { background: var(--color-indigo-50); color: var(--color-blue-600); }
.stat-icon-success { background: var(--color-green-50);  color: #166534; }
.stat-icon-warning { background: var(--color-yellow-50); color: #854d0e; }
.stat-icon-danger  { background: var(--color-red-50);    color: #991b1b; }

/* RESTOK CARD */
.restok-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  width: 100%;
  min-width: 0;
}
.restok-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-gray-200);
  background: transparent;
}
.restok-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.restok-card .card-title svg { width: 15px; height: 15px; color: var(--color-gray-500); }
.restok-card .card-body { padding: 20px; }
/* Form card — dibungkus dalam .card-container agar lebar terkontrol tanpa memotong card */
.card-container        { max-width: 600px; }
.card-container--wide  { max-width: 860px; }
/* Legacy: form-card masih didukung tapi max-width lebih longgar */
.restok-card.form-card         { max-width: 600px; }
.restok-card.form-card--wide   { max-width: 860px; }

/* ══════════════════════════════════════════════
   SETTINGS PAGE — panel & grid layout
   ══════════════════════════════════════════════ */
.setting-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}
/* 2-column grid untuk panel yang punya 2 card berdampingan */
.settings-col-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
/* Card form dengan lebar terbatas agar tidak terlalu lebar di layar besar */
.setting-tab-panel .restok-card.settings-card--narrow {
  max-width: 640px;
}
@media (max-width: 767px) {
  .settings-col-2 {
    grid-template-columns: 1fr;
  }
}

/* BON INFO LIST */
.bon-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bon-info-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-gray-100);
}
.bon-info-item:last-child { border-bottom: none; }
.bon-info-item dt {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-500);
  white-space: nowrap;
  min-width: 110px;
  flex-shrink: 0;
}
.bon-info-item dt svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--color-gray-400);
}
.bon-info-item dd {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-800);
  text-align: right;
}

/* BON TIMELINE */
.bon-timeline {
  list-style: none;
  margin: 0;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.bon-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.bon-timeline-item:last-child { padding-bottom: 0; }
.bon-timeline-item::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--color-gray-200);
}
.bon-timeline-item:last-child::before { display: none; }
.bon-timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-gray-300);
  border: 2px solid var(--color-white);
  box-shadow: 0 0 0 2px var(--color-gray-300);
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
  z-index: 1;
}
.bon-timeline-dot--blue   { background: var(--color-blue-600);  box-shadow: 0 0 0 2px var(--color-blue-600); }
.bon-timeline-dot--green  { background: var(--color-green-500); box-shadow: 0 0 0 2px var(--color-green-500); }
.bon-timeline-dot--red    { background: var(--color-red-500);   box-shadow: 0 0 0 2px var(--color-red-500); }
.bon-timeline-dot--muted  { background: var(--color-gray-200);  box-shadow: 0 0 0 2px var(--color-gray-200); border: 2px dashed var(--color-gray-300); }
.bon-timeline-current .bon-timeline-dot {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor;
  outline: none;
}
.bon-timeline-current .bon-timeline-dot--green  { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--color-green-500); }
.bon-timeline-current .bon-timeline-dot--blue   { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--color-blue-600); }
.bon-timeline-current .bon-timeline-dot--red    { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--color-red-500); }
.bon-timeline-current .bon-timeline-label       { color: var(--color-gray-900); font-weight: 700; }
.bon-timeline-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.bon-timeline-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gray-800);
  line-height: 1.4;
}
.bon-timeline-pending .bon-timeline-label { color: var(--color-gray-400); }
.bon-timeline-time {
  font-size: 12px;
  color: var(--color-gray-500);
  line-height: 1.4;
}
.bon-timeline-actor {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-gray-600);
  line-height: 1.4;
}

/* BON NOTE BOX */
.bon-note-box {
  margin: 0 20px 16px;
  padding: 12px 14px;
  background: var(--color-yellow-50);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
}
.bon-note-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-yellow-500);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.bon-note-label svg { width: 13px; height: 13px; }
.bon-note-text {
  font-size: 13px;
  color: var(--color-gray-700);
  margin: 0;
  line-height: 1.6;
}

/* BON STATUS BANNER */
.bon-status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
}
.bon-status-banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.bon-status-banner.badge-info     { background: var(--color-blue-50);   color: var(--color-blue-700);   border-color: var(--color-blue-200); }
.bon-status-banner.badge-active   { background: var(--color-green-50);  color: var(--color-green-700);  border-color: var(--color-green-200); }
.bon-status-banner.badge-danger   { background: var(--color-red-50);    color: var(--color-red-700);    border-color: var(--color-red-200); }
.bon-status-banner.badge-inactive { background: var(--color-gray-50);   color: var(--color-gray-500);   border-color: var(--color-gray-200); }
.bon-status-banner.badge-secondary{ background: var(--color-gray-50);   color: var(--color-gray-600);   border-color: var(--color-gray-200); }

/* CARD TABS */
.card-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-gray-200);
  padding: 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
  background: var(--color-white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-tabs::-webkit-scrollbar { display: none; }
.card-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-500);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
  line-height: 1;
  cursor: pointer;
}
.card-tab:hover {
  color: var(--color-gray-800);
  text-decoration: none;
  background: var(--color-gray-50);
}
.card-tab.active {
  color: var(--color-blue-600, #2563eb);
  border-bottom-color: var(--color-blue-600, #2563eb);
  font-weight: 600;
}
.card-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  background: var(--color-gray-100);
  color: var(--color-gray-500);
  line-height: 1;
}
.card-tab.active .card-tab-badge {
  background: #dbeafe;
  color: var(--color-blue-600, #2563eb);
}

/* Bootstrap card override */
.card { border: 1px solid var(--color-gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); background: var(--color-white); }

/* TABLE */
.table { font-size: 13px; border-color: var(--color-gray-200); margin: 0; }
.table thead th {
  font-size: 12px; font-weight: 600; color: var(--color-gray-500);
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
  padding: 10px 16px; white-space: nowrap;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; border-color: var(--color-gray-100); color: var(--color-gray-700); }
.table tbody tr:hover td { background: var(--color-gray-50); }

/* RESTOK TABLE (alias .table pakai wrapper restok-card) */
.restok-table { width: 100%; font-size: 13px; border-collapse: collapse; margin: 0; }
.restok-table thead th {
  font-size: 12px; font-weight: 600; color: var(--color-gray-500);
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
  padding: 10px 16px; white-space: nowrap; text-align: left;
}
.restok-table tbody td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--color-gray-100); color: var(--color-gray-700); }
.restok-table tbody tr:last-child td { border-bottom: none; }
.restok-table tbody tr:hover td { background: var(--color-gray-50); }
.restok-table td.col-note { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.restok-table td.col-note[title] { cursor: help; }

/* ACTION GROUP */
.action-group { display: flex; align-items: center; gap: 6px; }

/* btn-action — ghost-style icon button with hover fill */
.btn-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--color-gray-600);
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  position: relative;
}
.btn-action svg,
.btn-action img { 
  width: 16px; height: 16px; 
  flex-shrink: 0;
  transition: transform .15s ease;
}
.btn-action:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
  transform: translateY(-1px);
}
.btn-action:active {
  transform: translateY(0);
}

/* Edit / primary variant — indigo ghost */
.btn-action-edit {
  color: #6366f1;
}
.btn-action-edit:hover {
  background: #eef2ff;
  color: #4f46e5;
}
.btn-action-edit:hover svg,
.btn-action-edit:hover img {
  transform: scale(1.1);
}

/* Danger / delete variant — red ghost */
.btn-action-danger {
  color: #ef4444;
}
.btn-action-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}
.btn-action-danger:hover svg,
.btn-action-danger:hover img {
  transform: scale(1.1);
}

/* Warning variant — amber ghost */
.btn-action-warning {
  color: #d97706;
}
.btn-action-warning:hover {
  background: #fffbeb;
  color: #b45309;
}
.btn-action-warning:hover svg,
.btn-action-warning:hover img {
  transform: scale(1.1);
}

/* Success variant — green ghost */
.btn-action-success {
  color: #16a34a;
}
.btn-action-success:hover {
  background: #f0fdf4;
  color: #15803d;
}
.btn-action-success:hover svg,
.btn-action-success:hover img {
  transform: scale(1.1);
}

/* Text-label action button (e.g. "Batalkan BON") */
.btn-action:not(:empty):has(> *:not(img):not(svg)) {
  width: auto;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  gap: 6px;
}

/* Legacy alias — keep in sync */
.action-btn { display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-gray-200); background: var(--color-white);
  color: var(--color-gray-500); cursor: pointer; transition: background .12s, border-color .12s, color .12s;
  text-decoration: none; }
.action-btn svg { width: 13px; height: 13px; }
.action-btn:hover { background: var(--color-gray-50); border-color: var(--color-gray-300); color: var(--color-gray-800); }
.action-btn-danger:hover { background: var(--color-red-50); border-color: var(--color-red-200, #fca5a5); color: var(--color-red-500); }

/* BADGES — definisi lengkap ada di bagian badge-improvements di bawah */
.badge-status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* BEM double-dash btn-action aliases (used in backup panel) */
.btn-action--primary { color: #6366f1; }
.btn-action--primary:hover { background: #eef2ff; color: #4f46e5; }
.btn-action--primary:hover svg { transform: scale(1.1); }
.btn-action--danger { color: #ef4444; }
.btn-action--danger:hover { background: #fef2f2; color: #dc2626; }
.btn-action--danger:hover svg { transform: scale(1.1); }

/* btn-icon — icon button untuk aksi per-item di tabel (selesai/batal) */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.btn-icon svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
  transition: transform .15s ease;
}
.btn-icon:disabled,
.btn-icon[disabled] {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}
/* success variant — untuk Tandai Selesai */
.btn-icon-success {
  color: #16a34a;
}
.btn-icon-success:hover {
  background: #dcfce7;
  color: #15803d;
  transform: translateY(-1px);
}
.btn-icon-success:hover svg { transform: scale(1.1); }
.btn-icon-success:active { transform: translateY(0); }
/* danger variant — untuk Batalkan Item */
.btn-icon-danger {
  color: #ef4444;
}
.btn-icon-danger:hover {
  background: #fef2f2;
  color: #dc2626;
  transform: translateY(-1px);
}
.btn-icon-danger:hover svg { transform: scale(1.1); }
.btn-icon-danger:active { transform: translateY(0); }

/* Action button group */
.btn-action-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Table empty state */
.table-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--color-gray-400);
  text-align: center;
  gap: 12px;
}
.table-empty-state svg {
  width: 40px;
  height: 40px;
  opacity: .45;
  flex-shrink: 0;
}
.table-empty-state p {
  margin: 0;
  font-size: 14px;
  color: var(--color-gray-500);
}

/* FORM */
.form-control, .form-select {
  font-size: 14px; font-family: var(--font);
  border-color: var(--color-gray-200); border-radius: var(--radius);
  background: var(--color-white); color: var(--color-gray-900);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-blue-600);
  box-shadow: 0 0 0 3px rgba(25,60,184,.1);
  outline: none;
}
.form-label { font-size: 13px; font-weight: 500; color: var(--color-gray-700); margin-bottom: 6px; }

/* EMPTY STATE */
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 48px 16px; color: var(--color-gray-400); text-align: center; gap: 12px; }
.empty-icon { width: 36px; height: 36px; opacity: .3; }
.empty-state p { margin: 0; font-size: 13px; max-width: 280px; color: var(--color-gray-500); }

/* QUICK LINKS */
.quick-links { display: flex; flex-direction: column; gap: 4px; }
.quick-link-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--color-gray-700); font-size: 13px; font-weight: 500; transition: background .12s; }
.quick-link-item:hover { background: var(--color-gray-50); color: var(--color-gray-900); }
.quick-link-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-link-icon svg { width: 14px; height: 14px; }

/* INFO LIST */
.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.info-label { color: var(--color-gray-500); }
.info-value { font-weight: 500; color: var(--color-gray-800); }

/* FLASH / ALERT */
.app-flash {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 1060;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  max-width: 420px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.06);
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  animation: slideInRight .3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.app-flash.dismissing {
  animation: slideOutRight .25s ease-in forwards;
}

/* Alert Variants */
.app-flash-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}
.app-flash-success .app-flash-icon-wrap {
  color: #16a34a;
}
.app-flash-success .app-flash-title {
  color: #15803d;
}

.app-flash-error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fca5a5;
}
.app-flash-error .app-flash-icon-wrap {
  color: #dc2626;
}
.app-flash-error .app-flash-title {
  color: #b91c1c;
}

.app-flash-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fcd34d;
}
.app-flash-warning .app-flash-icon-wrap {
  color: #d97706;
}
.app-flash-warning .app-flash-title {
  color: #b45309;
}

.app-flash-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
}
.app-flash-info .app-flash-icon-wrap {
  color: #2563eb;
}
.app-flash-info .app-flash-title {
  color: #1d4ed8;
}

.app-flash-icon-wrap {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
}

.app-flash-icon-wrap svg {
  width: 16px;
  height: 16px;
}

.app-flash-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-flash-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.app-flash-msg {
  font-size: 13px;
  color: var(--color-gray-600);
  line-height: 1.5;
}

.app-flash-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-400);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background .15s, color .15s;
}

.app-flash-close:hover {
  background: rgba(0,0,0,.06);
  color: var(--color-gray-700);
}

/* DROPDOWN */
.dropdown-menu { border: 1px solid var(--color-gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 4px; font-size: 13px; background: var(--color-white); }
.dropdown-item { border-radius: 6px; padding: 7px 12px; color: var(--color-gray-700); font-size: 13px; transition: background .1s; }
.dropdown-item:hover { background: var(--color-gray-100); color: var(--color-gray-900); }
.dropdown-divider { border-color: var(--color-gray-200); margin: 4px 0; }
.dropdown-item-text { font-size: 12px; color: var(--color-gray-500); padding: 4px 12px; }

/* RESPONSIVE */

/* ── Tablet landscape & small laptop (≤1199px) ───────────────────────────── */
@media (max-width: 1199.98px) {
  .navbar-search { flex: 0 1 160px; min-width: 100px; }
}

/* ── Tablet portrait (≤991px) ────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  /* Sidebar jadi offcanvas */
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  .sidebar-toggle { display: flex; }
  /* Konten full width */
  .app-main { padding: 20px 20px; padding-left: 20px; padding-bottom: 120px; }
  /* Navbar search lebih kecil */
  .navbar-search { flex: 0 1 140px; min-width: 80px; }
  /* Page header wrap */
  .page-header { align-items: center; gap: 8px; }
  .page-header-actions { justify-content: flex-end; flex-shrink: 0; }
}

/* ── Mobile (≤767px) ─────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .sidebar { transform: translateX(-100%); top: var(--navbar-height); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay { top: var(--navbar-height); }
  .sidebar-overlay.show { display: block; opacity: 1; pointer-events: auto; }
  .sidebar-toggle { display: flex; }
  .navbar-search { display: none; }

  /* Navbar layout mobile */
  .navbar-left { gap: 8px; }
  .navbar-brand-icon { width: 32px; height: 32px; }
  .navbar-page-title { margin-left: 8px; }
  .navbar-right { gap: 4px; }
  .navbar-online-count { display: none; }
  .navbar-online-btn { padding: 4px 6px; }

  /* Sembunyikan breadcrumb di mobile */
  .navbar-page-title { display: none; }

  /* Sembunyikan preview pesan di list chat */
  .room-last-msg { display: none !important; }

  /* Tombol di page-header-actions: icon only di mobile */
  .page-header-actions .btn {
    font-size: 0;
    padding: 7px;
    min-width: 34px;
    justify-content: center;
    gap: 0;
  }
  .page-header-actions .btn svg { width: 16px; height: 16px; flex-shrink: 0; }

  .app-main { padding: 16px; padding-bottom: 100px; }

  /* Modal responsif di HP */
  .modal-dialog { margin: 12px; max-width: calc(100vw - 24px); }
  .modal-body { max-height: 60vh; overflow-y: auto; }
  .modal-footer { flex-wrap: wrap; gap: 8px; }
  .modal-footer .btn { flex: 1 1 auto; }

  /* Form responsif */
  .row.g-3 > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .input-group { flex-wrap: nowrap; }
  .btn-group, .d-flex.gap-2 { flex-wrap: wrap; }

  /* Tabel aksi tidak bertabrakan */
  .restok-table td:last-child .btn { padding: 4px 8px; font-size: 12px; }

  /* Card padding lebih kecil */
  .restok-card { border-radius: var(--radius); }
  .restok-card .card-body { padding: 16px; }

  /* Page header */
  .page-header { align-items: center; gap: 8px; margin-bottom: 14px; }
  .page-header-actions { justify-content: flex-end; flex-shrink: 0; flex-wrap: nowrap; }
  .page-title { font-size: 15px; }

  /* Cegah iOS Safari auto-zoom: input harus min 16px */
  .form-control,
  .form-select,
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  select,
  textarea,
  .ss-search {
    font-size: 16px;
  }
}

/* ── Small mobile (≤575px) ───────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .app-main { padding: 12px; padding-bottom: 90px; }
  .modal-dialog { margin: 8px; max-width: calc(100vw - 16px); }

  /* Stat cards 1 kolom */
  .stat-grid { grid-template-columns: 1fr !important; }

  /* Navbar brand name tersembunyi, hemat space */
  .navbar-brand-name { display: none; }

  /* Tombol tabel lebih compact */
  .btn-action { padding: 4px 8px; font-size: 11px; }

  /* Filter form wrap */
  .laporan-filter-form { gap: 8px; }
  .laporan-filter-form .form-group,
  .laporan-filter-form > * { flex: 1 1 100%; min-width: 0; }
}
/* CARD TABS OVERRIDE */
.restok-card > .card-tabs {
  display: flex !important;
  align-items: center;
  border-bottom: 1px solid var(--color-gray-200);
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
  background: var(--color-white);
  margin: 0;
}
.restok-card > .card-tabs::-webkit-scrollbar { display: none; }
.restok-card > .card-tabs .card-tab svg { width: 14px; height: 14px; flex-shrink: 0; }

/* SORT HEADER */
.sort-th {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.sort-th:hover { color: var(--color-blue-600, #2563eb); text-decoration: none; }
.restok-card > .card-tabs .card-tab {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-500) !important;
  text-decoration: none !important;
  border-bottom: 2px solid transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border-radius: 0;
}
.restok-card > .card-tabs .card-tab:hover {
  color: var(--color-gray-800) !important;
  text-decoration: none !important;
  background: var(--color-gray-50);
}
.restok-card > .card-tabs .card-tab.active {
  color: #2563eb !important;
  border-bottom-color: #2563eb !important;
  font-weight: 600;
}
.restok-card > .card-tabs .card-tab.active .card-tab-badge {
  background: #dbeafe;
  color: #2563eb;
}
/* Standalone tab bar card (tabs-only, no card-body) */
.restok-card.restok-card--tabs-only {
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent;
  margin-bottom: 0 !important;
  padding: 0 !important;
  width: 100%;
}
.restok-card.restok-card--tabs-only > .card-tabs {
  border-radius: 8px;
  border: 1.5px solid var(--color-gray-300);
  border-bottom: 1.5px solid var(--color-gray-300) !important;
  background: var(--color-white);
  margin-bottom: 0 !important;
  width: 100%;
  box-sizing: border-box;
}
/* Card immediately after tabs-only renders as continuation */
.restok-card.restok-card--tabs-only + .restok-card {
  border-radius: var(--radius) !important;
  border: 1.5px solid var(--color-gray-300) !important;
  margin-top: 8px !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
.restok-card.restok-card--tabs-only + .row .restok-card {
  border: 1.5px solid var(--color-gray-300);
  box-shadow: none;
}
.restok-card.restok-card--tabs-only + .row {
  margin-top: 8px;
}
.restok-card.restok-card--tabs-only + .row .restok-card {
  border: 1.5px solid var(--color-gray-300);
  box-shadow: none;
  overflow: hidden;
}

/* ==============================================
   AUTH PAGES — Login & Lock Screen
   Split-screen: left branding panel + right form
   ============================================== */

/* Remove default body background for auth pages */
body.auth-page {
  background: var(--color-gray-100);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ── Alert Notifikasi ──────────────────────────────────────────────── */
@keyframes notif-alert-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes notif-alert-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}
#notif-alert-container {
  position: fixed;
  top: calc(var(--navbar-height, 56px) + 10px);
  right: 14px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  width: 280px;
}
.notif-alert-item {
  pointer-events: all;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: notif-alert-in .2s ease forwards;
}
.notif-alert-item.dismissing {
  animation: notif-alert-out .18s ease forwards;
}
.notif-alert-text { flex: 1; min-width: 0; }
.notif-alert-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-alert-msg {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-alert-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  line-height: 1;
  font-size: 16px;
  margin-top: -1px;
  transition: color .15s;
}
.notif-alert-close:hover { color: #374151; }

/* Auth Alert Banner — slides out from behind navbar */
@keyframes auth-toast-in {
  from { transform: translateY(calc(-100% - var(--navbar-height))); }
  65%  { transform: translateY(6px); }
  to   { transform: translateY(0); }
}
@keyframes auth-toast-out {
  from { transform: translateY(0); }
  to   { transform: translateY(calc(-100% - var(--navbar-height))); }
}
@keyframes auth-toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}
.auth-toast {
  position: fixed;
  top: var(--navbar-height); /* posisi final tepat di bawah navbar */
  left: 0;
  right: 0;
  z-index: 1036; /* di atas sidebar (1035), di bawah navbar (1040) */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 48px 11px 48px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  animation: auth-toast-in .38s cubic-bezier(.22,1,.36,1) forwards;
}
.auth-toast.dismissing {
  animation: auth-toast-out .28s cubic-bezier(.4,0,.2,1) forwards;
}
.auth-toast-danger {
  background: #dc2626;
}
.auth-toast-danger .auth-toast-icon-wrap {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: .9;
}
.auth-toast-danger .auth-toast-icon-wrap svg {
  width: 16px;
  height: 16px;
}
.auth-toast-danger .auth-toast-progress {
  background: rgba(255,255,255,.5);
}
.auth-toast-success {
  background: #16a34a;
}
.auth-toast-success .auth-toast-icon-wrap {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: .9;
}
.auth-toast-success .auth-toast-icon-wrap svg {
  width: 16px;
  height: 16px;
}
.auth-toast-success .auth-toast-progress {
  background: rgba(255,255,255,.5);
}
.auth-toast-warning {
  background: #d97706;
}
.auth-toast-warning .auth-toast-icon-wrap {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: .9;
}
.auth-toast-warning .auth-toast-icon-wrap svg {
  width: 16px;
  height: 16px;
}
.auth-toast-warning .auth-toast-progress {
  background: rgba(255,255,255,.5);
}
.auth-toast-info {
  background: #2563eb;
}
.auth-toast-info .auth-toast-icon-wrap {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: .9;
}
.auth-toast-info .auth-toast-icon-wrap svg {
  width: 16px;
  height: 16px;
}
.auth-toast-info .auth-toast-progress {
  background: rgba(255,255,255,.5);
}
.auth-toast-msg {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-toast-close {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color .12s, background .12s;
}
.auth-toast-close:hover {
  color: #fff;
  background: rgba(255,255,255,.15);
}
/* Progress bar */
.auth-toast-progress-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,.2);
}
.auth-toast-progress {
  height: 100%;
  animation: auth-toast-progress 4s linear forwards;
}

/* AUTH NAVBAR — topbar matching dashboard style */
.auth-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.auth-navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.auth-navbar-icon {
  width: 32px; height: 32px;
  background: var(--color-blue-600);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  letter-spacing: .3px;
  flex-shrink: 0;
}
.auth-navbar-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-gray-900);
  letter-spacing: -.2px;
}

.auth-navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.auth-navbar-search {
  position: relative;
  width: 256px;
}
.auth-navbar-search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}
.auth-navbar-search-input {
  width: 100%;
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  padding: 6px 12px 6px 32px;
  font-size: 13px;
  color: var(--color-gray-400);
  font-family: var(--font);
  outline: none;
  cursor: not-allowed;
}

.auth-navbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.auth-navbar-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  color: var(--color-gray-500);
  cursor: default;
}
.auth-navbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-gray-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  color: var(--color-gray-500);
  margin-left: 4px;
  flex-shrink: 0;
}

/* Wrapper — full viewport, light bg, below navbar */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding-top: 56px;
  background: var(--color-gray-100);
}

/* Auth card — centered form container */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-xs);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.auth-logo-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0;
  letter-spacing: -.3px;
  text-align: center;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--color-gray-500);
  margin: 0 0 28px;
  line-height: 1.5;
}

/* Lock timer */
#lock-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--color-red-50);
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  font-size: 13px;
  color: #b91c1c;
  margin-bottom: 20px;
}

/* Maintenance alert di halaman login */
.alert-maintenance {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  font-size: 13px;
  color: #92400e;
  margin-bottom: 20px;
  line-height: 1.4;
}
.alert-maintenance strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
}

/* Margin utility for auth form */
.auth-card .mb-3 { margin-bottom: 20px; }
.auth-card .mb-5 { margin-bottom: 28px; }

/* Form fields */
.auth-card .form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-700);
  margin-bottom: 6px;
  display: block;
}
.auth-card .form-control {
  width: 100%;
  padding: 9px 13px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--color-gray-900);
  background: var(--color-white);
  border: 1.5px solid var(--color-gray-300);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}
.auth-card .form-control:focus {
  border-color: var(--color-blue-600);
  box-shadow: 0 0 0 3px rgba(25,60,184,.12);
}
.auth-card .form-control:disabled {
  background: var(--color-gray-100);
  color: var(--color-gray-400);
  cursor: not-allowed;
}
.auth-card .form-control.is-invalid {
  border-color: var(--color-red-500);
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.required-mark {
  color: var(--color-red-500);
  margin-left: 2px;
}

/* Password field wrapper */
.password-wrapper {
  position: relative;
}
.password-wrapper .form-control {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 1px; top: 1px;
  height: calc(100% - 2px);
  width: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-gray-400);
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}
.password-toggle:hover { color: var(--color-gray-700); }

/* Login button */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 24px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: linear-gradient(135deg, #193cb8 0%, #3b54d1 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .15s, box-shadow .15s, transform .1s;
  letter-spacing: .1px;
}
.btn-login:hover:not(:disabled) {
  opacity: .92;
  box-shadow: 0 4px 14px rgba(25,60,184,.35);
  transform: translateY(-1px);
}
.btn-login:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}
.btn-login:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn-login-default,
.btn-login-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
.btn-spinner {
  animation: btn-spin .7s linear infinite;
}

/* Copyright footer inside right panel */
.auth-copyright {
  margin-top: 28px;
  font-size: 12px;
  color: var(--color-gray-400);
  text-align: center;
}

/* Responsive */
@media (max-width: 480px) {
  .auth-navbar-center { display: none; }
  .auth-card {
    margin: 16px;
    padding: 28px 24px;
  }
  /* Cegah iOS Safari auto-zoom: input harus min 16px */
  .auth-card .form-control,
  .auth-card input,
  .auth-card select,
  .auth-card textarea {
    font-size: 16px;
  }
}

/* ==============================================
   Chat
   ============================================== */

/* Bubble pesan */
.chat-bubble {
  padding: .45rem .75rem;
  border-radius: .75rem;
  word-break: break-word;
  line-height: 1.45;
  font-size: 13.5px;
}
.chat-bubble-mine {
  background: var(--restok-primary, #1a56db);
  color: #fff;
  border-bottom-right-radius: .2rem;
}
.chat-bubble-other {
  background: var(--color-gray-100, #f1f3f5);
  color: var(--color-gray-900, #212529);
  border-bottom-left-radius: .2rem;
}

/* Avatar inisial di daftar room */
.chat-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--restok-primary, #1a56db);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
}

/* ==============================================
   Searchable Select Component (.ss-*)
   ============================================== */
.ss-wrap {
  position: relative;
}
.ss-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border: 1px solid var(--color-gray-300);
  border-radius: 6px;
  background: var(--color-white);
  cursor: pointer;
  min-height: 38px;
  user-select: none;
  font-size: 0.875rem;
  color: var(--color-gray-900);
  transition: border-color .15s, box-shadow .15s;
}
.ss-trigger:focus {
  outline: none;
  border-color: var(--color-blue-600);
  box-shadow: 0 0 0 3px rgba(25, 60, 184, .12);
}
.ss-trigger.ss-placeholder { color: var(--color-gray-400); }
.ss-trigger.ss-error {
  border-color: var(--color-red-500);
  box-shadow: 0 0 0 3px rgba(239,68,68,.15);
}
.ss-trigger.ss-open {
  border-radius: 6px 6px 0 0;
  border-color: var(--color-blue-600);
}
.ss-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--color-gray-400);
  transition: transform .2s;
  margin-left: 8px;
}
.ss-trigger.ss-open .ss-chevron { transform: rotate(180deg); }
.ss-dropdown {
  display: none;
  position: absolute;
  z-index: 1050;
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-blue-600);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,.1);
  flex-direction: column;
  max-height: 280px;
  overflow: hidden;
}
.ss-dropdown.ss-open { display: flex; }
.ss-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--color-gray-200);
  flex-shrink: 0;
}
.ss-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--color-gray-300);
  border-radius: 4px;
  font-size: 0.8125rem;
  outline: none;
  box-sizing: border-box;
  color: var(--color-gray-900);
}
.ss-search:focus { border-color: var(--color-blue-600); }
.ss-list {
  overflow-y: auto;
  flex: 1;
}
.ss-group-label {
  padding: 5px 12px 3px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-100);
}
.ss-option {
  padding: 8px 14px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--color-gray-900);
}
.ss-option:hover { background: var(--color-gray-100); }
.ss-option.ss-selected {
  background: var(--color-blue-50);
  font-weight: 600;
  color: var(--color-blue-600);
}
.ss-empty {
  padding: 12px 14px;
  color: var(--color-gray-400);
  font-size: 0.8125rem;
  text-align: center;
}

/* ==============================================
   NAVBAR CHAT DROPDOWN
   ============================================== */

/* Badge angka unread di navbar */
.navbar-unread-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--color-red-500, #e53e3e);
  color: #fff;
  border-radius: 9999px;
  font-size: 10px; font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 2px solid var(--color-white, #fff);
  pointer-events: none;
}

/* Dropdown chat lebih lebar dari notif biasa */
.navbar-chat-dropdown {
  width: 320px;
}

.navbar-dropdown-viewall {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-blue-600, #1a56db);
  text-decoration: none;
}
.navbar-dropdown-viewall:hover { text-decoration: underline; }

/* Daftar room di dropdown navbar */
.navbar-chat-list {
  list-style: none;
  margin: 0; padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.navbar-chat-item { border-bottom: 1px solid var(--color-gray-100, #f3f4f6); }
.navbar-chat-item:last-child { border-bottom: none; }

.navbar-chat-item-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.navbar-chat-item-link:hover { background: var(--color-gray-50, #f9fafb); }

.navbar-chat-item.has-unread .navbar-chat-item-link { background: #eff6ff; }
.navbar-chat-item.has-unread .navbar-chat-item-link:hover { background: #dbeafe; }

.navbar-chat-item-avatar {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-blue-600, #1a56db);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

.navbar-chat-item-body { flex: 1; min-width: 0; }

.navbar-chat-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 2px;
}
.navbar-chat-item-name {
  font-size: 13px; font-weight: 600;
  color: var(--color-gray-800, #1f2937);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.navbar-chat-item-time {
  font-size: 10px;
  color: var(--color-gray-400, #9ca3af);
  flex-shrink: 0;
}
.navbar-chat-item-preview {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.navbar-chat-item-msg {
  font-size: 12px;
  color: var(--color-gray-500, #6b7280);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.navbar-chat-item.has-unread .navbar-chat-item-msg { color: var(--color-gray-700, #374151); font-weight: 500; }
.navbar-chat-item-unread {
  flex-shrink: 0;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--color-blue-600, #1a56db);
  color: #fff;
  border-radius: 9999px;
  font-size: 10px; font-weight: 700;
  line-height: 18px; text-align: center;
}

/* ==============================================
   QUICK CHAT WIDGET — floating kanan bawah
   ============================================== */

#quickChatWidget {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 1050;
}

/* Tombol toggle */
.qc-toggle-btn {
  position: relative;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--color-blue-600, #1a56db);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(26,86,219,.35);
  transition: background .15s, transform .12s, box-shadow .15s;
}
.qc-toggle-btn:hover {
  background: var(--color-blue-700, #1741a6);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(26,86,219,.45);
}
.qc-toggle-btn:active { transform: scale(.97); }

.qc-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--color-red-500, #e53e3e);
  color: #fff;
  border-radius: 9999px;
  font-size: 10px; font-weight: 700;
  line-height: 18px; text-align: center;
  border: 2px solid #fff;
  pointer-events: none;
}

/* Panel — popup di atas tombol */
.qc-panel {
  position: absolute;
  bottom: 58px; right: 0;
  width: 310px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 480px;
  transform-origin: bottom right;
  animation: qcPanelIn .15s ease;
}
@keyframes qcPanelIn {
  from { opacity: 0; transform: scale(.95) translateY(6px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.qc-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-gray-100, #f3f4f6);
  background: var(--color-gray-50, #f9fafb);
}
.qc-panel-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--color-gray-800, #1f2937);
}
.qc-viewall-link {
  font-size: 11px; font-weight: 500;
  color: var(--color-blue-600, #1a56db);
  text-decoration: none;
}
.qc-viewall-link:hover { text-decoration: underline; }

/* Daftar room */
.qc-room-list {
  flex: 1; overflow-y: auto;
  max-height: 340px;
}

.qc-loading-state,
.qc-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  color: var(--color-gray-400, #9ca3af);
  font-size: 12px;
}

.qc-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--color-gray-200, #e5e7eb);
  border-top-color: var(--color-blue-500, #3b82f6);
  border-radius: 50%;
  animation: qcSpin .7s linear infinite;
}
@keyframes qcSpin { to { transform: rotate(360deg); } }

.qc-room-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none; border: none;
  text-align: left; cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--color-gray-100, #f3f4f6);
}
.qc-room-item:last-child { border-bottom: none; }
.qc-room-item:hover { background: var(--color-gray-50, #f9fafb); }
.qc-room-item.qc-room-unread { background: #eff6ff; }
.qc-room-item.qc-room-unread:hover { background: #dbeafe; }

.qc-room-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-blue-600, #1a56db);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.qc-room-info { flex: 1; min-width: 0; }
.qc-room-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 4px;
  margin-bottom: 2px;
}
.qc-room-name {
  font-size: 13px; font-weight: 600;
  color: var(--color-gray-800, #1f2937);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qc-room-badge {
  flex-shrink: 0;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--color-blue-600, #1a56db);
  color: #fff;
  border-radius: 9999px;
  font-size: 10px; font-weight: 700;
  line-height: 18px; text-align: center;
}
.qc-room-time {
  font-size: 10px;
  color: var(--color-gray-400, #9ca3af);
  flex-shrink: 0;
}
.qc-room-preview {
  font-size: 11px;
  color: var(--color-gray-500, #6b7280);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qc-room-item.qc-room-unread .qc-room-preview { color: var(--color-gray-700, #374151); font-weight: 500; }

/* Area kirim pesan */
.qc-send-area {
  display: flex; flex-direction: column;
  flex: 1;
  min-height: 0;
}
.qc-send-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-gray-100, #f3f4f6);
  background: var(--color-gray-50, #f9fafb);
}
.qc-back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--color-gray-500, #6b7280);
  padding: 4px; border-radius: 6px;
  display: flex; align-items: center;
  transition: background .1s;
}
.qc-back-btn:hover { background: var(--color-gray-200, #e5e7eb); color: var(--color-gray-700, #374151); }
.qc-active-room-name {
  flex: 1;
  font-size: 12px; font-weight: 600;
  color: var(--color-gray-800, #1f2937);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qc-open-room-link {
  color: var(--color-blue-600, #1a56db);
  display: flex; align-items: center;
  flex-shrink: 0;
}

/* Bubble pesan */
.qc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
  max-height: 240px;
  min-height: 100px;
}
.qc-msg {
  display: flex; flex-direction: column; gap: 1px;
  max-width: 85%;
}
.qc-msg-mine { align-self: flex-end; align-items: flex-end; }
.qc-msg-other { align-self: flex-start; align-items: flex-start; }
.qc-msg-sender {
  font-size: 10px; font-weight: 600;
  color: var(--color-gray-500, #6b7280);
  margin-bottom: 1px;
}
.qc-msg-bubble {
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px; line-height: 1.45;
  word-break: break-word;
}
.qc-msg-mine .qc-msg-bubble {
  background: var(--color-blue-600, #1a56db);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.qc-msg-other .qc-msg-bubble {
  background: var(--color-gray-100, #f1f3f5);
  color: var(--color-gray-900, #111827);
  border-bottom-left-radius: 3px;
}
.qc-msg-time {
  font-size: 10px;
  color: var(--color-gray-400, #9ca3af);
  padding: 0 2px;
}
.qc-msg-loading,
.qc-no-msg {
  text-align: center;
  font-size: 12px;
  color: var(--color-gray-400, #9ca3af);
  padding: 16px 0;
}

/* Form kirim */
.qc-send-form {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--color-gray-100, #f3f4f6);
}
.qc-msg-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--color-gray-200, #e5e7eb);
  border-radius: 9999px;
  font-size: 12px;
  font-family: var(--font, inherit);
  outline: none;
  transition: border-color .12s;
  background: var(--color-gray-50, #f9fafb);
}
.qc-msg-input:focus { border-color: var(--color-blue-400, #60a5fa); background: #fff; }
.qc-send-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-blue-600, #1a56db);
  color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
.qc-send-btn:hover { background: var(--color-blue-700, #1741a6); }
.qc-send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Table Toolbar (filter + search bar di atas tabel) ───────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-gray-100);
  flex-wrap: wrap;
  background: var(--color-white);
  border-radius: var(--radius) var(--radius) 0 0;
}
.table-toolbar-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
  max-width: 340px;
}
.table-toolbar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--color-gray-400);
  pointer-events: none;
}
.table-toolbar-search input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--color-gray-800);
  background: var(--color-gray-50);
  outline: none;
  transition: border-color .12s, background .12s;
}
.table-toolbar-search input:focus {
  border-color: var(--color-blue-600);
  background: var(--color-white);
}
.table-toolbar-search input::placeholder { color: var(--color-gray-400); }

.table-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.table-toolbar-filters select,
.table-toolbar-filters input[type="date"] {
  padding: 7px 10px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--color-gray-700);
  background: var(--color-gray-50);
  outline: none;
  cursor: pointer;
  transition: border-color .12s;
  min-width: 120px;
}
.table-toolbar-filters select:focus,
.table-toolbar-filters input[type="date"]:focus {
  border-color: var(--color-blue-600);
  background: var(--color-white);
}
.table-toolbar-filters label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-gray-500);
  white-space: nowrap;
}
.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.table-toolbar-count {
  font-size: 12px;
  color: var(--color-gray-400);
  white-space: nowrap;
}

/* ── Table Pagination ────────────────────────────────────────────────────── */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--color-gray-100);
  background: var(--color-white);
  border-radius: 0 0 var(--radius) var(--radius);
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
}
.table-pagination-info {
  font-size: 12.5px;
  color: var(--color-gray-500);
}
.table-pagination-info strong { color: var(--color-gray-700); }
.table-pagination-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}
.table-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-gray-700);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  line-height: 1;
}
.table-pagination-btn:hover:not(:disabled) {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
}
.table-pagination-btn.active {
  background: var(--color-blue-600);
  border-color: var(--color-blue-600);
  color: var(--color-white);
  font-weight: 600;
}
.table-pagination-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.table-pagination-btn svg { width: 14px; height: 14px; }
.table-pagination-size {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-gray-500);
}
.table-pagination-size select {
  padding: 5px 8px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--color-gray-700);
  background: var(--color-white);
  outline: none;
  cursor: pointer;
}

/* ── restok-card fix: hilangkan border-radius bawah saat ada toolbar bawah ─ */
.restok-card.has-toolbar-bottom .card-body { border-radius: 0; }

/* ── Form improvements ───────────────────────────────────────────────────── */
.form-section {
  margin-bottom: 24px;
}
.form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-gray-100);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-field label,
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-700);
}
.form-field .required-mark,
.required-mark { color: var(--color-red-500); margin-left: 2px; }
.form-control,
.form-select {
  padding: 8px 12px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--color-gray-800);
  background: var(--color-white);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--color-blue-600);
  box-shadow: 0 0 0 3px rgba(25, 60, 184, .08);
}
.form-control::placeholder { color: var(--color-gray-400); }
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--color-red-500); }
.form-hint {
  font-size: 12px;
  color: var(--color-gray-400);
  margin-top: 2px;
}
.form-hint.is-error { color: var(--color-red-500); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--color-gray-100);
}

/* ── Badge improvements (seragamkan badge & badge-status) ────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-active   { background: var(--color-green-50);  color: #15803d; }
.badge-inactive { background: var(--color-gray-100);  color: var(--color-gray-500); }
.badge-success  { background: var(--color-green-50);  color: #15803d; }
.badge-danger   { background: var(--color-red-50);    color: #dc2626; }
.badge-warning  { background: var(--color-yellow-50); color: #a16207; }
.badge-info     { background: var(--color-indigo-50); color: #4f46e5; }
.badge-secondary{ background: var(--color-gray-100);  color: var(--color-gray-600); }
/* alias agar .badge class BS tdk merusak tampilan */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.badge.badge-warning  { background: var(--color-yellow-50); color: #a16207; border: none; }
.badge.badge-success  { background: var(--color-green-50);  color: #15803d; border: none; }
.badge.badge-danger   { background: var(--color-red-50);    color: #dc2626; border: none; }
.badge.badge-secondary{ background: var(--color-gray-100);  color: var(--color-gray-600); border: none; }

/* ── btn-action tambahan variant ─────────────────────────────────────────── */
.btn-action-view {
  background: none; border: none;
  color: var(--color-indigo-500);
}
.btn-action-view:hover { background: var(--color-indigo-50); color: var(--color-indigo-500); }
.btn-action-sm {
  width: 26px; height: 26px;
  font-size: 11px;
}

/* ── approval btn-action override ───────────────────────────────────────── */
a.btn-action-review {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  background: var(--color-blue-50);
  color: var(--color-blue-600);
  border: 1px solid rgba(25,60,184,.15);
  transition: background .12s;
  text-decoration: none;
}
a.btn-action-review:hover { background: #dbeafe; color: var(--color-blue-600); }

/* ==============================================
   DASHBOARD — Charts, Recent, Stok Kritis
   ============================================== */

/* Stat grid — 4 col default, collapses pada mobile */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 1199px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px)  { .stat-grid { grid-template-columns: 1fr; } }

/* 6-card layout untuk admin/GS */
.stat-grid:has([data-card="totalItem"]):has([data-card="stokHabis"]) {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 991px) {
  .stat-grid:has([data-card="totalItem"]):has([data-card="stokHabis"]) {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 575px) {
  .stat-grid:has([data-card="totalItem"]):has([data-card="stokHabis"]) {
    grid-template-columns: 1fr;
  }
}

/* Stat card sebagai link */
a.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
a.card-link:hover { text-decoration: none; color: inherit; }
a.card-link:hover .stat-value { color: var(--color-blue-600); }

/* Flash animation saat nilai diupdate oleh polling */
@keyframes statFlash {
  0%   { color: var(--color-blue-600); }
  100% { color: var(--color-gray-900); }
}
.stat-value-flash { animation: statFlash .6s ease-out; }

/* Chart wrapper */
.chart-wrap {
  position: relative;
  height: 220px;
  width: 100%;
}
.chart-wrap-sm {
  height: 200px;
}
@media (max-width: 767px) {
  .chart-wrap    { height: 180px; }
  .chart-wrap-sm { height: 180px; }
}

/* Chart subtitle (pojok kanan card-header) */
.chart-subtitle {
  font-size: 11px;
  color: var(--color-gray-400);
  font-weight: 400;
}

/* Recent list */
.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--color-gray-100);
  transition: background .1s;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: var(--color-gray-50); }
.recent-item.recent-empty { justify-content: center; padding: 24px 20px; }

/* Recent icon */
.recent-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.recent-item-icon svg { width: 14px; height: 14px; }
.recent-icon-primary { background: var(--color-indigo-50); color: var(--color-blue-600); }
.recent-icon-success { background: var(--color-green-50);  color: #166534; }
.recent-icon-warning { background: var(--color-yellow-50); color: #854d0e; }
.recent-icon-danger  { background: var(--color-red-50);    color: #991b1b; }

/* Recent body */
.recent-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.recent-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-800);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-item-title:hover { color: var(--color-blue-600); text-decoration: none; }
.recent-item-meta {
  font-size: 11px;
  color: var(--color-gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Recent right side */
.recent-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.recent-item-qty {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-gray-600);
}
.recent-item-time {
  font-size: 11px;
  color: var(--color-gray-400);
  white-space: nowrap;
}

/* btn-xs for card-header actions */
.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
}

/* Page subtitle */
.page-subtitle {
  font-size: 13px;
  color: var(--color-gray-400);
  margin: 2px 0 0;
}

/* ── Laporan Filter Form ─────────────────────────────────────────────────── */
.laporan-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  width: 100%;
}
.laporan-filter-group {
  flex: 1 1 180px;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.laporan-filter-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-700);
  white-space: nowrap;
}
.laporan-filter-group .form-select,
.laporan-filter-group .form-control {
  width: 100%;
}
.laporan-filter-action {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
}
.laporan-filter-action .btn {
  white-space: nowrap;
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
}
@media (max-width: 575px) {
  .laporan-filter-group { flex: 1 1 100%; }
  .laporan-filter-action { flex: 1 1 100%; }
  .laporan-filter-action .btn { width: 100%; justify-content: center; }
}
