 :root {
 --primary: #275cff;
 --primary-hover: #1950e4;
 --primary-light: #eef4ff;
 --secondary: #0f172a;
 --accent: #275cff;
 --accent-soft: rgba(39, 92, 255, 0.12);
 --accent-strong: #102f66;
 --background: #f4f7fb;
 --surface: #ffffff;
 --surface-muted: #f5f8fd;
 --surface-soft: #f8fbff;
 --border: #e2e8f0;
 --text-primary: #0f172a;
 --text-secondary: #475569;
 --text-muted: #667085;
 --success: #16a34a;
 --warning: #f59e0b;
 --danger: #ef4444;
 --info: #0ea5e9;
 --focus: rgba(39, 92, 255, 0.24);
 --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
 --radius: 20px;
 --bg: var(--background);
 --text: var(--text-primary);
 --muted: var(--text-muted);
 --muted-soft: #94a3b8;
 --muted-strong: var(--text-secondary);
 }

 * {
 box-sizing: border-box;
 }

 html,
 body {
 min-height: 100%;
 margin: 0;
 padding: 0;
 background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
 color: var(--text);
 font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
 }

 .password-wrapper {
 position: relative;
 }

 .dropdown-menu {
 border-radius: 16px;
 box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
 border: 1px solid rgba(148, 163, 184, 0.18);
 }

 button,
 input,
 select,
 textarea {
 font: inherit;
 }

 img,
 svg {
 max-width: 100%;
 display: block;
 }

 a {
 color: inherit;
 text-decoration: none;
 }

 a:hover {
 text-decoration: underline;
 }

 body {
 min-height: 100vh;
 }

 .admin-shell {
 display: flex;
 min-height: 100vh;
 background: var(--bg);
 }

 .admin-sidebar {
 width: 280px;
 min-width: 280px;
 background: #0f172a;
 color: #fff;
 display: flex;
 flex-direction: column;
 padding: 1.5rem 1rem;
 gap: 1.25rem;
 position: relative;
 transition: transform 0.28s ease;
 }

 .admin-brand {
 display: flex;
 align-items: center;
 gap: 0.85rem;
 margin-bottom: 1.2rem;
 }

 .brand-mark {
 width: 46px;
 height: 46px;
 border-radius: 16px;
 display: grid;
 place-items: center;
 background: linear-gradient(135deg, #3f7dff, #18b7ff);
 color: #fff;
 font-weight: 800;
 letter-spacing: -0.04em;
 }

 .brand-text .brand-eyebrow {
 margin: 0;
 font-size: 0.68rem;
 text-transform: uppercase;
 letter-spacing: 0.24em;
 color: rgba(255, 255, 255, 0.65);
 }

 .brand-text .brand-title {
 margin: 0.18rem 0 0;
 font-size: 1rem;
 font-weight: 700;
 line-height: 1.2;
 }

 .admin-nav {
 display: flex;
 flex-direction: column;
 gap: 1rem;
 overflow: auto;
 padding-right: 0.25rem;
 }

 .nav-group {
 display: flex;
 flex-direction: column;
 gap: 0.65rem;
 }

 .nav-group-heading {
 font-size: 0.72rem;
 letter-spacing: 0.18em;
 color: rgba(255, 255, 255, 0.55);
 text-transform: uppercase;
 }

 .nav-link {
 display: flex;
 align-items: center;
 gap: 0.9rem;
 padding: 0.95rem 1rem;
 border-radius: 16px;
 color: rgba(255, 255, 255, 0.86);
 transition: all 0.2s ease;
 font-size: 0.95rem;
 font-weight: 600;
 }

 .nav-link:hover,
 .nav-link.active {
 background: rgba(255, 255, 255, 0.12);
 color: #fff;
 }

 .nav-link-icon {
 width: 1.45rem;
 height: 1.45rem;
 display: grid;
 place-items: center;
 font-size: 1.1rem;
 }

 .nav-link-label {
 flex: 1;
 }

 .sidebar-footer {
 margin-top: auto;
 padding-top: 1.25rem;
 border-top: 1px solid rgba(255, 255, 255, 0.08);
 }

 .sidebar-profile {
 display: grid;
 gap: 0.35rem;
 }

 .profile-line {
 font-size: 0.82rem;
 color: rgba(255, 255, 255, 0.7);
 }

 .profile-role {
 font-size: 0.88rem;
 font-weight: 700;
 color: #fff;
 }

 .mobile-menu-toggle {
 display: none;
 border: none;
 background: rgba(255, 255, 255, 0.08);
 color: #fff;
 width: 40px;
 height: 40px;
 border-radius: 14px;
 }

 .sidebar-overlay {
 display: none;
 position: fixed;
 inset: 0;
 background: rgba(15, 23, 42, 0.42);
 opacity: 0;
 transition: opacity 0.2s ease;
 pointer-events: none;
 z-index: 15;
 }
 
 .sidebar-overlay.show {
 display: block;
 opacity: 1;
 pointer-events: auto;
 }

 .admin-sidebar.mobile-open {
 transform: translateX(0);
 }

 .admin-main {
 flex: 1;
 display: flex;
 flex-direction: column;
 min-height: 100vh;
 }

 .admin-header {
 position: sticky;
 top: 0;
 z-index: 20;
 background: #fff;
 border-bottom: 1px solid var(--border);
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 1rem;
 padding: 1.1rem 1.75rem;
 }

 .header-left {
 display: flex;
 align-items: center;
 gap: 1rem;
 min-width: 0;
 }

 .header-breadcrumb {
 margin: 0 0 0.2rem;
 font-size: 0.79rem;
 color: var(--muted);
 text-transform: uppercase;
 letter-spacing: 0.16em;
 display: inline-block;
 max-width: 48vw;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
 }

 /* Accessibility: visible focus for interactive controls */
 :focus-visible {
   outline: 3px solid rgba(39,92,255,0.28);
   outline-offset: 2px;
 }

 .btn:focus-visible, .icon-button:focus-visible, .profile-dropdown .dropdown-toggle:focus-visible, .nav-link:focus-visible, .search-field input:focus-visible {
   outline: 3px solid rgba(39,92,255,0.28);
   outline-offset: 2px;
   border-radius: 8px;
 }

 /* Loading overlay / skeleton */
 .loading-overlay {
   position: relative;
 }
 .loading-overlay::after {
   content: '';
   position: absolute;
   inset: 0;
   background: linear-gradient(90deg, rgba(255,255,255,0.0), rgba(255,255,255,0.6), rgba(255,255,255,0.0));
   opacity: 0;
   transition: opacity 220ms ease;
   pointer-events: none;
 }
 .loading-overlay.loading::after {
   opacity: 1;
   animation: shimmer 1.2s infinite linear;
 }
 @keyframes shimmer { 0% { transform: translateX(-20%);} 100% { transform: translateX(120%);} }

 .skeleton-box { background: linear-gradient(180deg, rgba(226,232,240,0.6), rgba(226,232,240,0.45)); border-radius: 8px; min-height:1rem; }

 .header-title {
 margin: 0;
 font-size: 1.65rem;
 font-weight: 800;
 line-height: 1.05;
 }

.header-right {
 display: flex;
 align-items: center;
 gap: 0.85rem;
 flex-wrap: nowrap; /* keep controls on one line on desktop */
 min-width: 0;
}

.search-field {
 position: relative;
 flex: 1 1 360px; /* allow search to shrink/grow but not push other controls */
 min-width: 260px;
 max-width: 560px;
 width: 100%;
 margin-right: 0.6rem;
}

/* keep dropdowns/profile/bell fixed-size and prevent the search from forcing wrap */
.header-right > .dropdown,
.header-right > .profile-dropdown {
 flex: 0 0 auto;
}

  
 .search-field input {
 width: 100%;
 border-radius: 999px;
 padding: 0.95rem 3rem 0.95rem 3rem;
 border: 1px solid var(--border);
 background: var(--surface-soft);
 color: var(--text);
 outline: none;
 }
  
 .search-field > i {
 position: absolute;
 left: 1rem;
 top: 50%;
 transform: translateY(-50%);
 color: var(--muted);
 pointer-events: none;
 }
  
 .search-clear {
 position: absolute;
 right: 0.6rem;
 top: 50%;
 transform: translateY(-50%);
 border: none;
 width: 2rem;
 height: 2rem;
 border-radius: 999px;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 background: transparent;
 color: var(--muted);
 }
  
 .search-clear:hover {
 background: rgba(15, 23, 42, 0.06);
 color: var(--text);
 }
  
 .search-results {
 position: absolute;
 top: calc(100% + 0.5rem);
 left: 0;
 right: 0;
 z-index: 30;
 background: var(--surface);
 border: 1px solid rgba(148, 163, 184, 0.2);
 border-radius: 18px;
 box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
 padding: 0.5rem;
 max-height: 320px;
 overflow: auto;
 }
  
 .search-results a {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 0.75rem;
 width: 100%;
 padding: 0.8rem 0.9rem;
 border-radius: 12px;
 color: var(--text);
 transition: background 0.2s ease, transform 0.2s ease;
 }
  
 .search-results a:hover,
 .search-results a:focus-visible,
 .search-results a.is-selected {
 background: var(--surface-soft);
 transform: translateX(2px);
 text-decoration: none;
 }
  
 .search-results .search-result-title {
 font-weight: 700;
 }
  
 .search-results .search-result-group {
 color: var(--muted);
 font-size: 0.82rem;
 }
  
 .search-results .search-result-empty {
 color: var(--muted);
 font-size: 0.95rem;
 padding: 0.7rem 0.75rem;
 }

 @media (max-width: 991px) {
   .admin-header {
     flex-wrap: wrap;
     align-items: flex-start;
   }
   .search-field {
     min-width: 0;
     max-width: 100%;
     width: 100%;
   }
   .header-left,
   .header-right {
     width: 100%;
   }
   .header-left {
     justify-content: space-between;
     flex-wrap: wrap;
   }
   .header-right {
     justify-content: space-between;
     gap: 0.6rem;
     flex-wrap: wrap;
   }
   .profile-dropdown .dropdown-toggle {
     min-width: 0;
     width: auto;
   }
 }

 @media (max-width: 767px) {
   .search-field {
     min-width: 0;
     flex: 1;
     max-width: 100%;
   }
 }

.icon-button {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 44px;
 height: 44px;
 border-radius: 14px;
 border: 1px solid var(--border);
 background: var(--surface);
 color: var(--text);
 transition: all 0.2s ease;
 position: relative; /* allow absolute badge positioning inside */
}

.btn-outline-secondary {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 border-radius: 999px;
 border: 1px solid var(--border);
 background: var(--surface);
 color: var(--text);
 padding: 0.45rem 0.9rem;
 height: auto;
 width: auto;
}

.profile-dropdown .dropdown-toggle {
 display: inline-flex;
 align-items: center;
 gap: 0.6rem;
 padding: 0.25rem 0.6rem;
 min-width: 0;
 width: auto;
}


 .icon-button:hover,
 .btn-outline-secondary:hover {
 background: var(--surface-soft);
 }

 .profile-dropdown .dropdown-toggle {
 border-radius: 999px;
 border: 1px solid var(--border);
 background: var(--surface);
 color: var(--text);
 }

 .dropdown-menu {
 min-width: 200px;
 border-radius: 18px;
 border-color: var(--border);
 box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
 }

 .dropdown-item {
 font-size: 0.95rem;
 }

 .license-banner {
 margin: 0 1.75rem;
 padding: 1rem 1.15rem;
 border-radius: 18px;
 background: rgba(39, 92, 255, 0.05);
 border: 1px solid rgba(39, 92, 255, 0.12);
 color: var(--text);
 }

 .content {
 flex: 1;
 padding: 1.5rem 1.75rem 2rem;
 background: var(--bg);
 overflow-x: hidden;
 }

 .main-panel {
 display: grid;
 gap: 1.5rem;
 width: 100%;
 max-width: 100%;
 min-width: 0;
 grid-template-columns: minmax(0, 1fr);
 }

 .main-panel > * {
 width: 100%;
 max-width: 100%;
 min-width: 0;
 }

 .card-panel,
 .form-panel,
 .table-panel {
 background: var(--surface);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 box-shadow: var(--shadow);
 padding: 1.5rem;
 width: 100%;
 max-width: 100%;
 min-width: 0;
 }

 /* Mobile: convert admin tables to stacked cards for better app-like UX */
 @media (max-width: 767px) {
   .table-panel .table {
     border: 0;
   }
   .table-panel tbody tr {
     display: block;
     margin-bottom: 1rem;
     background: var(--surface);
     border: 1px solid var(--border);
     border-radius: 12px;
     padding: 0.85rem;
     box-shadow: 0 8px 28px rgba(15,23,42,0.04);
   }
   .table-panel tbody tr td {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 0.45rem 0;
     border: none;
   }
   .table-panel tbody tr td[data-label]::before {
     content: attr(data-label) ": ";
     font-weight: 700;
     color: var(--muted);
     margin-right: 0.5rem;
     flex: 0 0 auto;
   }
   .table-panel tbody tr td img.prod-thumb {
     width: 72px;
     height: 72px;
     margin-right: 0.6rem;
     flex: 0 0 auto;
   }
   .table-panel tbody tr td[data-label="Actions"] {
     display: flex;
     gap: 0.5rem;
     justify-content: flex-end;
   }
   .table-panel tbody tr td[data-label="Name"] {
     flex: 1 1 auto;
     padding-left: 0.5rem;
     text-align: left;
   }
   .table-panel thead { display: none; }
   .table-panel .section-description { display: none; }
 }

 .section-title {
 margin: 0 0 0.65rem;
 font-size: 1.1rem;
 font-weight: 700;
 color: var(--text);
 }
 
 .section-subtitle {
 margin: 0 0 0.25rem;
 font-size: 0.96rem;
 font-weight: 700;
 color: var(--text-primary);
 }
 
 .section-description {
 margin: 0;
 color: var(--muted);
 }

 .filter-panel {
 background: linear-gradient(135deg, rgba(39, 92, 255, 0.04), rgba(14, 165, 233, 0.05));
 border: 1px solid rgba(39, 92, 255, 0.12);
 border-radius: 22px;
 padding: 1.2rem 1.2rem 1.25rem;
 box-shadow: 0 16px 38px rgba(15, 23, 42, 0.05);
 }

 .filter-panel .form-control,
 .filter-panel .form-select {
 background: #ffffff;
 border-color: #dfe7f4;
 }

 .filter-panel .btn {
 min-height: 48px;
 }

 .form-control,
 .form-select,
 textarea {
 width: 100%;
 min-height: 48px;
 background: #f8fbff;
 border: 1px solid #dfe7f4;
 border-radius: 16px;
 color: var(--text);
 padding: 0.95rem 1rem;
 transition: border-color 0.2s ease, box-shadow 0.2s ease;
 }

 textarea {
 min-height: 120px;
 }

 .form-control:focus,
 .form-select:focus,
 textarea:focus {
 outline: none;
 border-color: rgba(39, 92, 255, 0.4);
 box-shadow: 0 0 0 4px rgba(39, 92, 255, 0.12);
 }

 .field-group {
 display: flex;
 flex-direction: column;
 gap: 0.5rem;
 }

 .field-group label {
 font-weight: 600;
 color: var(--muted-strong);
 font-size: 0.92rem;
 }

 button,
 .btn {
 border-radius: 999px;
 padding: 0.85rem 1.2rem;
 font-weight: 700;
 transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
 }

 .btn:hover,
 .btn:focus-visible {
 transform: translateY(-1px);
 }

 .btn-primary {
 background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
 color: #fff;
 border: 1px solid transparent;
 }

 .btn-primary:hover,
 .btn-primary:focus-visible {
 background: linear-gradient(135deg, var(--primary-hover) 0%, #0284c7 100%);
 color: #fff;
 }

 .btn-secondary {
 background: var(--surface);
 color: var(--text-primary);
 border: 1px solid var(--border);
 }

 .btn-secondary:hover,
 .btn-secondary:focus-visible {
 background: var(--surface-soft);
 color: var(--text-primary);
 }

 .btn-success {
 background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
 color: #fff;
 }

 .btn-danger {
 background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
 color: #fff;
 }

 .btn-warning {
 background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
 color: #fff;
 }

 .btn-info {
 background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%);
 color: #fff;
 }

 .btn-ghost,
 .btn-outline {
 background: transparent;
 color: var(--text-primary);
 border: 1px solid var(--border);
 }

 .btn-ghost:hover,
 .btn-outline:hover,
 .btn-ghost:focus-visible,
 .btn-outline:focus-visible {
 background: var(--surface-soft);
 color: var(--primary);
 }

 .btn-icon {
 width: 44px;
 min-width: 44px;
 padding: 0;
 }

 .btn-loading {
 opacity: 0.7;
 pointer-events: none;
 }

 .table-panel {
 border-radius: 22px;
 overflow: hidden;
 }

 .table-panel table {
 width: 100%;
 border-collapse: separate;
 border-spacing: 0;
 }

 .table-panel thead {
 background: var(--surface-muted);
 }

 .table-panel th,
 .table-panel td {
 padding: 1rem 1rem;
 border-bottom: 1px solid rgba(226,232,240,0.9);
 vertical-align: middle;
 color: var(--text-primary);
 }

 .table-panel tbody tr:hover {
 background: rgba(39, 92, 255, 0.05);
 }

 .table-dark,
 .table-dark th,
 .table-dark td,
 .table-dark tbody tr:hover {
 background: transparent !important;
 color: var(--text-primary) !important;
 }

 .table-dark thead th {
 background: var(--surface-muted) !important;
 color: var(--text-secondary) !important;
 }

 .table-dark tbody tr:hover {
 background: rgba(39, 92, 255, 0.05) !important;
 }

 .table-striped tbody tr:nth-of-type(odd) {
 background-color: rgba(226,232,240,0.3);
 }

 .table-hover tbody tr:hover {
 background-color: rgba(39, 92, 255, 0.05);
 }

 .table td:first-child,
 .table th:first-child,
 .table-panel td:first-child,
 .table-panel th:first-child {
 padding-left: 1.2rem;
 }

 .table td:last-child,
 .table th:last-child,
 .table-panel td:last-child,
 .table-panel th:last-child {
 padding-right: 1.2rem;
 }

 .modal-content.dark-theme {
 background: var(--surface);
 color: var(--text-primary);
 }

 .modal-content.dark-theme .modal-header,
 .modal-content.dark-theme .modal-footer {
 border-color: rgba(226,232,240,0.9);
 }

 .table-panel tbody tr:last-child td {
 border-bottom: none;
 }

 .status-pill {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 padding: 0.4rem 0.85rem;
 border-radius: 999px;
 font-size: 0.82rem;
 font-weight: 700;
 background: rgba(148, 163, 184, 0.12);
 color: var(--text-secondary);
 }
 
 .status-pill.success {
 background: rgba(22, 163, 74, 0.12);
 color: var(--success);
 }
 
 .status-pill.warning {
 background: rgba(245, 158, 11, 0.12);
 color: var(--warning);
 }
 
 .status-pill.danger {
 background: rgba(239, 68, 68, 0.12);
 color: var(--danger);
 }

 .glass-card {
 background: var(--surface);
 border: 1px solid var(--border);
 border-radius: 24px;
 box-shadow: var(--shadow);
 padding: 1.5rem;
 }

 .stat-card {
 background: #fff;
 border: 1px solid #e5e7eb;
 border-radius: 22px;
 padding: 1.35rem;
 box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
 }

 .stat-card .muted {
 color: var(--muted);
 }

 .stat-card .value {
 font-size: 2rem;
 font-weight: 800;
 margin: 0.45rem 0 0.25rem;
 }

 .muted,
 .text-muted {
 color: var(--muted) !important;
 }

 .small {
 font-size: 0.92rem !important;
 }

 .form-label {
 display: block;
 margin-bottom: 0.5rem;
 font-size: 0.95rem;
 font-weight: 600;
 color: var(--text);
 }

 .btn-info {
 background: #0ea5e9;
 color: #fff;
 border-color: transparent;
 }

 .btn-info:hover {
 background: #0284c7;
 }

 .btn-warning {
 background: #f59e0b;
 color: #fff;
 border-color: transparent;
 }

 .btn-danger {
 background: #ef4444;
 color: #fff;
 border-color: transparent;
 }

 .btn-outline-light,
 .btn-outline-secondary {
 background: transparent;
 color: var(--text);
 border-color: var(--border);
 }

 .btn-outline-light:hover,
 .btn-outline-secondary:hover {
 background: var(--surface-soft);
 }

 .dataTable thead th,
 .dataTable tbody td,
 .table th,
 .table td {
 color: var(--text) !important;
 }

 .table {
 width: 100%;
 border-collapse: collapse;
 border-spacing: 0;
 background: var(--surface);
 }

 .table th,
 .table td {
 padding: 1rem 1rem;
 border-bottom: 1px solid #e5e7eb;
 }

 .table thead th {
 background: #f8fbff;
 color: var(--text);
 font-weight: 700;
 }

 .table tbody tr:hover {
 background: #f7fbff;
 }

 .table-responsive {
 overflow-x: auto;
 }
 
 @media (max-width: 767px) {
   .table-panel table,
   .table-panel thead,
   .table-panel tbody,
   .table-panel th,
   .table-panel td,
   .table-panel tr {
     display: block;
     width: 100%;
   }
 
   .table-panel thead tr {
     position: absolute;
     top: -9999px;
     left: -9999px;
   }
 
   .table-panel tr {
     margin: 0 0 1rem;
     border: 1px solid var(--border);
     border-radius: 18px;
     background: var(--surface);
     box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
   }
 
   .table-panel td {
     padding: 1rem 1rem 1rem 45%;
     text-align: left;
     position: relative;
     border: none;
     border-bottom: 1px solid rgba(226, 232, 240, 0.8);
   }
 
   .table-panel td:last-child {
     border-bottom: none;
   }
 
   .table-panel td:before {
     position: absolute;
     top: 1rem;
     left: 1rem;
     width: calc(45% - 1.5rem);
     padding-right: 0.5rem;
     white-space: normal;
     content: attr(data-label);
     font-weight: 700;
     color: var(--muted);
   }
 
   .table-panel td img.preview {
     max-width: 72px;
     border-radius: 14px;
     display: block;
     margin-bottom: 0.75rem;
   }
 
   .table-panel td[data-label="Actions"] {
     padding-left: 1rem;
   }
 
   .table-panel td[data-label="Actions"]:before {
     display: none;
   }
 
   .table-panel td[data-label="Actions"] .btn-group {
     width: 100%;
     gap: 0.75rem;
     flex-wrap: wrap;
   }
 
   .table-panel td[data-label="Status"] .status-pill {
     width: min-content;
   }
 }
 
 .dark-input,
 .form-final,
 .editor-content,
 .editor-toolbar,
 #emailList {
 width: 100%;
 }

 .dark-input {
 background-color: #f8fbff !important;
 color: var(--text) !important;
 border-color: #dfe7f4 !important;
 }

 .dark-input::placeholder {
 color: #94a3b8 !important;
 }

 .editor-container {
 border: 1px solid #dfe7f4;
 border-radius: 16px;
 background: #fff;
 }

 .editor-toolbar {
 background: #f8fbff;
 border-bottom: 1px solid #e2e8f0;
 padding: 0.75rem;
 display: flex;
 flex-wrap: wrap;
 gap: 0.5rem;
 }

 .editor-toolbar button {
 background: #fff;
 color: var(--text);
 border: 1px solid #dfe7f4;
 border-radius: 12px;
 padding: 0.45rem 0.75rem;
 }

 .editor-toolbar button:hover {
 background: #eef4ff;
 }

 .editor-content {
 min-height: 220px;
 padding: 1rem;
 color: var(--text);
 background: #f8fbff;
 }

 .email-item {
 background: #f8fbff;
 padding: 0.75rem 0.85rem;
 border-radius: 14px;
 margin-bottom: 0.65rem;
 }

 .email-item span {
 display: inline-block;
 font-size: 0.95rem;
 color: var(--text);
 }

 .form-check-inline {
 display: inline-flex !important;
 align-items: center;
 gap: 0.5rem;
 }

 .modal-content {
 border-radius: 22px;
 border: 1px solid #e2e8f0;
 overflow: hidden;
 }

 .modal-header,
 .modal-footer {
 border: none;
 }

 .status-pill.success {
 color: var(--success);
 background: rgba(22, 163, 74, 0.12);
 }

 .status-pill.warning {
 color: #d97706;
 background: rgba(245, 158, 11, 0.12);
 }

 .status-pill.danger {
 color: var(--danger);
 background: rgba(239, 68, 68, 0.12);
 }

 .alert {
 border-radius: 18px;
 padding: 1rem 1.15rem;
 border: 1px solid transparent;
 }

 .alert-success {
 background: rgba(16, 163, 127, 0.12);
 color: #115e59;
 border-color: rgba(16, 163, 127, 0.2);
 }

 .alert-danger {
 background: rgba(239, 68, 68, 0.12);
 color: #991b1b;
 border-color: rgba(239, 68, 68, 0.2);
 }

 .alert-info {
 background: rgba(39, 92, 255, 0.1);
 color: #1d4ed8;
 border-color: rgba(39, 92, 255, 0.2);
 }

 .table-panel table th:first-child,
 .table-panel table td:first-child {
 padding-left: 1.4rem;
 }

 .table-panel table th:last-child,
 .table-panel table td:last-child {
 padding-right: 1.4rem;
 }

 @media (max-width: 991px) {
 .admin-shell {
   flex-direction: column;
 }

 .admin-sidebar {
   position: fixed;
   left: 0;
   top: 0;
   bottom: 0;
   width: 84%;
   max-width: 320px;
   z-index: 30;
   transform: translateX(-100%);
   background: #0f172a;
   box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
 }

 .admin-sidebar.mobile-open {
   transform: translateX(0);
 }

 .sidebar-overlay {
   display: block;
 }

 .mobile-menu-toggle {
   display: inline-flex;
 }

 .admin-header {
   padding: 1rem 1rem;
 }

 .header-right {
   justify-content: flex-end;
   width: 100%;
 }

 .search-field {
   min-width: 100%;
   max-width: none;
 }

 .admin-main {
   padding-top: 0.5rem;
 }
 }

 @media (max-width: 640px) {
 .header-title {
   font-size: 1.35rem;
 }

 .header-breadcrumb {
   font-size: 0.75rem;
 }

 .admin-header {
   gap: 0.75rem;
 }

 .search-field {
   max-width: 100%;
 }

 .btn,
 .btn-primary,
 .btn-secondary,
 .btn-tertiary {
   width: 100%;
 }
 }

 /* Override old dark-theme and glass-card styles */
 .dark-theme {
 background: var(--bg) !important;
 color: var(--text) !important;
 }

 .dark-theme .form-control,
 .dark-theme .form-select,
 .dark-theme textarea {
 background: #f8fbff !important;
 color: var(--text) !important;
 border-color: #dfe7f4 !important;
 }

 .dark-theme .table,
 .dark-theme .table-dark,
 .dark-theme table {
 background: #fff !important;
 color: var(--text) !important;
 }

 .dark-theme .table-dark thead th,
 .dark-theme .table thead th {
 background: #f8fbff !important;
 border-color: #edf2f7 !important;
 }

 .dark-theme .table tbody tr:hover {
 background: #f7fbff !important;
 }

 /* Login / auth page */
 .auth-page {
 min-height: 100vh;
 display: grid;
 place-items: center;
 padding: 2rem;
 background: linear-gradient(180deg, #eef4ff 0%, #fdfdff 100%);
 }

 .auth-panel {
 width: min(100%, 420px);
 background: #fff;
 border-radius: 28px;
 border: 1px solid #dfe7f4;
 box-shadow: 0 35px 80px rgba(15, 23, 42, 0.1);
 padding: 2.2rem;
 }

 .auth-brand {
 display: flex;
 align-items: center;
 gap: 0.9rem;
 margin-bottom: 1.6rem;
 }

 .auth-brand .brand-mark {
 width: 48px;
 height: 48px;
 border-radius: 16px;
 font-size: 1.05rem;
 }

 .auth-title {
 margin: 0;
 font-size: 1.8rem;
 font-weight: 800;
 }

 .auth-subtitle {
 margin: 0.55rem 0 0;
 color: var(--muted);
 line-height: 1.6;
 }

 .auth-form {
 margin-top: 1.5rem;
 display: grid;
 gap: 1rem;
 }

 .auth-form .field-group label {
 color: var(--muted-strong);
 }

 .auth-form .form-control {
 border-radius: 18px;
 }

 .form-note {
 font-size: 0.92rem;
 color: var(--muted);
 margin-top: 1rem;
 }

 .btn-loading {
 opacity: 0.8;
 }

 /* Shared admin design system */
 body {
 color: var(--text-primary);
 }

 a {
 color: inherit;
 }

 a:hover,
 a:focus-visible {
 color: var(--primary);
 text-decoration: none;
 }

 .admin-shell {
 background: linear-gradient(180deg, #f8fbff 0%, var(--background) 100%);
 }

 .admin-sidebar {
 background: linear-gradient(180deg, #09111f 0%, #14213d 100%);
 border-right: 1px solid rgba(255, 255, 255, 0.08);
 box-shadow: 24px 0 70px rgba(9, 17, 31, 0.18);
 }

 .admin-brand {
 padding: 0.2rem 0.2rem 0.6rem;
 }

 .brand-mark {
 background: linear-gradient(135deg, var(--primary) 0%, #18b7ff 100%);
 box-shadow: 0 16px 34px rgba(39, 92, 255, 0.22);
 }

 .admin-nav {
 padding-right: 0.3rem;
 }

 .nav-link {
 color: rgba(255, 255, 255, 0.84);
 padding: 0.9rem 1rem;
 border: 1px solid transparent;
 }

 .nav-link:hover,
 .nav-link:focus-visible,
 .nav-link.active {
 background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
 color: #fff;
 border-color: rgba(255,255,255,0.08);
 box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
 }

 .nav-link-icon {
 color: rgba(255, 255, 255, 0.9);
 }

 .sidebar-footer {
 border-top-color: rgba(255,255,255,0.12);
 }

 .admin-header {
 background: rgba(255,255,255,0.96);
 backdrop-filter: blur(16px);
 box-shadow: 0 16px 45px rgba(15, 23, 42, 0.06);
 border-bottom: 1px solid rgba(226,232,240,0.75);
 }

 .header-title {
 font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.65rem);
 letter-spacing: -0.02em;
 }

 .header-breadcrumb {
 color: var(--text-muted);
 letter-spacing: 0.16em;
 }

 .content {
 max-width: 1600px;
 width: 100%;
 margin: 0 auto;
 padding: 1.25rem 1.5rem 2rem;
 }

 .main-panel {
 display: grid;
 gap: 1.2rem;
 width: 100%;
 max-width: 100%;
 }

 .card-panel,
 .form-panel,
 .table-panel,
 .stat-card,
 .glass-card {
 background: rgba(255,255,255,0.96);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 box-shadow: var(--shadow);
 }

 .card-panel,
 .form-panel,
 .table-panel {
 padding: 1.25rem;
 }

 .section-title {
 font-size: 1rem;
 letter-spacing: -0.01em;
 }

 .section-description {
 color: var(--text-muted);
 line-height: 1.6;
 }

 .page-section {
 background: var(--surface);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 box-shadow: var(--shadow);
 padding: 1.5rem;
 }

 .page-section + .page-section {
 margin-top: 1.25rem;
 }

 .section-toolbar {
 display: flex;
 justify-content: space-between;
 align-items: center;
 gap: 1rem;
 flex-wrap: wrap;
 margin-bottom: 1.3rem;
 }

 .section-toolbar .section-actions {
 display: flex;
 gap: 0.75rem;
 flex-wrap: wrap;
 }

 .form-help {
 font-size: 0.9rem;
 color: var(--text-muted);
 margin-top: 0.35rem;
 }

 .field-row {
 display: grid;
 gap: 1rem;
 }

 .field-row.row-cols-1 > * {
 min-width: 0;
 }

 .stat-card {
 background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.98) 100%);
 padding: 1.2rem;
 min-height: 150px;
 display: flex;
 flex-direction: column;
 justify-content: center;
 }

 .stat-card .value {
 color: var(--text-primary);
 }

 .search-field input {
 border-radius: 999px;
 border: 1px solid rgba(226,232,240,0.95);
 background: var(--surface-muted);
 box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
 padding: 0.88rem 3rem 0.88rem 3rem;
 }

 .search-field input:focus {
 border-color: var(--primary);
 box-shadow: 0 0 0 4px rgba(39, 92, 255, 0.12);
 }

 .search-clear {
 color: var(--text-muted);
 }

 .icon-button,
 .profile-dropdown .dropdown-toggle,
 .btn-outline-secondary {
 min-height: 44px;
 border-radius: 999px;
 border: 1px solid rgba(226,232,240,0.95);
 color: var(--text-primary);
 background: var(--surface);
 box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
 }

 .icon-button:hover,
 .profile-dropdown .dropdown-toggle:hover,
 .btn-outline-secondary:hover,
 .icon-button:focus-visible,
 .profile-dropdown .dropdown-toggle:focus-visible,
 .btn-outline-secondary:focus-visible {
 background: var(--primary-light);
 color: var(--primary);
 border-color: rgba(39, 92, 255, 0.18);
 box-shadow: 0 10px 22px rgba(39, 92, 255, 0.12);
 }

 .btn,
 .btn-primary,
 .btn-secondary,
 .btn-danger,
 .btn-success,
 .btn-warning,
 .btn-info,
 .btn-tertiary,
 .btn-outline-secondary,
 .btn-outline-light {
 min-height: 44px;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 0.55rem;
 padding: 0.8rem 1.1rem;
 border-radius: 999px;
 font-weight: 700;
 border: 1px solid transparent;
 transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
 }

 .btn:hover,
 .btn:focus-visible,
 .btn-primary:hover,
 .btn-primary:focus-visible,
 .btn-secondary:hover,
 .btn-secondary:focus-visible,
 .btn-danger:hover,
 .btn-danger:focus-visible,
 .btn-success:hover,
 .btn-success:focus-visible,
 .btn-warning:hover,
 .btn-warning:focus-visible,
 .btn-info:hover,
 .btn-info:focus-visible,
 .btn-tertiary:hover,
 .btn-tertiary:focus-visible,
 .btn-outline-secondary:hover,
 .btn-outline-secondary:focus-visible,
 .btn-outline-light:hover,
 .btn-outline-light:focus-visible {
 transform: translateY(-1px);
 box-shadow: 0 10px 22px rgba(39, 92, 255, 0.12);
 }

 .btn-primary,
 .btn-success {
 background: linear-gradient(135deg, var(--primary) 0%, #0ea5e9 100%);
 color: #fff;
 border-color: transparent;
 }

 .btn-primary:hover,
 .btn-primary:focus-visible,
 .btn-success:hover,
 .btn-success:focus-visible {
 background: linear-gradient(135deg, var(--primary-hover) 0%, #0284c7 100%);
 color: #fff;
 }

 .btn-secondary,
 .btn-outline-secondary,
 .btn-outline-light,
 .btn-tertiary {
 background: var(--surface);
 color: var(--text-primary);
 border-color: rgba(226,232,240,0.95);
 }

 .btn-secondary:hover,
 .btn-outline-secondary:hover,
 .btn-outline-light:hover,
 .btn-tertiary:hover {
 background: var(--primary-light);
 color: var(--primary);
 }

 .btn-danger {
 background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
 color: #fff;
 }

 .btn-warning {
 background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
 color: #fff;
 }

 .btn-info {
 background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
 color: #fff;
 }

 .form-control,
 .form-select,
 textarea {
 min-height: 46px;
 border-radius: 16px;
 border: 1px solid rgba(226,232,240,0.95);
 background: var(--surface-muted);
 color: var(--text-primary);
 box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
 }

 .form-control::placeholder,
 .form-select::placeholder,
 textarea::placeholder {
 color: var(--text-muted);
 }

 .form-control:focus,
 .form-select:focus,
 textarea:focus {
 border-color: var(--primary);
 box-shadow: 0 0 0 4px rgba(39, 92, 255, 0.12);
 }

 .field-group label,
 .form-label {
 color: var(--text-secondary);
 font-weight: 700;
 }

 .table-panel {
 border-radius: 22px;
 overflow: hidden;
 }

 .table,
 .table-panel table {
 background: transparent;
 border-collapse: separate;
 border-spacing: 0;
 }

 .table thead th,
 .table-panel thead th {
 background: var(--surface-muted);
 color: var(--text-secondary);
 font-weight: 700;
 text-transform: uppercase;
 letter-spacing: 0.08em;
 font-size: 0.78rem;
 }

 .table tbody tr,
 .table-panel tbody tr {
 transition: background 180ms ease, transform 180ms ease;
 }

 .table tbody tr:hover,
 .table-panel tbody tr:hover {
 background: rgba(39, 92, 255, 0.05);
 }

 .table td,
 .table th,
 .table-panel td,
 .table-panel th {
 vertical-align: middle;
 color: var(--text-primary);
 }

 .status-pill {
 border: 1px solid transparent;
 box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
 }

 .status-pill.success {
 color: #0f766e;
 background: rgba(22, 163, 74, 0.12);
 }

 .status-pill.warning {
 color: #b45309;
 background: rgba(245, 158, 11, 0.12);
 }

 .status-pill.danger {
 color: #b91c1c;
 background: rgba(239, 68, 68, 0.12);
 }

 .dropdown-menu {
 border-radius: 18px;
 border: 1px solid rgba(226,232,240,0.95);
 box-shadow: 0 24px 65px rgba(15, 23, 42, 0.14);
 overflow: hidden;
 }

 .dropdown-item {
 padding: 0.8rem 1rem;
 color: var(--text-primary);
 }

 .dropdown-item:hover,
 .dropdown-item:focus-visible {
 background: var(--primary-light);
 color: var(--primary);
 }

 .modal-content {
 border: 1px solid rgba(226,232,240,0.95);
 border-radius: 24px;
 box-shadow: 0 30px 90px rgba(15, 23, 42, 0.16);
 overflow: hidden;
 }

 .modal-header,
 .modal-footer {
 border-color: rgba(226,232,240,0.9);
 }

 .alert {
 border-radius: 18px;
 border: 1px solid transparent;
 box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
 }

 .alert-success {
 background: rgba(22, 163, 74, 0.12);
 color: #166534;
 border-color: rgba(22,163,74,0.16);
 }

 .alert-danger {
 background: rgba(239, 68, 68, 0.12);
 color: #b91c1c;
 border-color: rgba(239,68,68,0.16);
 }

 .alert-info {
 background: rgba(39, 92, 255, 0.1);
 color: #1d4ed8;
 border-color: rgba(39,92,255,0.16);
 }

 .auth-page {
 background: radial-gradient(circle at top left, rgba(39,92,255,0.16), transparent 32%), linear-gradient(180deg, #f8fbff 0%, var(--background) 100%);
 }

 .auth-panel {
 background: rgba(255,255,255,0.96);
 border: 1px solid rgba(226,232,240,0.95);
 box-shadow: 0 35px 80px rgba(15, 23, 42, 0.12);
 }

 .auth-form .field-group {
 gap: 0.65rem;
 }

 .auth-form .form-control {
 border-radius: 18px;
 }

 .badge {
 box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
 }

 .pagination .page-link {
 border-radius: 999px;
 min-width: 42px;
 height: 42px;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 margin: 0 0.2rem;
 border-color: rgba(226,232,240,0.95);
 color: var(--text-primary);
 }

 .pagination .page-item.active .page-link,
 .pagination .page-link:hover,
 .pagination .page-link:focus-visible {
 background: var(--primary);
 border-color: var(--primary);
 color: #fff;
 }

 @media (max-width: 1200px) {
 .content {
   padding: 1rem 1.15rem 1.5rem;
 }
 }

 @media (max-width: 991px) {
 .admin-shell {
   flex-direction: column;
 }

 .admin-sidebar {
   position: fixed;
   left: 0;
   top: 0;
   bottom: 0;
   width: min(84vw, 320px);
   z-index: 35;
   transform: translateX(-102%);
   box-shadow: 0 25px 85px rgba(9, 17, 31, 0.24);
 }

 .admin-sidebar.mobile-open {
   transform: translateX(0);
 }

 .sidebar-overlay {
   display: block;
 }

 .mobile-menu-toggle {
   display: inline-flex;
 }

 .admin-header {
   padding: 0.95rem 1rem;
 }

 .content {
   padding: 0.9rem 0.95rem 1.3rem;
 }

 .card-panel,
 .form-panel,
 .table-panel,
 .stat-card {
   padding: 1rem;
 }

 .search-field {
   min-width: 0;
   width: 100%;
   max-width: none;
 }
 }

 @media (max-width: 767px) {
 .admin-header {
   flex-wrap: wrap;
   align-items: flex-start;
 }

 .header-right {
   width: 100%;
   justify-content: flex-end;
   gap: 0.6rem;
   flex-wrap: wrap;
 }

 .search-field {
   order: 3;
   width: 100%;
 }

 .btn,
 .btn-primary,
 .btn-secondary,
 .btn-danger,
 .btn-warning,
 .btn-info,
 .btn-tertiary,
 .btn-outline-secondary,
 .btn-outline-light {
   width: 100%;
   justify-content: center;
 }

 .card-panel,
 .form-panel,
 .table-panel,
 .stat-card {
   border-radius: 18px;
 }
 }

 @media (max-width: 575px) {
 .content {
   padding: 0.75rem 0.8rem 1.1rem;
 }

 .card-panel,
 .form-panel,
 .table-panel,
 .stat-card {
   padding: 0.9rem;
 }

 .header-title {
   font-size: 1.2rem;
 }

 .header-breadcrumb {
   font-size: 0.72rem;
 }

 .auth-panel {
   padding: 1.25rem;
   border-radius: 20px;
 }
 }
