@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Core Colors - Light/White Theme (From Chart) */
  --bg-dark: #fbfbfc;
  /* Background very light/white (Custom addition for light theme base) */
  /* Couleurs complémentaires white to Bleu Secondaire */
  --primary: #255387;
  /* Bleu Primaire #255387 */
  --primary-glow: rgba(37, 83, 135, 0.2);
  --secondary: #dfe9f3;
  /* Bleu Secondaire #dfe9f3 */
  --accent: #a2503b;
  /* Complémentaire Orange #a2503b */
  --accent-2: #8ba287;
  /* Complémentaire Green #8ba287 */
  --accent-3: #dbb65a;
  /* Complémentaire Yellow #dbb65a */
  --text-main: #1b1e1f;
  /* Couleurs Paragraphe #1b1e1f - For main text */
  --text-muted: #5a6673;
  /* A bit darker for readability on white */
  --border: rgba(37, 83, 135, 0.15);
  /* Primary as border but very transparent */
  --glass-bg: rgba(255, 255, 255, 0.85);
  /* Slightly opaque white glass */
  --glass-border: rgba(37, 83, 135, 0.08);

  /* Shadows */
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Layout */
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Effects - Removed for solid flat theme */
.blob {
  display: none;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: var(--primary);
  border-radius: 50%;
}

.blob-2 {
  bottom: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: var(--secondary);
  border-radius: 50%;
  animation-delay: -5s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
}

.text-gradient {
  color: var(--primary);
}

/* Forms & Inputs */
.input-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: var(--transition-fast);
}

.input-field {
  width: 100%;
  padding: 1rem 1.25rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  transition: var(--transition-fast);
  outline: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 83, 135, 0.1);
  background: white;
}

.input-field:focus+.input-icon i {
  color: var(--primary);
}

.input-icon {
  position: absolute;
  top: 2.3rem;
  right: 1.25rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-fast);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  outline: none;
  font-family: 'Outfit', sans-serif;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Layout Setup */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Utility Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s var(--transition-smooth) forwards;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

/* ---------------------------------
   ADMIN DASHBOARD GLOBALS 
--------------------------------- */
/* The admin SPA hides public page-wrapper via JS — no global display:none needed here */
/* (moved this reset to be safe only inside admin context) */
.admin-container~.page-wrapper {
  display: none;
}


.admin-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: #fbfbfc;
}

/* ------- SIDEBAR ------- */
.sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
}

.brand-logo {
    height: 120px;
    width: auto;
    margin: 0 auto 1.5rem auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(37, 83, 135, 0.1));
}

.admin-header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-right: 0.75rem;
}

.sidebar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.login-header-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-header-logo img {
    height: 140px;
    width: auto;
    object-fit: contain;
}

.sidebar-search {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.search-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem;
  background: white;
}

.search-box i {
  color: var(--text-muted);
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  width: 100%;
  color: var(--text-main);
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
}

.menu-item i.bx-folder,
.menu-item i.bxs-dashboard {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.menu-item i.bx-chevron-right {
  color: var(--text-muted);
  font-size: 1.25rem;
  margin-right: -0.25rem;
}

.menu-item.active {
  background-color: var(--primary);
  color: white;
  border-radius: 4px;
  margin: 0 1rem;
  padding: 0.5rem 1rem;
}

.menu-item.active i {
  color: white;
}

.menu-add {
  margin: 1rem 1.5rem;
  padding: 0.75rem;
  border: 1px dashed var(--text-muted);
  border-radius: 4px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  background: white;
}

.menu-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ------- MAIN CONTENT ------- */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #fbfbfc;
  overflow-y: auto;
}

/* Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: white;
  border-bottom: 1px solid var(--border);
}

.admin-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

.header-actions {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.header-icon {
  color: var(--primary);
  font-size: 1.25rem;
  cursor: pointer;
  text-decoration: none;
}

.header-icon.logout {
  color: var(--accent);
}

/* Sub-header / Breadcrumb */
.sub-header {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: white;
}

.sub-header > div:first-child {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.breadcrumb i {
  font-size: 1.2rem;
  color: var(--text-main);
}

.breadcrumb strong {
  font-weight: 600;
  color: var(--text-main);
}

.breadcrumb span {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.sub-actions {
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  align-items: center;
}

.view-toggle {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 1.25rem;
}

.view-toggle i {
  transition: opacity 0.2s, color 0.2s;
}

.view-toggle i:hover {
  color: var(--primary);
}

/* Grid Layout */
.cards-container {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.cards-container.list-view {
  display: flex;
  flex-direction: column;
}

/* Category & Section Cards */
.cat-card,
.section-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.cat-card::after,
.section-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.cat-card:hover,
.section-card:hover {
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(37, 83, 135, 0.12);
  transform: translateY(-8px);
  background: white;
}

.cat-card::before,
.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.cat-card:hover::before,
.section-card:hover::before {
    opacity: 1;
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    display: block;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.cards-container.list-view .cat-card,
.cards-container.list-view .section-card {
  flex-direction: row;
  align-items: center;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  min-height: 0;
  display: flex;
  gap: 1.5rem;
}

.cards-container.list-view .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cards-container.list-view .card-top {
  margin-bottom: 0;
  width: auto;
}

.cards-container.list-view .card-top .card-chevron {
    display: none;
}

.cards-container.list-view .card-description {
    height: auto;
    margin-bottom: 0;
    flex: none;
    padding: 0;
    opacity: 0.6;
    font-style: italic;
    font-size: 0.85rem;
    border-left: none;
    word-break: break-word;
    overflow-wrap: anywhere;
    width: 100%;
    margin-top: 0.25rem;
}

.card-icon {
  width: 52px;
  height: 52px;
  background: rgba(139, 162, 135, 0.15);
  color: var(--accent-2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.section-card .card-icon {
  background: rgba(37, 83, 135, 0.08);
  color: var(--primary);
}

.card-chevron {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.cards-container.list-view .card-title {
  margin-bottom: 0;
  flex: 1.5;
  padding: 0 1rem;
  font-size: 1rem;
}

.card-bottom {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.cards-container.list-view .card-bottom {
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
  min-width: 120px;
  justify-content: flex-end;
}

/* Buttons */
.btn-cancel {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: rgba(100, 116, 139, 0.08);
  color: var(--text-main);
}

.action-btn,
.btn-add-section {
  background: linear-gradient(135deg, var(--primary) 0%, #17365d 100%);
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(37, 83, 135, 0.25);
}

.action-btn:hover,
.btn-add-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 83, 135, 0.35);
}

/* Reusable Custom Toggle Switch */
.custom-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.custom-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-toggle .toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.custom-toggle .toggle-dot {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.custom-toggle input:checked+.toggle-slider {
  background-color: var(--primary);
}

.custom-toggle input:checked+.toggle-slider+.toggle-dot {
  transform: translateX(20px);
}

/* ============================================
   USERS TABLE & BADGES
   ============================================ */

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.users-table thead th {
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.users-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.users-table tbody tr:last-child {
  border-bottom: none;
}

.users-table tbody tr:hover {
  background: rgba(37, 83, 135, 0.03);
}

.users-table td {
  padding: 0.75rem 1rem;
  color: var(--text-main);
  vertical-align: middle;
}

/* Role Badges */
.badge-role {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-administrateur {
  background: rgba(37, 83, 135, 0.12);
  color: var(--primary);
}

.badge-manager {
  background: rgba(139, 162, 135, 0.15);
  color: #5a7a56;
}

.badge-gestion {
  background: rgba(219, 182, 90, 0.15);
  color: #9a7a20;
}

.badge-technicien {
  background: rgba(162, 80, 59, 0.12);
  color: var(--accent);
}

/* Search input inside modals */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper i {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input-wrapper input {
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  width: 240px;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--text-main);
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Action buttons in tables */
.btn-action-edit,
.btn-action-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.btn-action-edit {
  background: rgba(37, 83, 135, 0.08);
  color: var(--primary);
  border-color: rgba(37, 83, 135, 0.15);
}

.btn-action-edit:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 83, 135, 0.3);
  transform: translateY(-1px);
}

.btn-action-delete {
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.15);
}

.btn-action-delete:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* Compact row action icons for data tables */
.row-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  background: transparent;
}

.row-action-icon.edit {
  color: var(--primary);
  background: rgba(37, 83, 135, 0.06);
  border-color: rgba(37, 83, 135, 0.12);
}

.row-action-icon.edit:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(37, 83, 135, 0.3);
  transform: translateY(-1px) scale(1.05);
}

.row-action-icon.delete {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.1);
}

.row-action-icon.delete:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px) scale(1.05);
}

/* Column item row in columns modal */
.column-item-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.column-item-row:hover {
  border-color: rgba(37, 83, 135, 0.25);
  background: rgba(37, 83, 135, 0.02);
}

.column-item-row .drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 1.1rem;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.column-item-row:hover .drag-handle {
  opacity: 0.8;
}

.column-item-row input {
  flex-grow: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  background: transparent;
  outline: none;
  transition: all 0.2s ease;
}

.column-item-row input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(37, 83, 135, 0.08);
}

.column-item-row .col-remove-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.column-item-row .col-remove-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Row form field group */
.row-field-group {
  margin-bottom: 1.25rem;
}

.row-field-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.row-field-group label i {
  font-size: 0.95rem;
  color: var(--primary);
}

.row-field-group input,
.row-field-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  box-sizing: border-box;
  outline: none;
  background: #fbfbfc;
  transition: all 0.25s ease;
}

.row-field-group input:focus,
.row-field-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 83, 135, 0.1);
  background: white;
}

/* Reset link input */
.reset-link-input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: monospace;
  background: #f8fafc;
  box-sizing: border-box;
}

/* ============================================
   SPREADSHEET TABLE
   ============================================ */

.spreadsheet-table {
  width: 100%;
  min-width: 600px;
  margin: 0;
  border: none;
  font-size: 0.9rem;
  border-collapse: collapse;
}

.spreadsheet-table thead th {
  padding: 0.55rem 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  background: #f8fafc;
  white-space: nowrap;
}

.spreadsheet-table .spreadsheet-row {
  transition: background 0.15s ease, opacity 0.2s ease, transform 0.2s ease;
}

.spreadsheet-table .spreadsheet-row:hover {
  background: rgba(37, 83, 135, 0.02);
}

.spreadsheet-cell {
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.spreadsheet-cell .cell-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: none;
  background: transparent;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  box-sizing: border-box;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.spreadsheet-cell .cell-input::placeholder {
  color: rgba(90, 102, 115, 0.3);
}

.spreadsheet-cell .cell-input:focus {
  background: rgba(37, 83, 135, 0.04);
  box-shadow: inset 0 0 0 2px rgba(37, 83, 135, 0.2);
}

/* Action cell */
.spreadsheet-cell.cell-actions {
  width: 50px;
  text-align: center;
}

.spreadsheet-cell.cell-actions .row-action-icon {
  opacity: 0;
  transition: opacity 0.15s ease, all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
}

.spreadsheet-row:hover .cell-actions .row-action-icon {
  opacity: 1;
}

/* Save indicator */
.save-indicator {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--primary);
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(37, 83, 135, 0.3);
  z-index: 999;
  transition: all 0.3s ease;
}


/* ============================================
   GLOBAL SPECIAL SIDEBAR
   ============================================ */

/* Floating Triggers Horizontal Container */
.special-triggers-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 2rem;
  pointer-events: none;
  display: flex;
  justify-content: center;
  /* Center them on screen */
}

.special-triggers-scroll-container {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 90vw;
  overflow-x: auto;
  padding: 0.5rem;
  scrollbar-width: none;
  /* Firefox */
  scroll-behavior: smooth;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.special-triggers-scroll-container::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

/* Nav Arrows for the scrollable bar */
.trigger-nav-btn {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  color: var(--primary);
  transition: all 0.3s;
  z-index: 2;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.trigger-nav-btn:hover {
  background: var(--primary);
  color: white;
}

.trigger-nav-left {
  left: 0.5rem;
}

.trigger-nav-right {
  right: 0.5rem;
}

/* Trigger Button Redesign */
.special-sidebar-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-family: inherit;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.special-sidebar-trigger i {
  font-size: 1.25rem;
  opacity: 0.8;
}

.special-sidebar-trigger .trigger-label {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.special-sidebar-trigger:hover {
  transform: translateY(-5px);
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.special-sidebar-trigger:hover .trigger-label {
  color: white;
}


/* Sidebar Container */
.global-special-sidebar {
  position: fixed;
  top: 0;
  left: -400px;
  width: 380px;
  height: 100vh;
  background: white;
  z-index: 1010;
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
  transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.global-special-sidebar.active {
  left: 0;
}

.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Sidebar Header */
.sidebar-header-special {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.sidebar-header-special .header-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
}

.sidebar-header-special .close-btn-special {
  background: rgba(0, 0, 0, 0.03);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.sidebar-header-special .close-btn-special:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: rotate(90deg);
}

/* Sidebar Search */
.sidebar-search-special {
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
}

.search-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field-wrapper i {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.search-field-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

.search-field-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 83, 135, 0.08);
}

/* Sidebar Content */
.sidebar-content-special {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.special-cat-group {
  margin-bottom: 2rem;
}

.special-cat-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}

.special-sec-item {
  margin-bottom: 0.5rem;
}

.sec-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.sec-link:hover {
  background: rgba(37, 83, 135, 0.04);
  color: var(--primary);
  border-color: rgba(37, 83, 135, 0.1);
}

.sec-link i:first-child {
  font-size: 1.2rem;
  color: var(--primary);
  opacity: 0.7;
}

.sec-link .toggle-indicator {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.3s;
}

/* Rows visibility */
.special-rows-container {
  padding: 0.5rem 0 0.5rem 1rem;
  margin-left: 1.5rem;
  border-left: 2px solid var(--border);
}

.special-row-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: default;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.special-row-item:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.special-row-item strong {
  color: var(--primary);
  font-weight: 700;
}

/* Sidebar Footer */
.sidebar-footer-special {
  padding: 1.5rem;
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

/* Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1005;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Animations for search results */
.fadeOut {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.3s;
}

.fadeIn {
  opacity: 1;
  transform: scale(1);
  transition: all 0.3s;
}

/* Scrollbar styling for sidebar */
.sidebar-content-special::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content-special::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content-special::-webkit-scrollbar-thumb {
  background: rgba(37, 83, 135, 0.1);
  border-radius: 10px;
}

.sidebar-content-special::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Special Search Results Styling */
.special-result-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.special-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(37, 83, 135, 0.1), 0 4px 6px -2px rgba(37, 83, 135, 0.05);
  background: white !important;
  border-color: var(--primary) !important;
}

.row-data-grid {
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  margin-top: 0.5rem;
}

.special-result-card-wrapper {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}