/* ============================================
   MERGE OPS — SHARED DESIGN SYSTEM
   Single source of truth for all CSS tokens
   and common patterns across ops pages.
   ============================================ */


/* ============================================
   1. DESIGN TOKENS (:root) — Light Theme
   Merge Gold/Navy Design System
   ============================================ */

:root {
  /* Brand Constants */
  --brand-gold: #FFC570;
  --brand-beige: #EFD2B0;
  --brand-blue: #547792;
  --brand-navy: #1A3263;

  /* Backgrounds */
  --bg-app: #F8F6F2;
  --bg-section: #F2ECE3;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FFFDF9;
  --bg-hover: #F6EFE5;
  --bg-selected: #EAF0F4;

  /* Text */
  --text-primary: #1A3263;
  --text-secondary: #547792;
  --text-muted: #7A8EA3;
  --text-inverse: #FFFFFF;

  /* Borders */
  --border-primary: #D9C7AE;
  --border-soft: #E8DED0;
  --border-strong: #B8A587;
  --focus-ring: #547792;

  /* Buttons */
  --btn-primary-bg: #1A3263;
  --btn-primary-text: #FFFFFF;
  --btn-primary-hover: #14284F;
  --btn-secondary-bg: #547792;
  --btn-secondary-text: #FFFFFF;
  --btn-secondary-hover: #46667F;
  --btn-accent-bg: #FFC570;
  --btn-accent-text: #1A3263;
  --btn-accent-hover: #F2B75E;

  /* Status */
  --color-success: #2F6B4F;
  --color-success-bg: #E8F3EC;
  --color-success-border: #B9D8C2;
  --color-error: #A04545;
  --color-error-bg: #FBE9E8;
  --color-error-border: #E5B6B1;
  --color-warning: #9A650E;
  --color-warning-bg: #FFF3DF;
  --color-warning-border: #F3D19A;
  --color-info: #3F617A;
  --color-info-bg: #EAF0F4;
  --color-info-border: #BDD0DC;

  /* Shadows */
  --shadow-card: 0px 0px 20px 0px rgba(26,50,99,0.10);
  --shadow-button: 2px 4px 8px 0px rgba(26,50,99,0.12);

  /* Typography */
  --font-primary: 'Lato', sans-serif;
  --font-secondary: 'Inter', sans-serif;

  /* Spacing */
  --spacing-xs: 5px;
  --spacing-sm: 10px;
  --spacing-md: 15px;
  --spacing-lg: 20px;
  --spacing-xl: 30px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 15px;
  --radius-2xl: 20px;

  /* Layout */
  --sidebar-width: 220px;
}


/* ============================================
   2. DARK MODE TOKENS
   ============================================ */

[data-theme="dark"] {
  --bg-app: #0F1B36;
  --bg-section: #14284F;
  --bg-surface: #1A3263;
  --bg-surface-elevated: #213D74;
  --bg-hover: #284878;
  --bg-selected: #35577A;

  --text-primary: #F8F4EC;
  --text-secondary: #D9C7AE;
  --text-muted: #A8B8C8;
  --text-inverse: #1A3263;

  --border-primary: #35577A;
  --border-soft: #284878;
  --border-strong: #547792;
  --focus-ring: #FFC570;

  --btn-primary-bg: #FFC570;
  --btn-primary-text: #1A3263;
  --btn-primary-hover: #F2B75E;
  --btn-secondary-bg: #547792;
  --btn-secondary-text: #FFFFFF;
  --btn-secondary-hover: #6287A4;
  --btn-accent-bg: #EFD2B0;
  --btn-accent-text: #1A3263;
  --btn-accent-hover: #D9C7AE;

  --color-success: #B8E3C4;
  --color-success-bg: #173B2B;
  --color-success-border: #2E6A4D;
  --color-error: #F2C0BC;
  --color-error-bg: #4A2222;
  --color-error-border: #A04545;
  --color-warning: #FFD99A;
  --color-warning-bg: #4D3715;
  --color-warning-border: #9A650E;
  --color-info: #C8DCE8;
  --color-info-bg: #203A52;
  --color-info-border: #547792;

  --shadow-card: 0px 0px 20px 0px rgba(0,0,0,0.4);
  --shadow-button: 2px 4px 8px 0px rgba(0,0,0,0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-app: #0F1B36;
    --bg-section: #14284F;
    --bg-surface: #1A3263;
    --bg-surface-elevated: #213D74;
    --bg-hover: #284878;
    --bg-selected: #35577A;

    --text-primary: #F8F4EC;
    --text-secondary: #D9C7AE;
    --text-muted: #A8B8C8;
    --text-inverse: #1A3263;

    --border-primary: #35577A;
    --border-soft: #284878;
    --border-strong: #547792;
    --focus-ring: #FFC570;

    --btn-primary-bg: #FFC570;
    --btn-primary-text: #1A3263;
    --btn-primary-hover: #F2B75E;
    --btn-secondary-bg: #547792;
    --btn-secondary-text: #FFFFFF;
    --btn-secondary-hover: #6287A4;
    --btn-accent-bg: #EFD2B0;
    --btn-accent-text: #1A3263;
    --btn-accent-hover: #D9C7AE;

    --color-success: #B8E3C4;
    --color-success-bg: #173B2B;
    --color-success-border: #2E6A4D;
    --color-error: #F2C0BC;
    --color-error-bg: #4A2222;
    --color-error-border: #A04545;
    --color-warning: #FFD99A;
    --color-warning-bg: #4D3715;
    --color-warning-border: #9A650E;
    --color-info: #C8DCE8;
    --color-info-bg: #203A52;
    --color-info-border: #547792;

    --shadow-card: 0px 0px 20px 0px rgba(0,0,0,0.4);
    --shadow-button: 2px 4px 8px 0px rgba(0,0,0,0.3);
  }
}


/* ============================================
   3. BASE RESET
   ============================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ============================================
   4. SKIP-TO-CONTENT (a11y)
   ============================================ */

#skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--brand-navy);
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
}

#skip-to-content:focus {
  position: fixed;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  overflow: visible;
}


/* ============================================
   5. COMMON BASE LAYOUT
   ============================================ */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--spacing-lg) var(--spacing-xl);
}

/* Legacy alias used in several pages */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--spacing-lg) var(--spacing-xl);
}


/* ============================================
   6. HEADER
   ============================================ */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

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

.header-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.header-icon-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-icon-btn:hover {
  box-shadow: var(--shadow-button);
  background: var(--bg-section);
}

a.header-icon-btn {
  text-decoration: none;
  color: var(--text-secondary);
}

.header-icon-btn svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

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

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-error);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Header search input */
.header-search {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 0 var(--spacing-sm);
  gap: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search:focus-within {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(26,50,99,0.1);
}

.header-search svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.header-search input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--text-primary);
  padding: 8px 0;
  width: 200px;
}

.header-search input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}


/* ============================================
   7. CARDS
   ============================================ */

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: var(--spacing-lg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0px 4px 24px 0px rgba(26,50,99,0.18);
}

.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.stat-card .stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card .stat-icon.blue   { background: rgba(26,50,99,0.15); }
.stat-card .stat-icon.green  { background: rgba(47,107,79,0.15); }
.stat-card .stat-icon.orange { background: rgba(255,197,112,0.15); }
.stat-card .stat-icon.purple { background: rgba(84,119,146,0.15); }

.stat-card .stat-icon svg {
  width: 24px;
  height: 24px;
}


/* ============================================
   8. BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

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

/* Primary */
.btn-primary {
  background: var(--brand-navy);
  color: var(--text-inverse);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 2px 6px 12px 0px rgba(26,50,99,0.25);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-section);
  border-color: var(--brand-navy);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--brand-navy);
  border: 1px solid var(--brand-navy);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(26,50,99,0.06);
}

/* Danger */
.btn-danger {
  background: var(--color-error);
  color: var(--text-inverse);
}

.btn-danger:hover:not(:disabled) {
  background: #E63B15;
  transform: translateY(-1px);
}

/* Icon-only */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
}

.btn-icon:hover:not(:disabled) {
  background: var(--bg-section);
  color: var(--brand-navy);
  border-color: var(--brand-navy);
}

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

.btn-lg {
  font-size: 16px;
  padding: 14px 28px;
  border-radius: var(--radius-xl);
}


/* ============================================
   9. STATUS BADGES
   ============================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pending {
  background: rgba(255,197,112,0.12);
  color: #B83A95;
}
.status-pending::before { background: #FFC570; }

.status-assigned {
  background: rgba(26,50,99,0.1);
  color: #1A3263;
}
.status-assigned::before { background: #1A3263; }

.status-active {
  background: rgba(47,107,79,0.1);
  color: #0EA060;
}
.status-active::before { background: #2F6B4F; }

.status-in_transit,
.status-in-transit {
  background: rgba(26,50,99,0.1);
  color: #1A3263;
}
.status-in_transit::before,
.status-in-transit::before { background: #1A3263; }

.status-delivered {
  background: rgba(47,107,79,0.1);
  color: #0EA060;
}
.status-delivered::before { background: #2F6B4F; }

.status-completed {
  background: rgba(47,107,79,0.1);
  color: #0EA060;
}
.status-completed::before { background: #2F6B4F; }

.status-cancelled {
  background: rgba(160,69,69,0.1);
  color: #D43516;
}
.status-cancelled::before { background: #A04545; }

.status-failed {
  background: rgba(160,69,69,0.1);
  color: #D43516;
}
.status-failed::before { background: #A04545; }

.status-ready {
  background: rgba(47,107,79,0.12);
  color: #0EA060;
}
.status-ready::before { background: #2F6B4F; }

.status-maintenance {
  background: rgba(84,119,146,0.12);
  color: #7B6BA0;
}
.status-maintenance::before { background: #547792; }


/* ============================================
   10. TOAST NOTIFICATIONS
   ============================================ */

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-container {
  position: fixed;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  animation: toast-slide-in 0.3s ease forwards;
}

.toast.removing {
  animation: toast-slide-out 0.3s ease forwards;
}

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

.toast-success {
  border-left: 4px solid var(--color-success);
}
.toast-success svg { color: var(--color-success); }

.toast-error {
  border-left: 4px solid var(--color-error);
}
.toast-error svg { color: var(--color-error); }

.toast-warning {
  border-left: 4px solid var(--color-warning);
}
.toast-warning svg { color: var(--color-warning); }

.toast-info {
  border-left: 4px solid var(--brand-navy);
}
.toast-info svg { color: var(--brand-navy); }


/* ============================================
   11. LOADING & SPINNERS
   ============================================ */

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

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

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-soft);
  border-top-color: var(--brand-navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 56px;
  height: 56px;
  border-width: 4px;
}

/* Skeleton screen placeholders */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-section) 25%, #E6E0F0 50%, var(--bg-section) 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 100px;
  border-radius: var(--radius-2xl);
}


/* ============================================
   12. EMPTY STATES
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px var(--spacing-lg);
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-section);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
}

.empty-state-icon svg {
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 340px;
  line-height: 1.5;
  margin-bottom: var(--spacing-lg);
}

.empty-state-action {
  margin-top: var(--spacing-sm);
}


/* ============================================
   13. DATA TABLES
   ============================================ */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table thead th {
  background: var(--bg-section);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 12px var(--spacing-md);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-soft);
}

.data-table tbody td {
  padding: 14px var(--spacing-md);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(26,50,99,0.03);
  box-shadow: inset 3px 0 0 var(--brand-navy);
}

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

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--spacing-lg) 0;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0 8px;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
}

.pagination-btn.active {
  background: var(--brand-navy);
  color: var(--text-inverse);
  border-color: var(--brand-navy);
}

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

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


/* ============================================
   14. MODALS / DIALOGS
   ============================================ */

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

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,27,54,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: var(--spacing-lg);
  animation: modal-backdrop-in 0.2s ease;
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-2xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modal-slide-up 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--border-soft);
}

.modal-header h2,
.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-section);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

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

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: 1px solid var(--border-soft);
}


/* ============================================
   15. FORMS
   ============================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--spacing-lg);
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.form-input,
.form-select {
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--text-primary);
  padding: 10px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(26,50,99,0.1);
}

.form-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%239B7DD4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-input.error,
.form-select.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(160,69,69,0.1);
}

.form-input.success,
.form-select.success {
  border-color: var(--color-success);
}

.form-error {
  font-size: 12px;
  color: var(--color-error);
  font-weight: 600;
}

.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Inline field row */
.form-row {
  display: flex;
  gap: var(--spacing-md);
}

.form-row .form-group {
  flex: 1;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle input:checked + .toggle-slider {
  background: var(--brand-navy);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle input:focus-visible + .toggle-slider {
  outline: 2px solid var(--brand-navy);
  outline-offset: 2px;
}


/* ============================================
   16. TOOLTIPS
   ============================================ */

.tooltip-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-section);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: var(--brand-navy);
  color: var(--text-inverse);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--radius-md);
  white-space: nowrap;
  max-width: 260px;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tooltip-icon::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--brand-navy);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 200;
}

.tooltip-icon:hover::after,
.tooltip-icon:hover::before,
.tooltip-icon:focus::after,
.tooltip-icon:focus::before {
  opacity: 1;
  visibility: visible;
}


/* ============================================
   17. PRINT STYLESHEET
   ============================================ */

@media print {
  .sidebar,
  .header-actions,
  .toast-container,
  .notification-wrapper,
  .btn,
  .modal-overlay {
    display: none !important;
  }

  body {
    display: block;
    background: white;
    color: black;
  }

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

  .card,
  .stat-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .data-table {
    font-size: 11px;
  }

  .data-table thead th {
    background: #eee;
  }

  .data-table tbody tr:hover {
    background: none;
    box-shadow: none;
  }
}


/* ============================================
   18. RESPONSIVE RULES
   ============================================ */

@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Sidebar collapses on mobile */
  .sidebar {
    display: none;
  }

  body.sidebar-open .sidebar {
    display: flex;
  }

  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    cursor: pointer;
  }

  .hamburger-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
  }

  .main-content,
  .main {
    margin-left: 0;
    width: 100%;
    padding: var(--spacing-md);
  }

  .header {
    flex-direction: row;
    gap: var(--spacing-sm);
  }

  .header-title {
    font-size: 18px;
  }

  .modal {
    max-width: 100%;
    margin: var(--spacing-sm);
    border-radius: var(--radius-xl);
  }

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

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

  .data-table {
    font-size: 13px;
  }
}

/* Hide hamburger on desktop */
@media (min-width: 769px) {
  .hamburger-btn {
    display: none;
  }
}


/* ============================================
   19. MICRO-INTERACTIONS
   ============================================ */

/* Table row hover accent */
.data-table tbody tr {
  cursor: default;
}

/* Card hover lift — already in .card:hover above */

/* Filter tab transitions */
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  color: var(--brand-navy);
  background: rgba(26,50,99,0.05);
}

.filter-tab.active {
  color: var(--brand-navy);
  background: rgba(26,50,99,0.08);
  border-color: var(--brand-navy);
}


/* ============================================
   20. UTILITY CLASSES
   ============================================ */

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

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.gap-xs  { gap: var(--spacing-xs); }
.gap-sm  { gap: var(--spacing-sm); }
.gap-md  { gap: var(--spacing-md); }
.gap-lg  { gap: var(--spacing-lg); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
