/* ============================================================
   FUNOFOCUS CARE — Futuristic Dark Enterprise Dashboard
   Complete Stylesheet
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS VARIABLES (:root)
   ------------------------------------------------------------ */
:root {
  /* ── Brand Colors ── */
  --color-bg-primary:       #040408;
  --color-bg-secondary:     rgba(15, 15, 25, 0.4);
  --color-bg-sidebar:       #06060c;
  --color-bg-input:         rgba(255, 255, 255, 0.04);
  --color-bg-hover:         rgba(255, 255, 255, 0.06);
  --color-bg-table-header:  rgba(255, 255, 255, 0.03);
  --color-bg-table-alt:     rgba(255, 255, 255, 0.01);
  --color-bg-glass:         rgba(9, 9, 15, 0.65);
  --border-glass:           rgba(255, 255, 255, 0.05);
  --border-glass-orange:    rgba(245, 148, 30, 0.12);

  /* ── Orange Accent Palette ── */
  --color-orange:           #f5941e;
  --color-orange-dark:      #d97d16;
  --color-orange-glow:      rgba(245, 148, 30, 0.15);
  --color-orange-glow-strong: rgba(245, 148, 30, 0.28);
  --color-orange-tint:      rgba(245, 148, 30, 0.06);
  --color-orange-border:    rgba(245, 148, 30, 0.2);

  /* ── Semantic Colors ── */
  --color-success:          #22c55e;
  --color-success-bg:       rgba(34, 197, 94, 0.1);
  --color-success-border:   rgba(34, 197, 94, 0.25);

  --color-warning:          #f59e0b;
  --color-warning-bg:       rgba(245, 158, 11, 0.1);
  --color-warning-border:   rgba(245, 158, 11, 0.25);

  --color-info:             #3b82f6;
  --color-info-bg:          rgba(59, 130, 246, 0.1);
  --color-info-border:      rgba(59, 130, 246, 0.25);

  --color-danger:           #ef4444;
  --color-danger-bg:        rgba(239, 68, 68, 0.1);
  --color-danger-border:    rgba(239, 68, 68, 0.25);

  --text-primary:           rgba(255, 255, 255, 0.95);
  --text-secondary:         rgba(255, 255, 255, 0.75);
  --text-muted:             rgba(255, 255, 255, 0.58);
  --text-dim:               rgba(255, 255, 255, 0.45);

  /* ── Borders ── */
  --border-color:           rgba(255, 255, 255, 0.07);
  --border-color-hover:     rgba(255, 255, 255, 0.12);

  /* ── Typography ── */
  --font-heading:           'Inter Tight', sans-serif;
  --font-body:              'DM Sans', sans-serif;

  --fw-light:               300;
  --fw-regular:             400;
  --fw-medium:              500;
  --fw-semibold:            600;
  --fw-bold:                700;
  --fw-extrabold:           800;
  --fw-black:               900;

  --fs-xs:                  0.75rem;    /* 12px */
  --fs-sm:                  0.8125rem;  /* 13px */
  --fs-base:                0.875rem;   /* 14px */
  --fs-md:                  1rem;       /* 16px */
  --fs-lg:                  1.125rem;   /* 18px */
  --fs-xl:                  1.25rem;    /* 20px */
  --fs-2xl:                 1.5rem;     /* 24px */
  --fs-3xl:                 1.875rem;   /* 30px */
  --fs-4xl:                 2.25rem;    /* 36px */

  /* ── Spacing ── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* ── Radius ── */
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-xl:    18px;
  --radius-2xl:   24px;
  --radius-pill:  9999px;
  --radius-full:  50%;

  /* ── Shadows ── */
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:    0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:    0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl:    0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-orange: 0 0 22px var(--color-orange-glow-strong);
  --shadow-orange-sm: 0 0 12px var(--color-orange-glow);

  /* ── Transitions ── */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast:   180ms var(--ease-out-expo);
  --transition-base:   280ms var(--ease-out-expo);
  --transition-slow:   420ms var(--ease-out-expo);

  /* ── Layout ── */
  --sidebar-width:   260px;
  --header-height:   64px;
  --content-max:     1440px;

  /* ── Performance Ring ── */
  --ring-circumference: 326.73;
}

/* ------------------------------------------------------------
   2. GLOBAL RESET & BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: 
    linear-gradient(rgba(255, 255, 255, 0.006) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.006) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(15, 15, 25, 0.7) 0%, #030307 100%);
  background-size: 44px 44px, 44px 44px, auto;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea, select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

body::before {
  content: '';
  position: fixed;
  inset: -10%;
  z-index: -1;
  background: 
    radial-gradient(circle at 15% 20%, rgba(245, 148, 30, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(245, 148, 30, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 45% 60%, rgba(217, 125, 22, 0.05) 0%, transparent 45%);
  filter: blur(80px);
  pointer-events: none;
  animation: ambientShift 20s ease-in-out infinite alternate;
}

@keyframes ambientShift {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.05) translate(2%, 2%); }
  100% { transform: scale(1.02) translate(-1%, -1%); }
}

img, svg, video {
  display: block;
  max-width: 100%;
}

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

a:hover {
  color: var(--color-orange-dark);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--fs-4xl); font-weight: var(--fw-black); }
h2 { font-size: var(--fs-2xl); font-weight: var(--fw-extrabold); }
h3 { font-size: var(--fs-xl); font-weight: var(--fw-bold); }
h4 { font-size: var(--fs-lg); font-weight: var(--fw-bold); }

p {
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) rgba(255, 255, 255, 0.02);
}

/* ── Selection ── */
::selection {
  background: var(--color-orange);
  color: #000;
}

::-moz-selection {
  background: var(--color-orange);
  color: #000;
}

/* ------------------------------------------------------------
   3. LOGIN PAGE (.login-page)
   ------------------------------------------------------------ */
.login-page {
  display: none;  /* hidden by default — JS adds .active to show */
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6);
  background: var(--color-bg-primary);
  position: relative;
  overflow: hidden;
}

.login-page.active {
  display: flex;
}

/* ── Animated Background Gradient ── */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(245, 148, 30, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 70%, rgba(245, 148, 30, 0.04) 0%, transparent 70%);
  animation: loginBgShift 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes loginBgShift {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* ── Animated Blobs ── */
.login-blob,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
  animation: float 8s ease-in-out infinite alternate;
}

.login-page::after {
  content: '';
  width: 320px;
  height: 320px;
  background: var(--color-orange);
  top: -100px;
  right: -80px;
  opacity: 0.07;
  animation: float 10s ease-in-out infinite alternate-reverse;
}

.login-blob {
  width: 240px;
  height: 240px;
  background: var(--color-orange);
  bottom: -60px;
  left: -60px;
  opacity: 0.05;
}

.login-blob:nth-child(2) {
  width: 180px;
  height: 180px;
  top: 20%;
  left: 60%;
  bottom: auto;
  opacity: 0.04;
  animation-delay: -3s;
}

/* ── Login Card ── */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: var(--space-10);
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid var(--color-orange-border);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 40px rgba(245, 148, 30, 0.06),
    var(--shadow-xl);
  animation: scaleIn 0.5s var(--ease-out-expo);
}

/* ── Login Logo Area ── */
.login-logo {
  text-align: center;
  margin-bottom: var(--space-8);
  position: relative;
}

.login-logo::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-orange);
  border-radius: var(--radius-full);
  filter: blur(50px);
  opacity: 0.25;
  pointer-events: none;
}

/* ── Login Brand Logo ── */
.login-brand-logo {
  width: auto;
  height: 100px;
  max-width: 260px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  mix-blend-mode: screen; /* Makes black background transparent */
  /* Invert white BG to black, turn black text to white, rotate cyan back to orange */
  filter: invert(1) hue-rotate(180deg) brightness(1.2) contrast(1.2) drop-shadow(0 0 10px rgba(245, 148, 30, 0.2));
}

.login-logo h1,
.login-title {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ── Login Form ── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.login-field,
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.login-field label,
.form-group label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
}

.login-field input,
.login-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-input);
  border: 0.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--fs-base);
  transition: all var(--transition-base);
}

.login-field input:focus,
.login-input:focus {
  border-color: var(--color-orange-border);
  box-shadow: 0 0 0 3px var(--color-orange-glow), var(--shadow-orange-sm);
  background: rgba(255, 255, 255, 0.06);
}

.login-field input::placeholder,
.login-input::placeholder {
  color: var(--text-dim);
}

.login-btn,
.btn-primary {
  width: 100%;
  padding: var(--space-3) var(--space-6);
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  color: #fff;
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--fs-base);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.login-btn:hover,
.btn-primary:hover {
  box-shadow: var(--shadow-orange);
  transform: translateY(-1px);
}

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

.login-error {
  color: var(--color-danger);
  font-size: var(--fs-sm);
  text-align: center;
  padding: var(--space-2);
  background: var(--color-danger-bg);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--color-danger-border);
}

.login-error:empty {
  display: none;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

/* ------------------------------------------------------------
   4. APP LAYOUT (.app-layout)
   ------------------------------------------------------------ */
.app-layout {
  display: none; /* hidden by default — JS adds .active to show */
  min-height: 100vh;
}

.app-layout.active {
  display: block;
}

/* ── Page sections inside main area ── */
.page-content {
  display: none;
  flex: 1;
  padding: var(--space-8);
  overflow-y: auto;
}

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

.main-area {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  overflow-y: auto;
}

.main-content {
  flex: 1;
  padding: var(--space-8);
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}

/* ------------------------------------------------------------
   5. SIDEBAR (.sidebar)
   ------------------------------------------------------------ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: rgba(6, 6, 12, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-right: 0.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Sidebar Logo ── */
.sidebar-logo,
.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
  border-bottom: 0.5px solid var(--border-color);
  position: relative;
}

.sidebar-logo::after,
.sidebar-header::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-orange);
  border-radius: var(--radius-full);
  filter: blur(24px);
  opacity: 0.3;
  pointer-events: none;
}

.sidebar-logo img,
.sidebar-header img,
.sidebar-logo-icon img {
  width: auto;
  height: 34px;
  max-width: 120px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 10px rgba(245, 148, 30, 0.3));
}

/* Sidebar brand logo — wider for the full company logo */
.sidebar-brand-logo {
  width: auto !important;
  height: 95px !important; /* Increased for better visibility */
  max-width: 230px !important;
  object-fit: contain;
  mix-blend-mode: screen; /* Makes black background transparent */
  /* Invert white BG to black, turn black text to white, rotate cyan back to orange */
  filter: invert(1) hue-rotate(180deg) brightness(1.2) contrast(1.2) drop-shadow(0 0 8px rgba(245, 148, 30, 0.2)) !important;
}

.sidebar-logo-text,
.sidebar-brand-text {
  font-family: var(--font-heading);
  font-weight: var(--fw-extrabold);
  font-size: var(--fs-md);
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Sidebar Navigation ── */
.sidebar-nav,
.nav-menu {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-section-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-4) var(--space-3) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--color-bg-hover);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(245, 148, 30, 0.06);
  border-color: rgba(245, 148, 30, 0.16);
  color: var(--color-orange);
  font-weight: var(--fw-bold);
  box-shadow: 0 4px 15px rgba(245, 148, 30, 0.03);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: linear-gradient(180deg, #ffb04c, var(--color-orange-dark));
  border-radius: var(--radius-pill);
  box-shadow: 0 0 10px rgba(245, 148, 30, 0.7);
  animation: navActivePulse 2s infinite alternate;
}

@keyframes navActivePulse {
  0% { box-shadow: 0 0 6px rgba(245, 148, 30, 0.4); }
  100% { box-shadow: 0 0 14px rgba(245, 148, 30, 0.8); }
}

.nav-item .nav-icon,
.nav-item svg,
.nav-item i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.nav-item.active .nav-icon,
.nav-item.active svg,
.nav-item.active i {
  opacity: 1;
}

.nav-item .nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  background: var(--color-orange);
  color: #000;
  border-radius: var(--radius-pill);
  min-width: 20px;
  text-align: center;
}

/* ── Sidebar User Section ── */
.sidebar-user,
.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 0.5px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-user .user-avatar,
.sidebar-footer .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  color: #000;
  flex-shrink: 0;
}

.sidebar-user .user-info,
.sidebar-footer .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-name,
.sidebar-footer .user-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-role,
.sidebar-footer .user-role {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

/* ── Mobile Sidebar Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.active {
  opacity: 1;
}

/* ── Mobile Menu Toggle ── */
.menu-toggle {
  display: none;
  padding: var(--space-2);
  color: var(--text-primary);
  cursor: pointer;
}

/* ------------------------------------------------------------
   6. TOP HEADER (.top-header)
   ------------------------------------------------------------ */
.top-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-8);
  background: rgba(9, 9, 15, 0.98);
  border-bottom: 0.5px solid var(--border-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  min-height: var(--header-height);
  /* NO isolation: isolate here — that traps position:fixed children */
}

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

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

.page-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold);
  color: var(--text-primary);
}

.page-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ── Header Search ── */
.header-search,
.search-input-wrapper {
  position: relative;
  max-width: 320px;
}

.header-search input,
.search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-10);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-search input:focus,
.search-input:focus {
  outline: none;
  border-color: rgba(245, 148, 30, 0.5);
  box-shadow: 0 0 12px rgba(245, 148, 30, 0.2);
  background: rgba(8, 8, 14, 0.8);
  width: 280px;
}

.header-search > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* ── Notification Bell ── */
.header-notification,
.notification-btn {
  position: relative;
  padding: var(--space-2);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

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

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-orange);
  color: #000;
  font-size: 10px;
  font-weight: var(--fw-bold);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-bg-sidebar);
}

/* ── Header User ── */
.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  color: #000;
}

/* ------------------------------------------------------------
   7. STAT CARDS (.stat-card)
   ------------------------------------------------------------ */
.stats-grid,
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.stat-card {
  position: relative;
  padding: var(--space-6);
  background: var(--color-bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  animation: slideUp 0.5s var(--ease-out-expo) both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.16s; }
.stat-card:nth-child(4) { animation-delay: 0.24s; }
.stat-card:nth-child(5) { animation-delay: 0.32s; }

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--color-orange-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glass-orange);
  box-shadow:
    0 12px 30px rgba(245, 148, 30, 0.08),
    0 4px 20px rgba(0, 0, 0, 0.3);
}

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

/* ── Stat Card Accents ── */
.stat-card[data-accent="primary"]  { --stat-accent: var(--color-orange); }
.stat-card[data-accent="warning"]  { --stat-accent: var(--color-warning); }
.stat-card[data-accent="success"]  { --stat-accent: var(--color-success); }
.stat-card[data-accent="info"]     { --stat-accent: var(--color-info); }
.stat-card[data-accent="danger"]   { --stat-accent: var(--color-danger); }

/* ── Stat Icon ── */
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--stat-accent, var(--color-orange)), var(--color-orange-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: #000;
  font-size: var(--fs-lg);
  position: relative;
  z-index: 1;
}

.stat-card[data-accent="success"] .stat-icon {
  background: linear-gradient(135deg, var(--color-success), #16a34a);
}

.stat-card[data-accent="info"] .stat-icon {
  background: linear-gradient(135deg, var(--color-info), #2563eb);
}

.stat-card[data-accent="warning"] .stat-icon {
  background: linear-gradient(135deg, var(--color-warning), #d97706);
}

.stat-card[data-accent="danger"] .stat-icon {
  background: linear-gradient(135deg, var(--color-danger), #dc2626);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-black);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
  position: relative;
  z-index: 1;
}

.stat-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  position: relative;
  z-index: 1;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  margin-top: var(--space-2);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  position: relative;
  z-index: 1;
}

.stat-change.up {
  color: var(--color-success);
  background: var(--color-success-bg);
}

.stat-change.down {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

/* ------------------------------------------------------------
   8. CARDS (.card)
   ------------------------------------------------------------ */
.card {
  background: var(--color-bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glass-orange);
  box-shadow: 0 12px 36px rgba(245, 148, 30, 0.06), 0 8px 24px rgba(0, 0, 0, 0.35);
}


.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 0.5px solid var(--border-color);
}

.card-header h3,
.card-title {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.card-header-action,
.card-action {
  font-size: var(--fs-sm);
  color: var(--color-orange);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.card-header-action:hover,
.card-action:hover {
  color: var(--color-orange-dark);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 0.5px solid var(--border-color);
}

/* ------------------------------------------------------------
   9. DASHBOARD GRID & CHARTS
   ------------------------------------------------------------ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.dashboard-grid .card {
  animation: fadeIn 0.5s var(--ease-out-expo) both;
}

.dashboard-grid .card:nth-child(2) {
  animation-delay: 0.1s;
}

/* ── Chart ── */
.chart-container {
  padding: var(--space-4) 0;
}

/* ── Service Overview Grid ── */
.service-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4);
}

.overview-item {
  background: rgba(255, 255, 255, 0.02);
  border: 0.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform var(--transition-fast);
}

.overview-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.overview-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--fw-semibold);
}

.overview-value {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.overview-value.warning { color: var(--color-warning); }
.overview-value.success { color: var(--color-success); }
.overview-value.danger { color: var(--color-danger); }
.overview-value.info { color: var(--color-orange); }

/* ── Recent Complaints List ── */
.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 0.5px solid var(--border-color);
  transition: all var(--transition-fast);
  cursor: pointer;
}

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

.recent-item:hover {
  background: var(--color-orange-tint);
}

.recent-item-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.recent-item-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.recent-id {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--color-orange);
  flex-shrink: 0;
}

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

.recent-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.recent-time {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── Live Indicator ── */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-success);
  font-weight: var(--fw-semibold);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: var(--radius-full);
  animation: pulse 2s ease-in-out infinite;
}

/* ------------------------------------------------------------
   10. COMPLAINTS TABLE
   ------------------------------------------------------------ */
.table-wrapper,
.table-container {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--space-6) var(--space-6) var(--space-6);
  box-sizing: border-box;
}

.data-table,
.complaints-table {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-size: var(--fs-sm);
  min-width: 1100px; /* Ensures grid doesn't collapse too much on small screens */
}

.data-table thead,
.complaints-table thead,
.data-table tbody,
.complaints-table tbody {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.data-table tr,
.complaints-table tr {
  display: grid;
  /* Proper responsive grid distribution */
  grid-template-columns: 
    90px                   /* ID */
    minmax(180px, 2fr)     /* Customer */
    minmax(160px, 2fr)     /* Product */
    minmax(110px, 1fr)     /* Brand */
    minmax(110px, 1fr)     /* Priority */
    minmax(140px, 1.2fr)   /* Technician */
    minmax(130px, 1fr)     /* Status */
    120px                  /* Date */
    70px;                  /* Actions */
  width: 100%;
  align-items: center;
  border-bottom: 0.5px solid var(--border-color);
  transition: background var(--transition-fast);
}

.data-table tbody tr:nth-child(even),
.complaints-table tbody tr:nth-child(even) {
  background: var(--color-bg-table-alt);
}

.data-table tbody tr:hover,
.complaints-table tbody tr:hover {
  background: var(--color-orange-tint);
}

.data-table th,
.complaints-table th {
  padding: 24px 32px;
  background: var(--color-bg-table-header);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: left;
  border: none;
}

.data-table td,
.complaints-table td {
  padding: 20px 32px;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
}


/* ── Actions Column Formatting ── */
.data-table th:last-child,
.complaints-table th:last-child,
.data-table td:last-child,
.complaints-table td:last-child {
  display: flex;
  justify-content: flex-end;
  padding-left: 0 !important;
  padding-right: 20px !important;
}

/* ── Customer Cell ── */
.customer-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.customer-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(245, 148, 30, 0.3), rgba(201, 106, 8, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--color-orange);
  flex-shrink: 0;
}

.customer-name-cell {
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

.customer-phone-cell {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 1px;
}

.complaint-id-link {
  color: var(--color-orange);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.complaint-id-link:hover {
  color: var(--color-orange-dark);
  text-decoration: underline;
}

/* ------------------------------------------------------------
   11. BADGES (.badge)
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  line-height: 1.4;
}

.badge-primary {
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  color: #000;
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 0.5px solid var(--color-info-border);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 0.5px solid var(--color-warning-border);
}

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

.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 0.5px solid var(--color-danger-border);
}

.badge-default {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 0.5px solid var(--border-color);
}

/* ------------------------------------------------------------
   12. FILTER TABS (.filter-tab)
   ------------------------------------------------------------ */
.filter-tabs,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-input);
  border: 0.5px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
}

.filter-tab:hover {
  background: var(--color-bg-hover);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.filter-tab.active {
  background: var(--color-orange);
  color: #000;
  border-color: var(--color-orange);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-orange-sm);
}

.filter-tab .tab-count {
  padding: 1px 7px;
  font-size: 11px;
  font-weight: var(--fw-bold);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  line-height: 1.4;
}

.filter-tab.active .tab-count {
  background: rgba(0, 0, 0, 0.2);
  color: #000;
}

/* ------------------------------------------------------------
   13. COMPLAINT FORM
   ------------------------------------------------------------ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

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

.form-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.form-group input,
.form-group select,
.form-group textarea,
.form-input,
.form-select,
.form-textarea {
  box-sizing: border-box;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--fs-base);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(245, 148, 30, 0.5);
  box-shadow: 0 0 12px rgba(245, 148, 30, 0.25);
  background: rgba(8, 8, 14, 0.8);
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-group select,
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-group textarea,
.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* ── Form Section Spacing ── */
.form-section {
  margin-top: var(--space-8);
  margin-bottom: var(--space-6);
}

.section-label {
  display: block;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

/* ── Field Error Validation ── */
.field-error {
  color: #ff6b4a; /* Soft red/orange warning color */
  font-size: var(--fs-sm);
  margin-top: var(--space-2);
  display: block;
  font-weight: var(--fw-medium);
}

/* ── Priority Radio Pills ── */
.priority-selector {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.priority-option {
  position: relative;
  cursor: pointer;
  display: inline-flex;
}

.priority-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.priority-option .priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: var(--space-3) var(--space-5);
  border-radius: 50px; /* Modern rounded pill */
  border: 1.5px solid var(--border-color);
  background: var(--color-bg-input);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--text-dim);
  transition: all var(--transition-base);
  user-select: none;
}

.priority-option:hover .priority-pill {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
}

/* Selected States with Glow */
.priority-option input[type="radio"]:checked + .priority-pill.low {
  border-color: #4a90e2; /* blue/gray */
  background: rgba(74, 144, 226, 0.15);
  color: #4a90e2;
  box-shadow: 0 0 12px rgba(74, 144, 226, 0.25);
}

.priority-option input[type="radio"]:checked + .priority-pill.medium {
  border-color: #f5a623; /* yellow/orange */
  background: rgba(245, 166, 35, 0.15);
  color: #f5a623;
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.25);
}

.priority-option input[type="radio"]:checked + .priority-pill.high {
  border-color: #f06a35; /* orange/red */
  background: rgba(240, 106, 53, 0.15);
  color: #f06a35;
  box-shadow: 0 0 12px rgba(240, 106, 53, 0.25);
}

.priority-option input[type="radio"]:checked + .priority-pill.critical {
  border-color: #ff3b30; /* red */
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
  box-shadow: 0 0 12px rgba(255, 59, 48, 0.3);
}

/* ── Form Actions ── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 0.5px solid var(--border-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-secondary {
  background: var(--color-bg-input);
  border: 0.5px solid var(--border-color);
  color: var(--text-muted);
}

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

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

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

.btn-danger {
  background: var(--color-danger-bg);
  border: 0.5px solid var(--color-danger-border);
  color: var(--color-danger);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-md);
}

/* ------------------------------------------------------------
   14. COMPLAINT DETAIL PAGE
   ------------------------------------------------------------ */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-6);
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* ── Status Stepper ── */
.status-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  white-space: nowrap;
}

.stepper-step.active {
  color: var(--color-orange);
}

.stepper-step.completed {
  color: var(--color-success);
}

.stepper-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.stepper-step.active .stepper-dot {
  background: var(--color-orange);
  box-shadow: 0 0 8px var(--color-orange-glow);
}

.stepper-step.completed .stepper-dot {
  background: var(--color-success);
}

.stepper-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  min-width: 20px;
}

.stepper-line.active {
  background: linear-gradient(90deg, var(--color-orange), var(--color-orange-dark));
}

.stepper-line.completed {
  background: var(--color-success);
}

/* ── Detail Info Grid ── */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.detail-info-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.detail-info-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-info-value {
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

/* Legacy Timeline CSS Removed */

/* ── Add Note Section ── */
.add-note-section {
  margin-top: var(--space-4);
}

.add-note-section textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-input);
  border: 0.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  resize: vertical;
  min-height: 80px;
  transition: all var(--transition-base);
}

.add-note-section textarea:focus {
  border-color: var(--color-orange-border);
  box-shadow: 0 0 0 3px var(--color-orange-glow);
}

.add-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* ------------------------------------------------------------
   15. TECHNICIAN CARDS (.technician-card)
   ------------------------------------------------------------ */
.technicians-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.technician-card {
  background: var(--color-bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: var(--space-5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.technician-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glass-orange);
  box-shadow:
    0 12px 28px rgba(245, 148, 30, 0.06),
    0 6px 16px rgba(0, 0, 0, 0.25);
}

.tech-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.tech-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  color: #000;
  flex-shrink: 0;
}

.tech-details {
  flex: 1;
  min-width: 0;
}

.tech-name {
  font-family: var(--font-heading);
  font-size: var(--fs-md); /* Increased from base */
  font-weight: var(--fw-bold);
  color: #fff; /* Brighter contrast */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tech-specialty {
  font-size: var(--fs-sm); /* Increased from xs */
  color: var(--color-orange);
  font-weight: var(--fw-bold); /* Increased weight */
  margin-top: 2px;
}

.tech-phone {
  font-size: var(--fs-sm); /* Increased from xs */
  color: var(--text-secondary); /* Brighter than text-dim */
  margin-top: 1px;
}

.tech-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 12px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  border-radius: var(--radius-pill);
}

.tech-status.available {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80; /* Brighter green */
}

.tech-status.busy {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171; /* Brighter red */
}

.tech-status.on-leave {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.tech-stat-grid,
.tech-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 0.5px solid var(--border-color);
}

.tech-stat {
  text-align: center;
}

.tech-stat-value {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.tech-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ------------------------------------------------------------
   16. PERFORMANCE PAGE
   ------------------------------------------------------------ */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

/* ── Performance Rings ── */
.performance-ring-card {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.perf-ring-container, .perf-ring, .ring-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--perf-color, var(--color-orange)) 15%, transparent) 0%, transparent 70%);
  box-shadow: inset 0 0 20px color-mix(in srgb, var(--perf-color, var(--color-orange)) 20%, transparent);
}

.perf-ring svg, .ring-svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: color-mix(in srgb, var(--perf-color, var(--color-orange)) 10%, transparent);
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: var(--perf-color, var(--color-orange));
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: calc(326.73 * (1 - var(--perf-value, 0)));
  transition: stroke-dashoffset 1.5s var(--ease-out-expo);
  filter: drop-shadow(0 0 8px var(--perf-color, rgba(255,165,0,0.5)));
}

.perf-ring-value, .ring-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  color: var(--text-primary);
}

.ring-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

/* ── Horizontal Bar Charts (Product Breakdown) ── */
.h-bar-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.h-bar-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.h-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.h-bar-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.h-bar-count {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}

.h-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-pill);
  /* overflow: hidden; Removed so the glow is visible outside track */
}

.h-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bar-color, var(--color-orange)), color-mix(in srgb, var(--bar-color, var(--color-orange)) 60%, black));
  border-radius: var(--radius-pill);
  box-shadow: 0 0 12px color-mix(in srgb, var(--bar-color, var(--color-orange)) 50%, transparent);
  transition: width 1s var(--ease-out-expo);
  animation: barGrow 1.2s var(--ease-out-expo) both;
}

/* ── Leaderboard ── */
.leaderboard-list {
  display: flex;
  flex-direction: column;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 0.5px solid var(--border-color);
  transition: background var(--transition-fast);
}

.leaderboard-item:hover {
  background: var(--color-orange-tint);
}

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

.leaderboard-rank {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  flex-shrink: 0;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  color: #000;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
  background: rgba(192, 192, 192, 0.2);
  color: #c0c0c0;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
  background: rgba(205, 127, 50, 0.2);
  color: #cd7f32;
}

.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(245, 148, 30, 0.3), rgba(201, 106, 8, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--color-orange);
  flex-shrink: 0;
}

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

.leaderboard-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.leaderboard-meta {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.leaderboard-score {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--color-orange);
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   17. MODAL (.modal)
   ------------------------------------------------------------ */

/*
 * #assign-modal (.modal) is the outer full-screen overlay.
 * JS toggles .active on it. It must sit above sidebar (z-100)
 * and be hidden (display:none) until .active is added so it
 * never bleeds onto the login page.
 */
.modal {
  display: none;               /* hidden until JS adds .active  */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;               /* above sidebar (100) & header (50) */
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* Inner dialog card */
.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: rgba(18, 18, 28, 0.97);
  border: 0.5px solid var(--border-color);
  border-top: 2px solid var(--color-orange);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(12px);
  transition: transform var(--transition-base);
}

.modal.active .modal-card {
  transform: scale(1) translateY(0);
}

/* The inner .modal-backdrop div is just a click-trap — keep it invisible */
.modal > .modal-backdrop {
  display: none;
}

/* Legacy classes kept for any existing references */
.modal-backdrop.active,
.modal-overlay.active,
.modal-backdrop.show,
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 0.5px solid var(--border-color);
}

/* ── Modal Tech List ── */
.modal-tech-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.modal-tech-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 0.5px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.modal-tech-item:hover {
  background: var(--color-bg-hover);
  border-color: var(--border-color-hover);
}

.modal-tech-item.selected {
  border-color: var(--color-orange-border);
  background: var(--color-orange-tint);
}

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

.modal-tech-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.modal-tech-specialty {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.modal-tech-status {
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   18. TOAST NOTIFICATIONS (.toast)
   ------------------------------------------------------------ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 99999; /* ABOVE modals (1000) and notification dropdown (99999) */
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  min-width: 320px;
  max-width: 420px;
  padding: var(--space-4) var(--space-5);
  background: rgba(18, 18, 28, 0.95);
  border: 0.5px solid var(--border-color);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all var(--transition-base);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast.success, .toast-success { border-left: 3px solid var(--color-success); }
.toast.warning, .toast-warning { border-left: 3px solid var(--color-warning); }
.toast.info,    .toast-info    { border-left: 3px solid var(--color-info); }
.toast.error,   .toast-error   { border-left: 3px solid var(--color-danger); }

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

.toast.success .toast-icon { color: var(--color-success); }
.toast.warning .toast-icon { color: var(--color-warning); }
.toast.info .toast-icon    { color: var(--color-info); }
.toast.error .toast-icon   { color: var(--color-danger); }

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

.toast-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.toast-close {
  flex-shrink: 0;
  color: var(--text-dim);
  padding: 2px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

/* ------------------------------------------------------------
   19. PAGINATION (.pagination-btn)
   ------------------------------------------------------------ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-3);
  background: var(--color-bg-input);
  border: 0.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
}

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

.pagination-btn.active {
  background: var(--color-orange);
  color: #000;
  border-color: var(--color-orange);
  font-weight: var(--fw-bold);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  margin: 0 var(--space-3);
}

/* ------------------------------------------------------------
   20. UTILITY CLASSES
   ------------------------------------------------------------ */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

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

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.text-orange { color: var(--color-orange); }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info    { color: var(--color-info); }

.fw-medium   { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold     { font-weight: var(--fw-bold); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-1 {
  flex: 1;
}

.w-full {
  width: 100%;
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-4);
  color: var(--text-dim);
  opacity: 0.5;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  max-width: 360px;
}

/* ── Loading Spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-orange);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

/* ── Divider ── */
.divider {
  height: 0.5px;
  background: var(--border-color);
  margin: var(--space-4) 0;
}

/* ── Skeleton Loader ── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Action Row ── */
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

/* ── Icon Button ── */
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

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

/* ------------------------------------------------------------
   21. ANIMATIONS
   ------------------------------------------------------------ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-20px) translateX(10px);
  }
  100% {
    transform: translateY(0) translateX(0);
  }
}

@keyframes barGrow {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

@keyframes orangeGlowPulse {
  0%, 100% {
    box-shadow: 0 0 6px var(--color-orange-glow);
  }
  50% {
    box-shadow: 0 0 16px var(--color-orange-glow-strong);
  }
}

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

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

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

/* ── Orange glow pulse for live indicators ── */
.live-indicator .live-dot,
.status-live {
  animation: orangeGlowPulse 2s ease-in-out infinite;
}

/* ── Stat card entrance stagger ── */
.stat-card {
  animation: slideUp 0.5s var(--ease-out-expo) both;
}

/* ── Animated counters ── */
.stat-value,
.ring-value {
  animation: countUp 0.6s var(--ease-out-expo) both;
}

/* ── File Upload Dropzone ── */
.file-upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--color-orange);
  background: rgba(245, 148, 30, 0.05);
  box-shadow: 0 0 20px rgba(245, 148, 30, 0.1);
}

.file-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-icon {
  color: var(--text-dim);
  margin-bottom: var(--space-2);
}

.file-upload-text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.file-upload-text strong {
  color: var(--color-orange);
}

.file-upload-hint {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  margin-top: var(--space-1);
}

.file-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  max-width: 200px;
}

.file-preview-item .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.file-preview-item .file-remove {
  color: var(--color-danger);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.file-preview-item .file-remove:hover {
  color: #ff6b6b;
}

/* ── Attachment Display in Detail View ── */
.attachment-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  color: var(--color-orange);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.attachment-item:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-orange-border);
  transform: translateY(-1px);
}

.attachment-item svg {
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   22. PRINT STYLES
   ------------------------------------------------------------ */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .sidebar,
  .sidebar-overlay,
  .top-header,
  .menu-toggle,
  .toast-container,
  .modal-backdrop,
  .modal-overlay,
  .btn,
  .pagination,
  .filter-tabs,
  .header-search,
  .notification-btn,
  .header-notification {
    display: none !important;
  }

  .app-layout {
    display: block;
  }

  .main-area,
  .main-content {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
  }

  .card,
  .stat-card,
  .technician-card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .data-table th,
  .complaints-table th {
    border-bottom: 2px solid #000;
    font-weight: bold;
  }

  .data-table td,
  .complaints-table td {
    border-bottom: 1px solid #ccc;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666 !important;
  }

  .badge {
    border: 1px solid #999;
  }

  .detail-layout {
    display: block;
  }

  .detail-sidebar {
    margin-top: 1cm;
  }
}

/* ------------------------------------------------------------
   23. RESPONSIVE — Tablet (≤1024px)
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 0px;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }

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

  .sidebar-overlay {
    display: none;
    pointer-events: none;
  }

  .sidebar-overlay.active {
    display: block;
    pointer-events: auto;
  }

  .menu-toggle {
    display: flex;
  }

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

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

  .detail-sidebar {
    order: -1;
  }

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

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

  .top-header {
    padding: var(--space-3) var(--space-5);
  }

  .main-content {
    padding: var(--space-6);
  }
}

/* ── Tablet Small (≤768px) ── */
@media (max-width: 768px) {
  .stats-grid,
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

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

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

  .status-stepper {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .top-header {
    flex-wrap: nowrap;
    gap: var(--space-2);
  }
  .page-title {
    font-size: var(--fs-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-search input:focus,
  .search-input:focus {
    width: 100%;
  }

  .main-content {
    padding: var(--space-4);
  }

  .card-header {
    padding: var(--space-4);
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .card-body {
    padding: var(--space-4);
  }

  .stat-card {
    padding: var(--space-4);
  }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  .modal {
    max-width: 100%;
    margin: var(--space-4);
  }

  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs,
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
  }

  .table-wrapper,
  .table-container {
    margin: 0 calc(-1 * var(--space-4));
    padding: 0 var(--space-4);
  }

  .page-title {
    font-size: var(--fs-lg);
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Mobile (≤480px) ── */
@media (max-width: 480px) {
  body {
    font-size: var(--fs-sm);
  }

  .stats-grid,
  .stat-cards {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: var(--fs-2xl);
  }

  .stat-card {
    padding: var(--space-4);
  }

  .main-content {
    padding: var(--space-3);
  }

  .top-header {
    padding: var(--space-3) var(--space-4);
  }

  .page-title {
    font-size: var(--fs-md);
  }

  h2 {
    font-size: var(--fs-lg);
  }

  h3 {
    font-size: var(--fs-md);
  }

  .card {
    border-radius: var(--radius-lg);
  }

  .login-card {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
  }

  .login-logo h1,
  .login-title {
    font-size: var(--fs-xl);
  }

  .pagination {
    flex-wrap: wrap;
  }

  .pagination-btn {
    min-width: 32px;
    height: 32px;
    font-size: var(--fs-xs);
  }

  .priority-pills,
  .priority-options {
    flex-direction: column;
  }

  .priority-pill label {
    width: 100%;
    justify-content: center;
  }

  .dashboard-grid {
    gap: var(--space-4);
  }

  .tech-stat-grid,
  .tech-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }

  .toast-container {
    bottom: var(--space-3);
    left: var(--space-3);
    right: var(--space-3);
  }

  .ring-container {
    width: 100px;
    height: 100px;
  }

  .ring-svg {
    width: 100px;
    height: 100px;
  }

  .ring-value {
    font-size: var(--fs-xl);
  }

  .modal-backdrop,
  .modal-overlay {
    padding: var(--space-3);
  }

  .modal {
    border-radius: var(--radius-xl);
  }

  .recent-item {
    padding: var(--space-3) var(--space-4);
  }

  .leaderboard-item {
    padding: var(--space-3) var(--space-4);
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ring-fill {
    transition: none;
  }
}

/* ── High Contrast Mode ── */
@media (prefers-contrast: high) {
  :root {
    --border-color: rgba(255, 255, 255, 0.2);
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-dim: rgba(255, 255, 255, 0.5);
  }

  .card,
  .stat-card,
  .technician-card {
    border-width: 1px;
  }
}

/* ── Status Chips ── */
.status-update-chips {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.status-chip {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-color);
  background: var(--color-bg-input);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.status-chip:hover {
  background: var(--color-bg-hover);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

.status-chip.active {
  background: var(--color-orange-tint);
  border-color: var(--color-orange-border);
  color: var(--color-orange);
  box-shadow: 0 0 10px var(--color-orange-glow);
}

/* ── Stat Card Interactivity ── */
.stat-card[onclick] {
  cursor: pointer;
  transition: all var(--transition-base);
}
.stat-card[onclick]:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color-hover);
}
.stat-card[onclick]:active {
  transform: translateY(-1px);
}

/* ── Service Overview Interactivity ── */
.overview-item[onclick] {
  cursor: pointer;
  transition: all var(--transition-base);
}
.overview-item[onclick]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 122, 0, 0.1);
  background: var(--color-bg-hover);
}
.overview-item[onclick]:active {
  transform: translateY(0);
}

/* ── Notification Dropdown ── */
.notification-wrapper {
  position: relative;
}

.notification-dropdown {
  position: fixed;
  top: var(--header-height);
  right: 24px;
  margin-top: 8px;
  width: 340px;
  background: var(--color-bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s ease;
  z-index: 99999;
  display: flex;
  flex-direction: column;
}

.notification-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

.notification-header h4 {
  margin: 0;
  font-size: var(--fs-md);
  color: var(--text-primary);
}

.notification-mark-read {
  font-size: var(--fs-xs);
  color: var(--color-orange);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.notification-mark-read:hover {
  text-decoration: underline;
}

.notification-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notification-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background var(--transition-fast);
}
.notification-item:last-child {
  border-bottom: none;
}
.notification-item:hover {
  background: var(--color-bg-hover);
}

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

.notification-title {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}
.notification-item.unread .notification-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--color-orange);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 8px #ff9800, 0 0 3px #ff9800;
}

.notification-time {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.notification-empty {
  padding: var(--space-5);
  text-align: center;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

/* Dynamic Back Button */
.dynamic-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: 4px 12px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.dynamic-back-btn:hover {
  color: var(--text-base);
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
  transform: translateX(-2px);
}

/* Technician Bulk Actions */
.tech-bulk-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.bulk-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  position: relative;
  user-select: none;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 18px;
  width: 18px;
  background-color: var(--color-bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
  border-color: var(--color-orange);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--color-orange);
  border-color: var(--color-orange);
}

.checkmark:after {
  content: "";
  display: none;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.bulk-label-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.bulk-count {
  font-size: 14px;
  color: var(--color-orange);
  font-weight: 500;
}

/* Technician Card Updates */
.technician-card {
  position: relative;
}

.tech-card-checkbox {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

.tech-meta-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tech-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tech-active-job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tech-active-job-link {
  background: rgba(255, 122, 0, 0.1);
  color: var(--color-orange);
  border: 1px solid rgba(255, 122, 0, 0.2);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.tech-active-job-link:hover {
  background: rgba(255, 122, 0, 0.2);
  transform: translateY(-1px);
}

/* ── Modern Vertical Node Timeline ── */
.timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: var(--space-6);
  gap: var(--space-5);
  margin: var(--space-2) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.timeline-entry {
  position: relative;
  display: flex;
  width: 100%;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -23px; /* Center dot of 10px exactly with 2px line at left: 5px */
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-bg-primary);
  border: 2px solid var(--color-orange);
  z-index: 10;
}

/* Status Indicator Dot Colors */
.timeline-system::before {
  border-color: var(--text-muted);
  background-color: var(--color-bg-primary);
}
.timeline-right::before {
  border-color: var(--color-orange);
  background-color: var(--color-orange);
}
.timeline-left::before {
  border-color: var(--color-success);
  background-color: var(--color-success);
}

.timeline-bubble {
  width: 100%;
  max-width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timeline-meta {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-1);
}

.timeline-text {
  color: var(--text-primary);
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* ── Assigned IT Technician Card Styling ── */
.tech-badge-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tech-badge-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  flex-shrink: 0;
}

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

/* ── Tracker Grid Layout ── */
.tracker-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-6);
}

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

/* ── Top Header Translucency ── */
.top-header {
  background: rgba(9, 9, 15, 0.5) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
}

/* ── Responsive Form Grid & Properties Grid Helpers ── */
.responsive-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.properties-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

@media (max-width: 576px) {
  .responsive-form-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-3);
  }
  .properties-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-3);
  }
}

/* ── Mobile Responsive Table-To-Card Transforms ── */
@media (max-width: 768px) {
  .complaints-table,
  .data-table {
    min-width: 0 !important;
  }
  .complaints-table thead {
    display: none !important;
  }
  #history-complaints-list tr,
  #recent-complaints-list tr {
    display: grid;
    grid-template-areas:
      "id status"
      "product brand"
      "date actions";
    grid-template-columns: 1fr auto;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--color-bg-glass);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    min-width: 0 !important;
    width: 100% !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
  #history-complaints-list tr td:nth-child(1),
  #recent-complaints-list tr td:nth-child(1) { grid-area: id; }
  #history-complaints-list tr td:nth-child(2),
  #recent-complaints-list tr td:nth-child(2) { grid-area: product; }
  #history-complaints-list tr td:nth-child(3),
  #recent-complaints-list tr td:nth-child(3) { grid-area: brand; }
  #history-complaints-list tr td:nth-child(4),
  #recent-complaints-list tr td:nth-child(4) { grid-area: status; }
  #history-complaints-list tr td:nth-child(5),
  #recent-complaints-list tr td:nth-child(5) { grid-area: date; }
  #history-complaints-list tr td:nth-child(6),
  #recent-complaints-list tr td:nth-child(6) { grid-area: actions; }

  #history-complaints-list tr td,
  #recent-complaints-list tr td {
    padding: 0 !important;
    border: none !important;
    width: auto !important;
    min-width: 0 !important;
    display: flex;
    align-items: center;
  }
  #history-complaints-list tr td:nth-child(2)::before,
  #recent-complaints-list tr td:nth-child(2)::before {
    content: "Product: ";
    color: var(--text-dim);
    font-size: var(--fs-xs);
    margin-right: 4px;
  }
  #history-complaints-list tr td:nth-child(3)::before,
  #recent-complaints-list tr td:nth-child(3)::before {
    content: "Brand: ";
    color: var(--text-dim);
    font-size: var(--fs-xs);
    margin-right: 4px;
  }
}
