/* ==========================================================================
   MFI Management System — Enterprise Design System
   ========================================================================== */

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

:root {
  /* Brand & Status Colors */
  --primary: #1a56db;
  --primary-hover: #1e429f;
  --primary-light: #ebf5ff;
  --primary-focus: rgba(26, 86, 219, 0.2);

  --secondary: #64748b;
  --secondary-hover: #475569;
  --secondary-light: #f1f5f9;

  --success: #059669;
  --success-hover: #047857;
  --success-light: #d1fae5;
  --success-text: #065f46;

  --warning: #d97706;
  --warning-hover: #b45309;
  --warning-light: #fef3c7;
  --warning-text: #92400e;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-light: #fee2e2;
  --danger-text: #991b1b;

  --info: #0284c7;
  --info-light: #e0f2fe;

  /* Surfaces & Neutrals */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #1e3a8a;
  --border-sidebar: #1e293b;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #ffffff;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Elevation & Shape */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --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);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-main);
  background-color: var(--bg-app);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* Layout Hierarchy */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--border-sidebar);
  z-index: 40;
  transition: transform var(--transition-normal);
}

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

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.sidebar-brand-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #475569;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  color: var(--text-sidebar);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

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

.nav-item.active {
  background-color: #1e3a8a;
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #3b82f6;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active svg {
  opacity: 1;
  color: #60a5fa;
}

.nav-badge {
  margin-left: auto;
  background-color: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

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

.user-snippet {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: #3b82f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-name {
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

/* Top Header */
.top-header {
  height: 64px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 30;
}

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

.mobile-toggle-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-muted);
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.breadcrumb-trail span {
  color: var(--text-light);
}

.breadcrumb-trail a {
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumb-trail .current-crumb {
  color: var(--text-main);
  font-weight: 600;
}

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

.header-btn-icon {
  background: none;
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-btn-icon:hover {
  background-color: var(--border-light);
  color: var(--text-main);
}

/* Viewport Scrollable Area */
.viewport-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  background-color: var(--bg-app);
}

/* Page Header & Actions */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

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

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-blue { background-color: #ebf5ff; color: #2563eb; }
.stat-icon-green { background-color: #d1fae5; color: #059669; }
.stat-icon-amber { background-color: #fef3c7; color: #d97706; }
.stat-icon-purple { background-color: #f3e8ff; color: #9333ea; }
.stat-icon-red { background-color: #fee2e2; color: #dc2626; }
.stat-icon-cyan { background-color: #e0f2fe; color: #0284c7; }

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

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

.stat-sub {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Card Container */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
}

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

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-app);
}

/* Data Filter Bar */
.filter-bar {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.search-input-wrapper {
  position: relative;
  min-width: 240px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  width: 16px;
  height: 16px;
}

.search-input-wrapper input {
  padding-left: 36px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-label .required-star {
  color: var(--danger);
  margin-left: 3px;
}

.form-control, .form-select {
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea.form-control {
  height: auto;
  min-height: 80px;
}

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

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-light);
}

.invalid-feedback {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: block;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* Centered Form Layout & Proper Alignment */
.form-page-wrapper {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.form-page-wrapper .page-header {
  margin-bottom: 20px;
}

.form-page-wrapper .card {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
}

.form-page-wrapper .card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: #fafbfc;
}

.form-page-wrapper .card-body {
  padding: 28px 28px 32px;
}

.form-row-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
}

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

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: var(--border-light);
  border-color: #cbd5e1;
}

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

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

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background-color: var(--border-light);
  color: var(--text-main);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Modern Table Action Buttons & Action Groups
   ========================================================================== */
.table-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.table-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background-color: transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.action-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(0);
}

/* View Action (Soft Blue Tint) */
.action-btn-view {
  background-color: #eff6ff;
  border-color: #dbeafe;
  color: #2563eb;
}
.action-btn-view:hover {
  background-color: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
}

/* Edit Action (Soft Neutral/Slate) */
.action-btn-edit {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}
.action-btn-edit:hover {
  background-color: #334155;
  border-color: #1e293b;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(51, 65, 85, 0.3);
}

/* Status / Toggle Action (Soft Emerald for Active -> Deactivate, Soft Amber for Inactive -> Activate) */
.action-btn-status.is-active {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}
.action-btn-status.is-active:hover {
  background-color: #059669;
  border-color: #047857;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.35);
}

.action-btn-status.is-inactive {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #d97706;
}
.action-btn-status.is-inactive:hover {
  background-color: #d97706;
  border-color: #b45309;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.35);
}

/* Reset Password Action (Soft Violet/Purple) */
.action-btn-pwd {
  background-color: #faf5ff;
  border-color: #f3e8ff;
  color: #9333ea;
}
.action-btn-pwd:hover {
  background-color: #9333ea;
  border-color: #7e22ce;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(147, 51, 234, 0.35);
}

/* Delete Action (Soft Danger Red) */
.action-btn-delete {
  background-color: #fef2f2;
  border-color: #fee2e2;
  color: #dc2626;
}
.action-btn-delete:hover {
  background-color: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.35);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

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

.table-highlight-row {
  background-color: #f0fdf4 !important;
  border-left: 3px solid var(--success);
}

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

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-active { background-color: var(--success-light); color: var(--success-text); }
.badge-inactive { background-color: var(--danger-light); color: var(--danger-text); }
.badge-upcoming { background-color: var(--warning-light); color: var(--warning-text); }
.badge-current { background-color: #dbeafe; color: #1e40af; }
.badge-neutral { background-color: #f1f5f9; color: #475569; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  padding: 20px;
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition-fast);
}

.modal-dialog.modal-lg { max-width: 840px; }
.modal-dialog.modal-sm { max-width: 420px; }

.modal-backdrop.show .modal-dialog {
  transform: scale(1);
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
}

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

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

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

/* Toast Notifications Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background-color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

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

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-danger { border-left: 4px solid var(--danger); }
.toast-danger .toast-icon { color: var(--danger); }

.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.toast-message {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Autocomplete suggestions */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.autocomplete-menu.show {
  display: block;
}

.autocomplete-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.autocomplete-item:hover, .autocomplete-item.selected {
  background-color: var(--primary-light);
  color: var(--primary);
}

.autocomplete-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Pagination Bar */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 12px;
  color: var(--text-muted);
}

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

/* Empty State Component */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--text-light);
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-state-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto 18px;
}

/* Charts Grid */
.charts-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* Print Styles */
@media print {
  .sidebar, .top-header, .filter-bar, .page-actions, .btn, .pagination-wrapper {
    display: none !important;
  }
  .app-container, .main-wrapper, .viewport-content {
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #ffffff !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .charts-grid-2 {
    grid-template-columns: 1fr;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-toggle-btn {
    display: block;
  }
  .top-header {
    padding: 0 16px;
  }
  .viewport-content {
    padding: 16px;
  }
}

/* ==========================================================================
   Executive Dashboard 3D Micro-Animations & Refined Color System
   ========================================================================== */
.dashboard-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
}

.dashboard-title-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dashboard-title-area h1 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.pulse-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.4); }
}

.dashboard-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sync-timer-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.btn-icon-spin {
  display: inline-block;
  transition: transform 0.6s ease;
}

.spin-active {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 3D Stat Cards & Layout Grid */
.stats-grid, .charts-grid-2 {
  perspective: 1200px;
}

.stat-card-3d {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 4px 6px -2px rgba(15, 23, 42, 0.03), inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none !important;
  transform-style: preserve-3d;
  will-change: transform;
}

.stat-card-3d:hover {
  transform: translateY(-5px) rotateX(3deg) scale3d(1.02, 1.02, 1.02);
  box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

.stat-card-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  transition: background 0.3s ease;
}

/* Refined Standard Palette */
.stat-card-indigo::before { background: linear-gradient(90deg, #4f46e5, #6366f1); }
.stat-card-emerald::before { background: linear-gradient(90deg, #059669, #10b981); }
.stat-card-rose::before { background: linear-gradient(90deg, #e11d48, #f43f5e); }
.stat-card-violet::before { background: linear-gradient(90deg, #7c3aed, #8b5cf6); }
.stat-card-cyan::before { background: linear-gradient(90deg, #0284c7, #06b6d4); }
.stat-card-amber::before { background: linear-gradient(90deg, #d97706, #f59e0b); }

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-icon-3d-box {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transform: translateZ(12px);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-card-3d:hover .stat-icon-3d-box {
  transform: translateZ(24px) scale(1.08);
}

.stat-icon-indigo { background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(99, 102, 241, 0.15)); color: #4f46e5; }
.stat-icon-emerald { background: linear-gradient(135deg, rgba(5, 150, 105, 0.15), rgba(16, 185, 129, 0.15)); color: #059669; }
.stat-icon-rose { background: linear-gradient(135deg, rgba(225, 29, 72, 0.15), rgba(244, 63, 94, 0.15)); color: #e11d48; }
.stat-icon-violet { background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(139, 92, 246, 0.15)); color: #7c3aed; }
.stat-icon-cyan { background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(6, 182, 212, 0.15)); color: #0284c7; }
.stat-icon-amber { background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.15)); color: #d97706; }

.stat-trend-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trend-badge-up { background: rgba(16, 185, 129, 0.12); color: #047857; }
.trend-badge-neutral { background: rgba(100, 116, 139, 0.1); color: #475569; }
.trend-badge-warn { background: rgba(245, 158, 11, 0.15); color: #b45309; }

.stat-number-main {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.03em;
  transform: translateZ(8px);
}

.stat-title-main {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 5px;
}

.progress-mini-bar {
  width: 100%;
  height: 5px;
  background: #f1f5f9;
  border-radius: 3px;
  margin-top: 14px;
  overflow: hidden;
}

.progress-mini-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease-in-out;
}

/* Standard Quick Action 3D Grid */
.quick-actions-3d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.quick-action-3d-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none !important;
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.quick-action-3d-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 20px -4px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
  color: var(--primary);
}

.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}


