﻿/* --- design-tokens.css --- */
/* ═══════════════════════════════════════════
   Design Tokens — TailAdmin Style
   Dành cho Quản lý Tiệc Cưới
   ═══════════════════════════════════════════ */

:root {
  /* Brand Colors - Premium Violet/Blue */
  --color-primary: #4F46E5;
  /* Indigo 600 - Rất hiện đại */
  --color-primary-hover: #4338CA;
  --color-primary-dark: #3730A3;
  /* Thêm biến bị thiếu cho hover */
  --color-primary-light: rgba(79, 70, 229, 0.1);

  /* System / Status Colors */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #F43F5E;
  /* Rose 500 - đỏ hồng hiện đại */
  --color-info: #0EA5E9;

  /* Specific Banquet Colors */
  --color-booking: #10B981;
  --color-contract: #F43F5E;

  /* Surfaces & Backgrounds */
  --color-background: #F8FAFC;
  --color-bg-secondary: #F1F5F9; /* Slate 100 cho background phụ */
  /* Nền Slate 50 - Sáng, sang */
  --color-surface: #FFFFFF;
  --color-surface-elevated: #F4F6FB;
  --color-sidebar: var(--color-surface);
  /* Slate 900 - Đen sâu thăm thẳm */
  --color-header: rgba(255, 255, 255, 0.85);
  /* Glass header */

  /* Text & Typography */
  --color-text: #1E293B;
  /* Slate 800 */
  --color-text-secondary: #64748B;
  /* Slate 500 */
  --color-text-sidebar: #334155;
  /* Slate 700 — dễ đọc trên nền trắng */

  /* Borders & Dividers */
  --color-border: #F1F5F9;
  /* Slate 100 - Border siêu mờ */
  --color-border-strong: #E2E8F0;

  /* Shadows (Ultra Premium Soft Shadows) */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.02), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 25px 30px -5px rgba(0, 0, 0, 0.04), 0 15px 15px -10px rgba(0, 0, 0, 0.02);
  --shadow-glass: 0 4px 6px -1px rgba(0, 0, 0, 0.02);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 20px;
  --spacing-xl: 24px;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-md: 15px;
  /* Kích thước text chuẩn nhìn sang hơn */
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Radius (Squircle-like) */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  /* Layout Constants */
  --sidebar-width: 280px;
  --header-height: 62px;
  --navbar-height: 62px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════
   Dark Theme Overrides
   ═══════════════════════════════════════════ */
body.dark-theme {
  --color-background: #0F172A; /* Slate 900 */
  --color-surface: #1E293B; /* Slate 800 */
  --color-surface-elevated: #0F172A; /* Slate 900 (Tối hơn surface một chút để tạo độ sâu) */
  --color-sidebar: var(--color-surface); /* Slate 950 */
  --color-header: rgba(30, 41, 59, 0.85);
  --color-bg-secondary: #334155; /* Slate 700 cho header bảng */
  --color-text: #F8FAFC; /* Slate 50 */
  --color-text-secondary: #94A3B8; /* Slate 400 */
  --color-border: #334155; /* Slate 700 */
  --color-border-strong: #475569; /* Slate 600 */
  
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
}

/* Fix some styles for dark theme cards and inputs */
body.dark-theme .card,
body.dark-theme .header-right,
body.dark-theme .app-header {
  background-color: var(--color-surface);
  color: var(--color-text);
}
body.dark-theme .layout-option,
body.dark-theme .font-option,
body.dark-theme .theme-option {
  background-color: var(--color-surface) !important;
}


/* --- global.css --- */
/* ═══════════════════════════════════════════
   Global Styles — Reset & Core Layout (TailAdmin Clone)
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  /* Modern tighten */
  overflow: hidden;
}

/* ════ CUSTOM SCROLLBAR (Global) ════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

body.dark-theme ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
  letter-spacing: -0.02em;
  /* Tighter headers */
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

img {
  max-width: 100%;
  display: block;
}

/* ═══════════════════════════════════════════
   APP SHELL LAYOUT
   ═══════════════════════════════════════════ */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}



/* ════ SCROLLABLE CONTENT ════ */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px var(--spacing-xl);
  background: var(--color-background);
}

/* Fix width form container if needed */
.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

.page-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  background: var(--color-surface);
  padding: clamp(12px, 3vw, 20px) clamp(12px, 4vw, 24px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.page-title-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.page-title-heading {
  margin: 0;
  font-size: clamp(15px, 3vw, 19px);
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--color-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title-sub {
  font-size: clamp(11px, 1.5vw, 12px);
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.page-title-actions::-webkit-scrollbar {
  display: none;
}

.page-title-actions .button-bar {
  width: 100%;
  border: none;
  padding: 0;
  box-shadow: none;
}





/* ════ RESPONSIVE QUERIES ════ */
/* Desktop / Tablet (1024px) */
@media (max-width: 1024px) {
  .page-title-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    margin-bottom: 16px !important;
    border-radius: var(--radius-md) !important;
  }
  .page-title-info {
    width: 100% !important;
    flex-grow: 1 !important;
  }
  .page-title-heading {
    font-size: 16px !important;
  }
  .page-title-sub {
    font-size: 11px !important;
  }
  .btn-back-header {
    width: 28px !important;
    height: 28px !important;
  }
  .btn-back-header span {
    font-size: 16px !important;
  }
  .page-title-actions {
    width: 100% !important;
    justify-content: flex-start !important;
  }
  .page-title-actions .button-bar {
    width: 100% !important;
  }
}

/* Tablet Small / Mobile (768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --sidebar-width: 260px;
    /* Scale down typography on mobile screens */
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
  }

  .search-box {
    display: none;
  }

  .user-text {
    display: none;
  }

  .app-header {
    padding: 0 16px;
    gap: 8px;
  }

  .app-content {
    padding: 16px;
  }

  /* Tràn lề 2 bên (Full-bleed) cho các khối độc lập trên Mobile */
  .app-content>.button-bar,
  .dynamic-grid-card {
    margin-left: -16px !important;
    margin-right: -16px !important;
    width: calc(100% + 32px) !important;
    max-width: none !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* Trên mobile, tách hẳn Title ra khỏi hộp: Bỏ nền, viền của khung bọc ngoài */
  .page-title-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 16px !important;
  }

  /* Biến phần tiêu đề thành một khối (card) riêng */
  .page-title-info {
    background: var(--color-surface);
    width: calc(100% + 32px) !important;
    margin-left: -16px !important;
    margin-right: -16px !important;
    padding: 16px;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }

  /* Biến toolbar thành một thanh riêng biệt, tràn lề trên mobile */
  .page-title-actions {
    min-width: 0;
    width: calc(100% + 32px) !important;
    margin-left: -16px !important;
    margin-right: -16px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 16px;
  }

  .page-title-actions .button-bar {
    width: auto !important;
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
  }

  .header-left {
    gap: 12px;
  }

  .header-right {
    gap: 14px;
  }

  .btn-hamburger,
  .navbar-hamburger {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
  }

  .btn-hamburger .material-symbols-outlined,
  .navbar-hamburger .material-symbols-outlined {
    font-size: 20px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 12px;
    gap: 12px;
    border-radius: var(--radius-md);
  }

  .stat-icon {
    width: 44px;
    height: 44px;
  }

  .stat-icon .material-symbols-outlined {
    font-size: 22px;
  }

  .stat-info h3 {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .stat-info p {
    font-size: 13px;
    margin-bottom: 0;
  }

  .card-header {
    padding: 16px;
    font-size: 16px;
  }

  .card-body {
    padding: 16px;
  }

  .table-wrapper {
    margin-left: -16px !important;
    margin-right: -16px !important;
    width: calc(100% + 32px) !important;
    border-radius: 0 !important;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Cach trai 1 xiu de thay chu cot dau tien */
  .table-wrapper .data-table th:first-child,
  .table-wrapper .data-table td:first-child {
    padding-left: 16px !important;
  }
}

/* Extremely Small Mobile (e.g. 320px - iPhone SE) */
@media (max-width: 480px) {
  :root {
    --header-height: 56px;
    --sidebar-width: 240px;
    --font-size-2xl: 20px;
    --font-size-xl: 18px;
    --spacing-xl: 16px;
  }

  .btn-hamburger,
  .navbar-hamburger {
    width: 34px;
    height: 34px;
    border-radius: 6px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .icon-btn .material-symbols-outlined {
    font-size: 18px !important;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
  }

  .sidebar-header {
    padding: 0 12px;
    font-size: 15px;
  }

  .sidebar-header>div>.material-symbols-outlined {
    font-size: 22px !important;
    margin-right: 4px !important;
  }

  .btn-close-sidebar {
    width: 28px;
    height: 28px;
  }

  .nav-group-title {
    font-size: 10px;
    padding: 4px 12px;
    margin-top: 12px;
  }

  .nav-item {
    padding: 8px 12px;
    font-size: 13px;
    gap: 8px;
    margin: 2px 8px;
  }

  .nav-item span.icon {
    font-size: 18px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .stat-icon .material-symbols-outlined {
    font-size: 20px;
  }

  .stat-info h3 {
    font-size: 18px;
  }

  .stat-info p {
    font-size: 12px;
  }

  .card-header {
    padding: 12px;
    font-size: 14px;
  }

  .card-body {
    padding: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ════ GLOBAL COMPONENTS ════ */
.panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10004;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.panel-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ════ ANIMATIONS ════ */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ════ FLATPICKR OVERRIDES (Thu nhỏ) ════ */
.flatpickr-calendar {
  width: 260px !important;
  font-size: 13px !important;
}

.flatpickr-days,
.flatpickr-weeks {
  width: 260px !important;
}

.dayContainer {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
}

.flatpickr-day {
  max-width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
}

.flatpickr-month {
  height: 44px !important;
}

.flatpickr-current-month {
  font-size: 110% !important;
  padding-top: 6px !important;
}

span.flatpickr-weekday {
  font-size: 12px !important;
  color: var(--color-text-secondary) !important;
  font-weight: 700 !important;
}

/* ════ FLATPICKR COLORS (Màu sắc) ════ */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  border-color: var(--color-primary) !important;
  border-bottom: none !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3) !important;
}

.flatpickr-day.today.selected {
  color: #ffffff !important;
}

.flatpickr-day.today {
  border: 1px solid var(--color-primary) !important;
  border-bottom: 2px solid var(--color-primary) !important;
  color: var(--color-primary) !important;
  font-weight: bold;
  border-radius: 8px !important;
}

.flatpickr-day:hover {
  background: rgba(79, 70, 229, 0.08) !important;
  color: var(--color-primary) !important;
  border-radius: 8px !important;
  border-bottom: none !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--color-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: var(--color-primary) !important;
  font-weight: 800 !important;
}

/* ---- LOGO THEME SWITCHING ---- */
body.dark-theme .app-logo-light {
  display: none !important;
}

body:not(.dark-theme) .app-logo-dark {
  display: none !important;
}

/* Sidebar Text Brightness for Dark Theme */
body.dark-theme .nav-item {
  color: #f8fafc;
}

body.dark-theme .nav-item span.icon {
  color: #f8fafc;
  opacity: 0.9;
}

body.dark-theme .nav-group-title {
  color: #94a3b8;
  font-weight: 600;
}

body.dark-theme .nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .nav-item:hover span.icon {
  opacity: 1;
}

@media (max-width: 768px) {
  .app-navbar .navbar-brand {
    display: none !important;
  }
}

/* ════ DYNAMIC FORM GRID SYSTEM ════ */
.df-col-12 {
  width: 100% !important;
}

.df-col-8 {
  width: calc(66.666% - 3px) !important;
}

.df-col-6 {
  width: calc(50% - 5px) !important;
}

.df-col-4 {
  width: calc(33.333% - 7px) !important;
}

.df-col-3 {
  width: calc(25% - 8px) !important;
}

.df-col-2 {
  width: calc(16.666% - 8.5px) !important;
}

@media (max-width: 768px) {

  /* Trên Mobile: 
     - Mặc định 100% (df-col-12) vẫn giữ 100%.
     - Các ô 50% (df-col-6) vẫn giữ nguyên 50% để cho phép xếp 2 ô 1 hàng.
     - Các ô quá nhỏ như 33% và 25% sẽ được tự động giãn ra thành 50% (xếp 2 ô 1 hàng) 
       thay vì bị bóp nghẹt quá nhỏ hoặc bị giãn quá to 100%. */
  .df-col-8,
  .df-col-6,
  .df-col-4,
  .df-col-3,
  .df-col-2 {
    width: calc(50% - 5px) !important;
  }
}

/* ════ BACK BUTTON HEADER ════ */
.btn-back-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-back-header:hover {
  background: var(--color-border);
  border-color: var(--color-border-strong);
  color: var(--color-primary);
  transform: translateX(-2px);
}

.btn-back-header span {
  font-size: 18px !important;
}

/* --- navbar.css --- */
/* ═══════════════════════════════════════════
   TOP NAVBAR — Replaces sidebar layout
   ═══════════════════════════════════════════ */

/* ════ NAV CONTAINER ════ */
.app-navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--color-sidebar);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--spacing-md);
  gap: 0;
  font-family: var(--font-family);
  -webkit-user-select: none;
  user-select: none;
}

/* ════ BRAND / LOGO ════ */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  margin-right: 16px;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}

.navbar-brand .brand-icon {
  font-size: 28px;
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.6));
}

/* ════ NAV MENU (CENTER) ════ */
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  list-style: none;
  margin: 0;
  padding: 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.navbar-menu::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* ════ SCROLL ARROWS WRAPPER ════ */
.navbar-menu-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
}

.navbar-scroll-arrow {
  display: none; /* JS controls visibility */
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--color-sidebar);
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
  padding: 0;
}

.navbar-scroll-arrow .material-symbols-outlined {
  font-size: 20px;
}

.navbar-scroll-arrow:hover {
  opacity: 1;
  background: var(--color-background);
}

/* ── Nav Group Item (with dropdown) ── */
.nav-group {
  position: relative;
}

.nav-group-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--font-family);
  white-space: nowrap;
  transition: all var(--transition-fast);
  letter-spacing: -0.01em;
}

.nav-group-btn .nav-icon {
  font-size: 18px;
  opacity: 0.8;
}

.nav-group-btn .chevron {
  font-size: 16px;
  transition: transform var(--transition-fast);
  margin-left: 2px;
  opacity: 0.6;
}

.nav-group-btn:hover,
.nav-group.open .nav-group-btn {
  color: var(--color-text);
  background: var(--color-background);
}

.nav-group.open .nav-group-btn .chevron {
  transform: rotate(180deg);
}

/* ── Single nav link (no dropdown) ── */
.navbar-menu .nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  letter-spacing: -0.01em;
}

.navbar-menu .nav-link .nav-icon {
  font-size: 18px;
  opacity: 0.8;
}

.navbar-menu .nav-link:hover,
.navbar-menu .nav-link.active {
  color: var(--color-text);
  background: var(--color-background);
}

.navbar-menu .nav-link.active {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.navbar-menu .nav-link.active .nav-icon {
  opacity: 1;
}

/* ════ DROPDOWN PANEL ════ */
.nav-dropdown {
  position: fixed;
  min-width: 220px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
  pointer-events: none;
}

/* Dropdown arrow removed for fixed positioning */

.nav-group.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Dropdown Section Label */
.dropdown-section-label {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
}

/* Dropdown Item */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.dropdown-item .drop-icon {
  font-size: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.dropdown-item:hover {
  background: var(--color-background);
  color: var(--color-text);
}

.dropdown-item:hover .drop-icon {
  opacity: 1;
}

.dropdown-item.active {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.dropdown-item.active .drop-icon {
  opacity: 1;
}

.dropdown-divider {
  height: 1px;
  background: var(--color-background);
  margin: 4px 0;
}

/* ════ RIGHT SECTION ════ */
.navbar-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-left: auto;
  flex-shrink: 0;
}

.navbar-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.navbar-icon-btn:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.05);
}

body.dark-theme .navbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.navbar-icon-btn .material-symbols-outlined {
  font-size: 20px;
}

.navbar-icon-btn .badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--color-sidebar);
}

/* ── User Profile in Navbar ── */
.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.navbar-user:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.dark-theme .navbar-user:hover {
  background: rgba(255, 255, 255, 0.08);
}

.navbar-user .user-avatar-nav {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(79, 70, 229, 0.5);
}

.navbar-user .user-avatar-nav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.navbar-user .user-info-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.navbar-user .user-name-nav {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1;
}

.navbar-user .user-role-nav {
  font-size: 11.5px;
  color: var(--color-text-secondary);
  line-height: 1;
}

.navbar-user .expand-icon {
  font-size: 18px;
  color: var(--color-text-secondary);
  transition: transform var(--transition-fast);
}

/* User dropdown */
.navbar-user.open .expand-icon {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
  pointer-events: none;
}

.user-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 20px;
  width: 12px;
  height: 12px;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.navbar-user.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.user-dropdown-header {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 6px;
}

.user-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.user-dropdown-role {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-dropdown-item .material-symbols-outlined {
  font-size: 18px;
}

.user-dropdown-item:hover {
  background: var(--color-background);
  color: var(--color-text);
}

.user-dropdown-item.danger:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--color-danger);
}

/* ════ HAMBURGER (Mobile only) ════ */
.navbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  margin-right: 12px;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.navbar-hamburger:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
}

.navbar-hamburger .material-symbols-outlined {
  font-size: 24px;
}

/* ════ MOBILE DRAWER ════ */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  backdrop-filter: blur(2px);
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-sidebar);
  z-index: 10002;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.mobile-drawer.open {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}

.mobile-drawer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.mobile-drawer-brand .brand-icon {
  font-size: 24px;
  color: var(--color-primary);
}

.mobile-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-drawer-close:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
}

.mobile-drawer-nav {
  padding: 12px 0;
  flex: 1;
}

.mobile-nav-section-label {
  padding: 12px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: 0;
  margin: 2px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.mobile-nav-item .material-symbols-outlined {
  font-size: 20px;
  opacity: 0.8;
}

.mobile-nav-item:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-item.active {
  color: #ffffff;
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.mobile-nav-item.active .material-symbols-outlined {
  opacity: 1;
}

.mobile-nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 8px 0;
}

/* ════ RESPONSIVE ════ */
@media (max-width: 1024px) {
  .navbar-menu-wrapper {
    display: none;
  }

  .navbar-hamburger {
    display: flex;
  }

  .navbar-user .user-info-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-navbar {
    padding: 0 var(--spacing-md);
  }

  .navbar-brand {
    display: none;
  }

  .navbar-right {
    gap: var(--spacing-sm);
  }

  .navbar-icon-btn {
    width: 32px;
    height: 32px;
  }

  .navbar-icon-btn .material-symbols-outlined {
    font-size: 18px;
  }
}

/* ══════════════════════════════════════════
   LAYOUT SWITCHER (inside user dropdown)
   ══════════════════════════════════════════ */

.layout-switcher-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 8px;
}

.layout-switcher-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.layout-toggle-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}

.layout-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-family);
}

.layout-toggle-btn .material-symbols-outlined {
  font-size: 17px;
}

.layout-toggle-btn:hover {
  color: var(--color-text-secondary);
  background: rgba(255,255,255,0.05);
}

.layout-toggle-btn.active {
  background: var(--color-primary);
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.layout-toggle-btn.active:hover {
  background: var(--color-primary-hover);
  color: var(--color-text);
}

/* ══════════════════════════════════════════
   VERTICAL LAYOUT SHELL
   ══════════════════════════════════════════ */

.vertical-layout-shell {
  display: flex;
  flex-direction: row;
  width: 100%;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.layout-vertical #navbar-container {
  flex: 1;
  display: flex;
  width: 100%;
  overflow: hidden;
}

.vertical-layout-shell .app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-sidebar);
  color: var(--color-text-sidebar);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform var(--transition-normal);
  overflow-y: auto;
}

.vertical-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.vertical-main .app-header {
  height: var(--header-height);
  background-color: var(--color-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xl);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 99;
  flex-shrink: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  -webkit-user-select: none;
  user-select: none;
}

.user-profile:hover {
  background: rgba(0,0,0,0.04);
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1;
}

.user-role {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1;
  margin-top: 2px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(79,70,229,0.4);
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vertical-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
  pointer-events: none;
}

.vertical-user-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.vertical-user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Sidebar overlay for vertical mobile */
.vertical-layout-shell .sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.vertical-layout-shell .sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* btn-close-sidebar inside sidebar */
.app-sidebar .btn-close-sidebar {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--color-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* sidebar-header */
.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-nav {
  flex-grow: 1;
  overflow-y: auto;
  padding: var(--spacing-md) 0;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
body.dark-theme .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

/* nav-group-title inside sidebar */
.nav-group-title {
  padding: var(--spacing-xs) var(--spacing-lg);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--spacing-lg);
}

/* nav-item inside sidebar */
.nav-item {
  display: flex;
  align-items: center;
  padding: 11px var(--spacing-lg);
  margin: 3px var(--spacing-md);
  color: var(--color-text-secondary);
  font-weight: 500;
  border-radius: var(--radius-sm);
  gap: 12px;
  transition: all var(--transition-fast);
  font-size: 14px;
  text-decoration: none;
}

.nav-item .icon {
  font-size: 20px;
  opacity: 0.9;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background: rgba(79, 70, 229, 0.07);
  color: var(--color-primary);
}

.nav-item:hover .icon { opacity: 1; }

.nav-item.active {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.2);
}

.nav-item.active .icon { opacity: 1; }

/* Header search & icon-btn for vertical mode */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-background);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--color-text);
  width: 240px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-hamburger:hover {
  color: var(--color-text);
  background: var(--color-background);
}

.btn-hamburger .material-symbols-outlined {
  font-size: 24px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #EFF4FB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.icon-btn:hover { color: var(--color-primary); }

body.dark-theme .icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.icon-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
}

/* Mobile: show hamburger, hide sidebar in vertical mode */
@media (max-width: 1024px) {
  .vertical-layout-shell .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    transform: translateX(-100%);
    z-index: 10002;
  }

  .vertical-layout-shell .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .vertical-layout-shell .btn-close-sidebar {
    display: flex !important;
  }

  .btn-hamburger {
    display: flex !important;
  }

  .search-box {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .user-info {
    display: none !important;
  }

  .vertical-main .app-header {
    padding: 0 16px;
  }


  .header-right {
    gap: 8px;
  }
}


/* --- sidebar.css --- */
/* ═══════════════════════════════════════════
   SIDEBAR COMPONENTS
   ═══════════════════════════════════════════ */

#sidebar-container {
  width: var(--sidebar-width);
  flex-shrink: 0;
  transition: width var(--transition-normal);
}

@media (max-width: 1024px) {
  #sidebar-container {
    width: 0 !important;
  }
}

.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-sidebar);
  color: var(--color-text-sidebar);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 9999;
  transition: transform var(--transition-normal);
  border-right: 1px solid var(--color-border-strong);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  gap: 8px;
}

.btn-close-sidebar {
  display: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--color-text-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-close-sidebar:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
  flex-grow: 1;
  overflow-y: auto;
  padding: var(--spacing-md) 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

body.dark-theme .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.nav-group-title {
  padding: var(--spacing-xs) var(--spacing-lg);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--spacing-lg);
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 11px var(--spacing-lg);
  margin: 3px var(--spacing-md);
  color: var(--color-text-sidebar);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  gap: 12px;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.nav-item span.icon {
  font-size: 20px;
  opacity: 1;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background-color: rgba(79, 70, 229, 0.07);
  color: var(--color-primary);
}

.nav-item.active {
  background-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.nav-item.active span.icon {
  opacity: 1;
}

/* ════ MOBILE OVERLAY ════ */
.sidebar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}


/* --- header.css --- */
/* ═══════════════════════════════════════════
   HEADER COMPONENTS
   ═══════════════════════════════════════════ */

.app-header {
  height: var(--header-height);
  background-color: var(--color-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xl);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-glass);
  z-index: 99;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}



.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #EFF4FB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--color-primary);
}

.icon-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
}

/* ════ RESPONSIVE QUERIES ════ */
@media (max-width: 1024px) {
  .search-box {
    display: none !important;
  }
}

@media (max-width: 768px) {

  .app-header {
    padding: 0 16px;
    gap: 8px;
  }
  .user-info {
    display: none !important;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
  }
  .icon-btn .material-symbols-outlined {
    font-size: 18px !important;
  }
  .header-right {
    gap: 8px;
  }
}



/* --- dashboard.css --- */
/* ═══════════════════════════════════════════
   DASHBOARD LAYOUT CSS
   Chỉ chứa grid layout classes đặc thù của dashboard
   Các visual styles đã chuyển sang component CSS:
     - compare-badge.css, metric-card.css, sparkline.css
   - kv-table.css, hall-gauge.css, section-panel.css
   ═══════════════════════════════════════════ */

/* ─── WARNING BANNER ─── */
.db-warning-banner {
  display: flex;
  align-items: center;
  background-color: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  gap: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.db-warning-icon {
  color: var(--color-danger, #f43f5e);
  font-size: 24px;
}

.db-warning-text {
  flex: 1;
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.4;
}

.db-warning-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  background-color: var(--color-surface);
  color: var(--color-danger, #f43f5e);
  border: 1px solid rgba(244, 63, 94, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}

.db-warning-btn:hover {
  background-color: rgba(244, 63, 94, 0.05);
}

/* ─── TODAY GRID: 7 cột ngang liền mạch ─── */
.db-today-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 1.4fr 1fr 1fr 1fr 1fr;
}

/* Mỗi cell có border phải */
.db-today-grid > * {
  border-right: 1px solid var(--color-border);
}
.db-today-grid > *:last-child {
  border-right: none;
}

/* Hall cell không dùng MetricCard layout */
.db-today-hall-cell {
  border-right: 1px solid var(--color-border);
  background: rgba(79, 70, 229, 0.02);
}

/* ─── REVENUE GRID: 3 cột ─── */
.db-revenue-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
}

.db-revenue-grid > * {
  border-right: 1px solid var(--color-border);
}
.db-revenue-grid > *:last-child {
  border-right: none;
}

.db-revenue-main {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-revenue-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.db-revenue-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -1px;
  line-height: 1.1;
}

.db-revenue-compare {
  display: flex;
  align-items: center;
  gap: 6px;
}

.db-compare-text {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.db-revenue-stat-col {
  display: flex;
  flex-direction: column;
}

.db-rev-stat-item {
  padding: 16px 20px;
  flex: 1;
}

.db-rev-stat-divider {
  height: 1px;
  background: var(--color-border);
}

.db-rev-stat-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.db-rev-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.db-rev-stat-value.success { color: var(--color-success); }

.db-rev-stat-compare {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.db-rev-stat-sub {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* ─── BOTTOM GRID: 3 panels ─── */
.db-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* .card trong bottom-grid: bỏ margin-bottom mặc định (gap đã xử lý) */
.db-bottom-grid > .card {
  margin-bottom: 0;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1300px) {
  .db-today-grid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .db-today-hall-cell {
    grid-column: 3 / 5;
    border-right: none;
  }
  .db-revenue-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
  .db-bottom-grid {
    grid-template-columns: 1fr 1fr;
  }
  .db-bottom-grid .section-panel:last-child {
    grid-column: 1 / 3;
  }
}

@media (max-width: 900px) {
  .db-today-grid { grid-template-columns: 1fr 1fr; }
  .db-today-hall-cell { grid-column: 1 / 3; border-right: none; }
  .db-revenue-grid { grid-template-columns: 1fr; }
  .db-revenue-main { border-right: none !important; border-bottom: 1px solid var(--color-border); }
  .db-revenue-stat-col { border-right: none !important; flex-direction: row; }
  .db-rev-stat-divider { width: 1px; height: auto; }
  .db-rev-stat-item { flex: 1; }
  .db-bottom-grid { grid-template-columns: 1fr; }
  .db-bottom-grid .section-panel:last-child { grid-column: 1; }
}

@media (max-width: 600px) {
  .db-today-grid { 
    grid-template-columns: 1fr 1fr; 
    gap: 1px;
    background: var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }
  .db-today-hall-cell { 
    grid-column: 1 / 3; 
  }
  .db-today-grid > * { 
    border: none !important; 
    background: var(--color-surface);
  }
  
  .db-revenue-main {
    padding: 16px 6px !important;
  }
  
  .db-revenue-value { font-size: 22px; }

  .db-warning-banner {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .db-warning-icon {
    font-size: 20px;
    margin-top: 2px;
  }

  .db-warning-text {
    flex: 1 1 calc(100% - 32px);
    font-size: 12.5px;
    line-height: 1.35;
  }

  .db-warning-btn {
    flex: 1 1 100%;
    justify-content: center;
    margin-top: 2px;
    padding: 6px 12px;
    font-size: 12px;
  }
}


/* --- compare-badge.css --- */
/* ═══════════════════════════════════════════
   COMPARE BADGE COMPONENT
   So sánh kỳ trước: +12.5% ▲ / -3.2% ▼
   ═══════════════════════════════════════════ */

.compare-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 7px;
  border-radius: 99px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

/* Sizes */
.compare-badge--md {
  font-size: 12px;
  padding: 3px 8px;
}

.compare-badge--sm {
  font-size: 11px;
  padding: 2px 6px;
}

/* Icon */
.compare-badge .cb-icon {
  font-size: 12px !important;
  line-height: 1;
  display: flex;
  align-items: center;
}

.compare-badge--sm .cb-icon {
  font-size: 11px !important;
}

/* Directions */
.compare-badge--up {
  background: rgba(16, 185, 129, 0.10);
  color: var(--color-success);
}

.compare-badge--down {
  background: rgba(244, 63, 94, 0.10);
  color: var(--color-danger);
}

.compare-badge--neutral {
  background: rgba(148, 163, 184, 0.10);
  color: var(--color-text-secondary);
}

/* Dark theme */
body.dark-theme .compare-badge--up {
  background: rgba(16, 185, 129, 0.15);
}

body.dark-theme .compare-badge--down {
  background: rgba(244, 63, 94, 0.15);
}

body.dark-theme .compare-badge--neutral {
  background: rgba(148, 163, 184, 0.12);
}


/* --- metric-card.css --- */
/* ═══════════════════════════════════════════
   METRIC CARD COMPONENT
   KPI card: icon + label + value lớn + sub
   ═══════════════════════════════════════════ */

.metric-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  transition: background 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

/* Clickable variant */
.metric-card--clickable {
  cursor: pointer;
}

.metric-card--clickable:hover {
  background: rgba(79, 70, 229, 0.025);
}

/* ─── Icon ─── */
.metric-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.metric-card--clickable:hover .metric-card__icon {
  transform: scale(1.08);
}

.metric-card__icon .material-symbols-outlined {
  font-size: 20px !important;
}

/* ─── Content ─── */
.metric-card__content {
  flex: 1;
  min-width: 0;
}

.metric-card__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card__value {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.15;
  letter-spacing: -0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card__sub {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Size: large ─── */
.metric-card--large .metric-card__icon {
  width: 48px;
  height: 48px;
}

.metric-card--large .metric-card__icon .material-symbols-outlined {
  font-size: 24px !important;
}

.metric-card--large .metric-card__value {
  font-size: 26px;
  letter-spacing: -0.8px;
}

.metric-card--large .metric-card__label {
  font-size: 12px;
}

/* ─── Responsive ─── */
@media (max-width: 992px) {
  .metric-card--large .metric-card__value {
    font-size: 20px;
  }
}

@media (max-width: 600px) {
  .metric-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .metric-card__value {
    font-size: 18px;
  }
}


/* --- sparkline.css --- */
/* ═══════════════════════════════════════════
   SPARKLINE CHART COMPONENT
   Mini trend chart trên Canvas
   ═══════════════════════════════════════════ */

.sparkline-canvas {
  display: block;
  max-width: 100%;
}

/* Wrapper dùng khi cần căn chỉnh vị trí */
.sparkline-wrap {
  display: flex;
  align-items: flex-end;
}


/* --- kv-table.css --- */
/* ═══════════════════════════════════════════
   KV TABLE COMPONENT
   Bảng 2 cột: key ↔ value tài chính
   ═══════════════════════════════════════════ */

.kvtable {
  width: 100%;
}

.kvtable__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  gap: 8px;
  transition: background 0.15s;
}

.kvtable__row:last-child {
  border-bottom: none;
}

/* Header row */
.kvtable__row--header {
  background: rgba(248, 250, 252, 0.9);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

body.dark-theme .kvtable__row--header {
  background: rgba(30, 41, 59, 0.6);
}

/* Total row */
.kvtable__row--total {
  background: rgba(79, 70, 229, 0.04);
  font-weight: 600;
}

body.dark-theme .kvtable__row--total {
  background: rgba(79, 70, 229, 0.08);
}

/* Label */
.kvtable__label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  color: var(--color-text);
  font-size: 13px;
}

/* Value */
.kvtable__value {
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
}

.kvtable__row--total .kvtable__value {
  font-weight: 800;
  font-size: 14px;
}

/* Dot indicator */
.kvtable__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* --- hall-gauge.css --- */
/* ═══════════════════════════════════════════
   HALL GAUGE COMPONENT
   Progress gauge: tổng / đang / xong
   ═══════════════════════════════════════════ */

.hall-gauge {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}

/* Title */
.hall-gauge__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.hall-gauge__icon {
  font-size: 16px !important;
  color: var(--color-primary);
}

/* Big count */
.hall-gauge__count {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hall-gauge__count-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -1px;
}

.hall-gauge__count-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Bar */
.hall-gauge__bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hall-gauge__bar {
  flex: 1;
  height: 8px;
  background: rgba(79, 70, 229, 0.10);
  border-radius: 999px;
  overflow: hidden;
}

body.dark-theme .hall-gauge__bar {
  background: rgba(79, 70, 229, 0.20);
}

.hall-gauge__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hall-gauge__pct {
  font-size: 13px;
  font-weight: 700;
  min-width: 38px;
  text-align: right;
}

/* Sub text */
.hall-gauge__sub {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-secondary);
  gap: 8px;
}

.hall-gauge__sub strong {
  color: var(--color-text);
  font-weight: 600;
}


/* --- section-panel.css --- */
/* ═══════════════════════════════════════════
   SECTION PANEL COMPONENT
   Kế thừa .card + .card-header từ card.css
   Chỉ override những gì khác biệt
   ═══════════════════════════════════════════ */

/* ─── Override .card cho dashboard section ─── */
/* Tắt hover lift — dashboard sections không cần float */
.section-panel.card:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

/* Ghi đè margin-bottom mặc định của .card (24px) → 16px */
.section-panel.card {
  margin-bottom: 16px;
  border-radius: var(--radius-md);
}

/* ─── Override .card-header ─── */
/* card-header mặc định: padding 20px 24px, font-size lg
   dashboard cần: compact hơn, uppercase label style */
.section-panel .card-header {
  padding: 9px 16px;
  min-height: 40px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  background: rgba(248, 250, 252, 0.6);
}

body.dark-theme .section-panel .card-header {
  background: rgba(30, 41, 59, 0.5);
}

/* ─── Title group (icon + title text + trailing) ─── */
.section-panel__title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.section-panel__icon {
  font-size: 15px !important;
  color: var(--color-primary);
  flex-shrink: 0;
}

.section-panel__title-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-panel__trailing {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-secondary);
  white-space: nowrap;
  opacity: 0.8;
}

/* ─── Actions group ─── */
.section-panel__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ─── Period select — dùng cùng CSS variable với .ui-input ─── */
.section-panel__period-select {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 12px;
  padding: 3px 8px;
  height: 28px;
  width: auto;
  min-width: 90px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.section-panel__period-select:focus {
  border-color: var(--color-primary);
}

/* ─── Refresh button — kế thừa .btn .btn-tool, override size ─── */
.section-panel__refresh-btn {
  /* Kế thừa base styles từ .btn + .btn-tool */
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
  /* Override: btn-tool không có border, section-panel cần border nhỏ */
  border: 1px solid var(--color-border-strong) !important;
}

.section-panel__refresh-btn:hover {
  background: var(--color-primary-light) !important;
  color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.section-panel__refresh-btn .material-symbols-outlined {
  font-size: 16px !important;
  transition: transform 0.4s ease;
}

.section-panel__refresh-btn:hover .material-symbols-outlined {
  transform: rotate(180deg);
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .section-panel__title-text {
    font-size: 11px;
  }

  .section-panel .card-header {
    padding: 8px 12px;
  }
}

/* --- report-filter.css --- */
/* ═══════════════════════════════════════════
   REPORT FILTER DIALOG COMPONENT
   Dialog "Chọn báo cáo" với fields động từ API
   ═══════════════════════════════════════════ */

/* ─── Body layout ─── */
.rfd-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 0;
}

/* ─── Loading spinner ─── */
.rfd-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.rfd-spin {
  animation: rfd-rotate 1s linear infinite;
  font-size: 20px !important;
  color: var(--color-primary);
}

@keyframes rfd-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Row: label + input ─── */
.rfd-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--color-border);
}

.rfd-row:last-child { border-bottom: none; }

.rfd-row:hover { background: rgba(79, 70, 229, 0.015); }

/* ─── Label ─── */
.rfd-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}

/* ─── Input override (compact hơn .ui-input mặc định) ─── */
.rfd-input {
  padding: 5px 10px !important;
  font-size: 13px !important;
  height: 32px;
}

.rfd-select {
  cursor: pointer;
}

/* ─── Date range ─── */
.rfd-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rfd-date-range .rfd-input {
  flex: 1;
  min-width: 0;
}

.rfd-date-sep {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Footer ─── */
.rfd-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .rfd-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .rfd-date-range {
    flex-wrap: wrap;
  }
}


/* --- accordion.css --- */
/* ═══════════════════════════════════════════
   ACCORDION COMPONENT
   ═══════════════════════════════════════════ */

.ui-accordion {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.ui-accordion-header {
  padding: 16px 24px;
  background: var(--color-background);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--color-text);
  transition: background 0.2s;
}

.ui-accordion-header:hover {
  background: rgba(148, 163, 184, 0.1);
}

.ui-accordion-icon {
  transition: transform 0.3s ease;
}

.ui-accordion.open .ui-accordion-icon {
  transform: rotate(180deg);
}

.ui-accordion-body {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--color-surface);
}

.ui-accordion.open .ui-accordion-body {
  padding: 24px;
  max-height: 1000px;
  border-top: 1px solid var(--color-border);
}


/* --- alert.css --- */
/* ═══════════════════════════════════════════
   ALERT / TOAST COMPONENT
   ═══════════════════════════════════════════ */

#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

@media (min-width: 768px) {
  #toast-container {
    left: auto;
    right: 24px;
    transform: none;
    align-items: flex-end;
  }
}

.toast {
  min-width: 220px;
  max-width: 340px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-left: 3px solid var(--color-primary);
  transform: translateY(-16px);
  opacity: 0;
  pointer-events: auto;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left-color: var(--color-success); }
.toast.danger { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon .material-symbols-outlined {
  font-size: 24px;
}
.toast.success .toast-icon { color: var(--color-success); }
.toast.danger .toast-icon { color: var(--color-danger); }
.toast.warning .toast-icon { color: var(--color-warning); }
.toast.info .toast-icon { color: var(--color-primary); }

.toast-content {
  flex-grow: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0;
  display: flex;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

/* Timer bar */
.toast {
  position: relative;
  overflow: hidden;
}

.toast-timer {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--color-primary);
  animation: toast-timer-shrink linear forwards;
  transform-origin: left;
}

@keyframes toast-timer-shrink {
  from { width: 100%; }
  to   { width: 0%; }
}

.toast.success .toast-timer { background: var(--color-success); }
.toast.danger  .toast-timer { background: var(--color-danger); }
.toast.warning .toast-timer { background: var(--color-warning); }


/* --- badge.css --- */
/* ═══════════════════════════════════════════
   BADGE COMPONENT
   ═══════════════════════════════════════════ */

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.status-badge.danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.status-badge.primary {
  background: rgba(60, 80, 224, 0.1);
  color: var(--color-primary);
}


/* --- button.css --- */
/* ═══════════════════════════════════════════
   BUTTON COMPONENTS
   ═══════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: var(--font-size-md);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn:active {
  background-color: var(--color-border);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-secondary);
  border-color: transparent;
}

.btn-secondary:hover:not(:disabled) {
  background: #E2E8F0;
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

.btn-danger:hover:not(:disabled) {
  background: #DC2626;
  border-color: #DC2626;
}

/* BUTTON BARS */
.button-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  max-width: 100%;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.button-bar::-webkit-scrollbar {
  display: none;
}
/* Wrapper ngoài giữ shadow (shadow bị clip nếu đặt trực tiếp vào overflow:auto) */
#customers-btn-container .button-bar,
.toolbar-host .button-bar {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.btn-tool {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: 500;
  border-radius: var(--radius-sm);
  box-shadow: none;
  white-space: nowrap;
}

.btn-tool:hover {
  background: var(--color-background);
  color: var(--color-primary);
}

.btn-tool.text-danger:hover {
  color: var(--color-danger);
}

.btn-tool .material-symbols-outlined {
  font-size: 18px;
}

.button-bar .divider {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  margin: 0 4px;
}

/* OUTLINE BUTTONS */
.btn-outline-primary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline-primary:hover:not(:disabled) {
  background: var(--color-primary);
  color: white;
}

.btn-outline-success {
  background: transparent;
  color: var(--color-success);
  border-color: var(--color-success);
}
.btn-outline-success:hover:not(:disabled) {
  background: var(--color-success);
  color: white;
}

.btn-outline-danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.btn-outline-danger:hover:not(:disabled) {
  background: var(--color-danger);
  color: white;
}

/* GENERIC OUTLINE (ELEVATED ON HOVER) */
.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: all 0.2s ease;
}
.btn-outline:hover:not(:disabled) {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}


/* --- calendar.css --- */
/* ═══════════════════════════════════════════
   PREMIUM CALENDAR (Lịch Tiệc) CSS
   ═══════════════════════════════════════════ */

.ui-calendar-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-normal);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
}

.calendar-month-picker {
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  box-shadow: none;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: all var(--transition-normal);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.calendar-month-picker .material-symbols-outlined {
  color: var(--color-primary) !important;
  transition: transform 0.3s ease;
}

.calendar-month-picker:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--color-border-strong);
  box-shadow: none;
  transform: translateY(-1px);
}
.calendar-month-picker:hover .material-symbols-outlined {
  transform: translateY(2px);
}

/* Premium Dropdown Month Picker */
.calendar-dropdown-picker {
  position: absolute;
  width: 280px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
  border: 1px solid var(--color-border-strong);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: popInCell var(--transition-fast) forwards;
  z-index: 1000000000 !important;
}

.calendar-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-dropdown-year-label {
  font-weight: 800;
  font-size: 16px;
  color: var(--color-text);
  letter-spacing: -0.2px;
}

.calendar-dropdown-months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.calendar-dropdown-month-btn {
  padding: 8px 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(0, 0, 0, 0.02);
  color: var(--color-text);
}

body.dark-theme .calendar-dropdown-month-btn {
  background: rgba(255, 255, 255, 0.02);
}

.calendar-dropdown-month-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text);
}

.calendar-dropdown-month-btn.active {
  background: var(--color-border-strong);
  color: var(--color-text);
  font-weight: 800;
  box-shadow: none;
}

.calendar-dropdown-month-btn.has-events {
  position: relative;
}

.month-event-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-danger);
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.calendar-dropdown-month-btn.active .month-event-dot {
  background: var(--color-text);
}


/* Modern Gap-Based Schedule Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--color-surface-hover, #f3f4f6);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
}

body.dark-theme .calendar-days-header {
  background: rgba(255, 255, 255, 0.05);
}

.calendar-day-header {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  padding: 12px 0;
  user-select: none;
}

.calendar-day-header.sunday {
  color: var(--color-danger);
}

/* Individual Schedule Card Slots */
.calendar-day {
  background: var(--color-surface);
  border-radius: 0;
  padding: 8px 10px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  box-sizing: border-box;
}


/* Empty Slots (Other Month Days) */
.calendar-day.empty-day {
  background: rgba(0, 0, 0, 0.015);
  box-shadow: none;
}

.calendar-day.empty-day .calendar-day-number span {
  color: var(--color-text-secondary);
  opacity: 0.45;
  font-weight: 500;
}

.calendar-day.empty-day:hover {
  background: rgba(148, 163, 184, 0.05);
  border-color: var(--color-border-strong);
}

/* Hover effect: simple background change for table grid */
.calendar-day:hover:not(.empty-day) {
  background: var(--color-hover, rgba(0, 0, 0, 0.04));
  z-index: 2;
}

.calendar-day:active:not(.empty-day) {
  background: rgba(0, 0, 0, 0.07);
}

.calendar-day-number {
  font-weight: 700;
  font-size: 14px;
  align-self: flex-start;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.calendar-day-number span.solar-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-text);
  transition: all var(--transition-fast);
}

/* Today Cell Accent styling */
.calendar-day.today {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04), rgba(79, 70, 229, 0.01));
}

.calendar-day.today .calendar-day-number span.solar-date {
  color: white !important;
  font-weight: 800;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

.calendar-day-number span.lunar-date {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  opacity: 0.7;
}

.calendar-day-number span.lunar-date.highlight {
  color: var(--color-danger);
  font-weight: 700;
  opacity: 0.9;
}

/* Event Labels inside Days */
.calendar-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  width: 100%;
}

.calendar-event-label {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  letter-spacing: 0.2px;
}

.calendar-event-label .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Soft success themed booking tags */
.calendar-event-label.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.15);
}

.calendar-event-label.success .dot {
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.calendar-event-label.success:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.25);
}

/* Soft primary themed contract tags */
.calendar-event-label.primary {
  background: rgba(225, 29, 72, 0.08);
  color: #E11D48;
  border-color: rgba(225, 29, 72, 0.15);
}

.calendar-event-label.primary .dot {
  background: #F43F5E;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.25);
}

.calendar-event-label.primary:hover {
  background: rgba(225, 29, 72, 0.12);
  border-color: rgba(225, 29, 72, 0.25);
}

/* Mobile responsive dots instead of full labels */
.calendar-event-dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.calendar-event-dot.primary { background: #F43F5E; }
.calendar-event-dot.success { background: #10B981; }

@keyframes popInCell {
  0% { opacity: 0; transform: scale(0.96) translateY(4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.calendar-day.animate-pop {
  animation: popInCell 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

/* ════ MOBILE RESPONSIVE ADAPTATION ════ */
@media (max-width: 1024px) {
  .calendar-grid,
  .calendar-days-header {
    gap: 6px;
  }
  .calendar-day {
    padding: 8px 10px;
    min-height: 95px;
  }
}

@media (max-width: 768px) {
  .ui-calendar-wrapper {
    padding: 16px 4px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    box-shadow: none;
  }
  .calendar-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
    flex-wrap: nowrap;
  }
  .calendar-header > div:last-child {
    width: auto;
    display: flex;
    justify-content: flex-end;
    gap: 2px;
  }
  .calendar-header .btn {
    font-size: 11px;
    padding: 6px 8px;
    white-space: nowrap;
  }
  .calendar-month-picker {
    font-size: clamp(14px, 4vw, 16px);
    padding: 6px 8px;
    gap: 4px;
    white-space: nowrap;
  }
  .calendar-grid,
  .calendar-days-header {
    gap: 0;
  }
  .calendar-day-header {
    font-size: 11px;
    padding: 6px 0;
  }
  .calendar-day {
    min-height: 58px;
    padding: 6px 6px;
    align-items: center;
    justify-content: center;
  }
  .calendar-day-number {
    text-align: center;
    align-self: center;
    flex-direction: column;
    gap: 0;
  }
  .calendar-day-number span.solar-date {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
  .calendar-day-number span.lunar-date {
    font-size: 9.5px;
    line-height: 1;
    margin-top: 1px;
    white-space: nowrap;
  }
  .calendar-event-label {
    display: none;
  }
  .calendar-events {
    flex-direction: row;
    justify-content: center;
    gap: 3px;
    margin-top: 4px;
  }
  .calendar-event-dot {
    display: block;
    width: 5px;
    height: 5px;
  }
}

/* Selected Day Style */
.calendar-day.selected {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(79, 70, 229, 0.02)) !important;
}
.calendar-day.selected .calendar-day-number span.solar-date {
  color: white !important;
  font-weight: 800;
  background: var(--color-primary) !important;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

/* Custom Datepicker Overrides */
.custom-datepicker-popup {
  position: absolute;
  z-index: 99999999 !important;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  width: 340px;
  box-sizing: border-box;
  animation: popInCell var(--transition-fast) forwards;
}

.custom-datepicker-popup .ui-calendar-wrapper {
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  margin: 0 !important;
  width: 100% !important;
}

.custom-datepicker-popup .calendar-header {
  margin-bottom: 8px !important;
  gap: 8px !important;
  padding: 0 !important;
}

.custom-datepicker-popup .calendar-month-picker {
  font-size: 15px !important;
  padding: 4px 8px !important;
  gap: 4px !important;
  border-radius: var(--radius-sm) !important;
}

.custom-datepicker-popup .calendar-header > div:last-child {
  gap: 4px !important;
}

.custom-datepicker-popup .calendar-header .btn {
  padding: 4px 8px !important;
  font-size: 12px !important;
  height: 28px !important;
  width: auto !important;
}

.custom-datepicker-popup .calendar-header button.rounded-circle {
  width: 28px !important;
  height: 28px !important;
}

.custom-datepicker-popup .calendar-day-header {
  padding: 4px 0 !important;
  font-size: 11px !important;
}

.custom-datepicker-popup .calendar-grid {
  gap: 0 !important;
  border-radius: 6px !important;
}

.custom-datepicker-popup .calendar-day {
  min-height: 48px !important;
  padding: 4px !important;
  align-items: center !important;
  justify-content: center !important;
}

.custom-datepicker-popup .calendar-day-number {
  align-self: center !important;
  text-align: center !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0 !important;
}

.custom-datepicker-popup .calendar-day-number span.solar-date {
  width: 24px !important;
  height: 24px !important;
  font-size: 13px !important;
}

.custom-datepicker-popup .calendar-day-number span.lunar-date {
  font-size: 9.5px !important;
  margin-top: 1px !important;
  display: block !important;
  line-height: 1.1 !important;
}

/* Mobile Responsive Datepicker Popup Centering */
@media (max-width: 576px) {
  .custom-datepicker-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    animation: mobilePopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    margin: 0 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
    z-index: 99999999 !important;
  }
}

@keyframes mobilePopIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}




/* --- card.css --- */
/* ═══════════════════════════════════════════
   CARD COMPONENTS
   ═══════════════════════════════════════════ */

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  margin-bottom: var(--spacing-xl);
  overflow: hidden;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 24px;
}

/* Edge-to-edge on mobile */
@media (max-width: 768px) {
  .card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
  }
  .card-body {
    padding: 16px;
  }
}


/* --- chart.css --- */
/* ═══════════════════════════════════════════
   CHART COMPONENT
   ═══════════════════════════════════════════ */

.chart-wrapper {
  position: relative;
  width: 100%;
  padding: 16px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* ═══════════════════════════════════════════
   PRINT MEDIA QUERY (DÀNH RIÊNG CHO BIỂU ĐỒ)
   ═══════════════════════════════════════════ */
@media print {
  /* Ép trình duyệt in màu nền, màu đường kẻ và nét của canvas */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Đảm bảo canvas không bị co lại hay mờ đi khi in */
  canvas {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  .card {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}


/* --- checkbox.css --- */
/* ═══════════════════════════════════════════
   PREMIUM CUSTOM CONTROLS (CHECKBOX, COMBOBOX, TABLE DROPDOWN)
   ═══════════════════════════════════════════ */

/* 1. CUSTOM CHECKBOX */
.modern-checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.modern-checkbox-wrapper:hover {
  background: rgba(0, 0, 0, 0.03);
}

.modern-checkbox {
  appearance: none;
  background-color: transparent;
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-strong);
  border-radius: 4px;
  display: grid;
  place-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.modern-checkbox::before {
  content: "";
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em white;
  background-color: transparent;
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.modern-checkbox:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.modern-checkbox:checked::before {
  transform: scale(1);
}

.modern-checkbox:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
}



/* --- radio.css --- */
/* ═══════════════════════════════════════════
   PREMIUM CUSTOM CONTROLS (RADIO)
   ═══════════════════════════════════════════ */

/* 1. CUSTOM RADIO */
.modern-radio-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text, #333);
  padding: 4px 8px;
  border-radius: var(--radius-sm, 4px);
  transition: background var(--transition-fast, 0.2s ease);
}

.modern-radio-wrapper:hover {
  background: rgba(0, 0, 0, 0.03);
}

.modern-radio {
  appearance: none;
  background-color: transparent;
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-strong, #ccc);
  border-radius: 50%; /* Circle shape for radio */
  display: grid;
  place-content: center;
  transition: all var(--transition-fast, 0.2s ease);
  cursor: pointer;
}

.modern-radio::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  background-color: white;
}

.modern-radio:checked {
  background-color: var(--color-primary, #00B14F);
  border-color: var(--color-primary, #00B14F);
}

.modern-radio:checked::before {
  transform: scale(1);
}

.modern-radio:focus-visible {
  outline: 2px solid var(--color-primary-light, #e0f4e6);
  outline-offset: 2px;
}

.modern-radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}


/* --- combobox.css --- */
/* 2. COMBO BOX & INPUT WRAPPERS */
.combo-box-container {
  display: flex;
  position: relative;
  width: 100%;
}

.combo-box-container .ui-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, 8px) 0 0 var(--radius, 8px);
  outline: none;
  font-size: 14.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  color: var(--color-text, #1e293b);
  background: var(--color-surface, #fff);
}

.combo-box-container .ui-input:focus {
  border-color: var(--color-primary, #6366f1);
  box-shadow: inset 0 0 0 1px var(--color-primary, #6366f1);
}

.combo-box-container.ui-input-disabled .ui-input,
.combo-box-container.ui-input-disabled .combo-box-actions {
  background: var(--color-background, #f1f5f9);
  color: var(--color-text-secondary, #64748b);
  cursor: not-allowed;
}

.combo-box-container.ui-input-disabled .combo-action-btn {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

.combo-box-actions {
  display: flex;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-left: none;
  border-radius: 0 var(--radius, 8px) var(--radius, 8px) 0;
  overflow: hidden;
}

.combo-action-btn {
  background: transparent;
  border: none;
  border-left: 1px solid var(--color-border, #e2e8f0);
  padding: 0 8px;
  color: var(--color-text-secondary, #94a3b8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.combo-action-btn:first-child { border-left: none; }

.combo-action-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary, #6366f1);
}

.combo-action-btn .material-symbols-outlined { font-size: 22px; }

/* ── Dropdown: Search bar ─────────────────────────────────────── */
.dd-search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface, #fff);
  position: sticky;
  top: 0;
  z-index: 3;
}

.dd-search-icon {
  font-size: 18px;
  color: var(--color-primary, #6366f1);
  flex-shrink: 0;
  pointer-events: none;
  opacity: 0.7;
}

.dd-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--color-text, #1e293b);
  background: transparent;
  padding: 0 0 0 6px;
  line-height: 1.5;
}

.dd-search-input::placeholder {
  color: var(--color-text-secondary, #94a3b8);
  opacity: 0.8;
}

/* ── Dropdown: Table wrapper ──────────────────────────────────── */
.dd-table-wrapper {
  overflow-y: auto;
  overflow-x: auto;
  max-height: 220px;
  flex: 1;
  background: var(--color-surface, #fff);
}



/* ── Dropdown: Footer "+ Thêm mới" ───────────────────────────── */
.dd-footer {
  border-top: 2px solid var(--color-border, #e2e8f0);
  background: var(--color-surface, #fff);
  position: sticky;
  bottom: 0;
  z-index: 3;
  flex-shrink: 0;
}

.dd-footer-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--color-primary, #6366f1);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dd-footer-add-btn:hover { background: rgba(99, 102, 241, 0.08); }

.dd-footer-add-btn .material-symbols-outlined {
  font-size: 16px;
  flex-shrink: 0;
}


/* --- context-menu.css --- */
/* ═══════════════════════════════════════════
   CONTEXT MENU COMPONENT (Menu chuột phải)
   ═══════════════════════════════════════════ */

.ui-context-menu {
  position: absolute;
  z-index: 999999;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--color-border);
  min-width: 180px;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.2s;
}

.context-menu-item:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-primary);
}

.context-menu-item .material-symbols-outlined {
  font-size: 18px;
  color: var(--color-text-secondary);
}

.context-menu-item:hover .material-symbols-outlined {
  color: var(--color-primary);
}

.context-menu-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}


/* --- empty-state.css --- */
/* ═══════════════════════════════════════════
   EMPTY STATE COMPONENT (Trạng thái rỗng)
   ═══════════════════════════════════════════ */

.ui-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
}

.ui-empty-icon {
  font-size: 48px;
  color: var(--color-text-secondary);
  opacity: 0.5;
  margin-bottom: 16px;
}

.ui-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.ui-empty-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  max-width: 300px;
  margin-bottom: 24px;
}


/* --- file-upload.css --- */
/* ═══════════════════════════════════════════
   FILE UPLOAD COMPONENT (Khu vực tải lên)
   ═══════════════════════════════════════════ */

.ui-file-upload {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  background: var(--color-background);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ui-file-upload:hover, .ui-file-upload.dragover {
  border-color: var(--color-primary);
  background: rgba(60, 80, 224, 0.05);
}

.ui-file-upload input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.ui-upload-icon {
  font-size: 40px;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.ui-upload-text {
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
  margin-bottom: 4px;
}

.ui-upload-hint {
  font-size: 12px;
  color: var(--color-text-secondary);
}


/* --- filter.css --- */
/* ═══════════════════════════════════════════
   FILTER COMPONENT
   ═══════════════════════════════════════════ */

.filter-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.filter-item label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.filter-item .ui-input {
  background: var(--color-surface);
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 52px; /* align with input height */
}

.filter-wrapper.advanced {
  background: var(--color-background);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
  margin-bottom: 16px;
}


/* --- form.css --- */
/* ═══════════════════════════════════════════
   FORM COMPONENTS
   ═══════════════════════════════════════════ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.ui-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  outline: none;
  font-size: var(--font-size-md);
  font-family: inherit;
  color: var(--color-text);
  transition: all 0.2s;
}

.ui-input:focus {
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 1px var(--color-primary), 0 0 0 3px var(--color-primary-light);
}

.ui-input:disabled {
  background: var(--color-background);
  color: var(--color-text-secondary);
  cursor: not-allowed;
}

/* Ẩn nút reveal/clear mặc định của trình duyệt cho input password */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none !important;
}


/* --- grid-dropdown.css --- */
/* Grid Cell Input wrapper */
.grid-cell-dropdown-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.grid-cell-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  outline: none;
  padding: 4px;
  font-size: 13px;
  font-family: inherit;
  color: inherit;
}
.grid-cell-input:focus {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 2px var(--color-primary-light);
  border-radius: 2px;
}


/* --- loading-spinner.css --- */
/* ═══════════════════════════════════════════
   LOADING SPINNER COMPONENT
   ═══════════════════════════════════════════ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border-strong);
  border-bottom-color: var(--color-primary);
  border-radius: 50%;
  animation: rotation 1s linear infinite;
  margin-bottom: 16px;
}

.loading-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.5px;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* --- modal.css --- */
/* ═══════════════════════════════════════════
   MODAL COMPONENTS
   ═══════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalZoom {
  from { opacity: 0; transform: scale(0.95) translateY(-20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease forwards;
}

.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  animation: modalZoom 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--color-text);
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: var(--color-background);
  color: var(--color-danger);
}

/* Make Modals Full-Screen on Mobile Viewports */
@media (max-width: 600px) {
  .modal-overlay {
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }
  .modal-overlay .modal-content {
    width: 100% !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0px !important;
    margin: 0 !important;
    border: none !important;
  }
  .modal-overlay .ui-modal-body {
    padding: 12px 8px !important;
    flex: 1 !important;
  }
}


/* --- pagination.css --- */
/* ═══════════════════════════════════════════
   DATAGRID PAGER COMPONENT
   ═══════════════════════════════════════════ */

.datagrid-pager {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.pager-separator {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 4px;
}

/* 1. Size Selector */
.pager-size-selector select {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  cursor: pointer;
  font-size: 13px;
}

.pager-size-selector select:hover {
  border-color: var(--color-primary);
}

/* 2. Controls */
.pager-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pager-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.pager-btn:hover:not(:disabled) {
  background: var(--color-background);
  color: var(--color-primary);
  border-color: var(--color-border);
}

.pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pager-btn .material-symbols-outlined {
  font-size: 18px;
}

.pager-input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px;
}

.pager-input {
  width: 45px;
  height: 26px;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
}

.pager-input:focus {
  border-color: var(--color-primary);
  outline: none;
}

/* 3. Info */
.pager-info {
  margin-left: auto; /* Push info to the right */
}

/* --- RESPONSIVE PAGINATION --- */
@media (max-width: 768px) {
  .datagrid-pager {
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 8px 0;
    gap: 8px;
  }
  
  .pager-separator {
    display: none;
  }

  .pager-btn-capture {
    display: none; /* Ẩn nút chụp màn hình cho đỡ tốn diện tích */
  }

  .pager-btn {
    width: 24px;
    height: 24px;
  }

  .pager-btn .material-symbols-outlined {
    font-size: 16px;
  }

  .pager-input {
    width: 35px;
    height: 24px;
    font-size: 12px;
  }

  .pager-size-selector select {
    padding: 2px 6px;
    font-size: 12px;
  }
  
  .pager-info {
    margin-left: 0;
    width: 100%;
    text-align: center;
    margin-top: 6px;
    font-size: 12px;
  }
}


/* --- popover.css --- */
/* ═══════════════════════════════════════════
   POPOVER COMPONENT (Khung nổi)
   ═══════════════════════════════════════════ */

.ui-popover {
  position: absolute;
  z-index: 99999;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--color-border);
  min-width: 250px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-popover.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ui-popover-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  color: var(--color-text);
  font-size: 14px;
}

.ui-popover-body {
  padding: 16px;
}


/* --- search-bar.css --- */
/* ═══════════════════════════════════════════
   SEARCH BAR COMPONENT
   ═══════════════════════════════════════════ */

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-secondary);
  background: var(--color-background);
  padding: 10px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  background: var(--color-surface);
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.search-box input {
  border: none;
  outline: none;
  font-size: var(--font-size-sm);
  background: transparent;
  width: 250px;
  font-weight: 500;
}


/* --- shared-dropdown.css --- */
/* 3. DATAGRID DROPDOWN MENU (FOR COMBOBOX/GRID CELL) */
.data-dropdown-menu {
  /* position & top/left set dynamically by UIUtils.computeDropdownPosition (fixed) */
  width: max-content;
  min-width: 100%;
  max-width: 95vw;
  background: var(--color-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.data-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
}



.dropdown-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.dropdown-table thead {
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Soft shadow below sticky header */
}

.dropdown-table th {
  padding: 8px 12px;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
  border-bottom: 2px solid var(--color-border);
}

.dropdown-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  white-space: nowrap;
  line-height: 1.4;
}

/* Nổi bật cột chính (ví dụ Tên nhân viên/Tên hàng) */
.dropdown-table td.highlight-col {
  font-weight: 600;
  color: var(--color-primary);
}

.dropdown-table tbody tr {
  cursor: pointer;
  background: var(--color-surface);
  transition: background 0.15s ease;
}

.dropdown-table tbody tr:hover {
  background: rgba(60, 80, 224, 0.08);
}

.dropdown-table tbody tr.active {
  background: rgba(99, 102, 241, 0.12) !important;
}

.dropdown-table tbody tr.active td {
  color: var(--color-primary, #6366f1) !important;
  font-weight: 600;
}

/* Mobile: Reduce font size and tighten spacing */
@media (max-width: 768px) {
  .dropdown-table {
    font-size: 12px;
  }
  .dropdown-table th {
    font-size: 11px;
    padding: 4px 8px;
  }
  .dropdown-table td {
    padding: 4px 8px;
  }
}



/* --- skeleton.css --- */
/* ═══════════════════════════════════════════
   SKELETON LOADER COMPONENT
   ═══════════════════════════════════════════ */

.skeleton {
  background: #e2e8f0;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  margin-bottom: 16px;
  width: 50%;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}


/* --- slider.css --- */
/* ═══════════════════════════════════════════
   SLIDER COMPONENT
   ═══════════════════════════════════════════ */

.ui-slider-container {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.ui-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  position: relative;
}

.ui-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s;
}

.ui-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.ui-slider-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  min-width: 48px;
  text-align: right;
}


/* --- stepper.css --- */
/* ═══════════════════════════════════════════
   STEPPER COMPONENT (Trình tự nhiều bước)
   ═══════════════════════════════════════════ */

.ui-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
}

.ui-stepper::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-border);
  z-index: 1;
}

.ui-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--color-surface); /* to cover the line */
  padding: 0 16px;
}

.ui-step-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
}

.ui-step.active .ui-step-circle {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
  box-shadow: 0 0 0 3px rgba(60, 80, 224, 0.1);
}

.ui-step.completed .ui-step-circle {
  border-color: var(--color-success);
  background: var(--color-success);
  color: white;
}

.ui-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.ui-step.active .ui-step-label {
  color: var(--color-primary);
}

.ui-step.completed .ui-step-label {
  color: var(--color-success);
}
.ui-stepper::before {
  display: none !important;
}
.ui-step {
  flex: 1 0 auto;
  min-width: 80px;
  background: transparent !important;
  padding: 0 8px;
}
.ui-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--color-border);
  z-index: -1;
}
.ui-step.completed:not(:last-child)::after {
  background: var(--color-success);
}
@media (max-width: 768px) {
  .ui-stepper {
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    padding-bottom: 12px;
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .ui-step {
    min-width: 90px;
  }
}
.ui-stepper {
  align-items: flex-start !important;
}


/* --- table.css --- */
/* ═══════════════════════════════════════════
   DATAGRID TABLE COMPONENTS
   ═══════════════════════════════════════════ */

.table-wrapper {
  overflow-x: auto;
  overflow-y: hidden; /* Ensure vertical corners are clipped */
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--color-surface);
  padding: 16px 24px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 32px;
}

.data-table tbody tr {
  cursor: pointer;
  transition: 
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.05);
}

.data-table tbody tr.active {
  background-color: var(--color-primary-light);
  box-shadow: inset 4px 0 0 var(--color-primary);
}

.data-table tbody tr td {
  transition: 
    color 0.2s ease,
    font-weight 0.2s ease;
}

.data-table tbody tr.active td {
  color: var(--color-primary);
  font-weight: 600;
}

/* ════ DARK THEME OVERRIDES ════ */
body.dark-theme .data-table {
  background-color: var(--color-surface);
}
body.dark-theme .data-table th {
  background-color: var(--color-surface);
  border-bottom-color: var(--color-border);
  color: var(--color-text-secondary);
}
body.dark-theme .data-table td {
  border-bottom-color: var(--color-border);
  color: var(--color-text);
}
body.dark-theme .data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* --- RESPONSIVE TABLE (Card View on Mobile) --- */
@media (max-width: 768px) {
  .data-table:not(.no-mobile-stack),
  .data-table:not(.no-mobile-stack) tbody {
    display: block;
    width: 100%;
  }
  .data-table:not(.no-mobile-stack) thead {
    display: none; /* Ẩn tiêu đề ngang trên mobile */
  }

  .data-table:not(.no-mobile-stack) tbody tr {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    padding: 8px;
    background: var(--color-surface);
  }

  .data-table:not(.no-mobile-stack) tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 12px 12px;
    text-align: right !important;
    white-space: normal; word-break: break-word;
    max-width: 100%;
  }

  .data-table:not(.no-mobile-stack) tbody td:last-child {
    border-bottom: none;
  }

  /* Tạo tiêu đề ảo từ thuộc tính data-label */
  .data-table:not(.no-mobile-stack) tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: left;
    margin-right: 16px;
    text-transform: uppercase;
    font-size: 12px;
    flex-shrink: 0;
  }
}





/* --- tabs.css --- */
/* ═══════════════════════════════════════════
   TABS / SEGMENT COMPONENT
   ═══════════════════════════════════════════ */

.ui-tabs {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.ui-tabs-header {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--color-border);
  gap: 32px;
  margin-bottom: 24px;
  padding: 0 24px;
  overflow-x: auto;
  overflow-y: hidden;
}

@media (max-width: 768px) {
  .ui-tabs-header {
    gap: 16px;
    padding: 0 8px;
  }
}

.ui-tab-btn {
  background: none;
  border: none;
  padding: 12px 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  white-space: nowrap;
}

.ui-tab-btn:hover {
  color: var(--color-primary);
}

.ui-tab-btn.active {
  color: var(--color-primary);
}

.ui-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 4px 4px 0 0;
}

.ui-tabs-body {
  position: relative;
  width: 100%;
}

.ui-tab-panel {
  display: none;
  animation: tabFadeIn 0.3s ease;
}

.ui-tab-panel.active {
  display: block;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.ui-tabs-header::-webkit-scrollbar {
  display: none;
}

.ui-tabs-header {
  -ms-overflow-style: none;
  scrollbar-width: none;
}


/* ═══════════════════════════════════════════
   UI NESTED TABS — Tab phân cấp 2 cấp (Cha → Con)
   ═══════════════════════════════════════════ */

.ui-nested-tabs {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ── Tab Cha ─────────────────────────────── */
.ui-nested-tabs__parent-bar {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  padding: 6px 8px;
  background: var(--color-surface-elevated, #f4f6fb);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ui-nested-tabs__parent-bar::-webkit-scrollbar {
  display: none;
}

.ui-nested-tab-parent-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm, 13px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.ui-nested-tab-parent-btn:hover {
  background: rgba(var(--color-primary-rgb, 60, 80, 224), 0.08);
  color: var(--color-primary);
}

.ui-nested-tab-parent-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(var(--color-primary-rgb, 60, 80, 224), 0.35);
}

.ui-nested-tab-parent-btn.active .material-symbols-outlined {
  color: #fff;
}

.ui-nested-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.ui-nested-tab-parent-btn:not(.active) .ui-nested-tab-badge {
  background: rgba(var(--color-primary-rgb, 60, 80, 224), 0.12);
  color: var(--color-primary);
}

/* ── Child Section ───────────────────────── */
.ui-nested-tabs__section {
  display: none;
  animation: nestedTabFadeIn 0.25s ease;
}

.ui-nested-tabs__section.active {
  display: block;
}

@keyframes nestedTabFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Tab Con Bar ─────────────────────────── */
.ui-nested-tabs__child-bar {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 100%;
  min-width: 0;
  border-bottom: 2px solid var(--color-border, #e8eaf0);
  margin-bottom: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ui-nested-tabs__child-bar::-webkit-scrollbar {
  display: none;
}

.ui-nested-tab-child-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm, 13px);
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.ui-nested-tab-child-btn:hover {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb, 60, 80, 224), 0.04);
}

.ui-nested-tab-child-btn.active {
  color: var(--color-primary);
  font-weight: 700;
  border-bottom-color: var(--color-primary);
}

/* ── Panel ───────────────────────────────── */
.ui-nested-tabs__panel-area {
  position: relative;
}

.ui-nested-tab-panel {
  display: none;
  animation: nestedTabFadeIn 0.2s ease;
}

.ui-nested-tab-panel.active {
  display: block;
}

/* ── Default empty panel ─────────────────── */
.ui-nested-tab-default-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-secondary);
  background: var(--color-surface-elevated, #f8f9fc);
  border-radius: 12px;
  border: 1.5px dashed var(--color-border, #e0e4ef);
}

/* ── Empty state ─────────────────────────── */
.ui-nested-tabs-empty {
  text-align: center;
  padding: 48px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* ════════════════════════════════════════════
   DRAG & DROP STYLES
   ════════════════════════════════════════════ */

/* ── Drag handle icon ─────────────────────── */
.ui-nested-drag-handle {
  font-size: 16px !important;
  opacity: 0;
  cursor: grab;
  color: var(--color-text-secondary);
  transition: opacity 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.ui-nested-tab-parent-btn:hover .ui-nested-drag-handle,
.ui-nested-tab-child-btn:hover .ui-nested-drag-handle {
  opacity: 0.5;
}

.ui-nested-tab-parent-btn:hover .ui-nested-drag-handle:hover,
.ui-nested-tab-child-btn:hover .ui-nested-drag-handle:hover {
  opacity: 1;
  color: var(--color-primary);
}

.ui-nested-drag-handle--child {
  font-size: 14px !important;
}

/* ── Item đang được kéo ───────────────────── */
.ui-nested-dragging {
  opacity: 0.4;
  cursor: grabbing !important;
  transform: scale(0.97);
  transition: opacity 0.1s, transform 0.1s;
}

/* ── Drop placeholder (dải chỉ vị trí thả) ── */
.ui-nested-drop-placeholder {
  width: 3px;
  min-width: 3px;
  align-self: stretch;
  background: var(--color-primary);
  border-radius: 3px;
  margin: 4px 2px;
  opacity: 0.7;
  transition: all 0.12s ease;
  pointer-events: none;
  animation: placeholderPulse 0.8s ease infinite alternate;
  flex-shrink: 0;
}

.ui-nested-drop-placeholder--child {
  margin: 6px 1px;
  align-self: auto;
  height: auto;
  min-height: 28px;
}

@keyframes placeholderPulse {
  from {
    opacity: 0.5;
  }

  to {
    opacity: 1;
  }
}


/* ════════════════════════════════════════════
   UI NESTED TABS — VERTICAL MODE
   Layout: sidebar dọc bên trái + content bên phải
   Dùng: UINestedTabs.create(data, { vertical: true })
   ════════════════════════════════════════════ */

.ui-nested-tabs--vertical {
  display: flex;
  flex-direction: row;
  gap: 0;
  width: 100%;
  min-height: 300px;
}

/* ── Sidebar (cột trái) ──────────────────── */
.ui-nested-tabs__sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  user-select: none;
}

/* Thanh kéo Resizer */
.ui-nested-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  transition: background 0.2s;
}

.ui-nested-resizer:hover,
.ui-nested-resizer.is-resizing {
  background: var(--color-primary);
  opacity: 0.5;
}

/* ── Parent item trong sidebar ───────────── */
.ui-nested-tabs__sidebar-parent {
  display: flex;
  flex-direction: column;
}

.ui-nested-tab-parent-btn--v {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm, 13px);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  border-radius: 0;
  position: relative;
  font-family: inherit;
  white-space: nowrap;
}

.ui-nested-tab-parent-btn--v:hover {
  background: rgba(var(--color-primary-rgb, 60, 80, 224), 0.06);
  color: var(--color-primary);
}

.ui-nested-tab-parent-btn--v.active {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb, 60, 80, 224), 0.09);
  font-weight: 700;
}

.ui-nested-tab-parent-btn--v.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary);
  border-radius: 0 3px 3px 0;
}

/* Chevron xoay khi mở */
.ui-nested-parent-chevron {
  margin-left: auto;
  font-size: 18px !important;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  opacity: 0.5;
}

.ui-nested-tab-parent-btn--v.active .ui-nested-parent-chevron {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--color-primary);
}

/* ── Child list (accordion slide) ────────── */
.ui-nested-tabs__child-list {
  display: none;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

.ui-nested-tabs__child-list.open {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ui-nested-tab-child-btn--v {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 46px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm, 13px);
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-nested-tab-child-btn--v:hover {
  background: rgba(var(--color-primary-rgb, 60, 80, 224), 0.05);
  color: var(--color-primary);
}

.ui-nested-tab-child-btn--v.active {
  color: var(--color-primary);
  font-weight: 600;
  background: rgba(var(--color-primary-rgb, 60, 80, 224), 0.08);
}

.ui-nested-tab-child-btn--v.active::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  background: var(--color-primary);
  border-radius: 50%;
}

/* Drag handle trong vertical mode */
.ui-nested-tab-parent-btn--v .ui-nested-drag-handle,
.ui-nested-tab-child-btn--v .ui-nested-drag-handle {
  margin-left: 0;
  margin-right: 0;
}

/* ── Content panel (cột phải) ────────────── */
.ui-nested-tabs__vertical-content {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 24px;
  position: relative;
}

.ui-nested-tab-panel--v {
  display: none;
  animation: nestedTabFadeIn 0.22s ease;
}

.ui-nested-tab-panel--v.active {
  display: block;
}

/* ── Vertical drop placeholder ──────────── */
.ui-nested-drop-placeholder--v {
  height: 3px;
  min-height: 3px;
  width: calc(100% - 24px);
  margin: 1px 12px;
  background: var(--color-primary);
  border-radius: 3px;
  animation: placeholderPulse 0.8s ease infinite alternate;
  pointer-events: none;
}

/* ── Responsive: collapse sidebar on mobile ─ */
@media (max-width: 640px) {
  .ui-nested-tabs--vertical {
    flex-direction: column;
  }

  .ui-nested-tabs__sidebar {
    width: 100%;
    max-width: 100%;
    border-right: none;
    border-bottom: 2px solid var(--color-border, #e8eaf0);
    flex-direction: column;
    padding: 0;
  }

  .ui-nested-tab-parent-btn--v {
    border-radius: 0;
  }

  .ui-nested-tabs__child-list {
    flex-direction: column;
  }

  .ui-nested-tabs__vertical-content {
    padding: 16px 0 0;
  }
}

@media (max-width: 768px) {

  /* Cho phép cuộn ngang (Scrollable) khi thu hẹp thay vì phá vỡ layout */
  .ui-nested-tabs__parent-bar {
    padding: 4px 6px;
    /* Vẫn giữ nguyên bo tròn border-radius: 12px; */
  }

  .ui-nested-tab-parent-btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .ui-nested-tab-child-btn {
    padding: 8px 14px;
    font-size: 12px;
  }
}

/* ════ MODULE TABS (Global) ════ */
.custom-tabs-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  width: 100%;
}

.custom-tab-btn {
  padding: 12px 16px;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.custom-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.custom-tab-btn:hover {
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .custom-tabs-header {
    margin-left: -16px !important;
    margin-right: -16px !important;
    width: calc(100% + 32px) !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .custom-tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px 4px !important;
    font-size: 13px;
    white-space: normal;
  }

  .custom-tab-btn i {
    font-size: 16px !important;
  }
}

/* --- timeline.css --- */
/* ═══════════════════════════════════════════
   TIMELINE COMPONENT (Lịch sử trạng thái)
   ═══════════════════════════════════════════ */

.ui-timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  padding-left: 16px;
}

.ui-timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 21px; /* 16px + 5px radius */
  width: 2px;
  background: var(--color-border);
  z-index: 1;
}

.timeline-item {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 16px;
}

.timeline-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border-strong);
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-item.success .timeline-marker {
  border-color: var(--color-success);
  background: var(--color-success);
}

.timeline-item.primary .timeline-marker {
  border-color: var(--color-primary);
  background: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(60, 80, 224, 0.1);
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.timeline-time {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.timeline-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  background: var(--color-background);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}


/* --- toast.css --- */
/* ═══════════════════════════════════════════
   TOAST COMPONENT (Thông báo đẩy)
   ═══════════════════════════════════════════ */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.ui-toast {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 280px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  opacity: 0;
  pointer-events: auto;
  border-left: 4px solid var(--color-primary);
  /* Animation handled by JS for enter/leave */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.ui-toast.success { border-left-color: var(--color-success); background: linear-gradient(rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.1)), var(--color-surface); }
.ui-toast.error { border-left-color: var(--color-danger); background: linear-gradient(rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.1)), var(--color-surface); }
.ui-toast.warning { border-left-color: var(--color-warning); background: linear-gradient(rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.1)), var(--color-surface); }

.ui-toast-icon {
  font-size: 20px;
  color: var(--color-primary);
}
.ui-toast.success .ui-toast-icon { color: var(--color-success); }
.ui-toast.error .ui-toast-icon   { color: var(--color-danger); }
.ui-toast.warning .ui-toast-icon { color: var(--color-warning); }

.ui-toast-content {
  flex: 1;
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
}




/* --- tooltip.css --- */
/* ═══════════════════════════════════════════
   TOOLTIP COMPONENT — JS-driven (position: fixed)
   CSS chỉ định style cho #ui-tooltip element được JS tạo ra
   ═══════════════════════════════════════════ */

#ui-tooltip {
  position: fixed;
  z-index: 99999;
  background: #1E293B;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#ui-tooltip.visible {
  opacity: 1;
}

#ui-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #1E293B transparent;
}


/* --- total-bar.css --- */
/* ═══════════════════════════════════════════
   TOTAL BAR COMPONENT
   ═══════════════════════════════════════════ */

.total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-background);
  padding: 16px 24px;
  border-top: 2px dashed var(--color-border);
  margin-top: 16px;
}

.total-bar-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.total-bar-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}


/* --- tree.css --- */
/* ═══════════════════════════════════════════
   TREE VIEW COMPONENT (Danh mục hình cây)
   ═══════════════════════════════════════════ */

.ui-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ui-tree ul {
  list-style: none;
  padding-left: 24px;
  position: relative;
  display: none;
}

.ui-tree ul.open {
  display: block;
}

.ui-tree ul::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  width: 1px;
  background: var(--color-border);
}

.ui-tree-node {
  display: flex;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  color: var(--color-text);
  font-size: 14px;
}

.ui-tree-node:hover {
  color: var(--color-primary);
}

.ui-tree-toggle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  color: var(--color-text-secondary);
}

.ui-tree-toggle.empty {
  visibility: hidden;
}

.ui-tree-icon {
  margin-right: 8px;
  color: var(--color-text-secondary);
  font-size: 18px;
}


/* --- user-profile.css --- */
/* ═══════════════════════════════════════════
   USER PROFILE / AVATAR COMPONENT
   ═══════════════════════════════════════════ */

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.user-text {
  text-align: right;
}

.user-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text);
}

.user-role {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  transition: all var(--transition-normal);
}

@media (max-width: 768px) {
  .user-avatar {
    width: 36px;
    height: 36px;
  }
  .user-profile {
    gap: 8px;
  }
}


/* --- search-dropdown.css --- */
/* ═══════════════════════════════════════════
   SEARCH DROPDOWN COMPONENT
   ═══════════════════════════════════════════ */

.ui-search-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 320px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong, var(--color-border));
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  padding: 8px 0;
  max-height: 300px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ui-search-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}



.ui-search-dropdown-item {
  display: block;
  padding: 10px 16px;
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.2s ease;
}

.ui-search-dropdown-item:hover {
  background: var(--color-background);
  color: var(--color-text);
}

@media (max-width: 768px) {
  .ui-search-dropdown-item {
    padding: 8px 14px;
    font-size: 13px;
  }
}


/* --- side-panel.css --- */
/* ═══════════════════════════════════════════
   SIDE PANEL COMPONENT (Right Drawer)
   ═══════════════════════════════════════════ */

.ui-side-panel-overlay {
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.ui-side-panel-overlay.show {
  visibility: visible;
  opacity: 1;
}

.ui-side-panel {
  position: fixed;
  top: 0;
  right: -1000px;
  width: 100%;
  max-width: 650px;
  height: 100vh;
  background: var(--color-surface);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  z-index: 10001;
  display: none;
  flex-direction: column;
  opacity: 0.8;
  transition: 
    right 0.45s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.4s ease;
}

.ui-side-panel.show {
  right: 0 !important;
  opacity: 1 !important;
}


/* --- screen-capture.css --- */
/* ═══════════════════════════════════════════
   SCREEN CAPTURE COMPONENT CSS
   ═══════════════════════════════════════════ */

.screen-capture-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  cursor: crosshair;
  user-select: none;
}

.screen-capture-toolbar button {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.2s;
}

.screen-capture-toolbar button:hover {
  background: var(--color-background);
  color: var(--color-primary);
}

.screen-capture-toolbar button .material-symbols-outlined {
  font-size: 18px;
}


