/* ═══════════════════════════════════════════════════════════════
   ServiceDesk Pro — Teal Theme
   ═══════════════════════════════════════════════════════════════ */

   :root {
    /* Primary palette */
    --primary: #0d9488;
    --primary-light: #14b8a6;
    --primary-dark: #0f766e;
    --primary-faint: #ccfbf1;
  
    /* Neutrals */
    --dark: #1e293b;
    --gray-700: #334155;
    --gray-500: #64748b;
    --gray-300: #cbd5e1;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
  
    /* Semantic */
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #2563eb;
    --info-light: #dbeafe;
  
    /* Surfaces */
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-active: #f0fdfa;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.03);
  }
  
  /* ── Base ──────────────────────────────────────────────────── */
  /* ═══════════════════════════════════════════════════════════════
   NAVBAR FIX — Dark navbar with white text, or light with dark text
   ═══════════════════════════════════════════════════════════════ */

/* Option A: Dark navbar (recommended — premium look) */
.navbar {
  background: linear-gradient(135deg, #1e293b, #0f172a) !important;
  border-bottom: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar-brand {
  color: #ffffff !important;
  font-weight: 700;
}

.navbar-brand i,
.navbar-brand .bi {
  color: #14b8a6 !important;  /* teal accent on icon */
}

.navbar-brand-logo {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.not-stock-item-section {
  background-color: #fffbeb;
  border: 1.5px dashed #f59e0b;
}

.not-stock-item-section .form-control,
.not-stock-item-section .form-select {
  border-color: #d4a017;
  background-color: #ffffff;
}

.navbar .nav-link {
  color: rgba(255,255,255,0.75) !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.navbar .nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(255,255,255,0.08);
}

.navbar .nav-link.active {
  color: #14b8a6 !important;
  background-color: rgba(20, 184, 166, 0.1);
}

/* User dropdown / profile area */
.navbar .dropdown-toggle,
.navbar .btn-outline-light,
.navbar .text-light {
  color: rgba(255,255,255,0.9) !important;
}

.navbar .dropdown-menu {
  background-color: #1e293b;
  border: 1px solid #334155;
}

.navbar .dropdown-item {
  color: rgba(255,255,255,0.8);
}

.navbar .dropdown-item:hover {
  background-color: rgba(20, 184, 166, 0.15);
  color: #14b8a6;
}

.navbar .dropdown-divider {
  border-color: #334155;
}

/* Hamburger menu icon */
.navbar-toggler {
  border-color: rgba(255,255,255,0.3);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Admin badge */
.navbar .badge.bg-secondary {
  background: linear-gradient(135deg, #14b8a6, #0d9488) !important;
  color: white !important;
  font-weight: 600;
  border: none;
}

/* ── Option B: Light navbar (if you prefer) ─────────────────
   Comment out everything above and uncomment below:

.navbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar-brand {
  color: #0d9488 !important;
}

.navbar .nav-link {
  color: #475569 !important;
}

.navbar .nav-link:hover {
  color: #0d9488 !important;
  background-color: #f0fdfa;
}

.navbar .nav-link.active {
  color: #0d9488 !important;
}
*/


  body {
    background-color: var(--body-bg);
    font-size: 0.9rem;
    color: var(--dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  
  /* ── Typography ────────────────────────────────────────────── */
  
  h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    letter-spacing: -0.01em;
  }
  
  .text-muted {
    color: var(--gray-500) !important;
  }
  
  /* ── Navbar ────────────────────────────────────────────────── */
  
  .navbar {
    background-color: var(--card-bg) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  
  .navbar-brand {
    font-weight: 700;
    color: var(--primary) !important;
    letter-spacing: -0.02em;
  }
  
  .navbar-brand i {
    color: var(--primary);
  }
  
  /* ── Sidebar ───────────────────────────────────────────────── */
  
  .sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    min-height: calc(100vh - 56px);
  }
  
  .sidebar .nav-link {
    color: var(--gray-700);
    border-radius: 8px;
    margin: 2px 8px;
    padding: 0.6rem 1rem;
    font-weight: 500;
    transition: all 0.15s ease;
  }
  
  .sidebar .nav-link:hover {
    background-color: var(--gray-100);
    color: var(--dark);
  }
  
  .sidebar .nav-link.active {
    background-color: var(--sidebar-active) !important;
    color: var(--primary) !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
  }
  
  .sidebar .nav-link i {
    width: 22px;
    text-align: center;
    margin-right: 0.5rem;
    font-size: 1.05rem;
  }
  
  /* ── Cards ─────────────────────────────────────────────────── */
  
  .card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
  }
  
  .card:hover {
    box-shadow: var(--shadow-lg);
  }
  
  .card-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
  }
  
  /* Stat cards */
  .stat-card {
    position: relative;
    overflow: hidden;
  }
  
  .stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
  }
  
  .stat-card .fs-3 {
    background: linear-gradient(135deg, var(--dark), var(--gray-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  /* ── Buttons ───────────────────────────────────────────────── */
  
  .btn {
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.15s ease;
  }
  
  .btn:active {
    transform: scale(0.97);
  }
  
  .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.2);
  }
  
  .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #115e59);
    box-shadow: 0 4px 8px rgba(13, 148, 136, 0.3);
    transform: translateY(-1px);
  }
  
  .btn-success {
    background: linear-gradient(135deg, var(--success), #047857);
    border: none;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
  }
  
  .btn-success:hover {
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
    transform: translateY(-1px);
  }
  
  .btn-dark {
    background: linear-gradient(135deg, var(--dark), #334155);
    border: none;
  }
  
  .btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
  }
  
  .btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
  }
  
  /* ── Tables ────────────────────────────────────────────────── */
  
  .table {
    --bs-table-bg: transparent;
  }
  
  .table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    padding: 0.85rem 0.75rem;
    background-color: var(--gray-50);
  }
  
  .table tbody td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }
  
  .table tbody tr:hover {
    background-color: var(--gray-50);
  }
  
  /* ── Badges ────────────────────────────────────────────────── */
  
  .badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.4em 0.75em;
    border-radius: 6px;
    letter-spacing: 0.02em;
  }
  
  .badge.bg-primary   { background: linear-gradient(135deg, #3b82f6, #2563eb) !important; }
  .badge.bg-success   { background: linear-gradient(135deg, #10b981, var(--success)) !important; }
  .badge.bg-warning   { background: linear-gradient(135deg, #fbbf24, var(--warning)) !important; color: #78350f !important; }
  .badge.bg-danger    { background: linear-gradient(135deg, #ef4444, var(--danger)) !important; }
  .badge.bg-secondary { background: linear-gradient(135deg, #94a3b8, #64748b) !important; }
  .badge.bg-dark      { background: linear-gradient(135deg, var(--gray-700), var(--dark)) !important; }
  
  /* Status-specific badges */
  .status-new         { background: linear-gradient(135deg, #94a3b8, #64748b) !important; }
  .status-assigned    { background: linear-gradient(135deg, #3b82f6, #2563eb) !important; }
  .status-in_progress { background: linear-gradient(135deg, #06b6d4, #0891b2) !important; color: white !important; }
  .status-awaiting    { background: linear-gradient(135deg, #fbbf24, #d97706) !important; color: #78350f !important; }
  .status-done        { background: linear-gradient(135deg, #34d399, var(--success)) !important; }
  .status-paid        { background: linear-gradient(135deg, var(--dark), #0f172a) !important; }
  
  /* ── Forms ─────────────────────────────────────────────────── */
  
  .form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #94a3b8;
    font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .form-control::placeholder {
    color: #94a3b8;
  }

  .form-control:hover, .form-select:hover {
    border-color: #64748b;
  }

  .form-control:disabled, .form-select:disabled,
  .form-control[readonly] {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
  }

  .input-group-text {
    border: 1.5px solid #94a3b8;
    color: #475569;
    font-weight: 500;
  }

  .form-check-input {
    border: 1.5px solid #94a3b8;
  }

  /* Bootstrap's textarea/select share .form-control/.form-select above,
     but table-embedded and modal inputs sometimes rely on the raw
     bootstrap variable directly — cover that too so nothing slips through. */
  textarea.form-control, select.form-select {
    border-width: 1.5px;
  }

  .form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
  }

  /* ── POS-Style Active Field Highlight ─────────────────────────
     Makes it obvious — to the staff member AND anyone watching the
     screen — exactly which field is currently being filled in.
     Highlights the control itself, its whole field block, and its
     label, the moment it receives focus. No JS required.
  ──────────────────────────────────────────────────────────────── */

  .form-control:focus,
  .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.22), 0 2px 6px rgba(13, 148, 136, 0.15);
  }

  .form-control.is-invalid:focus,
  .form-select.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2), 0 2px 6px rgba(220, 38, 38, 0.15);
  }

  .form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.22);
  }

  /* The currency/unit prefix lights up together with its input. Light
     tint + dark bold text (not solid teal + white) — dark-on-light
     reliably clears contrast requirements regardless of exact shade,
     where white-on-mid-teal was borderline at small sizes and blended
     into the enclosing highlighted column, which uses this same light
     tint (see "Highlight the entire field block" below). */
  .input-group:has(.form-control:focus) .input-group-text {
    background-color: var(--primary-faint);
    border-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 700;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  /* Highlight the entire field block (label + control) the person is
     currently on — a left accent bar + soft tint, like a POS terminal */
  form .mb-1:not(.row),
  form .mb-2:not(.row),
  form .mb-3:not(.row),
  form .mb-4:not(.row),
  form [class*="col-"] {
    border-radius: 8px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, padding-left 0.15s ease, margin-left 0.15s ease;
  }

  form .mb-1:not(.row):has(:focus),
  form .mb-2:not(.row):has(:focus),
  form .mb-3:not(.row):has(:focus),
  form .mb-4:not(.row):has(:focus),
  form [class*="col-"]:has(:focus) {
    background-color: var(--primary-faint);
    box-shadow: inset 3px 0 0 var(--primary);
    padding-left: 0.6rem;
    margin-left: -0.6rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  form .mb-1:not(.row):has(.is-invalid:focus),
  form .mb-2:not(.row):has(.is-invalid:focus),
  form .mb-3:not(.row):has(.is-invalid:focus),
  form .mb-4:not(.row):has(.is-invalid:focus),
  form [class*="col-"]:has(.is-invalid:focus) {
    background-color: var(--danger-light);
    box-shadow: inset 3px 0 0 var(--danger);
  }

  form .mb-1:not(.row):has(:focus) > .form-label,
  form .mb-2:not(.row):has(:focus) > .form-label,
  form .mb-3:not(.row):has(:focus) > .form-label,
  form .mb-4:not(.row):has(:focus) > .form-label,
  form [class*="col-"]:has(:focus) > .form-label {
    color: var(--primary-dark);
    font-weight: 700;
  }

  form [class*="col-"]:has(.is-invalid:focus) > .form-label {
    color: var(--danger);
  }

  /* Fallback for older browsers without :has() support */
  @supports not selector(:has(*)) {
    form .mb-1:not(.row):focus-within,
    form .mb-2:not(.row):focus-within,
    form .mb-3:not(.row):focus-within,
    form .mb-4:not(.row):focus-within,
    form [class*="col-"]:focus-within {
      background-color: var(--primary-faint);
      box-shadow: inset 3px 0 0 var(--primary);
      padding-left: 0.6rem;
      margin-left: -0.6rem;
      padding-top: 0.35rem;
      padding-bottom: 0.35rem;
    }

    form .mb-1:not(.row):focus-within > .form-label,
    form .mb-2:not(.row):focus-within > .form-label,
    form .mb-3:not(.row):focus-within > .form-label,
    form .mb-4:not(.row):focus-within > .form-label,
    form [class*="col-"]:focus-within > .form-label {
      color: var(--primary-dark);
      font-weight: 700;
    }
  }

  /* Teal, on-theme selection for search dropdowns (e.g. customer/product picker) */
  .list-group-item-action.active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
  }


  .input-group-text {
    background-color: var(--gray-50);
    border-color: #94a3b8;
    border-width: 1.5px;
    color: #475569;
    font-weight: 500;
  }
  
  /* ── Alerts & Notifications ────────────────────────────────── */
  
  .alert {
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
  }
  
  .alert-success { background-color: var(--success-light); color: #065f46; }
  .alert-danger  { background-color: var(--danger-light); color: #991b1b; }
  .alert-warning { background-color: var(--warning-light); color: #92400e; }
  .alert-info    { background-color: var(--info-light); color: #1e40af; }
  
  /* ── Dropdowns / Lists ─────────────────────────────────────── */
  
  .list-group-item {
    border-color: var(--border);
    transition: background-color 0.1s;
  }
  
  .list-group-item-action:hover {
    background-color: var(--sidebar-active);
  }
  
  .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
  }
  
  .dropdown-item {
    font-size: 0.88rem;
    padding: 0.5rem 1rem;
  }
  
  .dropdown-item:hover {
    background-color: var(--sidebar-active);
    color: var(--primary);
  }
  
  /* ── Modals ────────────────────────────────────────────────── */
  
  .modal-content {
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
  }
  
  .modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.25rem;
  }
  
  .modal-footer {
    border-top: 1px solid var(--border);
  }

  /* Fit the screen: the dialog never grows past the viewport; the header and
     footer stay put and only the body scrolls. These modals wrap body+footer
     in a <form>, which Bootstrap's scrollable layout doesn't expect, so the
     form is made part of the flex column here. */
  .modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }
  .modal-dialog-scrollable .modal-content > form > .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .modal-dialog-scrollable .modal-content > form > .modal-footer {
    flex-shrink: 0;
  }
  @media (max-width: 575.98px) {
    .modal-dialog { margin: 0.5rem; max-width: calc(100vw - 1rem); }
    .modal-content { min-width: 0; }
    .modal-dialog-scrollable { height: calc(100% - 1rem); }
  }
  
  /* ── Pagination ────────────────────────────────────────────── */
  
  .pagination .page-link {
    border-color: var(--border);
    color: var(--gray-700);
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }
  
  .pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
  }
  
  /* ── Receipt / Print ───────────────────────────────────────── */
  
  #receipt {
    border: 1px dashed var(--gray-300);
  }

  /* .receipt-wrap controls on-screen preview width & centering — deliberately
     NOT a Bootstrap grid column (col-md-6 etc), because those stay locked to
     a fraction of the page width even when printing, which is what made A4
     receipts print out tiny and off-center. The card itself only controls
     font size for the thermal-width presets. */
  .receipt-wrap {
    margin: 0 auto;
  }
  .receipt-wrap.receipt-58mm { max-width: 320px; }
  .receipt-wrap.receipt-80mm { max-width: 380px; }
  .receipt-wrap.receipt-a5   { max-width: 480px; }
  .receipt-wrap.receipt-a4   { max-width: 650px; }

  #receipt.receipt-58mm { font-size: 0.68rem; }
  #receipt.receipt-80mm { font-size: 0.78rem; }
  #receipt.receipt-a5   { font-size: 0.85rem; }

  @media print {
    .receipt-wrap {
      max-width: none !important;
      width: 100% !important;
      margin: 0 !important;
    }
    #receipt .card-body {
      padding: 0.35rem !important;
    }
  }
  
  @media print {
    .no-print, .navbar, .sidebar, .btn, .alert, .bottom-nav, .offcanvas { 
      display: none !important; 
    }
    .card { 
      box-shadow: none !important; 
      border: 1px solid var(--border) !important; 
    }
    body { 
      background: white !important; 
    }
    main.container-fluid {
      padding: 0 !important;
      margin: 0 !important;
    }
    main.has-bottom-nav {
      padding-bottom: 0 !important;
    }
    .print-only {
      display: block !important;
      border-bottom: 2px solid var(--gray-800, #212529);
      padding-bottom: 0.75rem;
    }
    table {
      font-size: 0.85rem;
    }
    a {
      color: inherit !important;
      text-decoration: none !important;
    }
  }

  /* Hidden on screen; only shown by the @media print rule above, so
     printed reports carry a proper letterhead even though the on-screen
     header (back button, print button, filters) is hidden via .no-print. */
  .print-only {
    display: none;
  }
  
  /* ── Touch Mode ────────────────────────────────────────────── */
  
  .touch-mode .btn {
    min-height: 48px;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
  
  .touch-mode .btn-sm {
    min-height: 42px;
    padding: 0.45rem 0.9rem;
    font-size: 0.92rem;
  }
  
  .touch-mode .form-control,
  .touch-mode .form-select {
    min-height: 52px;
    font-size: 1.05rem;
  }
  
  .touch-mode .form-control-sm,
  .touch-mode .form-select-sm {
    min-height: 46px;
    font-size: 1rem;
  }
  
  .touch-mode table td,
  .touch-mode table th {
    padding: 1rem 0.85rem;
  }
  
  .touch-mode .nav-link {
    padding: 0.75rem 1.1rem;
  }
  
  .touch-mode .list-group-item {
    padding: 1rem 1.1rem;
  }
  
  .touch-mode .modal-footer .btn {
    min-width: 110px;
  }
  
  /* ── Animations ────────────────────────────────────────────── */
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  
  .card {
    animation: fadeIn 0.3s ease-out;
  }
  
  /* ── Scrollbar ─────────────────────────────────────────────── */
  
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
  }

  /* ── Dashboard: hero + tile launcher ──────────────────────────
     Full-bleed background image (set in Settings → Branding) with
     clickable glass-style tiles floating on top, similar to a
     clinical/POS "app launcher" home screen.
  ──────────────────────────────────────────────────────────────── */

  .dashboard-hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    padding: 2rem 1.75rem 2.25rem;
    margin: -0.25rem 0 1.5rem;
    background-color: var(--dark);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-lg);
  }

  .dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.88) 0%, rgba(15, 23, 42, 0.72) 45%, rgba(15, 23, 42, 0.55) 100%);
  }

  .dashboard-hero.no-bg {
    background: linear-gradient(135deg, var(--dark), var(--primary-dark));
  }

  .dashboard-hero.no-bg::before {
    background: none;
  }

  .dashboard-hero > * {
    position: relative;
    z-index: 1;
  }

  .dashboard-hero-heading {
    color: #fff;
  }

  .dashboard-hero-heading .text-sub {
    color: rgba(255, 255, 255, 0.75);
  }

  /* Compact stat pills sitting on the hero image */
  .hero-stat-pill {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    color: #fff;
    min-width: 108px;
  }

  .hero-stat-pill .val {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
  }

  .hero-stat-pill .lbl {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  /* Tile grid */
  .tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
    gap: 0.9rem;
    margin-top: 1.5rem;
  }

  .dashboard-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    padding: 1.15rem 0.6rem;
    aspect-ratio: 1 / 1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  }

  .dashboard-tile:hover,
  .dashboard-tile:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
    background: #ffffff;
    color: var(--primary-dark);
  }

  .dashboard-tile .tile-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-faint), #ffffff);
    color: var(--primary);
    font-size: 1.4rem;
  }

  .dashboard-tile .tile-label {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
  }

  .dashboard-tile .tile-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15em 0.45em;
    border-radius: 20px;
  }

  .touch-mode .dashboard-tile {
    aspect-ratio: auto;
    min-height: 128px;
  }

  /* Section labels above each tile group on the dashboard */
  .tile-section + .tile-section {
    margin-top: 1.75rem;
  }

  .tile-section-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.75rem;
  }

  .tile-section-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
  }

  /* Back office tiles get a visually distinct, bundled sub-panel so it
     reads as "the admin drawer" rather than blending into daily-use tiles */
  .back-office-panel {
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 1rem 1rem 1.1rem;
  }

  .back-office-panel .tile-section-label {
    margin-bottom: 0.9rem;
  }

  .back-office-panel .dashboard-tile {
    background: rgba(255, 255, 255, 0.85);
  }

  .back-office-panel .dashboard-tile:hover {
    background: #ffffff;
  }
  
/* ── Help icons (ⓘ) ──────────────────────────────────────────────
   Field-level hints are hidden by default and only shown when the
   icon is clicked (via Bootstrap popover, trigger:"focus"), so the
   form stays clean for people who don't need the extra explanation. */
.help-icon {
  cursor: pointer;
  font-size: 0.85rem;
  vertical-align: middle;
}
.help-icon:hover {
  color: #0d6efd !important;
}

/* ═══════════════════════════════════════════════════════════════
   PWA / Mobile App-Like Layout
   ═══════════════════════════════════════════════════════════════ */

/* Respect the notch/home-indicator area on iOS when installed standalone */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Bottom tab bar — only rendered on small screens (d-md-none in markup) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.5rem 0.25rem 0.4rem;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item .badge {
  position: absolute;
  top: 2px;
  right: 18%;
  font-size: 0.55rem;
  padding: 0.2em 0.4em;
}

/* Leave room above the bottom nav so content/floating buttons don't hide behind it */
main.has-bottom-nav {
  padding-bottom: 5rem !important;
}

@media (min-width: 768px) {
  main.has-bottom-nav {
    padding-bottom: 1rem !important;
  }
}

/* Notification dropdown items */
.notif-item {
  transition: background-color 0.15s ease;
}
.notif-item:hover {
  background-color: var(--gray-50);
}
.notif-item.notif-unread {
  background-color: var(--primary-faint);
}
.notif-item.notif-unread:hover {
  background-color: #b6f3ea;
}

/* ── Standalone (installed) mode tweaks ──────────────────────────
   Applied automatically by pwa.js adding .pwa-standalone to <html>
   when running installed rather than in a normal browser tab. */
html.pwa-standalone .navbar {
  padding-top: max(0.5rem, env(safe-area-inset-top));
}

/* Bigger, thumb-friendly touch targets on phones generally, not just
   in the existing "touch-mode" power-user setting */
@media (max-width: 767.98px) {
  .btn {
    min-height: 38px;
  }
  .form-control,
  .form-select {
    min-height: 44px;
  }
  .table td, .table th {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
  .card {
    border-radius: 12px;
  }
  .navbar-brand-logo {
    height: 28px;
  }
}

/* Collapsible settings sections (Settings page) — rotate the chevron to
   show open/closed state instead of everything being expanded at once. */
[data-bs-toggle="collapse"] .bi-chevron-down {
  transition: transform 0.2s ease;
}
[data-bs-toggle="collapse"]:not(.collapsed) .bi-chevron-down {
  transform: rotate(180deg);
}

/* Guidance/explanatory text hidden system-wide — form field hints, (i)
   tooltip icons, and anything explicitly marked as a helper note. Kept
   as one global rule rather than removing each instance from every
   template, so it's a single line to reverse if that's ever wanted
   later, instead of hunting the markup back down across dozens of files. */
.form-text,
.help-icon,
.helper-text {
  display: none !important;
}
