/* ═══════════════════════════════════════════
   DENTAL LAB DESIGN SYSTEM v1.0
   Clinical Precision: Glass + Neumorphism
   ═══════════════════════════════════════════ */

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Geist', -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-light); }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

/* ─── DESIGN TOKENS ─── */
:root {
  /* Core */
  --white: #FFFFFF;
  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-elevated: #FFFFFF;

  /* Accent */
  --cyan: #06B6D4;
  --cyan-light: #22D3EE;
  --cyan-dark: #0891B2;
  --cyan-subtle: rgba(6, 182, 212, 0.08);
  --cyan-glow: rgba(6, 182, 212, 0.15);

  /* Status */
  --mint: #10B981;
  --mint-subtle: rgba(16, 185, 129, 0.08);
  --amber: #F59E0B;
  --amber-subtle: rgba(245, 158, 11, 0.08);
  --red: #EF4444;
  --red-subtle: rgba(239, 68, 68, 0.08);
  --slate: #94A3B8;

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  /* Typography */
  --font-primary: 'Geist', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;

  /* Spacing (4px grid) */
  --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;
  --space-16: 4rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Neumorphism */
  --neu: 6px 6px 14px rgba(166, 180, 200, 0.18), -6px -6px 14px rgba(255, 255, 255, 0.7);
  --neu-inset: inset 4px 4px 8px rgba(166, 180, 200, 0.15), inset -4px -4px 8px rgba(255, 255, 255, 0.6);
  --neu-hover: 8px 8px 20px rgba(166, 180, 200, 0.22), -8px -8px 20px rgba(255, 255, 255, 0.8);
  --shadow-elevated: 0 20px 60px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 23, 42, 0.04);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-strong: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: blur(20px);
  --glass-blur-strong: blur(32px);
  --glass-dark-bg: rgba(15, 23, 42, 0.75);
  --glass-dark-blur: blur(16px);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-enter: 350ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 60px;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: 1.3;
  color: var(--text-primary);
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }
.text-mono { font-family: var(--font-mono); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }

/* ─── LAYOUT ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  transition: width var(--duration-slow) var(--ease-out);
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  gap: var(--space-3);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo {
  height: 28px;
  width: auto;
  max-width: 160px;
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar-brand {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity var(--duration-fast);
}

.sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
}

.nav-section-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-4) var(--space-3) var(--space-2);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-section-label { opacity: 0; height: 0; padding: 0; }

.nav-item {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  gap: var(--space-3);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: var(--cyan-subtle);
  color: var(--cyan);
}

.nav-item.active {
  background: var(--cyan-subtle);
  color: var(--cyan);
  font-weight: var(--font-semibold);
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  opacity: 1;
  transition: opacity var(--duration-fast);
}

.sidebar.collapsed .nav-label { opacity: 0; }

.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  flex-shrink: 0;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all var(--duration-normal) var(--ease-out);
}

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

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  transition: transform var(--duration-normal) var(--ease-out);
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* ─── MAIN CONTENT ─── */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--duration-slow) var(--ease-out);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-collapsed);
}

.header {
  height: var(--header-height);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.header-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

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

.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
}

.header-btn:hover {
  background: var(--cyan-subtle);
  color: var(--cyan);
}

.header-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.notification-badge.has-count {
  width: auto;
  height: auto;
  min-width: 18px;
  padding: 0 4px;
  top: 2px;
  right: 2px;
  font-size: 10px;
  font-weight: var(--font-semibold);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: var(--radius-full);
}

.lang-switch {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  transition: all var(--duration-normal) var(--ease-out);
  text-transform: uppercase;
}

.lang-btn.active {
  background: var(--white);
  color: var(--cyan);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.user-menu:hover {
  background: var(--cyan-subtle);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cyan-subtle);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.hamburger-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

/* ─── MAIN CANVAS ─── */
.main-content {
  flex: 1;
  padding: var(--space-8);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

.page-actions {
  display: flex;
  gap: var(--space-3);
}

/* ─── CARDS ─── */
.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--neu);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--neu-hover);
}

.card-flat {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.card-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
}

/* ─── STAT CARDS ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--neu);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
  opacity: 0;
  transform: translateY(16px);
  animation: page-enter var(--duration-enter) var(--ease-out) forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

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

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

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

.stat-card-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.stat-card-icon.cyan { background: var(--cyan-subtle); color: var(--cyan); }
.stat-card-icon.mint { background: var(--mint-subtle); color: var(--mint); }
.stat-card-icon.amber { background: var(--amber-subtle); color: var(--amber); }
.stat-card-icon.red { background: var(--red-subtle); color: var(--red); }

.stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  line-height: 1;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.btn-primary {
  background: var(--cyan);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  background: var(--cyan-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--neu-inset);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-secondary);
  box-shadow: var(--neu);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: var(--neu-hover);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: var(--neu-inset);
}

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

.btn-ghost:hover {
  background: var(--cyan-subtle);
  color: var(--cyan);
}

.btn-danger {
  background: var(--red-subtle);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: var(--white);
}

.btn-success {
  background: var(--mint);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-warning {
  background: var(--amber);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.btn-sm {
  padding: 8px 14px;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--text-md);
}

.btn-xl {
  padding: 20px 32px;
  font-size: var(--text-lg);
  min-height: 80px;
  border-radius: var(--radius-lg);
  font-weight: var(--font-semibold);
  width: 100%;
}

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ─── INPUTS ─── */
.form-group {
  margin-bottom: var(--space-5);
}

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

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: all var(--duration-normal) var(--ease-out);
}

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

.form-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-subtle), var(--neu-inset);
}

.form-input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-subtle);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--red);
  margin-top: var(--space-1);
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  padding-right: 36px;
  background: var(--bg-primary);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

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

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

.form-radio-group, .form-check-group {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.form-radio, .form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.form-radio input, .form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
}

/* ─── TABLES ─── */
.table-container {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.table-filters {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

.table-filters .form-input,
.table-filters .form-select {
  padding: 7px 12px;
  font-size: var(--text-xs);
  min-width: 140px;
}

.data-table {
  width: 100%;
}

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

.data-table th {
  padding: 12px 16px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.data-table th:hover {
  color: var(--text-secondary);
}

.data-table th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.3;
  transition: opacity var(--duration-fast);
}

.data-table th.sorted .sort-icon {
  opacity: 1;
  color: var(--cyan);
}

.data-table td {
  padding: 12px 16px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.data-table tbody tr {
  transition: background var(--duration-fast);
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.03);
}

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

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pagination-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-out);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--cyan-subtle);
  color: var(--cyan);
}

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

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

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-nouvelle { background: rgba(59, 130, 246, 0.08); color: #3B82F6; }
.badge-nouvelle .badge-dot { background: #3B82F6; }

.badge-en_production { background: var(--cyan-subtle); color: var(--cyan); }
.badge-en_production .badge-dot { background: var(--cyan); animation: status-pulse 2s ease-in-out infinite; }

.badge-en_retard { background: var(--red-subtle); color: var(--red); }
.badge-en_retard .badge-dot { background: var(--red); animation: status-pulse 1.5s ease-in-out infinite; }

.badge-terminee { background: var(--mint-subtle); color: var(--mint); }
.badge-terminee .badge-dot { background: var(--mint); }

.badge-en_preparation { background: var(--amber-subtle); color: var(--amber); }
.badge-en_preparation .badge-dot { background: var(--amber); }

.badge-expediee { background: rgba(139, 92, 246, 0.08); color: #8B5CF6; }
.badge-expediee .badge-dot { background: #8B5CF6; }

.badge-livree { background: rgba(148, 163, 184, 0.1); color: var(--slate); }
.badge-livree .badge-dot { background: var(--slate); }

.badge-annulee { background: rgba(148, 163, 184, 0.1); color: var(--slate); text-decoration: line-through; }
.badge-annulee .badge-dot { background: var(--slate); }

.badge-urgent {
  background: var(--red-subtle);
  color: var(--red);
  animation: pulse-urgent 2s ease-in-out infinite;
}

.badge-normal { background: rgba(148, 163, 184, 0.1); color: var(--slate); }

.badge-role-admin { background: rgba(139, 92, 246, 0.08); color: #8B5CF6; }
.badge-role-technicien { background: var(--cyan-subtle); color: var(--cyan); }
.badge-role-dentiste { background: var(--mint-subtle); color: var(--mint); }

/* ─── EMPTY STATES ─── */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--text-muted);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  opacity: 0.3;
}

.empty-state-icon svg {
  width: 64px;
  height: 64px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1;
}

.empty-state-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* ─── LOADING ─── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-primary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-heading { height: 24px; width: 40%; margin-bottom: 16px; }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(148, 163, 184, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* ─── MOBILE OVERLAY ─── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 99;
}

/* ─── ANIMATIONS ─── */
@keyframes page-enter {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px transparent; }
}

@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

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

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

/* ─── UTILITIES ─── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }
  .sidebar .nav-label,
  .sidebar .sidebar-brand,
  .sidebar .nav-section-label { opacity: 0; }
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .sidebar-brand,
  .sidebar.collapsed .nav-section-label { opacity: 0; }
  .main-wrapper {
    margin-left: var(--sidebar-collapsed);
  }
  .sidebar.mobile-open {
    width: var(--sidebar-width);
  }
  .sidebar.mobile-open .nav-label,
  .sidebar.mobile-open .sidebar-brand,
  .sidebar.mobile-open .nav-section-label { opacity: 1; }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease-out);
    z-index: 200;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-overlay.active { display: block; }
  .main-wrapper {
    margin-left: 0;
  }
  .hamburger-btn {
    display: flex;
  }
  .header {
    padding: 0 var(--space-4);
  }
  .main-content {
    padding: var(--space-4);
  }
  .user-name { display: none; }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .table-filters {
    width: 100%;
    flex-direction: column;
  }
  .table-filters .form-input,
  .table-filters .form-select {
    width: 100%;
  }
}

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