/* ==========================================================================
   CherryAI Fixed Assets — PREMIUM PROFESSIONAL UI
   High-impact design with depth, gradients, and micro-interactions
   ========================================================================== */

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

:root {
  /* ==========================================================================
     LEGACY VARIABLE ALIASES (Backward Compatibility)
     These reference tokens.css for consistency. DO NOT change these hex values.
     ADR-010: All new code should use tokens directly.
     ========================================================================== */
  
  /* Brand colors - aliased to tokens */
  --primary: var(--color-brand-600);
  --primary-hover: var(--color-brand-800);
  --primary-light: var(--color-brand-100);
  --primary-gradient: var(--gradient-brand);
  
  --cherry-primary: var(--color-brand-600);
  --cherry-secondary: var(--color-brand-550);
  --cherry-accent: var(--color-brand-450);
  
  /* Semantic colors - aliased to tokens */
  --secondary: var(--color-text-3);
  --success: var(--color-success-600);
  --success-light: var(--color-success-100);
  --warning: var(--color-warning-600);
  --warning-light: var(--color-warning-100);
  --danger: var(--color-danger-600);
  --danger-light: var(--color-danger-100);
  --info: var(--color-info-500);
  --info-light: var(--color-info-100);
  
  /* Background/surface colors - aliased to tokens */
  --bg-primary: var(--color-surface-0);
  --bg-secondary: var(--color-surface-1);
  --bg-tertiary: var(--color-surface-2);
  --bg-sidebar: var(--gradient-sidebar);
  --bg-sidebar-hover: var(--color-overlay-light);
  --bg-sidebar-active: var(--color-overlay-light-hover);
  
  /* Text colors - aliased to tokens */
  --text-primary: var(--color-text-1);
  --text-secondary: var(--color-text-2);
  --text-muted: var(--color-text-4);
  --text-inverse: var(--color-text-inverse);
  
  /* Border colors - aliased to tokens */
  --border: var(--color-border-1);
  --border-focus: var(--color-focus);
  
  /* Shadows - these remain as-is (already in tokens.css) */
  --shadow-sm: var(--shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05));
  --shadow-md: var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06));
  --shadow-lg: var(--shadow-lg, 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.08));
  --shadow-xl: var(--shadow-xl, 0 20px 40px -10px rgb(0 0 0 / 0.15), 0 10px 20px -10px rgb(0 0 0 / 0.1));
  --shadow-glow: var(--shadow-glow, 0 0 20px rgb(59 130 246 / 0.3));
  --shadow-card: var(--shadow-card, 0 1px 3px rgb(0 0 0 / 0.05), 0 20px 40px -20px rgb(0 0 0 / 0.1));
  
  /* Radius - aliased to tokens */
  --radius-sm: var(--radius-sm, 0.375rem);
  --radius-md: var(--radius-md, 0.5rem);
  --radius-lg: var(--radius-lg, 0.75rem);
  --radius-xl: var(--radius-xl, 1rem);
  --radius-2xl: var(--radius-2xl, 1.25rem);
  
  /* Layout dimensions (not tokenized - page-specific) */
  --sidebar-width: 280px;
  --header-height: 64px;
  
  /* Transitions - aliased to tokens */
  --transition-fast: var(--dur-fast) var(--ease-standard);
  --transition-normal: var(--dur-normal) var(--ease-standard);
  --transition-bounce: var(--dur-slow) var(--ease-bounce);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgb(0 0 0 / 0.15);
}

.sidebar-brand {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-brand-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgb(59 130 246 / 0.4);
  transition: transform var(--transition-bounce), box-shadow var(--transition-normal);
}

.sidebar-brand:hover .sidebar-brand-icon {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 6px 20px rgb(59 130 246 / 0.5);
}

.sidebar-brand-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  background: #f0f4f8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-bounce);
}

.sidebar-brand:hover .sidebar-brand-logo {
  transform: scale(1.05);
}

.sidebar-brand-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand-module {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.02em;
  margin-top: 3px;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 20px 16px;
  flex: 1;
}

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
  padding-left: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius-lg);
  margin-bottom: 4px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transition: transform var(--transition-bounce);
}

.sidebar-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
  transform: translateX(4px);
}

.sidebar-link.active {
  background: var(--bg-sidebar-active);
  color: #fff;
}

.sidebar-link.active::before {
  transform: scaleY(1);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity var(--transition-fast), transform var(--transition-bounce);
}

.sidebar-link:hover svg,
.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-link:hover svg {
  transform: scale(1.1);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ========== MAIN CONTENT ========== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.main-header {
  background: var(--bg-secondary);
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.97);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.05);
}

.header-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.header-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}

.page-content {
  flex: 1;
  padding: 28px 32px;
}

.content-header {
  background: var(--bg-secondary);
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0.5rem 0 0 0;
}

.page-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.content-body {
  padding: 28px 32px;
}

/* ========== CARDS ========== */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-tertiary));
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

.card-body {
  padding: 24px;
}

/* ========== STAT CARDS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-start;
  gap: 18px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.stat-card.stat-success { border-left-color: var(--success); }
.stat-card.stat-warning { border-left-color: var(--warning); }
.stat-card.stat-danger { border-left-color: var(--danger); }
.stat-card.stat-info { border-left-color: var(--info); }
.stat-card.stat-purple { border-left-color: #7c3aed; }
.stat-card.stat-secondary { border-left-color: var(--secondary); }
.stat-card.stat-pink { border-left-color: #db2777; }

a.stat-card.stat-link {
  text-decoration: none;
  cursor: pointer;
  display: flex;
}

a.stat-card.stat-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.stat-card.stat-active {
  box-shadow: 0 0 0 2px var(--primary), var(--shadow-lg);
}

.stat-card.stat-active.stat-success { box-shadow: 0 0 0 2px var(--success), var(--shadow-lg); }
.stat-card.stat-active.stat-warning { box-shadow: 0 0 0 2px var(--warning), var(--shadow-lg); }
.stat-card.stat-active.stat-danger { box-shadow: 0 0 0 2px var(--danger), var(--shadow-lg); }
.stat-card.stat-active.stat-info { box-shadow: 0 0 0 2px var(--info), var(--shadow-lg); }
.stat-card.stat-active.stat-purple { box-shadow: 0 0 0 2px #7c3aed, var(--shadow-lg); }
.stat-card.stat-active.stat-pink { box-shadow: 0 0 0 2px #db2777, var(--shadow-lg); }

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-bounce);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-5deg);
}

.stat-icon svg {
  width: 28px;
  height: 28px;
}

.stat-icon.primary {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
  box-shadow: 0 4px 12px rgb(37 99 235 / 0.2);
}

.stat-icon.success {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
  box-shadow: 0 4px 12px rgb(22 163 74 / 0.2);
}

.stat-icon.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
  box-shadow: 0 4px 12px rgb(217 119 6 / 0.2);
}

.stat-icon.danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  box-shadow: 0 4px 12px rgb(220 38 38 / 0.2);
}

.stat-content {
  flex: 1;
  min-width: 0;
}

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

.stat-value {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-change {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* ========== DATA TABLES — PREMIUM MODERN DESIGN ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  table-layout: auto;
}

.data-table thead {
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  white-space: nowrap;
}

.data-table th:first-child {
  padding-left: 20px;
}

.data-table th:last-child {
  padding-right: 20px;
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.data-table td:first-child {
  padding-left: 20px;
}

.data-table td:last-child {
  padding-right: 20px;
}

/* Primary column - bold anchor text */
.data-table td.col-primary,
.data-table td:first-child {
  font-weight: 700;
  color: #1e40af;
  font-size: 14px;
}

/* Description column */
.data-table td.col-description {
  font-weight: 400;
  color: #374151;
  max-width: 400px;
}

/* Location/code columns - uppercase subtle */
.data-table td.col-code {
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Date columns */
.data-table td.col-date,
.data-table th[data-type="date"] + td {
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Currency/numeric columns */
.data-table td.col-currency,
.data-table td.col-amount,
.data-table .num {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #374151;
  text-align: right;
  white-space: nowrap;
}

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

.data-table tbody tr:hover {
  background: #fafbfd;
}

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

/* Clickable table rows */
.data-table tbody tr.clickable-row {
  cursor: pointer;
}

.data-table tbody tr.clickable-row:hover {
  background: #f0f4ff;
}

.data-table tbody tr.clickable-row td a {
  color: #1e40af;
  text-decoration: none;
  font-weight: 700;
}

.data-table tbody tr.clickable-row td a:hover {
  text-decoration: underline;
}

.asset-link {
  color: #1e40af;
  text-decoration: none;
  font-weight: 700;
}

.asset-link:hover {
  color: #1e3a8a;
  text-decoration: underline;
}

/* ========== ENHANCED DATA GRID ========== */
.enhanced-grid-container {
  width: 100%;
}

.grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.grid-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.grid-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.grid-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 400px;
  flex: 1;
}

.grid-search svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.grid-search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  background: var(--lux-surface, #ffffff);
  transition: all 0.2s ease;
  color: #1e293b;
}

.grid-search-input:focus {
  outline: none;
  border-color: #2e4a7d;
  box-shadow: 0 0 0 4px rgba(46, 74, 125, 0.12);
}

.grid-search-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.grid-count {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: var(--lux-surface-alt, #f1f5f9);
  padding: 8px 14px;
  border-radius: 8px;
}

.grid-export-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-weight: 600;
  border-radius: 10px;
}

/* Sortable headers */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  position: relative;
}

.data-table th.sortable:hover {
  background: var(--lux-surface-alt, #f1f5f9);
  color: #1e3a5f;
}

.data-table th .sort-icon {
  display: inline-flex;
  margin-left: 6px;
  opacity: 0.3;
  transition: opacity 0.15s ease;
}

.data-table th.sortable:hover .sort-icon {
  opacity: 0.6;
}

.data-table th.sort-asc .sort-icon,
.data-table th.sort-desc .sort-icon {
  opacity: 1;
  color: #2e4a7d;
}

.data-table th.sort-asc .sort-icon svg {
  transform: rotate(180deg);
}

/* Enhanced clickable rows */
.data-table.enhanced-grid tbody tr {
  transition: all 0.15s ease;
}

.data-table.enhanced-grid tbody tr:hover {
  background: linear-gradient(90deg, #f0f4ff 0%, #f8fafc 100%);
  transform: scale(1.002);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.data-table.enhanced-grid tbody tr.clickable-row {
  cursor: pointer;
}

.data-table.enhanced-grid tbody tr.clickable-row:active {
  transform: scale(0.998);
}

/* ========== PREMIUM DATAGRID TOOLBAR ========== */
.grid-toolbar-premium {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid #e2e8f0;
}

.grid-toolbar-premium .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: var(--lux-surface, #fff);
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.grid-toolbar-premium .btn:hover {
  background: var(--lux-surface-alt, #f3f4f6);
  border-color: #9ca3af;
}

.grid-toolbar-premium .btn svg {
  width: 16px;
  height: 16px;
}

/* Filter/Column/Export Dropdowns */
.grid-filter-toggle,
.grid-column-toggle,
.grid-export-toggle {
  position: relative;
}

.grid-filter-dropdown,
.grid-column-dropdown,
.grid-export-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 280px;
  background: var(--lux-surface, #fff);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  overflow: hidden;
}

.grid-export-dropdown {
  min-width: 160px;
}

.grid-dropdown-header {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: var(--lux-surface-alt, #f8fafc);
  border-bottom: 1px solid #e2e8f0;
}

.grid-dropdown-footer {
  padding: 12px 16px;
  background: var(--lux-surface-alt, #f8fafc);
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid-filter-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 16px;
}

.grid-filter-item {
  margin-bottom: 12px;
}

.grid-filter-item:last-child {
  margin-bottom: 0;
}

.grid-filter-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.grid-filter-item input,
.grid-filter-item select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  color: #1e293b;
}

.grid-filter-item input:focus,
.grid-filter-item select:focus {
  outline: none;
  border-color: #2e4a7d;
  box-shadow: 0 0 0 3px rgba(46, 74, 125, 0.1);
}

.grid-column-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.grid-column-item:hover {
  background: var(--lux-surface-alt, #f1f5f9);
}

.grid-column-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2e4a7d;
}

.grid-column-item span {
  font-size: 14px;
  color: #1e293b;
}

.grid-export-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.grid-export-dropdown button:hover {
  background: var(--lux-surface-alt, #f1f5f9);
}

.grid-export-dropdown button svg {
  width: 16px;
  height: 16px;
  color: #6b7280;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  background: #2e4a7d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
}

/* Sticky Header */
.enhanced-grid thead.sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
}

.enhanced-grid thead.sticky-header th {
  background: var(--lux-surface-alt, #f8fafc);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ========== MODERN STATUS BADGES ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-badge.active,
.status-badge.completed,
.status-badge.success {
  background: #dcfce7;
  color: #166534;
}

.status-badge.inactive,
.status-badge.disposed,
.status-badge.cancelled {
  background: var(--lux-surface-alt, #f1f5f9);
  color: #64748b;
}

.status-badge.pending,
.status-badge.scheduled,
.status-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.in-progress,
.status-badge.working {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.overdue,
.status-badge.error,
.status-badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgb(59 130 246 / 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(59 130 246 / 0.45);
}

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

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgb(239 68 68 / 0.35);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(239 68 68 / 0.45);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 4px 12px rgb(34 197 94 / 0.35);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(34 197 94 / 0.45);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 12px rgb(245 158 11 / 0.35);
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(245 158 11 / 0.45);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn-outline {
  background: var(--bg-secondary);
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(46 74 125 / 0.25);
}

.btn-outline-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border);
  box-shadow: none;
}

.btn-outline-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-danger {
  background: var(--bg-secondary);
  color: var(--danger);
  border: 2px solid var(--danger);
  box-shadow: none;
}

.btn-outline-danger:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(239 68 68 / 0.25);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn svg {
  transition: transform var(--transition-bounce);
}

.btn:hover svg {
  transform: scale(1.1);
}

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #15803d;
  box-shadow: 0 2px 4px rgb(21 128 61 / 0.15);
}

.badge-warning {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  box-shadow: 0 2px 4px rgb(180 83 9 / 0.15);
}

.badge-danger {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
  box-shadow: 0 2px 4px rgb(220 38 38 / 0.15);
}

.badge-secondary {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #475569;
}

.badge-primary {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  box-shadow: 0 2px 4px rgb(29 78 216 / 0.15);
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a5f !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.form-control, .form-select {
  width: 100%;
  padding: 12px 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.01em;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  color: #1e293b;
  background: var(--lux-surface, #ffffff);
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.form-control:hover, .form-select:hover {
  border-color: #cbd5e1;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: #2e4a7d;
  box-shadow: 0 0 0 4px rgba(46, 74, 125, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04);
  background: #fefefe;
}

.form-control::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* Static form control (read-only display) */
.form-control-static {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-height: 38px;
}

.form-control-static .text-muted {
  color: var(--text-muted);
  font-style: italic;
}

.form-control-static .text-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8rem;
}

.form-control-static .text-link:hover {
  text-decoration: underline;
}

/* ========== CURRENCY INPUT GROUPS ========== */
.input-group-currency {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-weight: 500;
  z-index: 1;
  pointer-events: none;
}

.input-group-currency .form-control {
  padding-left: 32px;
}

/* ========== SEARCH BAR ========== */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar svg {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  padding-left: 44px !important;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
}

.search-bar input:focus {
  background: var(--bg-secondary);
  border-color: var(--primary);
}

/* ========== QUICK ACTIONS ========== */
.quick-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
}

.quick-action:hover {
  background: var(--bg-tertiary);
  border-color: var(--border);
  transform: translateX(4px);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: var(--primary);
  transition: transform var(--transition-bounce);
}

.quick-action:hover .quick-action-icon {
  transform: scale(1.1) rotate(-5deg);
}

.quick-action-text {
  font-weight: 600;
  color: var(--text-primary);
}

.quick-action-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== ACTION GROUPS ========== */
.action-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 60px 40px;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}

/* ========== ALERTS ========== */
.alert {
  padding: 14px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  font-weight: 500;
}

.alert-success {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #15803d;
  border: 1px solid #86efac;
}

.alert-danger {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.alert svg.alert-icon {
  flex-shrink: 0;
  margin-right: 12px;
}

/* ========== PREMIUM MODALS ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: modalOverlayFadeIn 0.25s ease-out;
}

@keyframes modalOverlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-overlay .modal {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-2xl);
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 25px 50px -12px rgba(0, 0, 0, 0.35),
    0 0 100px -20px rgba(46, 74, 125, 0.25);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 100%;
  max-width: 520px;
  margin: 24px auto;
}

.modal-overlay .modal.modal-md {
  max-width: 560px;
}

.modal-overlay .modal.modal-lg {
  max-width: 680px;
}

.modal-overlay .modal.modal-xl {
  max-width: 900px;
}

.modal-overlay .modal.modal-2xl {
  max-width: 1100px;
}

.modal-overlay .modal-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 200px);
  max-height: calc(100dvh - 200px);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding: 24px 28px;
}

.modal-overlay .modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-overlay .modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-overlay .modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

body.modal-open {
  overflow: hidden;
}

.modal-content {
  background: var(--lux-surface, #ffffff);
  border-radius: var(--radius-2xl);
  border: none;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}


.modal-header {
  padding: 20px 28px;
  border-bottom: none;
  background: linear-gradient(135deg, #1e3a5f 0%, #2e4a7d 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #ffffff;
}

.modal-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.modal-header-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(46, 74, 125, 0.3);
}

.modal-header-icon svg {
  width: 22px;
  height: 22px;
}

.modal-header-text h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-header-text p {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.modal-title {
  font-weight: 700;
  color: var(--text-primary);
}


.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid #e2e8f0;
  background: var(--lux-surface-alt, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.modal-footer .btn {
  min-width: 100px;
}

/* Modal Form Grid Layouts */
.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.modal-form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

.modal-form-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.modal-form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.modal-form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Enhanced form controls in modals */
.modal-body .form-group {
  margin-bottom: 0;
}

.modal-body .form-group label,
.modal-body .form-label,
.modal-content .form-label,
.modal-overlay .form-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: block;
}

.modal-content .form-control,
.modal-content .form-select {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--lux-surface, #ffffff);
  transition: all 0.2s ease;
}

.modal-content .form-control:focus,
.modal-content .form-select:focus {
  border-color: #2e4a7d;
  box-shadow: 0 0 0 3px rgba(46, 74, 125, 0.12);
  outline: none;
}

.modal-content .form-control::placeholder {
  color: #94a3b8;
}

.modal-content .form-group {
  margin-bottom: 16px;
}

.modal-body .form-control {
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  padding: 12px 14px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: var(--lux-surface, #ffffff);
}

.modal-body .form-control:focus {
  border-color: #2e4a7d;
  box-shadow: 0 0 0 3px rgba(46, 74, 125, 0.12);
  outline: none;
}

.modal-body textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

.modal-body select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Inline form row for compact fields */
.modal-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

/* Checkbox styling in modals */
.modal-body .checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.modal-body .checkbox-label:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.modal-body .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ========== TOUR BUTTON ========== */
.tour-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 2px solid var(--border);
  border-radius: 50px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
}

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

.tour-btn svg {
  width: 18px;
  height: 18px;
}

/* ========== UTILITY CLASSES ========== */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-fade-in {
  animation: fadeInUp 0.4s ease-out;
}

/* Page load animations */
.stats-grid .stat-card {
  animation: fadeInUp 0.4s ease-out backwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.2s; }

.card {
  animation: fadeInUp 0.4s ease-out backwards;
  animation-delay: 0.25s;
}

/* ========== FOOTER ========== */
.app-footer {
  margin-top: auto;
  padding: 16px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.app-footer p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ========== CHERRYAI BRANDING ========== */
.cherryai-sidebar {
  background: linear-gradient(180deg, #1e3a5f 0%, #2e4a7d 100%);
}

.cherryai-sidebar .sidebar-link.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: #ffffff;
}

.cherryai-sidebar .sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ========== LOCATION BREAKDOWN ========== */
.location-breakdown {
  padding: 16px;
}

.location-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.location-item:last-child {
  border-bottom: none;
}

.location-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.location-name {
  font-weight: 600;
  color: var(--text-primary);
}

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

.location-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.location-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.5s ease-out;
}

.location-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-align: right;
}

/* ========== COST TYPE CARDS ========== */
a.cost-type-card {
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-normal);
}

a.cost-type-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.cost-type-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cost-type-amount {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   BEST-OF-BREED DATA DISPLAY TYPOGRAPHY
   Premium typography for labels, values, and data grids
   ========================================================================== */

.detail-list {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  gap: 16px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row:hover {
  background: rgba(241, 245, 249, 0.5);
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 6px;
}

.detail-label {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  min-width: 120px;
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  text-align: right;
  word-break: break-word;
  line-height: 1.5;
}

.detail-value strong {
  font-weight: 700;
  color: #0f172a;
}

.detail-section {
  background: var(--lux-surface, #ffffff);
  border-radius: 10px;
  padding: 20px 24px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 2px;
}

/* Tab Navigation - Premium Style */
.tab-container {
  padding: 24px;
}

.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 28px;
  background: transparent;
}


/* Form Labels & Inputs - Premium Style */
.form-group label,
label.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
}

.form-control,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  background: var(--lux-surface, #ffffff);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  width: 100%;
  transition: all 0.15s ease;
  line-height: 1.5;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

select.form-control,
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

/* Badge Styles - Premium */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}

.badge-success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.badge-secondary {
  background: var(--lux-surface-alt, #f1f5f9);
  color: #64748b;
}

.badge-primary {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

/* Card Headers - Premium Style */
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.01em;
}

.card-body {
  padding: 24px;
}

/* Data Grid Typography */
.data-grid th {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  background: var(--lux-surface-alt, #f8fafc);
  border-bottom: 2px solid #e2e8f0;
}

.data-grid td {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.data-grid tr:hover td {
  background: rgba(59, 130, 246, 0.03);
}

/* Hierarchy Links - Premium */
.hierarchy-item {
  margin-bottom: 10px;
}

.hierarchy-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--lux-surface-alt, #f8fafc);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hierarchy-link:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  transform: translateX(4px);
}

.hierarchy-number {
  font-size: 15px;
  font-weight: 700;
  color: #3b82f6;
  font-variant-numeric: tabular-nums;
}

.hierarchy-link:hover .hierarchy-number {
  color: white;
}

.hierarchy-desc {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
}

.hierarchy-link:hover .hierarchy-desc {
  color: white;
}

/* Money/Number Formatting */
.money-value,
.numeric-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Empty State Typography */
.text-muted {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 400;
}

/* ============================================================
   ASSET PAGE - Best-of-Breed Enterprise Design
   Inspired by IBM Maximo, SAP, Salesforce
   ============================================================ */

.asset-page {
  max-width: 1400px;
  margin: 0 auto;
}

/* Asset Header Card - Premium Hero Section */
.asset-header-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  margin-bottom: 24px;
  overflow: hidden;
}

.asset-header-content {
  display: flex;
  gap: 32px;
  padding: 28px 32px;
  align-items: flex-start;
}

.asset-image-container {
  position: relative;
  flex-shrink: 0;
}

.asset-image {
  width: 180px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.condition-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.condition-excellent, .condition-good { background: rgba(16, 185, 129, 0.9); color: white; }
.condition-fair { background: rgba(245, 158, 11, 0.9); color: white; }
.condition-poor, .condition-critical { background: rgba(239, 68, 68, 0.9); color: white; }

.asset-info-panel {
  flex: 1;
  min-width: 0;
}

.asset-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.asset-number {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.asset-description {
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
  margin: 6px 0 0;
}

.status-indicator {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-active { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #15803d; }
.status-inactive { background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); color: #475569; }
.status-disposed { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #b45309; }
.status-intransit { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1d4ed8; }

.asset-location-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.location-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--lux-surface-alt, #f1f5f9);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.location-chip svg { color: #64748b; }
.location-chip-secondary { background: var(--lux-surface-alt, #f8fafc); border-style: dashed; }

.asset-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-flag {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.flag-critical { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); color: #dc2626; border: 1px solid #fecaca; }
.flag-rotating { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); color: #0284c7; border: 1px solid #bae6fd; }
.flag-priority { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); color: #d97706; border: 1px solid #fde68a; }

/* Asset Card Bottom Section */
.asset-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-top: 1px solid #e2e8f0;
  gap: 24px;
}

.asset-quick-stats {
  display: flex;
  gap: 40px;
}

.quick-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quick-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.asset-action-buttons {
  display: flex;
  gap: 12px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.action-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.action-btn-secondary {
  background: var(--lux-surface, white);
  color: #334155;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.action-btn-secondary:hover {
  background: var(--lux-surface-alt, #f8fafc);
  border-color: #cbd5e1;
}

.action-btn-danger {
  background: var(--lux-surface, white);
  color: #dc2626;
  border: 1px solid #fecaca;
}

.action-btn-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* Form Sections - Premium Style */
.form-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--lux-border, #f1f5f9);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--lux-text, #1e293b);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--lux-border, #f1f5f9);
  position: relative;
}

.form-section-title::before {
  content: '';
  width: 5px;
  height: 24px;
  background: linear-gradient(180deg, #3b82f6 0%, #1e3a5f 100%);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.form-section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6 0%, transparent 100%);
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
}

/* Ultra Premium Form Labels - Global */
.form-section .form-group .form-label,
.form-section .form-group label,
.form-row .form-group label {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: var(--lux-text-secondary, #1e3a5f) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  margin-bottom: 6px !important;
  display: block !important;
  background: linear-gradient(90deg, var(--form-label-gradient-start, #1e3a5f) 0%, var(--form-label-gradient-end, #3b82f6) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Ultra Premium Form Values - Global with high specificity */
.form-section .form-group .form-value,
.form-row .form-group .form-value,
.tab-content .form-group .form-value,
div.form-value {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--lux-text, #334155) !important;
  padding: 0 !important;
  border: none !important;
  min-height: auto !important;
  line-height: 1.4 !important;
  letter-spacing: -0.005em !important;
  background: none !important;
  -webkit-text-fill-color: var(--lux-text, #334155) !important;
}

.form-value.empty {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  font-style: italic;
  font-weight: 400 !important;
}


/* Form Footer Actions */
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 0 0;
  margin-top: 24px;
  border-top: 1px solid #e2e8f0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .asset-header-content {
    flex-direction: column;
    gap: 20px;
  }
  
  .asset-image {
    width: 100%;
    height: 200px;
  }
  
  .asset-card-bottom {
    flex-direction: column;
    align-items: stretch;
  }
  
  .asset-quick-stats {
    justify-content: space-between;
  }
  
  .asset-action-buttons {
    justify-content: flex-end;
  }
  
  .form-row {
    flex-direction: column;
  }
}

/* ========== CRITICAL: FORM VALUE CONSISTENCY OVERRIDE ========== */
/* These rules MUST be at the end to override all other styles */
.form-value,
div.form-value,
.form-group .form-value,
.form-row .form-group .form-value,
.form-section .form-group .form-value,
.tab-content .form-group .form-value,
.tab-content .form-section .form-group .form-value,
.premium-tabs .form-value {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--lux-text, #334155) !important;
  line-height: 1.4 !important;
  letter-spacing: -0.005em !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  -webkit-text-fill-color: var(--lux-text, #334155) !important;
  min-height: auto !important;
}

/* ========== LEGACY ROUTE WARNING BANNER ========== */
.legacy-banner {
  background: var(--warning-light);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #b45309;
  font-size: 0.875rem;
}

.legacy-banner i {
  flex-shrink: 0;
  font-size: 1rem;
}

.legacy-banner a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
}

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

/* ========== COMPACT FILTER BAR ========== */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.filter-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.filter-item {
  min-width: 120px;
}

.filter-item-search {
  flex: 1;
  min-width: 200px;
}

.filter-item .form-control-sm,
.filter-item-search .form-control-sm {
  height: 36px;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-sm {
  height: 36px;
  padding: 0 1rem;
  font-size: 0.875rem;
}

/* Compact hero for list pages */
.page-hero-compact .page-hero-main {
  padding: 1rem 1.5rem;
}

.page-hero-compact .page-hero-title {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.page-hero-compact .page-hero-subtitle {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.page-hero-compact .page-hero-kpis {
  gap: 0.75rem;
}

.page-hero-compact .kpi-card {
  padding: 0.5rem 1rem;
  min-width: 80px;
}

.page-hero-compact .kpi-value {
  font-size: 1.25rem;
}

/* ========== GRID FILTER TOOLBAR (Asset Register Style) ========== */
.grid-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.grid-filter-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 200px;
}

.grid-filter-search {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.grid-filter-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.grid-filter-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.grid-filter-search input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15);
}

.grid-filter-search input::placeholder {
  color: var(--text-muted);
}

.grid-filter-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.grid-filter-select {
  height: 38px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") right 8px center/16px no-repeat;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  min-width: 120px;
}

.grid-filter-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15);
}

/* ========== GRID PAGINATION ========== */
.grid-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.grid-pagination-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.grid-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-pagination-controls .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* ========== QUICK STATS ROW 4 COLUMNS ========== */
.quick-stats-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .quick-stats-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .quick-stats-row-4 {
    grid-template-columns: 1fr;
  }
  
  .grid-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .grid-filter-left,
  .grid-filter-right {
    width: 100%;
  }
  
  .grid-filter-search {
    max-width: none;
  }
}
