/* ==========================================================================
   NGŨ GIA LAND - LUXURY EMERALD DESIGN SYSTEM & COMPONENT STYLES
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand Emerald & Primary Colors */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-glow: rgba(5, 150, 105, 0.15);
  
  /* Sidebar Dark Theme */
  --sidebar-bg: #091310;
  --sidebar-surface: #0f1c17;
  --sidebar-border: #14241e;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-active-bg: #059669;

  /* App Light Theme */
  --bg-app: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-muted: #f8fafc;
  --bg-subtle: #f1f5f9;

  /* Text Colors */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  /* Accent Colors */
  --emerald: #10b981;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --amber: #f59e0b;
  --amber-light: #fffbeb;
  --red: #ef4444;
  --red-light: #fef2f2;
  --teal: #0d9488;
  --teal-light: #f0fdfa;

  /* Borders & Shadows */
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-dropdown: 0 12px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);

  /* Layout */
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 76px;
  --header-height: 72px;
  --transition-speed: 0.25s;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Application Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: width var(--transition-speed) ease;
  border-right: 1px solid var(--sidebar-border);
  overflow-y: auto;
  overflow-x: hidden;
}

.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #059669, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.brand-info {
  overflow: hidden;
  white-space: nowrap;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 9px;
  color: #6ee7b7;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.nav-group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  padding: 0 10px;
  margin-bottom: 6px;
}

.app-sidebar.collapsed .nav-group-title,
.app-sidebar.collapsed .brand-info,
.app-sidebar.collapsed .nav-item span,
.app-sidebar.collapsed .user-info,
.app-sidebar.collapsed .user-dropdown-arrow {
  display: none;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: #94a3b8;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.nav-item:hover {
  background-color: var(--sidebar-surface);
  color: #ffffff;
}

.nav-item.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.nav-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--sidebar-border);
  background-color: var(--sidebar-surface);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.user-profile-widget:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.user-avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #10b981;
}

.user-info {
  overflow: hidden;
  flex: 1;
}

.user-info-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.user-info-role {
  font-size: 11px;
  color: #94a3b8;
}

.user-dropdown-arrow {
  color: #94a3b8;
}

/* ==========================================================================
   MAIN CONTENT WRAPPER & HEADER
   ========================================================================== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-speed) ease;
}

.app-sidebar.collapsed + .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

.app-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.header-page-title-group h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.header-page-title-group p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Global Search Input Box */
.header-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 240px;
}

.header-search-bar:hover, .header-search-bar:focus-within {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.header-search-bar input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-main);
  width: 100%;
}

.header-search-bar input::placeholder {
  color: var(--text-subtle);
}

.search-shortcut-badge {
  background-color: #e2e8f0;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Date Range Button */
.header-date-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-date-picker:hover {
  border-color: var(--primary);
  background-color: var(--bg-muted);
}

/* Notification Bell Icon */
.notification-bell-btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-bell-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.notification-badge-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* User Pill in Header */
.header-user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s ease;
}

.header-user-pill:hover {
  background-color: var(--bg-subtle);
}

.header-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.header-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.header-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   PAGE CONTAINER & LAYOUT GRID
   ========================================================================== */
.page-content-wrapper {
  padding: 24px 28px;
  flex: 1;
}

.page-view {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CARDS & KPI STAT WIDGETS
   ========================================================================== */
.kpi-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kpi-icon-box {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-green { background-color: #ecfdf5; color: #10b981; }
.kpi-icon-blue { background-color: #eff6ff; color: #3b82f6; }
.kpi-icon-purple { background-color: #f5f3ff; color: #8b5cf6; }
.kpi-icon-amber { background-color: #fffbeb; color: #f59e0b; }
.kpi-icon-red { background-color: #fef2f2; color: #ef4444; }
.kpi-icon-teal { background-color: #f0fdfa; color: #0d9488; }
.kpi-icon-gray { background-color: #f8fafc; color: #64748b; }

.kpi-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  margin: 2px 0;
}

.kpi-subtext {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-diff-up { color: var(--emerald); font-weight: 600; }
.kpi-diff-down { color: var(--red); font-weight: 600; }

.kpi-sparkline-svg {
  width: 90px;
  height: 36px;
}

/* ==========================================================================
   TOOLBARS, BUTTONS, INPUTS & FILTERS
   ========================================================================== */
.content-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header-bar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 13px;
  min-width: 220px;
  transition: all 0.2s ease;
}

.search-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-input-box input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 13px;
  color: var(--text-main);
}

.select-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  cursor: pointer;
  transition: border 0.2s ease;
}

.select-box:focus {
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  user-select: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

.btn-outline {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-muted);
  border-color: #cbd5e1;
}

.btn-icon-only {
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
}

/* Tabs */
.tab-group {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  background-color: #ffffff;
}

.tab-item {
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-item:hover {
  color: var(--primary);
}

.tab-item.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* Sub tabs pill style */
.sub-tab-pill-group {
  display: inline-flex;
  background-color: var(--bg-muted);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.sub-tab-pill {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-tab-pill.active {
  background-color: #ffffff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-wrapper,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.custom-table,
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.custom-table th,
.data-table th {
  padding: 13px 18px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  vertical-align: middle;
}

.custom-table td,
.data-table td {
  padding: 14px 18px;
  font-size: 13px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  white-space: nowrap;
}

.custom-table tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.custom-table tbody tr,
.data-table tbody tr {
  transition: background 0.15s ease;
}

.custom-table tbody tr:hover,
.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

.text-left {
  text-align: left !important;
}

/* Table Elements */
.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cell-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.cell-avatar-square {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
}

.cell-user-info {
  display: flex;
  flex-direction: column;
}

.cell-user-name {
  font-weight: 600;
  color: var(--text-main);
}

.cell-user-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green { background-color: #ecfdf5; color: #059669; }
.badge-blue { background-color: #eff6ff; color: #2563eb; }
.badge-purple { background-color: #f5f3ff; color: #7c3aed; }
.badge-amber { background-color: #fffbeb; color: #d97706; }
.badge-red { background-color: #fef2f2; color: #dc2626; }
.badge-teal { background-color: #f0fdfa; color: #0d9488; }
.badge-gray { background-color: #f1f5f9; color: #475569; }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active { background-color: var(--emerald); }
.status-dot.leave { background-color: var(--amber); }
.status-dot.inactive { background-color: var(--red); }

.action-menu-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.action-menu-btn:hover {
  background-color: var(--bg-muted);
  color: var(--text-main);
  border-color: #cbd5e1;
}

/* Pagination Bar */
.pagination-bar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  background-color: #ffffff;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   2-COLUMN & SPLIT LAYOUTS
   ========================================================================== */
.split-layout-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

.split-layout-sidebar-right {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.three-column-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

/* Organization Tree View */
.org-tree-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.org-tree-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  flex: 1;
}

.tree-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tree-node:hover {
  background-color: var(--bg-muted);
}

.tree-node.active {
  background-color: #ecfdf5;
  color: var(--primary);
  font-weight: 600;
}

.tree-node-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-node-badge {
  background-color: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.tree-sub-list {
  list-style: none;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px dashed #cbd5e1;
  margin-left: 14px;
  margin-top: 4px;
  margin-bottom: 4px;
}

/* ==========================================================================
   CALENDAR & TIMELINE (Lịch chăm sóc & Chấm công)
   ========================================================================== */
.calendar-week-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  overflow: hidden;
}

.cal-header-cell {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-subtle);
  background-color: var(--bg-muted);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.cal-header-cell.today {
  background-color: #ecfdf5;
  color: var(--primary);
}

.cal-time-cell {
  padding: 8px 6px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-color);
  background-color: #fafbfc;
  height: 52px;
}

.cal-day-col {
  border-right: 1px solid var(--border-subtle);
  position: relative;
  height: 520px;
  background-color: #ffffff;
}

.cal-event-card {
  position: absolute;
  left: 4px;
  right: 4px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 3px solid;
  overflow: hidden;
}

.cal-event-card:hover {
  transform: scale(1.02);
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.event-green { background-color: #ecfdf5; border-color: #10b981; color: #065f46; }
.event-blue { background-color: #eff6ff; border-color: #3b82f6; color: #1e40af; }
.event-purple { background-color: #f5f3ff; border-color: #8b5cf6; color: #5b21b6; }
.event-amber { background-color: #fffbeb; border-color: #f59e0b; color: #92400e; }
.event-teal { background-color: #f0fdfa; border-color: #0d9488; color: #115e59; }

/* Mini Calendar Widget */
.mini-calendar-widget {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 12px;
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.mini-cal-day-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.mini-cal-day-cell {
  font-size: 11.5px;
  padding: 6px 0;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.mini-cal-day-cell:hover {
  background-color: var(--bg-muted);
}

.mini-cal-day-cell.active-day {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.mini-cal-dot-indicator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-top: 2px;
}

/* ==========================================================================
   SETTINGS PAGE FORMS & INPUT GROUPS
   ========================================================================== */
.settings-nav-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-nav-item:hover {
  background-color: var(--bg-muted);
}

.settings-nav-item.active {
  background-color: #ecfdf5;
  color: var(--primary);
  font-weight: 600;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-textarea, .form-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ==========================================================================
   NOTIFICATION FLYOUT PANEL (Screenshot 2026-08-15 165140.png)
   ========================================================================== */
.notification-flyout {
  position: fixed;
  top: 76px;
  right: 28px;
  width: 380px;
  max-width: calc(100vw - 32px);
  background-color: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-dropdown);
  border: 1px solid var(--border-color);
  z-index: 50;
  display: none;
  flex-direction: column;
  animation: slideDown 0.2s ease;
  max-height: calc(100vh - 100px);
  overflow: hidden;
}

.notification-flyout.open {
  display: flex;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-header {
  padding: 16px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-title-group h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.notif-title-group span {
  font-size: 12px;
  color: var(--text-muted);
}

.notif-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-mark-all-btn {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}

.notif-tabs {
  display: flex;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 8px;
  overflow-x: auto;
}

.notif-tab {
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.notif-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.notif-body {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notif-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background-color: var(--bg-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.notif-item:hover {
  background-color: #f1f5f9;
}

.notif-item.unread {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
}

.notif-icon-box {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
}

.notif-content {
  flex: 1;
}

.notif-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.notif-item-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.notif-item-time {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 4px;
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  align-self: center;
}

.notif-footer {
  padding: 12px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  background-color: #ffffff;
}

.notif-view-all-link {
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* ==========================================================================
   MODALS & DIALOGS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background-color: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 0.2s ease;
}

.modal-card.modal-lg {
  max-width: 720px;
}

@keyframes scaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background-color: var(--bg-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.25s ease;
  border-left: 4px solid var(--primary);
}

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

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1280px) {
  .kpi-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
/* ==========================================================================
   KANBAN BOARD (Công việc)
   ========================================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 16px;
  overflow-x: auto;
}

.kanban-column {
  background-color: var(--bg-muted);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 480px;
  border: 1px solid var(--border-subtle);
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
}

.kanban-card {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  cursor: grab;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}

/* ==========================================================================
   PERMISSION MATRIX (Phân quyền)
   ========================================================================== */
.perm-matrix-table th {
  text-align: center;
  padding: 14px 16px;
  vertical-align: middle;
}

.perm-matrix-table th:first-child {
  text-align: left;
  padding-left: 24px;
}

.perm-matrix-table td:first-child {
  text-align: left;
  padding-left: 24px;
}

.perm-matrix-table td:not(:first-child) {
  text-align: center;
  vertical-align: middle;
  padding: 14px 16px;
}

.perm-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  margin: 0 auto;
}

.custom-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  vertical-align: middle;
  margin: 0 auto;
}

.custom-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.custom-switch input:checked + .switch-slider {
  background-color: var(--primary);
}

.custom-switch input:checked + .switch-slider:before {
  transform: translateX(16px);
}

/* ==========================================================================
   REPORT CARDS (Báo cáo)
   ========================================================================== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 24px;
}

.report-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.report-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1280px) {
  .kpi-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
  .split-layout-sidebar-right {
    grid-template-columns: 1fr;
  }
  .split-layout-container {
    grid-template-columns: 1fr;
  }
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
  .report-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .kpi-grid-4, .kpi-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .three-column-grid {
    grid-template-columns: 1fr;
  }
  .settings-form-grid {
    grid-template-columns: 1fr;
  }
  .report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    width: var(--sidebar-collapsed-width);
  }
  .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
  }
  .app-sidebar .nav-group-title,
  .app-sidebar .brand-info,
  .app-sidebar .nav-item span,
  .app-sidebar .user-info,
  .app-sidebar .user-dropdown-arrow {
    display: none;
  }
  .kpi-grid-4, .kpi-grid-5 {
    grid-template-columns: 1fr;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .header-search-bar {
    display: none;
  }
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

