/**
 * M-TUNED Portal Styles
 * Premium automotive-inspired design with dark theme and gold accents
 * Modern, clean, professional - Built for performance
 */

/* ============================================
   CSS Variables - Theme System
   ============================================ */
:root {
  /* Brand Colors */
  --color-gold: #ffc700;
  --color-gold-dark: #d4a500;
  --color-gold-light: #ffd740;

  /* Dark Theme Backgrounds */
  --color-bg-primary: #0a0a0a;
  --color-bg-secondary: #141414;
  --color-bg-tertiary: #1a1a1a;
  --color-bg-elevated: #1f1f1f;
  --color-bg-hover: #242424;

  /* Text Colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: #a0a0a0;
  --color-text-tertiary: #707070;
  --color-text-muted: #505050;

  /* Border Colors */
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-light: rgba(255, 255, 255, 0.12);
  --color-border-focus: var(--color-gold);

  /* Status Colors */
  --color-success: #00ff88;
  --color-success-bg: rgba(0, 255, 136, 0.1);
  --color-warning: #ffaa00;
  --color-warning-bg: rgba(255, 170, 0, 0.1);
  --color-error: #ff3366;
  --color-error-bg: rgba(255, 51, 102, 0.1);
  --color-info: #00aaff;
  --color-info-bg: rgba(0, 170, 255, 0.1);

  /* Typography */
  --font-heading: 'Orbitron', 'Rajdhani', sans-serif;
  --font-body: 'Inter', 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  overflow-x: hidden;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

h1 {
  font-size: 1.75rem;
  letter-spacing: 0.08em;
}

h2 {
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

h3 {
  font-size: 1rem;
  letter-spacing: 0.05em;
}

h4 {
  font-size: 0.9rem;
}

p {
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

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

a:hover {
  color: var(--color-gold-light);
}

/* ============================================
   Portal Shell Layout
   ============================================ */
.portal-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 60px 1fr auto;
  grid-template-areas:
    "header header"
    "sidebar main"
    "sidebar footer";
  min-height: 100vh;
  background: var(--color-bg-primary);
}

.portal-shell.sidebar-collapsed {
  grid-template-columns: 70px 1fr;
}

/* Header */
.portal-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--color-bg-hover);
}

.hamburger-icon {
  width: 20px;
  height: 2px;
  background: var(--color-text-primary);
  position: relative;
  display: block;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--color-text-primary);
  left: 0;
}

.hamburger-icon::before {
  top: -6px;
}

.hamburger-icon::after {
  bottom: -6px;
}

/* Logo */
.portal-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo-image {
  height: 32px;
  width: auto;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: 0.1em;
}

.logo-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: var(--color-gold);
  color: var(--color-bg-primary);
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Notification Bell */
.notification-bell {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  position: relative;
  font-size: 1.125rem;
  transition: all var(--transition-fast);
}

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

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-error);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* User Menu Trigger */
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.user-menu-trigger:hover {
  background: var(--color-bg-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
  color: var(--color-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.user-name-header {
  color: var(--color-text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.icon-chevron-down {
  color: var(--color-text-tertiary);
  font-size: 0.75rem;
}

/* ============================================
   Sidebar Navigation
   ============================================ */
.portal-sidebar {
  grid-area: sidebar;
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: width var(--transition-normal);
}

.sidebar-nav {
  flex: 1;
  padding: var(--spacing-md) 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  margin: 2px 0;
}

.sidebar-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  border-left-color: var(--color-border-light);
}

.sidebar-item.active {
  background: rgba(255, 199, 0, 0.08);
  color: var(--color-gold);
  border-left-color: var(--color-gold);
}

.sidebar-item i {
  font-size: 1.125rem;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.sidebar-item.active i {
  opacity: 1;
}

.sidebar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--spacing-md) var(--spacing-lg);
}

.sidebar-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
}

.status-indicator.status-online {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

/* Collapsed Sidebar */
.sidebar-collapsed .portal-sidebar {
  width: 70px;
}

.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .logo-text,
.sidebar-collapsed .logo-badge,
.sidebar-collapsed .sidebar-footer,
.sidebar-collapsed .sidebar-divider {
  display: none;
}

.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding: var(--spacing-md);
}

.sidebar-collapsed .sidebar-item i {
  margin: 0;
}

/* ============================================
   Main Content Area
   ============================================ */
.portal-main {
  grid-area: main;
  background: var(--color-bg-primary);
  overflow-y: auto;
  min-height: 0;
}

.portal-content {
  padding: var(--spacing-xl);
  max-width: 1600px;
  margin: 0 auto;
}

/* ============================================
   Portal Footer
   ============================================ */
.portal-footer {
  grid-area: footer;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto;
}

.footer-right {
  display: flex;
  gap: var(--spacing-lg);
}

.footer-right a {
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
}

.footer-right a:hover {
  color: var(--color-gold);
}

/* ============================================
   Dropdowns
   ============================================ */
.notification-dropdown,
.user-menu-dropdown {
  position: fixed;
  top: 65px;
  right: var(--spacing-lg);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  min-width: 320px;
  max-height: 480px;
  overflow: hidden;
}

.notification-header,
.user-menu-header {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h3,
.user-menu-header h3 {
  font-size: 0.875rem;
  margin: 0;
  font-weight: 600;
}

.notification-list {
  max-height: 350px;
  overflow-y: auto;
}

.notification-item {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  transition: background var(--transition-fast);
}

.notification-item:hover {
  background: var(--color-bg-hover);
}

.notification-item.unread {
  background: rgba(255, 199, 0, 0.05);
}

.notification-empty {
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--color-text-tertiary);
}

.notification-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.user-menu-header {
  display: flex;
  gap: var(--spacing-md);
}

.user-menu-header .user-info {
  flex: 1;
}

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

.user-menu-header .user-email {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.user-menu-items {
  padding: var(--spacing-sm) 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-lg);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.user-menu-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.user-menu-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--spacing-sm) 0;
}

/* ============================================
   Mobile Overlay
   ============================================ */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99;
  backdrop-filter: blur(4px);
}

/* ============================================
   Icon Placeholders (using text fallbacks)
   ============================================ */
.icon-bell::before { content: "🔔"; font-style: normal; }
.icon-dashboard::before { content: "📊"; font-style: normal; }
.icon-users::before { content: "👥"; font-style: normal; }
.icon-queue::before { content: "📋"; font-style: normal; }
.icon-chart::before { content: "📈"; font-style: normal; }
.icon-help::before { content: "❓"; font-style: normal; }
.icon-user::before { content: "👤"; font-style: normal; }
.icon-settings::before { content: "⚙️"; font-style: normal; }
.icon-logout::before { content: "🚪"; font-style: normal; }
.icon-chevron-down::before { content: "▼"; font-style: normal; font-size: 0.6em; }
.icon-calendar::before { content: "📅"; font-style: normal; }
.icon-shop::before { content: "🛒"; font-style: normal; }

/* ============================================
   Login Page
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--color-bg-primary);
}

.login-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.login-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(255, 199, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 199, 0, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.login-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 0%, var(--color-bg-primary) 70%);
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: var(--spacing-lg);
}

.login-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.login-logo {
  height: 64px;
  margin-bottom: var(--spacing-md);
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-xs);
  letter-spacing: 0.15em;
}

.login-subtitle {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.form-tabs {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  background: var(--color-bg-primary);
  border-radius: var(--radius-md);
  padding: 4px;
}

.form-tab {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.form-tab:hover {
  color: var(--color-text-secondary);
}

.form-tab.active {
  background: var(--color-bg-tertiary);
  color: var(--color-gold);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  padding: var(--spacing-md);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(255, 199, 0, 0.1);
}

.form-group input::placeholder {
  color: var(--color-text-muted);
}

.password-field {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 4px;
}

.password-toggle:hover {
  color: var(--color-text-secondary);
}

.form-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.demo-notice {
  background: rgba(255, 199, 0, 0.08);
  border: 1px solid rgba(255, 199, 0, 0.2);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  font-size: 0.8rem;
  color: var(--color-gold);
  line-height: 1.5;
}

.demo-notice strong {
  display: block;
  margin-bottom: var(--spacing-xs);
}

.login-form .btn-primary {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-md);
  font-size: 0.95rem;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.form-link {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
}

.form-link a {
  color: var(--color-gold);
  font-weight: 500;
}

.login-footer {
  text-align: center;
  margin-top: var(--spacing-lg);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.login-footer p {
  margin: 0;
}

/* ============================================
   Modals
   ============================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
}

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

.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.modal-close,
.btn-close {
  background: transparent;
  border: none;
  color: var(--color-text-tertiary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

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

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

/* Modal Overlay (alternative) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay .modal-dialog {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
}

/* Form Controls within Modals */
.form-textarea {
  width: 100%;
  padding: var(--spacing-md);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 100px;
  transition: all var(--transition-fast);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(255, 199, 0, 0.1);
}

.form-help {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  margin-top: var(--spacing-xs);
}

.required {
  color: var(--color-error);
}

.info-banner {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-info-bg);
  border: 1px solid rgba(0, 170, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--color-info);
  font-size: 0.8rem;
  margin-top: var(--spacing-md);
}

.info-banner svg {
  flex-shrink: 0;
}

.info-banner strong {
  display: block;
  margin-bottom: 2px;
}

.info-banner p {
  margin: 0;
  opacity: 0.8;
}

/* ============================================
   Responsive Portal Shell
   ============================================ */
@media (max-width: 1024px) {
  .portal-shell {
    grid-template-columns: 220px 1fr;
  }

  .portal-shell.sidebar-collapsed {
    grid-template-columns: 60px 1fr;
  }
}

@media (max-width: 768px) {
  .portal-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main"
      "footer";
  }

  .portal-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    z-index: 100;
    transition: transform var(--transition-normal);
  }

  .portal-sidebar.mobile-open {
    transform: translateX(0);
  }

  .portal-content {
    padding: var(--spacing-lg);
  }

  .user-name-header {
    display: none;
  }

  .logo-text,
  .logo-badge {
    display: none;
  }

  .notification-dropdown,
  .user-menu-dropdown {
    right: var(--spacing-sm);
    min-width: 280px;
  }
}

@media (max-width: 480px) {
  .portal-content {
    padding: var(--spacing-md);
  }

  .portal-header {
    padding: 0 var(--spacing-md);
  }
}

/* ============================================
   Page Header Component
   ============================================ */
.page-header {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 2px solid var(--color-border);
}

.page-header h1 {
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p,
.page-header .subtitle {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   Card System - Premium Design
   ============================================ */
.content-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-lg);
  transition: all var(--transition-normal);
}

.content-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-light);
}

.content-card.elevated {
  background: var(--color-bg-tertiary);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  color: var(--color-text-primary);
}

.card-body {
  color: var(--color-text-secondary);
}

/* ============================================
   Stats Display System
   ============================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

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

.stat-card:hover::before {
  opacity: 1;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
}

/* Status Color Variants */
.stat-card.success .stat-number {
  background: linear-gradient(135deg, var(--color-success) 0%, #00dd77 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.warning .stat-number {
  background: linear-gradient(135deg, var(--color-warning) 0%, #ff9900 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.error .stat-number {
  background: linear-gradient(135deg, var(--color-error) 0%, #ff2255 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Stat Card Variants */
.stat-card.stat-urgent {
  border-color: var(--color-error);
}

.stat-card.stat-urgent .stat-number {
  background: linear-gradient(135deg, var(--color-error) 0%, #ff2255 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.stat-highlight {
  border-color: var(--color-gold);
}

.stat-card.stat-highlight .stat-number {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.stat-success {
  border-color: var(--color-success);
}

.stat-card.stat-success .stat-number {
  background: linear-gradient(135deg, var(--color-success) 0%, #00cc6a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Section Grouping
   ============================================ */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--color-border);
  position: relative;
}

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

.section {
  margin-bottom: var(--spacing-xl);
}

.section + .section {
  margin-top: var(--spacing-2xl);
}

/* ============================================
   Tables - Modern Data Display
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: var(--spacing-lg);
}

.data-table thead {
  background: var(--color-bg-tertiary);
}

.data-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.data-table th:first-child {
  border-top-left-radius: var(--radius-md);
}

.data-table th:last-child {
  border-top-right-radius: var(--radius-md);
}

.data-table td {
  padding: 1rem 1.25rem;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}

.data-table tbody tr {
  transition: all var(--transition-fast);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
  background: var(--color-bg-hover);
  transform: scale(1.001);
}

.data-table tbody tr:hover td {
  color: var(--color-gold-light);
}

/* Table Cell Alignment */
.data-table .text-right {
  text-align: right;
}

.data-table .text-center {
  text-align: center;
}

/* Completed Row Styling */
.data-table tbody tr.row-completed {
  opacity: 0.6;
  background: rgba(0, 255, 0, 0.05);
}

.data-table tbody tr.row-completed td {
  text-decoration: line-through;
  text-decoration-color: var(--color-text-tertiary);
}

.data-table tbody tr.row-completed td:first-child,
.data-table tbody tr.row-completed td:last-child {
  text-decoration: none;
}

/* Checkbox Cell */
.checkbox-cell {
  text-align: center;
  width: 50px;
}

.order-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-gold);
}

/* Text Muted */
.text-muted {
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
}

/* Order Number */
.order-number {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Customer Email */
.customer-email {
  font-size: 0.75rem;
}

/* Order Total */
.order-total {
  font-weight: 600;
  color: var(--color-gold);
}

/* ============================================
   Status Badges - Pill-Shaped Indicators
   ============================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

/* Status Badge Variants */
.status-badge.in_review,
.status-badge.blue {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info);
}

.status-badge.waiting_log,
.status-badge.orange {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
}

.status-badge.tune_sent,
.status-badge.green {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.status-badge.intake,
.status-badge.gray {
  background: rgba(112, 112, 112, 0.1);
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-text-tertiary);
}

.status-badge.pending {
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
  border: 1px solid #ffd700;
}

.status-badge.completed {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.status-badge.error,
.status-badge.red {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

/* Status Badge with Indicator Dot */
.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================
   Buttons - Premium Action Elements
   ============================================ */
.btn,
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

/* Primary Button - Gold Gradient */
.btn-primary,
.action-btn.primary {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
  color: var(--color-bg-primary);
  box-shadow: 0 4px 12px rgba(255, 199, 0, 0.3);
  border: 1px solid transparent;
}

.btn-primary:hover,
.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 199, 0, 0.5);
}

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

/* Secondary Button - Transparent with Border */
.btn-secondary,
.action-btn.secondary {
  background: transparent;
  color: var(--color-text-primary);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover,
.action-btn.secondary:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-gold);
  color: var(--color-gold);
  transform: translateY(-2px);
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, var(--color-error) 0%, #cc2952 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 51, 102, 0.5);
}

/* Success Button */
.btn-success {
  background: linear-gradient(135deg, var(--color-success) 0%, #00cc6a 100%);
  color: var(--color-bg-primary);
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 255, 136, 0.5);
}

/* Small Button */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.7rem;
}

/* Large Button */
.btn-lg {
  padding: 1rem 2rem;
  font-size: 0.9rem;
}

/* Block Button */
.btn-block {
  width: 100%;
}

/* Disabled State */
.btn:disabled,
.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Small Button Variant */
.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.btn-small.btn-primary {
  background: var(--color-gold);
  color: var(--color-bg-primary);
  border: none;
  box-shadow: none;
}

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

.btn-small:hover {
  transform: none;
}

/* Text Button */
.btn-text {
  background: transparent;
  border: none;
  color: var(--color-gold);
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.btn-text:hover {
  color: var(--color-gold-light);
  text-decoration: underline;
}

/* Link Button */
.btn-link {
  background: transparent;
  border: none;
  color: var(--color-gold);
  padding: 0;
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.btn-link:hover {
  color: var(--color-gold-light);
  text-decoration: underline;
}

/* ============================================
   Dashboard Page Container
   ============================================ */
.dashboard-page {
  width: 100%;
  max-width: 100%;
}

.page-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* Full Width Card */
.full-width {
  grid-column: 1 / -1;
}

.content-card.full-width {
  grid-column: 1 / -1;
}

/* ============================================
   Dashboard Grid Layout
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
}

.dashboard-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
}

.dashboard-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
}

/* ============================================
   Customer Grid (CRM)
   ============================================ */
.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.customer-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-normal);
}

.customer-card:hover {
  border-color: var(--color-border-light);
  box-shadow: var(--shadow-md);
}

.customer-header {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.customer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
  color: var(--color-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

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

.customer-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text-primary);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-vehicle {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  margin: 0;
}

.customer-stats {
  display: flex;
  gap: var(--spacing-lg);
  padding: var(--spacing-md) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing-md);
}

.mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mini-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gold);
}

.mini-stat-label {
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.customer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.last-activity {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

/* ============================================
   Case Items (Dashboard)
   ============================================ */
.case-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.case-item:hover {
  border-color: var(--color-gold);
  background: var(--color-bg-hover);
}

.case-main {
  flex: 1;
  min-width: 0;
}

.case-customer {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.case-vehicle {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
}

.case-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.case-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ============================================
   Activity Timeline
   ============================================ */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.activity-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-border);
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

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

.activity-message {
  font-size: 0.875rem;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ============================================
   Toolbar
   ============================================ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.6rem 1rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-select:hover {
  border-color: var(--color-border-light);
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-gold);
}

.search-box {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(255, 199, 0, 0.1);
}

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

.toolbar-actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* ============================================
   Spinner
   ============================================ */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: middle;
  margin-right: var(--spacing-xs);
}

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

/* ============================================
   Notification Styles
   ============================================ */
.notification {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-normal);
  z-index: 1100;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.notification-success {
  border-color: var(--color-success);
  color: var(--color-success);
}

.notification-error {
  border-color: var(--color-error);
  color: var(--color-error);
}

.notification-info {
  border-color: var(--color-info);
  color: var(--color-info);
}

/* ============================================
   Forms - Modern Input Styling
   ============================================ */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(255, 199, 0, 0.1);
  background: var(--color-bg-secondary);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* ============================================
   Utility Classes
   ============================================ */

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-muted { color: var(--color-text-muted); }
.text-gold { color: var(--color-gold); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }

/* ============================================
   Additional Components
   ============================================ */

/* Alert/Notice Boxes */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  margin-bottom: var(--spacing-lg);
  font-size: 0.9rem;
}

.alert-info {
  background: var(--color-info-bg);
  border-color: var(--color-info);
  color: var(--color-info);
}

.alert-success {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.alert-warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.alert-error {
  background: var(--color-error-bg);
  border-color: var(--color-error);
  color: var(--color-error);
}

/* Loading Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-2xl);
  text-align: center;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--spacing-xl) 0;
}

/* Badge (General) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: rgba(255, 199, 0, 0.15);
  color: var(--color-gold);
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--spacing-2xl);
  color: var(--color-text-tertiary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-lg);
  opacity: 0.5;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
}

.empty-state-message {
  color: var(--color-text-tertiary);
  margin-bottom: var(--spacing-lg);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .dashboard-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.125rem;
  }

  h3 {
    font-size: 0.95rem;
  }

  .stats-row {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
  }

  .stat-number {
    font-size: 2rem;
  }

  .dashboard-grid,
  .dashboard-grid-2,
  .dashboard-grid-3,
  .dashboard-grid-4 {
    grid-template-columns: 1fr;
  }

  .content-card {
    padding: var(--spacing-md);
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.25rem;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: var(--spacing-md);
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .btn,
  .action-btn {
    width: 100%;
    padding: 0.85rem 1.25rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.6rem;
    font-size: 0.75rem;
  }
}

/* ============================================
   Services Grid
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-lg);
}

.service-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

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

.service-image {
  height: 180px;
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-image.placeholder {
  color: var(--color-text-muted);
}

.service-content {
  padding: var(--spacing-lg);
}

.service-name {
  font-size: 1.125rem;
  margin-bottom: var(--spacing-xs);
}

.service-tagline {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--spacing-md);
}

.service-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}

.service-duration {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.service-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gold);
}

.service-description {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--spacing-md);
  line-height: 1.5;
}

.service-actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* ============================================
   Products Grid
   ============================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--spacing-lg);
}

.product-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: pointer;
}

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

.product-image {
  height: 200px;
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  color: var(--color-text-muted);
}

.image-placeholder.large {
  padding: var(--spacing-xl);
}

.sale-badge {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: var(--color-error);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.out-of-stock-badge {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: var(--color-text-muted);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.product-content {
  padding: var(--spacing-lg);
}

.product-name {
  font-size: 1rem;
  margin-bottom: var(--spacing-sm);
}

.product-tag {
  display: inline-block;
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  margin-right: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
}

.product-price {
  margin: var(--spacing-md) 0;
}

.price-current {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gold);
}

.price-original {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
  margin-right: var(--spacing-sm);
}

.price-sale {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-error);
}

.product-price-large .price-current,
.product-price-large .price-sale {
  font-size: 1.75rem;
}

.product-actions {
  margin-top: var(--spacing-md);
}

/* Product Detail Modal */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
}

.product-detail-gallery .main-image {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.thumbnail-row {
  display: flex;
  gap: var(--spacing-sm);
}

.thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.thumbnail:hover {
  opacity: 1;
}

.product-detail-info .product-sku {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin: var(--spacing-sm) 0;
}

.product-tags {
  margin: var(--spacing-md) 0;
}

.product-description h4 {
  margin-bottom: var(--spacing-sm);
}

.product-stock {
  margin-top: var(--spacing-md);
}

.stock-status {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
}

.stock-status.in-stock {
  color: var(--color-success);
}

.stock-status.out-of-stock {
  color: var(--color-error);
}

/* Availability Slots */
.availability-dates {
  max-height: 300px;
  overflow-y: auto;
}

.date-group {
  margin-bottom: var(--spacing-lg);
}

.date-header {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border);
}

.time-slots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.time-slot {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.time-slot:hover {
  border-color: var(--color-gold);
  background: var(--color-bg-hover);
}

.time-slot.selected {
  background: rgba(255, 199, 0, 0.15);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* Booking Summary */
.booking-summary {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

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

.summary-row.total {
  font-weight: 700;
  color: var(--color-gold);
  font-size: 1.1rem;
  padding-top: var(--spacing-md);
}

/* Form Sections */
.form-section {
  margin-bottom: var(--spacing-xl);
}

.form-section h3 {
  margin-bottom: var(--spacing-md);
  font-size: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

/* Filter Buttons */
.filter-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--color-border-light);
  color: var(--color-text-primary);
}

.filter-btn.active {
  background: rgba(255, 199, 0, 0.15);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* Success/Error States */
.success-state,
.error-state,
.loading-state {
  text-align: center;
  padding: var(--spacing-xl);
}

.success-state svg,
.error-state svg {
  margin-bottom: var(--spacing-md);
}

.success-state h3 {
  color: var(--color-success);
  margin-bottom: var(--spacing-sm);
}

.booking-details {
  background: var(--color-bg-tertiary);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-top: var(--spacing-md);
  font-size: 0.9rem;
}

/* Responsive Services/Products */
@media (max-width: 768px) {
  .services-grid,
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-detail {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }

  .content-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }

  .btn,
  .action-btn {
    display: none;
  }
}
