/* ============================================
   PaintPlanner Admin Panel — Design System
   Premium Dark Theme with Glassmorphism
   ============================================ */

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

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Background */
  --bg-primary: #0a0e27;
  --bg-secondary: #111638;
  --bg-card: rgba(17, 22, 56, 0.7);
  --bg-card-solid: #151a3d;
  --bg-sidebar: rgba(10, 14, 39, 0.95);
  --bg-input: rgba(255, 255, 255, 0.05);
  --bg-hover: rgba(255, 255, 255, 0.08);
  --bg-table-row: rgba(255, 255, 255, 0.02);
  --bg-table-hover: rgba(255, 255, 255, 0.06);

  /* Text */
  --text-primary: #e8eaf6;
  --text-secondary: #8b8fb0;
  --text-muted: #5a5e80;
  --text-white: #ffffff;

  /* Accent Colors */
  --cyan: #00d4ff;
  --cyan-glow: rgba(0, 212, 255, 0.15);
  --purple: #7c3aed;
  --purple-glow: rgba(124, 58, 237, 0.15);
  --orange: #f97316;
  --orange-glow: rgba(249, 115, 22, 0.15);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.15);
  --amber: #f59e0b;
  --blue: #3b82f6;

  /* Gradients */
  --gradient-cyan-purple: linear-gradient(135deg, #00d4ff, #7c3aed);
  --gradient-orange-pink: linear-gradient(135deg, #f97316, #ec4899);
  --gradient-emerald-cyan: linear-gradient(135deg, #10b981, #00d4ff);
  --gradient-purple-rose: linear-gradient(135deg, #7c3aed, #f43f5e);
  --gradient-sidebar: linear-gradient(180deg, #0a0e27, #111638);

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);

  /* Sizing */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 65px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 20px rgba(0, 212, 255, 0.2);
  --shadow-glow-purple: 0 0 20px rgba(124, 58, 237, 0.2);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: var(--text-white);
}

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

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

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

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 40%, rgba(0, 212, 255, 0.08), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(124, 58, 237, 0.08), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(249, 115, 22, 0.05), transparent 30%);
  animation: loginBgPulse 15s ease-in-out infinite alternate;
}

@keyframes loginBgPulse {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-2%, -2%) rotate(3deg); }
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: loginSlideIn 0.6s ease-out;
}

@keyframes loginSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--gradient-cyan-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  box-shadow: var(--shadow-glow-cyan);
}

.login-logo h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-cyan-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.login-error {
  background: var(--rose-glow);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--rose);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

/* ============================================
   LAYOUT — SIDEBAR + MAIN
   ============================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--gradient-sidebar);
  border-right: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), width var(--transition-base);
  overflow-y: auto;
  overflow-x: hidden;
}

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

.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-cyan-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-glow-cyan);
}

.sidebar-brand h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-cyan-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

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

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

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 16px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--cyan-glow);
  color: var(--cyan);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--cyan);
  border-radius: 0 3px 3px 0;
}

.sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-link .badge {
  margin-left: auto;
  background: var(--cyan);
  color: var(--bg-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-base);
  min-width: 0; /* Fixes flex child width expansion bug */
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(10, 14, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

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

.header-left .page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 600;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.hamburger:hover {
  background: var(--bg-hover);
}

.header-search {
  position: relative;
  width: 300px;
}

.header-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition-fast);
  outline: none;
}

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

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

.header-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

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

.header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.header-profile:hover {
  background: var(--bg-hover);
}

.header-profile .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-cyan-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
}

.header-profile .info {
  line-height: 1.3;
}

.header-profile .info .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-profile .info .role {
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--rose-glow);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: var(--radius-sm);
  color: var(--rose);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'Inter', sans-serif;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: rgba(244, 63, 94, 0.4);
}

/* ============================================
   PAGE CONTENT AREA
   ============================================ */
.page-content {
  padding: 28px 32px;
  animation: fadeInUp 0.4s ease-out;
}

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

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 2px;
}

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

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.kpi-card.cyan::before { background: var(--gradient-cyan-purple); }
.kpi-card.orange::before { background: var(--gradient-orange-pink); }
.kpi-card.emerald::before { background: var(--gradient-emerald-cyan); }
.kpi-card.purple::before { background: var(--gradient-purple-rose); }

.kpi-card .kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.kpi-card.cyan .kpi-icon { background: var(--cyan-glow); color: var(--cyan); }
.kpi-card.orange .kpi-icon { background: var(--orange-glow); color: var(--orange); }
.kpi-card.emerald .kpi-icon { background: var(--emerald-glow); color: var(--emerald); }
.kpi-card.purple .kpi-icon { background: var(--purple-glow); color: var(--purple); }

.kpi-card .kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-card .kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-card .kpi-trend {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 20px;
}

.kpi-trend.up {
  color: var(--emerald);
  background: var(--emerald-glow);
}

.kpi-trend.down {
  color: var(--rose);
  background: var(--rose-glow);
}

/* ============================================
   CHARTS
   ============================================ */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chart-card .chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.chart-card .chart-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.chart-card canvas {
  width: 100% !important;
  max-height: 300px;
}

/* ============================================
   TABLE STYLES
   ============================================ */
.table-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.table-header h3 {
  font-size: 16px;
  font-weight: 600;
}

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

.table-search {
  position: relative;
}

.table-search input {
  padding: 8px 14px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  width: 220px;
  transition: all var(--transition-fast);
}

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

.table-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg-table-row);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-color);
}

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

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

.data-table tbody td {
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
}

.data-table .email-cell {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.badge-pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
}
.badge-pending::before { background: var(--amber); }

.badge-ongoing, .badge-confirmed {
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue);
}
.badge-ongoing::before, .badge-confirmed::before { background: var(--blue); }

.badge-completed {
  background: var(--emerald-glow);
  color: var(--emerald);
}
.badge-completed::before { background: var(--emerald); }

.badge-cancelled {
  background: var(--rose-glow);
  color: var(--rose);
}
.badge-cancelled::before { background: var(--rose); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-cyan-purple);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(0, 212, 255, 0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--emerald-glow);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: var(--rose-glow);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.2);
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: rgba(244, 63, 94, 0.4);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.btn-warning:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.4);
}

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

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

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.action-btns {
  display: flex;
  gap: 6px;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8fb0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

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

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

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

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

.modal {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.3s ease;
}

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

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--rose-glow);
  color: var(--rose);
}

.modal-body {
  padding: 28px;
}

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

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  min-width: 300px;
  animation: toastSlide 0.4s ease;
}

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

.toast.toast-exit {
  animation: toastExit 0.3s ease forwards;
}

@keyframes toastExit {
  to { opacity: 0; transform: translateX(100px); }
}

.toast-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.toast-success .toast-icon { color: var(--emerald); }
.toast-error .toast-icon { color: var(--rose); }
.toast-info .toast-icon { color: var(--cyan); }
.toast-warning .toast-icon { color: var(--amber); }

.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  width: fit-content;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.tab-btn.active {
  background: var(--bg-card-solid);
  color: var(--cyan);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}

/* ============================================
   FILTERS
   ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 36px 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8fb0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

/* ============================================
   DETAIL VIEW / INFO GRID
   ============================================ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.detail-item {
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.detail-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-item .value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-white);
}

/* ============================================
   FAVOURITE STAR
   ============================================ */
.fav-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  padding: 4px;
}

.fav-btn:hover, .fav-btn.active {
  color: var(--amber);
  transform: scale(1.2);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

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

.pagination-btns {
  display: flex;
  gap: 4px;
}

.pagination-btns .page-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.pagination-btns .page-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pagination-btns .page-btn.active {
  background: var(--cyan);
  color: var(--bg-primary);
  border-color: var(--cyan);
  font-weight: 600;
}

/* ============================================
   CONFIRM DIALOG
   ============================================ */
.confirm-body {
  text-align: center;
  padding: 20px 0;
}

.confirm-body .confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--rose-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--rose);
  margin: 0 auto 20px;
}

.confirm-body h3 {
  margin-bottom: 8px;
}

.confirm-body p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================
   SIDEBAR OVERLAY (Mobile)
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .header-search {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .header {
    padding: 0 16px;
  }

  .header-search {
    display: none;
  }

  .page-content {
    padding: 20px 16px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .header-profile .info {
    display: none;
  }

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

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 32px 24px;
    margin: 16px;
  }

  .modal {
    margin: 10px;
  }
}

/* ---------- View Switcher (Table vs Cards) ---------- */
.view-switcher {
  display: inline-flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-left: 12px;
}

.view-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.view-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.view-btn.active {
  color: var(--cyan);
  background: var(--bg-card-solid);
  box-shadow: var(--shadow-sm);
}

/* ---------- Grid View Layout & Cards ---------- */
.grid-container {
  display: none; /* Controlled by active class */
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
  animation: fadeInUp 0.4s ease-out;
}

.grid-container.active {
  display: grid;
}

.table-card.hidden {
  display: none;
}

.interactive-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.interactive-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.interactive-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--border-color);
}

.interactive-card.border-pending::before { background: var(--amber); }
.interactive-card.border-ongoing::before { background: var(--blue); }
.interactive-card.border-completed::before { background: var(--emerald); }
.interactive-card.border-cancelled::before { background: var(--rose); }

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-customer-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-white);
  margin-top: 4px;
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.card-meta-item i {
  color: var(--text-muted);
  width: 16px;
  text-align: center;
}

.card-progress-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0;
}

.card-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.card-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-slow);
}

.card-progress-fill.pending { background: var(--amber); }
.card-progress-fill.ongoing { background: var(--blue); }
.card-progress-fill.completed { background: var(--emerald); }
.card-progress-fill.cancelled { background: var(--rose); }

.card-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  margin-top: auto;
}

.card-badge-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ---------- Heartbeat & Counting animations ---------- */
.status-indicator.pulse {
  animation: heartBeatPulse 2s infinite;
}

@keyframes heartBeatPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.metric-count {
  transition: all 0.5s ease-out;
}

