    :root {
      --bg-base: #f1f5f9;
      --bg-surface: #ffffff;
      --bg-surface-light: #f8fafc;
      --primary: #0a444a;
      --success: #10b981;
      --danger: #ef4444;
      --warning: #f59e0b;
      --text-main: #1e293b;
      --text-muted: #64748b;
      --border: #e2e8f0;
      --radius-sm: 6px;
      --radius-md: 8px;
      --radius-lg: 12px;
      --space-xs: 4px;
      --space-sm: 8px;
      --space-md: 16px;
      --space-lg: 20px;
      --nav-height: 68px;
      /* Legacy aliases so existing inline styles still work */
      --bg: #f1f5f9;
      --bg-body: #f1f5f9;
      --bg-main: #f1f5f9;
      --app-bg: #f8fafc;
      --card: #ffffff;
      --text: #1e293b;
      --muted: #64748b;
      --accent: #0a444a;

      /* Stitch design-system tokens (Admin panel restyle only) */
      --mint: #14b8a6;
      --mint-strong: #0d9488;
      --admin-shadow-card: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
      --admin-shadow-hover: 0 10px 24px -6px rgba(10, 68, 74, 0.18);
      --chip-live-bg: #d1fae5;
      --chip-live-text: #065f46;
      --chip-live-border: #a7f3d0;
      --chip-pending-bg: #fef3c7;
      --chip-pending-text: #92400e;
      --chip-pending-border: #fde68a;
      --chip-alert-bg: #fee2e2;
      --chip-alert-text: #991b1b;
      --chip-alert-border: #fecaca;
      --chip-info-bg: #dbeafe;
      --chip-info-text: #1e40af;
      --chip-info-border: #bfdbfe;
      --admin-sidebar-bg: #062e33;
      --admin-sidebar-text: #9dc4c8;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Inter', sans-serif;
      -webkit-tap-highlight-color: transparent;
    }

    html,
    body {
      height: 100%;
      overflow: hidden;
    }

    body {
      background: var(--bg-base);
      color: var(--text-main);
      display: flex;
      justify-content: center;
    }

    ::-webkit-scrollbar {
      display: none;
    }

    .hidden {
      display: none !important;
    }

    /* App Shell */
    .app-wrapper {
      width: 100%;
      max-width: 450px;
      margin: 0 auto;
      box-shadow: 0 0 24px rgba(0, 0, 0, 0.15);
      background: var(--bg-base);
      height: 100vh;
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    /* Responsive adjustments: 450px max-width on mobile, 800px on PC/Tablet */
    .view-box,
    .header-inner,
    .sub-header-inner,
    .content-area {
      width: 100%;
      max-width: 450px;
    }

    @media (min-width: 768px) {
      .app-wrapper {
        max-width: 1100px !important;
      }

      .app-wrapper.no-nav {
        box-shadow: none;
      }

      .view-box,
      .header-inner,
      .sub-header-inner,
      .content-area {
        max-width: 1100px !important;
      }
    }


    .app-wrapper.no-nav .bottom-nav {
      display: none;
    }

    .app-wrapper.no-nav .sticky-header-group {
      display: none;
    }

    /* Views */
    .view-box {
      display: none;
      flex-direction: column;
      flex: 1;
      width: 100%;
      background: var(--bg-base);
      overflow-y: auto;
      /* Ensure space for bottom nav */
      padding-bottom: calc(var(--nav-height) + 20px);
    }

    .view-box.active {
      display: flex;
      animation: fadeIn 0.3s ease;
    }

    @keyframes viewSlideIn {
      from {
        opacity: 0;
        transform: translateX(30px);
      }

      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    /* Glassmorphism Header */
    .sticky-header-group {
      position: sticky;
      top: 0;
      z-index: 90;
      width: 100%;
    }

    .app-header {
      background-color: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      height: 45px;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .header-inner {
      width: 100%;
      max-width: 450px;
      margin: 0 auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 var(--space-lg);
      height: 45px;
    }

    .header-title {
      font-size: 1rem;
      font-weight: 900;
      color: var(--primary);
      letter-spacing: -0.5px;
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 0;
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .btn-logout {
      background: transparent;
      border: none;
      font-size: 1.2rem;
      color: var(--danger);
      cursor: pointer;
      padding: 4px;
    }

    .sub-header {
      background: var(--primary);
      color: white;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 30px;
      width: 100%;
    }

    .sub-header-inner {
      width: 100%;
      max-width: 450px;
      margin: 0 auto;
      padding: 0 var(--space-lg);
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 30px;
    }

    .brand-name {
      font-size: 0.65rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      opacity: 0.9;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .date-disp {
      font-size: 0.65rem;
      font-weight: 700;
      background: rgba(255, 255, 255, 0.2);
      padding: 4px 8px;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      gap: 5px;
    }

    /* Content Area */
    .content-area {
      width: 100%;
      max-width: 450px;
      margin: 0 auto;
      padding: 15px var(--space-lg) 8px var(--space-lg);
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(3px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Login Icon */
    @keyframes logo-spin {
      from {
        transform: rotate(0deg);
      }

      to {
        transform: rotate(360deg);
      }
    }

    .login-wrapper {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: var(--space-lg);
      max-width: 400px;
      margin: 0 auto;
      width: 100%;
    }

    .login-header {
      text-align: center;
      margin-bottom: var(--space-lg);
    }

    .icon-box {
      position: relative;
      width: 80px;
      height: 80px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 1.5rem auto;
    }

    .icon-box::before {
      content: '';
      position: absolute;
      inset: 0;
      background-color: var(--primary);
      border-radius: 24px;
      box-shadow: 0 10px 25px rgba(10, 68, 74, 0.2);
      animation: logo-spin 20s linear infinite;
    }

    .icon-box i {
      position: relative;
      color: white;
      font-size: 2.5rem;
      z-index: 1;
    }

    .app-abbr {
      font-size: 2.2rem;
      font-weight: 900;
      color: var(--primary);
      letter-spacing: 4px;
      margin-bottom: 4px;
      line-height: 1;
    }

    .app-full-name {
      font-size: 0.7rem;
      color: var(--text-muted);
      font-weight: 700;
      letter-spacing: 1.5px;
      text-transform: uppercase;
    }

    .login-card {
      background: var(--bg-surface);
      padding: var(--space-lg);
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
    }

    .login-field {
      margin-bottom: var(--space-md);
    }

    .login-input-group {
      position: relative;
      margin-top: 6px;
    }

    .login-input-group i {
      position: absolute;
      left: 16px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      font-size: 1rem;
      pointer-events: none;
    }

    .login-input-group .input,
    .login-input-group select {
      width: 100%;
      padding-left: 48px;
      height: 48px;
      border-radius: var(--radius-md);
      background: var(--bg-surface-light);
      border: 1px solid var(--border);
      color: var(--text-main);
      font-size: 1rem;
      font-weight: 700;
      outline: none;
      transition: border-color 0.2s;
      margin-bottom: 0;
    }

    .login-input-group input {
      letter-spacing: 3px;
    }

    .login-input-group .input:focus,
    .login-input-group select:focus {
      border-color: var(--primary);
    }

    /* Branch Cards Interactive Grid (Option 2 - Compact 3-Column) */
    .branch-cards-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      margin-top: 6px;
      padding: 2px;
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(8px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes pulseFade {

      0%,
      100% {
        opacity: 0.5;
      }

      50% {
        opacity: 1;
      }
    }

    .cards-loading-placeholder {
      animation: pulseFade 1.2s infinite ease-in-out;
    }

    .branch-card {
      background: var(--bg-surface-light);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 8px 4px;
      text-align: center;
      cursor: pointer;
      position: relative;
      transition: all 0.15s ease;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
      -webkit-user-select: none;
      user-select: none;
      animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    .branch-card:active {
      transform: scale(0.95);
    }

    .branch-card.active {
      background: var(--bg-surface);
      border-color: var(--primary);
      border-width: 1.5px;
      box-shadow: 0 4px 10px rgba(10, 68, 74, 0.1);
      transform: translateY(-1px) scale(1.02);
    }

    .branch-card-icon {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: rgba(10, 68, 74, 0.05);
      color: var(--primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.9rem;
      transition: all 0.15s ease;
    }

    .branch-card.active .branch-card-icon {
      background: var(--primary);
      color: white;
    }

    .branch-card-name {
      font-size: 0.62rem;
      font-weight: 800;
      color: var(--text-main);
      text-transform: uppercase;
      letter-spacing: 0.2px;
      transition: color 0.15s ease;
      line-height: 1.1;
      word-break: break-word;
    }

    .branch-card.active .branch-card-name {
      color: var(--primary);
    }

    .branch-card-badge {
      position: absolute;
      top: 2px;
      right: 2px;
      color: var(--success);
      font-size: 0.75rem;
      opacity: 0;
      transform: scale(0.5);
      transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .branch-card.active .branch-card-badge {
      opacity: 1;
      transform: scale(1);
    }



    .login-input-group .input::placeholder {
      font-size: 0.75rem;
      color: var(--text-muted);
      opacity: 0.5;
      font-weight: 500;
    }

    .btn-login {
      width: 100%;
      height: 56px;
      background: var(--primary);
      color: white;
      border: none;
      border-radius: var(--radius-md);
      font-size: 1rem;
      font-weight: 800;
      text-transform: uppercase;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      cursor: pointer;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      margin-top: 8px;
    }

    .btn-login:active {
      transform: scale(0.97);
    }

    /* Form Controls */
    label,
    .label {
      font-size: 0.65rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: block;
      margin-bottom: var(--space-xs);
      margin-top: var(--space-xs);
    }

    input:not(.compact),
    select,
    .input {
      width: 100%;
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 0 var(--space-md);
      height: 40px;
      font-size: 0.8rem;
      font-family: 'Inter', sans-serif;
      color: var(--text-main);
      outline: none;
      transition: border-color 0.2s;
      margin-bottom: var(--space-sm);
    }

    input:focus,
    select:focus,
    .input:focus {
      border-color: var(--primary);
    }

    .btn-add {
      background: var(--primary);
      color: white;
      width: 40px;
      height: 40px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      cursor: pointer;
    }

    .compact {
      width: 50px;
      height: 32px;
      padding: 2px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      text-align: center;
      font-size: 14px;
      font-weight: 600;
      background: var(--bg-surface);
      color: var(--primary);
    }

    .compact:focus {
      border-color: var(--primary);
    }

    /* Buttons */
    .btn,
    .btn-main {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      height: 38px;
      background-color: var(--primary);
      color: white;
      border: none;
      border-radius: var(--radius-md);
      font-size: 0.75rem;
      font-weight: 800;
      text-transform: uppercase;
      cursor: pointer;
      transition: transform 0.1s, opacity 0.2s;
      font-family: 'Inter', sans-serif;
      margin-bottom: 6px;
    }

    .btn:active,
    .btn-main:active {
      transform: scale(0.98);
    }

    .btn-save {
      background-color: var(--success);
    }

    .btn-delete,
    .btn-danger {
      background-color: var(--danger);
      color: white;
      border: none;
    }

    .btn-rev,
    .btn-outline {
      background-color: transparent;
      color: var(--primary);
      border: 1px solid var(--primary);
    }

    .btn-warning {
      background-color: var(--warning);
      color: white;
    }

    .btn-success {
      background-color: var(--success);
    }

    .btn-small {
      height: auto;
      padding: 6px 12px;
      width: auto;
      font-size: 0.7rem;
      margin-bottom: 0;
    }

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

    /* Cards */
    .card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: var(--space-lg);
      margin-bottom: var(--space-md);
    }

    /* KPI / Dashboard */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      margin-bottom: var(--space-md);
    }

    .kpi-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: var(--space-md);
      text-align: center;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
    }

    .kpi-card:hover {
      border-color: var(--primary);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      transform: translateY(-2px);
    }

    .kpi-card:active {
      transform: scale(0.97);
    }

    .dash-section {
      margin-bottom: 24px;
    }

    .dash-title {
      font-size: 0.65rem;
      font-weight: 800;
      color: var(--primary);
      text-transform: uppercase;
      letter-spacing: 0.8px;
      margin: 16px 0 8px 0;
      display: flex;
      align-items: center;
      gap: 8px;
      opacity: 0.8;
    }

    .dash-title::after {
      content: '';
      flex: 1;
      height: 1px;
      background: linear-gradient(to right, var(--border), transparent);
    }

    .kpi-title {
      font-size: 0.62rem;
      font-weight: 700;
      color: var(--text-muted);
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .kpi-val {
      font-size: 1.1rem;
      font-weight: 800;
      color: var(--primary);
    }

    .dash-list {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 0 var(--space-md);
      list-style: none;
      margin: 0 0 var(--space-md) 0;
    }

    .dash-list-item {
      display: flex;
      justify-content: space-between;
      padding: 10px 0;
      border-bottom: 1px solid var(--border);
      font-size: 0.8rem;
      font-weight: 600;
    }

    .dash-list-item:last-child {
      border-bottom: none;
    }

    /* Admin Dashboard — period chip + Branch Performance / Top Sellers data tables
       (all scoped to #adminTabDashboard / admin-only classes, no shared class touched) */
    .admin-period-chip {
      display: none;
      align-items: center;
      gap: 6px;
      align-self: flex-start;
      background: var(--bg-surface-light);
      border: 1px solid var(--border);
      color: var(--primary);
      font-size: 0.68rem;
      font-weight: 700;
      padding: 6px 12px;
      border-radius: var(--radius-md);
      margin-bottom: var(--space-md);
    }

    #adminTabDashboard .dash-section {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: var(--space-md);
      box-shadow: var(--admin-shadow-card);
      margin-bottom: var(--space-md);
    }

    #adminTabDashboard .dash-title {
      margin: 0 0 8px 0;
      font-size: 0.7rem;
    }

    .admin-table-wrap {
      overflow-x: auto;
    }

    .admin-data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.78rem;
    }

    .admin-data-table thead th {
      font-size: 0.62rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.3px;
      color: var(--text-muted);
      padding: 0 2px 8px 2px;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }

    .admin-data-table tbody td {
      padding: 9px 2px;
      font-weight: 600;
      color: var(--text-main);
      border-bottom: 1px solid var(--border);
    }

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

    .admin-data-table tbody tr:hover td {
      background: var(--bg-surface-light);
    }

    .admin-data-table .admin-num {
      font-variant-numeric: tabular-nums lining-nums;
      color: var(--primary);
      font-weight: 700;
    }

    .admin-table-empty {
      text-align: center !important;
      color: var(--text-muted);
      font-weight: 500 !important;
      padding: 18px 0 !important;
    }

    /* Admin Report Tables */
    .admin-report-table {
      width: 100%;
      table-layout: fixed;
      border-collapse: collapse;
      background: var(--bg-surface);
      border-radius: var(--radius-md);
      overflow: hidden;
      margin-bottom: var(--space-md);
      font-size: 0.72rem;
      border: 1px solid var(--border);
    }

    .admin-report-table th {
      background: var(--bg-surface-light);
      color: var(--primary);
      padding: 6px 4px;
      font-weight: 800;
      text-transform: uppercase;
      font-size: 0.62rem;
      letter-spacing: 0.2px;
      border-bottom: 2px solid var(--border);
      text-align: center;
      white-space: nowrap;
    }

    .admin-report-table th:first-child {
      text-align: left;
      padding-left: 8px;
    }

    .admin-report-table td {
      padding: 6px 8px;
      border-bottom: 1px solid var(--border);
      text-align: left;
      vertical-align: middle;
      font-size: 0.72rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--text-main);
    }

    .admin-report-table tr:last-child td {
      border-bottom: none;
    }

    .branch-totals-wrap {
      width: 100%;
      margin-bottom: 18px;
    }

    .branch-totals-table {
      margin-bottom: 0;
    }

    /* Mobile reports — less compressed, Branch Totals stays readable */
    @media (max-width: 767px) {
      .admin-report-table {
        font-size: 0.8rem;
        table-layout: auto;
      }

      .admin-report-table th {
        padding: 9px 7px;
        font-size: 0.64rem;
        letter-spacing: 0.15px;
      }

      .admin-report-table th:first-child {
        padding-left: 10px;
      }

      .admin-report-table td {
        padding: 9px 7px;
        font-size: 0.8rem;
        overflow: visible;
        text-overflow: clip;
      }

      .admin-report-table td:first-child {
        white-space: normal;
        word-break: break-word;
        min-width: 64px;
      }

      .branch-totals-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 16px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--bg-surface);
      }

      .branch-totals-table {
        min-width: 460px;
        border: none;
        border-radius: 0;
        overflow: visible;
      }

      .branch-totals-table th,
      .branch-totals-table td {
        padding: 10px 8px;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
      }

      .branch-totals-table th:first-child,
      .branch-totals-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--bg-surface);
        min-width: 78px;
        max-width: 110px;
        white-space: normal;
        word-break: break-word;
        box-shadow: 4px 0 8px -4px rgba(0, 0, 0, 0.08);
      }

      .branch-totals-table th:first-child {
        background: var(--bg-surface-light);
      }

      .branch-totals-table tr[style*="background"] td:first-child,
      .branch-totals-table tr:last-child td:first-child {
        background: var(--bg-surface-light);
      }
    }

    @media (min-width: 768px) {
      .admin-report-table th {
        font-size: 0.65rem;
        padding: 8px 6px;
      }

      .branch-totals-table th,
      .branch-totals-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
      }

      .branch-totals-table th {
        font-size: 0.68rem;
      }
    }

    #overviewReportTable {
      min-width: 520px !important;
    }

    #overviewReportTable th {
      font-size: 0.5rem;
      padding: 4px 2px;
      letter-spacing: 0;
      line-height: 1.1;
      white-space: normal;
      word-break: break-word;
      hyphens: auto;
    }

    #overviewReportTable td {
      padding: 5px 3px;
      font-size: 0.68rem;
    }

    #overviewReportTable th:first-child,
    #overviewReportTable td:first-child {
      padding-left: 6px;
    }

    .filter-col-apply {
      flex: 0 0 72px;
      min-width: 72px;
    }

    .filter-col-apply .btn-main {
      font-size: 0.68rem;
      padding: 0 6px;
    }

    #adminFilterGrid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 8px;
      align-items: end;
      margin-bottom: var(--space-md);
    }

    #adminFilterGrid .filter-col,
    #adminFilterGrid .filter-col-apply {
      flex: none;
      min-width: 0;
      width: auto;
    }

    #adminFilterGrid .filter-col input,
    #adminFilterGrid .filter-col select {
      min-width: 0;
      width: 100%;
      max-width: 100%;
    }

    #adminFilterGrid input[type="date"] {
      min-width: 0;
      max-width: 100%;
    }

    #adminFilterGrid .filter-col-apply .btn-main {
      width: 100%;
      height: 32px;
      margin: 0;
    }

    @media (max-width: 699px) {
      #adminFilterGrid input[type="date"],
      #adminFilterGrid select {
        font-size: 16px;
        height: 36px;
      }

      #adminFilterGrid .filter-col-apply .btn-main {
        height: 36px;
      }

      #adminView .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
      }

      #adminView .kpi-card {
        padding: 10px 10px;
        gap: 6px;
      }

      #adminView .kpi-icon-wrapper {
        width: 20px;
        height: 20px;
        font-size: 0.68rem;
        top: 8px;
        right: 8px;
      }

      #adminView .kpi-content {
        padding-right: 18px;
      }

      #adminView .kpi-title {
        font-size: 0.55rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      #adminView .kpi-val {
        font-size: 1rem;
      }

      #adminView .sub-tabs {
        flex-wrap: wrap;
        gap: 4px;
      }

      #adminView .sub-tab-btn {
        flex: 1 1 calc(33.33% - 4px);
        min-width: 0;
        font-size: 0.62rem;
        padding: 8px 4px;
      }
    }

    @media (min-width: 700px) {
      #adminFilterGrid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) 80px;
      }

      #adminFilterGrid .filter-col-apply {
        width: 80px;
      }
    }

    /* Tables */
    .kitchen-table {
      width: 100%;
      border-collapse: collapse;
      background: var(--bg-surface);
      border-radius: var(--radius-md);
      overflow: hidden;
      margin-bottom: var(--space-md);
      font-size: 0.75rem;
      border: 1px solid var(--border);
    }

    .kitchen-table th {
      background: var(--bg-base);
      color: var(--text-muted);
      padding: 4px 8px;
      font-weight: 800;
      text-transform: uppercase;
      font-size: 0.6rem;
      letter-spacing: 0.5px;
      border-bottom: 1px solid var(--border);
      text-align: center;
    }

    .kitchen-table td {
      padding: 4px 8px;
      border-bottom: 1px solid var(--border);
      text-align: center;
      vertical-align: middle;
      font-size: 0.75rem;
    }

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

    /* Specific for Stock Page to avoid wrapping */
    #stockView .kitchen-table th {
      font-size: 0.5rem;
      padding: 2px 4px;
    }

    #stockView .kitchen-table td {
      padding: 2px 1px;
      font-size: 0.65rem;
    }

    #stockView .kitchen-table td:first-child {
      padding-left: 4px;
      text-align: left;
      font-size: 0.7rem;
    }

    #stockView .kitchen-table input.compact {
      width: 42px;
      height: 26px;
      padding: 0 2px;
      font-size: 0.75rem;
    }

    /* Individual view density controls */
    #kitchenView .kitchen-table td {
      padding: 6px;
    }

    #kitchenPackingView .kitchen-table td {
      padding: 0 4px;
      /* 0 vertical, 4px horizontal for minimal readability */
      height: 32px;
      /* Ensure a minimum height for the row even with 0 padding */
    }

    #kitchenPackingView .pack-checkbox {
      transform: scale(1);
      margin: 0 auto;
    }

    .kitchen-table td:first-child {
      text-align: left;
      padding-left: 8px;
      font-weight: 600;
      font-size: 0.8rem;
      color: var(--primary);
    }

    /* Kitchen board theme-aware cell colors (no stuck inline light-mode colors) */
    .kitchen-table .kt-cat-row {
      background: var(--bg-surface-light);
    }

    .kitchen-table .kt-cat-row th {
      background: var(--bg-surface-light);
      color: var(--primary);
      text-align: left;
      padding: 8px 4px;
      border: 1px solid var(--border);
    }

    .kitchen-table .kt-branch-h {
      text-align: center;
      border: 1px solid var(--border);
      width: 40px;
      color: var(--text-muted);
      background: var(--bg-surface-light);
    }

    .kitchen-table .kt-tot-h {
      text-align: center;
      border: 1px solid var(--border);
      width: 50px;
      color: var(--text-muted);
      background: var(--bg-surface-light);
      font-weight: 800;
    }

    .kitchen-table .kt-name {
      text-align: left;
      font-weight: 500;
      border: 1px solid var(--border);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--text-main);
      background: var(--bg-surface);
    }

    .kitchen-table .kt-cell {
      border: 1px solid var(--border);
      text-align: center;
      background: var(--bg-surface);
      color: var(--text-main);
      font-weight: 700;
    }

    .kitchen-table .kt-empty {
      color: var(--text-muted);
      font-weight: 500;
      opacity: 0.55;
    }

    .kitchen-table .kt-revised {
      background: rgba(239, 68, 68, 0.18) !important;
      color: var(--danger) !important;
      font-weight: 800;
    }

    .kitchen-table .kt-total {
      font-weight: 800;
      text-align: center;
      border: 1px solid var(--border);
      background: rgba(20, 184, 166, 0.14);
      color: var(--text-main);
    }

    body.dark .kitchen-table .kt-cat-row,
    body.dark .kitchen-table .kt-cat-row th,
    body.dark .kitchen-table .kt-branch-h,
    body.dark .kitchen-table .kt-tot-h {
      background: #323232 !important;
      color: var(--primary);
    }

    body.dark .kitchen-table .kt-name,
    body.dark .kitchen-table .kt-cell {
      background: var(--bg-surface);
      color: var(--text-main);
    }

    body.dark .kitchen-table .kt-empty {
      color: #727272;
      opacity: 0.85;
    }

    body.dark .kitchen-table .kt-revised {
      background: rgba(209, 96, 96, 0.28) !important;
      color: #e8aeae !important;
    }

    body.dark .kitchen-table .kt-total {
      background: rgba(183, 191, 192, 0.16) !important;
      color: var(--text-main);
    }

    body.dark .kitchen-table {
      background: var(--bg-surface);
      border-color: var(--border);
    }

    /* Notices */
    .notice-box {
      padding: 10px 20px;
      border-radius: var(--radius-md);
      margin-bottom: var(--space-md);
      font-size: 0.75rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      justify-content: center;
    }

    .notice-green {
      background: #d1fae5;
      color: #065f46;
      border: 1px solid #6ee7b7;
    }

    .notice-yellow {
      background: #fef9c3;
      color: #854d0e;
      border: 1px solid #fef08a;
    }

    .notice-red {
      background: #fee2e2;
      color: #991b1b;
      border: 1px solid #fca5a5;
    }

    /* Receipt */
    .receipt-box {
      background: var(--bg-surface);
      border: 1px dashed var(--border);
      padding: var(--space-md);
      border-radius: var(--radius-md);
      font-size: 0.8rem;
      color: var(--text-main);
      margin-bottom: var(--space-md);
    }

    .receipt-cat {
      font-weight: 800;
      color: var(--primary);
      padding: 4px 0;
      margin: 10px 0 4px 0;
      text-transform: uppercase;
      font-size: 0.65rem;
      letter-spacing: 0.5px;
    }

    .receipt-item {
      display: flex;
      justify-content: space-between;
      margin-bottom: 6px;
      border-bottom: 1px dashed var(--border);
      padding-bottom: 4px;
    }

    .receipt-qty {
      font-weight: 700;
    }

    /* Filters */
    .filter-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: var(--space-md);
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 12px;
      box-shadow: var(--admin-shadow-card);
    }

    .filter-col {
      flex: 1 1 calc(33.333% - 6px);
      min-width: 100px;
    }

    .filter-col input,
    .filter-col select {
      margin-bottom: 0;
      height: 32px;
      padding: 0 8px;
      font-size: 0.75rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-surface);
      color: var(--text-main);
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .filter-col input:focus,
    .filter-col select:focus {
      border-color: var(--mint);
      box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
    }

    .filter-label {
      display: block;
      font-size: 0.6rem;
      font-weight: 700;
      letter-spacing: 0.4px;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-bottom: 3px;
    }

    .report-period-banner {
      margin: -4px 0 12px;
      padding: 8px 14px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
      background: var(--bg-surface-light);
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--primary);
      text-align: center;
    }

    /* Tabs */
    .sub-tabs {
      display: flex;
      background: var(--border);
      padding: 4px;
      border-radius: var(--radius-md);
      margin-bottom: var(--space-md);
    }

    .sub-tab-btn {
      flex: 1;
      border: none;
      background: transparent;
      padding: 8px;
      font-size: 0.7rem;
      font-weight: 700;
      color: var(--text);
      border-radius: var(--radius-sm);
      cursor: pointer;
      text-transform: uppercase;
    }

    .sub-tab-btn.active {
      background: var(--bg-surface);
      color: var(--primary);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .admin-main-tabs {
      display: flex;
      gap: 4px;
      background: var(--bg-surface-light);
      border: 1px solid var(--border);
      padding: 4px;
      border-radius: var(--radius-md);
      margin-bottom: var(--space-md);
    }

    .admin-main-tab-btn {
      flex: 1;
      padding: 9px 8px;
      background: transparent;
      border: none;
      border-radius: var(--radius-sm);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.2px;
      color: var(--text-muted);
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    }

    .admin-main-tab-btn.active {
      background: var(--bg-surface);
      color: var(--primary);
      box-shadow: var(--admin-shadow-card);
    }

    .admin-mobile-actions {
      display: none;
      gap: 8px;
      margin: 0 0 12px;
      flex-wrap: wrap;
    }

    .admin-mobile-actions .btn-main {
      flex: 1 1 auto;
      min-width: 0;
      height: 36px;
      margin: 0;
      font-size: 0.72rem;
      padding: 0 10px;
    }

    /* Mobile admin — polished tabs, no bottom-nav duplication */
    @media (max-width: 1023px) {
      .admin-main-tabs {
        gap: 3px;
        padding: 3px;
        margin: 0 0 14px;
        border-radius: 10px;
      }

      .admin-main-tab-btn {
        padding: 10px 4px;
        font-size: 0.68rem;
        letter-spacing: 0;
        line-height: 1.15;
        border-radius: 8px;
      }

      .admin-mobile-actions {
        display: flex;
      }
    }

    .admin-tab-content {
      display: none;
    }

    .admin-tab-content.active {
      display: block;
      animation: fadeIn 0.2s ease;
    }

    /* ═══ CKOS Admin shell — cloned from Accounts Payable (ERP) pattern ═══
       Full-bleed desktop shell: left light sidebar + main panel.
       Mobile (<1024px): sidebar hidden; keep existing top pills + bottom-nav. */
    .admin-shell {
      display: flex;
      flex: 1;
      min-height: 0;
      width: 100%;
    }

    .admin-sidebar {
      display: none;
      width: 260px;
      flex-shrink: 0;
      background: var(--bg-surface);
      border-right: 1px solid var(--border);
      flex-direction: column;
      padding: 16px 12px;
      gap: 4px;
      overflow-y: auto;
      z-index: 15;
    }

    .admin-main {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-width: 0;
      min-height: 0;
      overflow: hidden;
      background: var(--bg-base);
    }

    .admin-main-scroll {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 0;
    }

    .admin-workspace {
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-height: 0;
    }

    .admin-work-left {
      width: 100%;
    }

    .admin-work-left-title {
      display: none;
      font-size: 0.68rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      color: var(--text-muted);
      margin-bottom: 10px;
    }

    .admin-work-right {
      width: 100%;
      min-width: 0;
    }

    .admin-menu-filter-box {
      margin-bottom: 12px;
    }

    .menu-page-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 12px;
    }

    .menu-page-actions .btn-main {
      width: 100%;
      height: 36px;
      margin: 0;
      font-size: 0.72rem;
    }

    .admin-panel-header {
      display: none;
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      height: 52px;
      flex-shrink: 0;
      align-items: center;
      justify-content: space-between;
      padding: 0 22px;
    }

    .admin-panel-header-brand {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .admin-panel-header-brand strong {
      font-size: 1rem;
      font-weight: 800;
      color: var(--primary);
      letter-spacing: -0.3px;
    }

    .admin-panel-header-brand span {
      display: block;
      font-size: 0.58rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .admin-panel-header-actions {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .admin-panel-header-actions button {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--bg-surface);
      color: var(--primary);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .admin-panel-header-actions button.danger {
      color: var(--danger);
    }

    .admin-panel-subheader {
      display: none;
      background: var(--primary);
      color: #fff;
      height: 34px;
      flex-shrink: 0;
      align-items: center;
      justify-content: space-between;
      padding: 0 22px;
      font-size: 0.78rem;
      font-weight: 700;
    }

    .admin-sidebar-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px 20px;
      margin-bottom: 8px;
      border-bottom: 1px solid var(--border);
    }

    .admin-sidebar-brand-icon {
      width: 40px;
      height: 40px;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--primary) 0%, var(--mint) 100%);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
      flex-shrink: 0;
    }

    .admin-sidebar-brand-text {
      min-width: 0;
    }

    .admin-sidebar-brand-text strong {
      display: block;
      font-size: 1rem;
      font-weight: 800;
      color: var(--primary);
      letter-spacing: -0.3px;
      line-height: 1.1;
    }

    .admin-sidebar-brand-text span {
      display: block;
      font-size: 0.62rem;
      color: var(--text-muted);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      margin-top: 2px;
    }

    .admin-nav-section {
      font-size: 0.62rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: var(--text-muted);
      padding: 12px 12px 6px;
      opacity: 0.85;
    }

    .admin-sidebar-link {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 11px 14px;
      border: none;
      border-radius: var(--radius-md);
      background: transparent;
      color: var(--text-muted);
      font-family: inherit;
      font-size: 0.88rem;
      font-weight: 600;
      cursor: pointer;
      text-align: left;
      transition: background 0.15s, color 0.15s;
    }

    .admin-sidebar-link i {
      width: 20px;
      text-align: center;
      font-size: 0.95rem;
      flex-shrink: 0;
    }

    .admin-sidebar-link:hover {
      background: var(--bg-surface-light);
      color: var(--text-main);
    }

    .admin-sidebar-link.active {
      background: linear-gradient(135deg, rgba(10, 68, 74, 0.12) 0%, rgba(20, 184, 166, 0.08) 100%);
      color: var(--primary);
      font-weight: 700;
    }

    .admin-sidebar-link.active i {
      color: var(--primary);
    }

    .admin-sidebar-logout {
      display: none;
      align-items: center;
      gap: 12px;
      width: 100%;
      margin-top: auto;
      padding: 11px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      background: transparent;
      color: var(--text-muted);
      font-family: inherit;
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
    }

    .admin-sidebar-logout:hover {
      background: var(--chip-alert-bg);
      color: var(--chip-alert-text);
      border-color: var(--chip-alert-border);
    }

    /* Desktop admin mode — full-bleed ERP shell */
    @media (min-width: 1024px) {
      .app-wrapper.admin-mode {
        max-width: none !important;
        box-shadow: none;
      }

      .app-wrapper.admin-mode .sticky-header-group,
      .app-wrapper.admin-mode .bottom-nav {
        display: none !important;
      }

      .app-wrapper.admin-mode #adminView.active,
      .app-wrapper.admin-mode #adminAuditView.active,
      .app-wrapper.admin-mode #adminOrderView.active {
        max-width: none !important;
        padding-bottom: 0;
        height: 100%;
        overflow: hidden;
      }

      .app-wrapper.admin-mode #adminView .content-area,
      .app-wrapper.admin-mode #adminAuditView .content-area,
      .app-wrapper.admin-mode #adminOrderView .content-area {
        max-width: none !important;
        margin: 0;
        padding: 0 !important;
        height: 100%;
        display: flex;
        flex-direction: column;
        gap: 0;
      }

      .app-wrapper.admin-mode .admin-sidebar {
        display: flex;
      }

      .app-wrapper.admin-mode .admin-sidebar-logout {
        display: flex;
      }

      .app-wrapper.admin-mode .admin-panel-header,
      .app-wrapper.admin-mode .admin-panel-subheader {
        display: flex;
      }

      .app-wrapper.admin-mode .admin-main-tabs {
        display: none;
      }

      .app-wrapper.admin-mode .admin-main-scroll {
        padding: 16px 20px 24px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
      }

      .app-wrapper.admin-mode .admin-workspace {
        flex-direction: row;
        align-items: stretch;
        gap: 16px;
        flex: 1;
        min-height: 0;
      }

      .app-wrapper.admin-mode .admin-work-left {
        width: 300px;
        flex-shrink: 0;
        background: var(--bg-surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 18px 16px;
        box-shadow: var(--admin-shadow-card);
        overflow-y: auto;
        align-self: stretch;
      }

      .app-wrapper.admin-mode .admin-work-left-title {
        display: block;
        margin-bottom: 14px;
      }

      .app-wrapper.admin-mode .admin-work-right {
        flex: 1;
        min-width: 0;
        overflow-y: auto;
        padding: 0 2px 8px 0;
      }

      .app-wrapper.admin-mode #adminFilterGrid {
        grid-template-columns: 1fr !important;
        gap: 12px;
        margin-bottom: 14px;
        padding: 0;
        border: none;
        box-shadow: none;
        background: transparent;
      }

      .app-wrapper.admin-mode #adminFilterGrid .filter-col,
      .app-wrapper.admin-mode #adminFilterGrid .filter-col-apply {
        width: 100%;
      }

      .app-wrapper.admin-mode #adminFilterGrid .filter-col input,
      .app-wrapper.admin-mode #adminFilterGrid .filter-col select,
      .app-wrapper.admin-mode #adminFilterGrid .filter-col-apply .btn-main {
        width: 100%;
        height: 34px;
        font-size: 0.8rem;
      }

      .app-wrapper.admin-mode .admin-tab-content > .btn-main {
        width: auto;
        max-width: 280px;
        padding: 0 16px;
      }

      .app-wrapper.admin-mode #adminView .kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 12px;
        margin-bottom: 16px;
      }

      .app-wrapper.admin-mode #adminDashContent {
        display: block !important;
      }

      .app-wrapper.admin-mode #adminDashContent .admin-dash-tables {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        align-items: start;
      }

      .app-wrapper.admin-mode #adminTabDashboard .dash-section {
        margin-bottom: 0;
      }

      .app-wrapper.admin-mode #adminTabMenu .menu-cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
      }

      .app-wrapper.admin-mode #adminTabMenu .menu-item-card {
        padding: 10px 8px;
        gap: 4px;
        min-height: 64px;
        box-shadow: none;
        animation: none;
      }

      .app-wrapper.admin-mode #adminTabMenu .menu-item-card-status-dot {
        display: none;
      }

      .app-wrapper.admin-mode #adminTabMenu .menu-item-card-name {
        font-size: 0.72rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
      }

      .app-wrapper.admin-mode #adminTabMenu .menu-item-card-price {
        font-size: 0.7rem;
        font-variant-numeric: tabular-nums;
      }

      .app-wrapper.admin-mode #adminKTable {
        overflow-x: auto;
      }

      .app-wrapper.admin-mode #adminKTable .kitchen-table {
        font-size: 0.78rem;
      }
    }

    /* Discrepancies top summaries — side by side (always, not locked in admin media query) */
    .disc-top-row {
      display: flex !important;
      flex-direction: row !important;
      flex-wrap: nowrap !important;
      align-items: flex-start !important;
      gap: 12px !important;
      margin-bottom: 18px !important;
      width: 100% !important;
    }

    .disc-top-col {
      min-width: 0 !important;
      flex: 1 1 0 !important;
    }

    .disc-top-col.disc-branch-summary {
      flex: 1.45 1 0 !important;
      margin-bottom: 0 !important;
    }

    .disc-top-col.disc-penalty-summary {
      flex: 0.9 1 0 !important;
    }

    .disc-top-col .dash-title {
      margin-top: 0;
    }

    .disc-top-col .admin-report-table {
      width: 100%;
      margin-bottom: 0;
    }

    @media (max-width: 700px) {
      .disc-top-row {
        flex-direction: column !important;
        flex-wrap: wrap !important;
      }

      .disc-top-col.disc-branch-summary,
      .disc-top-col.disc-penalty-summary {
        flex: 1 1 auto !important;
        width: 100% !important;
      }
    }

    body.dark .admin-sidebar {
      background: #292929;
      border-right-color: #414141;
    }

    body.dark .admin-sidebar-brand {
      border-bottom-color: #414141;
    }

    body.dark .admin-panel-header {
      background: rgba(23, 23, 23, 0.92);
      border-bottom-color: #414141;
    }

    /* ═══ Staff shell (Branch + Kitchen) — same ERP desktop pattern as Admin ═══ */
    .staff-sidebar {
      display: none;
      width: 260px;
      flex-shrink: 0;
      background: var(--bg-surface);
      border-right: 1px solid var(--border);
      flex-direction: column;
      padding: 16px 12px;
      gap: 4px;
      overflow-y: auto;
      z-index: 15;
    }

    @media (min-width: 1024px) {
      .app-wrapper.staff-mode {
        max-width: none !important;
        box-shadow: none;
        display: grid !important;
        grid-template-columns: 260px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
      }

      .app-wrapper.staff-mode > .staff-sidebar {
        display: flex;
        grid-column: 1;
        grid-row: 1 / -1;
        height: 100%;
        max-height: 100vh;
      }

      .app-wrapper.staff-mode > .sticky-header-group {
        grid-column: 2;
        grid-row: 1;
      }

      .app-wrapper.staff-mode > .view-box.active {
        grid-column: 2;
        grid-row: 2;
        max-width: none !important;
        width: 100% !important;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: 24px;
      }

      .app-wrapper.staff-mode > .view-box:not(.active) {
        display: none !important;
      }

      .app-wrapper.staff-mode > .bottom-nav {
        display: none !important;
      }

      .app-wrapper.staff-mode .header-inner,
      .app-wrapper.staff-mode .sub-header-inner,
      .app-wrapper.staff-mode .content-area {
        max-width: none !important;
      }

      .app-wrapper.staff-mode .content-area {
        padding: 18px 28px 28px !important;
      }

      .app-wrapper.staff-mode #mainMenuView .dash-hub-list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
      }

      .app-wrapper.staff-mode #kitchenMainView .staff-hub-list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        padding: 0 !important;
      }

      .app-wrapper.staff-mode .menu-cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }

      .app-wrapper.staff-mode .kitchen-table {
        font-size: 0.88rem;
      }

      .app-wrapper.staff-mode .kitchen-table th {
        padding: 10px 14px;
        font-size: 0.68rem;
      }

      .app-wrapper.staff-mode .kitchen-table td {
        padding: 10px 14px;
        font-size: 0.88rem;
      }

      .app-wrapper.staff-mode .audit-table {
        margin-bottom: 18px;
      }

      .app-wrapper.staff-mode .audit-table th {
        padding: 12px 10px;
        font-size: 0.68rem;
      }

      .app-wrapper.staff-mode .audit-table th:first-child {
        padding-left: 16px;
        font-size: 0.82rem;
      }

      .app-wrapper.staff-mode .audit-table td {
        padding: 12px 10px;
        font-size: 0.86rem;
      }

      .app-wrapper.staff-mode .audit-table td:first-child {
        padding-left: 16px;
        padding-right: 14px;
      }

      .app-wrapper.staff-mode .staff-desktop-action {
        display: inline-flex;
      }

      .app-wrapper.staff-mode .content-area > .btn-main,
      .app-wrapper.staff-mode .content-area .btn-main:not(.btn-small) {
        width: auto;
        max-width: 280px;
        padding: 0 16px;
      }
    }

    .page-toolbar {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 12px;
    }

    .page-toolbar-text {
      flex: 1 1 auto;
      min-width: 0;
    }

    .page-toolbar-text .dash-title {
      margin-top: 0;
    }

    .page-toolbar-note {
      font-size: 0.75rem;
      line-height: 1.45;
      color: var(--text-muted);
      max-width: 560px;
    }

    .staff-desktop-action {
      display: none;
      align-items: center;
      justify-content: center;
      gap: 8px;
      flex: 0 0 auto;
      width: auto;
      height: 36px;
      padding: 0 14px;
      margin: 0;
      font-size: 0.72rem;
      white-space: nowrap;
    }

    .history-back-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 32px;
      margin: 0 0 8px;
      padding: 0;
      border: none;
      background: transparent;
      color: var(--primary);
      font-family: inherit;
      font-size: 0.75rem;
      font-weight: 800;
      cursor: pointer;
    }

    .history-day-nav {
      display: flex;
      align-items: center;
      gap: 10px;
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 10px 12px;
      margin-bottom: 14px;
    }

    .history-day-nav-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 34px;
      padding: 0 12px;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      background: var(--bg-base);
      color: var(--text-main);
      font-family: inherit;
      font-size: 0.72rem;
      font-weight: 700;
      cursor: pointer;
      flex-shrink: 0;
    }

    .history-day-nav-btn:hover:not(:disabled) {
      border-color: var(--primary);
      color: var(--primary);
    }

    .history-day-nav-btn:disabled {
      opacity: 0.35;
      cursor: not-allowed;
    }

    .history-day-nav-center {
      flex: 1;
      min-width: 0;
      text-align: center;
    }

    .history-day-nav-center strong {
      display: block;
      font-size: 0.88rem;
      font-weight: 800;
      color: var(--text-main);
    }

    .history-day-nav-center span {
      display: block;
      font-size: 0.65rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.3px;
      margin-top: 3px;
    }

    body.dark .staff-sidebar {
      background: #292929;
      border-right-color: #414141;
    }

    /* Bottom Nav — equal-width buttons (WMS pattern) */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      background-color: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: center;
      z-index: 100;
      padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)) 0;
      height: auto;
      min-height: var(--nav-height);
      box-sizing: border-box;
    }

    .nav-inner {
      width: 100%;
      max-width: 450px;
      margin: 0 auto;
      display: flex;
      justify-content: center;
      align-items: stretch;
      gap: 8px;
      padding: 0 var(--space-lg);
      box-sizing: border-box;
    }

    @media (min-width: 768px) {
      .nav-inner {
        max-width: 640px !important;
        gap: 10px;
        padding: 0 20px;
      }

      .nav-bar-btn {
        height: 48px;
        font-size: 0.76rem;
        padding: 0 12px;
        flex: 0 1 160px;
        max-width: 170px;
      }
    }

    .nav-bar-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 48px;
      padding: 0 10px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--bg-surface);
      color: var(--text-main);
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.2px;
      cursor: pointer;
      white-space: normal;
      word-break: break-word;
      text-align: center;
      line-height: 1.15;
      font-family: inherit;
      flex: 1 1 0;
      min-width: 0;
      max-width: 100%;
      box-sizing: border-box;
    }

    @media (min-width: 768px) {
      .nav-bar-btn {
        flex: 0 1 160px;
        max-width: 170px;
      }
    }

    .nav-bar-btn i {
      font-size: 1rem;
      line-height: 1;
      flex-shrink: 0;
    }

    .nav-bar-btn .nav-btn-label {
      display: inline;
      line-height: 1.15;
      text-align: center;
    }

    .nav-bar-btn:active {
      transform: scale(0.97);
    }

    .nav-bar-btn:disabled,
    .nav-bar-btn.btn-disabled {
      opacity: 0.45;
      cursor: not-allowed;
      pointer-events: none;
    }

    .nav-bar-btn.nav-back {
      background: var(--bg-body);
      border-color: var(--border);
      color: var(--text-muted);
    }

    .nav-bar-btn.nav-primary {
      background: var(--primary);
      border-color: var(--primary);
      color: #fff;
    }

    .nav-bar-btn.nav-save {
      background: var(--success);
      border-color: var(--success);
      color: #fff;
    }

    .nav-bar-btn.nav-danger {
      background: var(--danger);
      border-color: var(--danger);
      color: #fff;
    }

    .nav-bar-btn.nav-muted {
      background: #64748b;
      border-color: #64748b;
      color: #fff;
    }

    .nav-bar-btn.nav-warn {
      background: var(--warning);
      border-color: var(--warning);
      color: #fff;
    }

    .nav-bar-btn.nav-wa {
      background: #25D366;
      border-color: #1ebe57;
      color: #fff;
    }

    .nav-bar-btn.nav-excel {
      background: #217346;
      border-color: #1a5c38;
      color: #fff;
    }

    .nav-bar-btn.nav-print {
      background: #475569;
      border-color: #334155;
      color: #fff;
    }

    .nav-bar-btn.nav-info {
      background: #2563eb;
      border-color: #1d4ed8;
      color: #fff;
    }

    .nav-bar-btn.nav-menu {
      background: #c2410c;
      border-color: #9a3412;
      color: #fff;
    }

    @media (max-width: 480px) {
      .nav-inner.has-many-btns .nav-btn-label {
        display: none !important;
      }

      .nav-inner.has-many-btns .nav-bar-btn {
        padding: 0 8px;
        gap: 0;
      }

      .nav-inner.has-many-btns .nav-bar-btn i {
        font-size: 1.3rem !important;
      }
    }

    .app-wrapper.hide-bottom-nav .bottom-nav {
      display: none !important;
    }

    .app-wrapper.hide-bottom-nav .view-box {
      padding-bottom: 20px;
    }

    .nav-item {
      display: none;
    }

    /* Modal */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(15, 23, 42, 0.6);
      backdrop-filter: blur(4px);
      z-index: 9999;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
    }

    .modal-overlay.active {
      display: flex;
    }

    .modal-overlay.keyboard-open {
      align-items: flex-start;
      padding-top: 40px;
      overflow-y: auto;
    }

    .modal-box {
      background: var(--bg-surface);
      width: 100%;
      max-width: 380px;
      border-radius: var(--radius-lg);
      max-height: 85vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
      animation: modalFadeScale 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .modal-box.modal-wide {
      max-width: 560px;
    }

    .menu-editor-switch-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 4px 2px;
      border: none;
    }

    .menu-editor-switch-row span {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-main);
    }

    .menu-editor-flags {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .menu-editor-flag {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 6px 10px;
      border-radius: var(--radius-md);
      background: var(--bg-surface-light);
    }

    .menu-editor-flag span {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text-main);
    }

    .modal-box.modal-wide .modal-header {
      padding: 12px 16px 8px;
    }

    .modal-box.modal-wide .modal-body {
      padding: 10px 16px;
    }

    .modal-box.modal-wide .modal-footer {
      padding: 8px 16px 12px;
    }

    .modal-box.modal-wide #menuEditorBranchList {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0 12px;
    }

    .modal-header {
      padding: 16px 20px 10px 20px;
      border-bottom: 1px solid var(--border);
    }

    .modal-body {
      padding: 16px 20px;
      overflow-y: auto;
      flex: 1;
      max-height: calc(85vh - 110px);
    }

    .modal-footer {
      padding: 10px 20px 16px 20px;
      border-top: 1px solid var(--border);
      background: var(--bg-surface-light);
    }

    @keyframes modalFadeScale {
      from {
        transform: scale(0.92);
        opacity: 0;
      }

      to {
        transform: scale(1);
        opacity: 1;
      }
    }

    /* Modal Form / Elements Compact Adjustments */
    .modal-box input:not(.compact),
    .modal-box select {
      height: 34px !important;
      /* Compact input height */
      padding: 0 10px !important;
      font-size: 0.78rem !important;
      margin-bottom: 6px !important;
    }

    .modal-box label {
      font-size: 0.58rem !important;
      margin-bottom: 2px !important;
      margin-top: 3px !important;
    }

    .modal-title {
      font-size: 0.9rem;
      font-weight: 800;
      color: var(--text-main);
      margin-bottom: 12px;
      text-align: center;
    }

    .modal-msg {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-bottom: 10px;
      line-height: 1.4;
    }

    .modal-actions {
      margin-top: 12px;
    }

    .modal-actions .btn-main {
      height: 34px !important;
      font-size: 0.72rem !important;
      border-radius: var(--radius-md) !important;
      margin-bottom: 0 !important;
    }

    .price-delete-row {
      display: flex;
      align-items: flex-end;
      gap: 8px;
    }

    .price-delete-field {
      flex: 1 1 0;
      min-width: 0;
    }

    .price-delete-label {
      display: block;
      margin: 0 0 4px;
      font-size: 0.58rem;
      font-weight: 700;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      color: var(--text-muted);
      line-height: 1;
    }

    .modal-box .price-delete-row input.price-delete-input,
    .modal-box .price-delete-row button.price-delete-btn {
      height: 40px !important;
      min-height: 40px !important;
      max-height: 40px !important;
      margin: 0 !important;
      padding: 0 12px !important;
      box-sizing: border-box !important;
      border-radius: var(--radius-md);
      font-size: 0.78rem !important;
      line-height: 1 !important;
    }

    .modal-box .price-delete-row input.price-delete-input {
      display: block;
      width: 100%;
      border: 1px solid var(--border);
      background: var(--bg-surface);
      color: var(--text-main);
    }

    .modal-box .price-delete-row button.price-delete-btn {
      flex: 1 1 0;
      width: auto;
      min-width: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border: none;
      background: var(--danger);
      color: #fff;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.3px;
      cursor: pointer;
      font-family: inherit;
    }

    /* Loader Overhaul - UNIFIED GLASSMORPHIC DESIGN */
    #loader-overlay {
      position: fixed;
      inset: 0;
      background: rgba(248, 250, 252, 0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      z-index: 10000;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    html.preload #loader-overlay {
      display: flex !important;
      background: var(--bg);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }

    html.preload .view-box.active {
      animation: none !important;
    }

    #loader-overlay,
    #loader-overlay *:not(i):not([class*="fa-"]) {
      font-family: 'Inter', sans-serif !important;
    }

    .loader-content {
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 20px;
    }

    .loader-spinner-container {
      position: relative;
      width: 72px;
      height: 72px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .loader-spinner {
      width: 100%;
      height: 100%;
      border: 4px solid var(--border);
      border-top: 4px solid var(--primary);
      border-radius: 50%;
      animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
    }

    .loader-icon {
      position: absolute;
      color: var(--primary);
      font-size: 24px;
      animation: breathe 1.5s ease-in-out infinite;
    }

    @keyframes breathe {

      0%,
      100% {
        transform: scale(0.9);
        opacity: 0.8;
      }

      50% {
        transform: scale(1.1);
        opacity: 1;
      }
    }

    #loader-status {
      font-size: 0.85rem;
      font-weight: 800;
      color: var(--primary);
      letter-spacing: 1.5px;
      text-transform: uppercase;
      max-width: 250px;
      line-height: 1.4;
      animation: pulse 1.5s infinite;
    }

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

    @keyframes pulse {

      0%,
      100% {
        opacity: 1;
      }

      50% {
        opacity: 0.5;
      }
    }

    /* Anti-Hang retry warning styles */
    .loader-retry-box {
      margin-top: 15px;
      text-align: center;
      animation: fadeInUp 0.4s ease-out;
    }

    .loader-retry-text {
      font-size: 0.7rem;
      font-weight: 700;
      color: var(--danger);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 8px;
    }

    .loader-retry-btn {
      background: var(--danger);
      color: white;
      border: none;
      padding: 8px 16px;
      border-radius: var(--radius-sm);
      font-size: 0.65rem;
      font-weight: 800;
      cursor: pointer;
      text-transform: uppercase;
      transition: all 0.2s;
    }

    .loader-retry-btn:active {
      transform: scale(0.95);
    }

    /* Toast */
    #toast-container {
      position: fixed;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      width: 90%;
      max-width: 320px;
      z-index: 99999;
      display: flex;
      flex-direction: column;
      gap: 8px;
      pointer-events: none;
    }

    .toast {
      background: var(--primary);
      color: white;
      border-radius: var(--radius-md);
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      animation: toastIn 0.3s ease forwards;
      font-size: 0.75rem;
      font-weight: 700;
      opacity: 0;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .toast.show {
      opacity: 1;
    }

    @keyframes toastIn {
      from {
        transform: translateY(20px);
        opacity: 0;
      }

      to {
        transform: translateY(0);
        opacity: 1;
      }
    }

    .toast-corner {
      position: fixed;
      top: 14px;
      right: 14px;
      z-index: 100000;
      width: auto;
      max-width: 180px;
      padding: 6px 10px;
      border-radius: 8px;
      background: var(--primary);
      color: #fff;
      font-size: 0.68rem;
      font-weight: 700;
      line-height: 1.2;
      text-align: center;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
      opacity: 0;
      transform: translateY(-6px);
      transition: opacity 0.2s ease, transform 0.2s ease;
      pointer-events: none;
    }

    .toast-corner.show {
      opacity: 1;
      transform: none;
    }

    .toast-corner.toast-corner-error {
      background: var(--danger);
    }
      from {
        transform: translateY(20px);
        opacity: 0;
      }

      to {
        transform: translateY(0);
        opacity: 1;
      }
    

    /* Checkbox */
    .pack-checkbox {
      width: 18px;
      height: 18px;
      accent-color: var(--success);
      cursor: pointer;
      margin: 0 auto;
      display: block;
      transform: scale(1.1);
    }

    .kitchen-table td:has(.pack-checkbox) {
      text-align: center;
    }

    /* Flex utils */
    .flex-row {
      display: flex;
      gap: 8px;
    }

    .flex-row>* {
      flex: 1;
    }

    /* Compact branch dashboard cards */
    .dash-hub-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 2px 0;
    }

    .dash-hub-card {
      padding: 10px 12px !important;
      gap: 10px !important;
    }

    .dash-hub-card.is-locked {
      opacity: 0.55;
      cursor: not-allowed !important;
      filter: grayscale(0.2);
    }

    .dash-hub-card > div:first-of-type {
      width: 36px !important;
      height: 36px !important;
      border-radius: 10px !important;
      font-size: 1.05rem !important;
    }

    .dash-hub-card > div:nth-of-type(2) > div:first-child {
      font-size: 0.78rem !important;
      margin-bottom: 1px !important;
    }

    .dash-hub-card > div:nth-of-type(2) > div:last-child {
      font-size: 0.6rem !important;
    }

    .warehouse-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    @media (min-width: 768px) {
      .warehouse-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
    }

    @media (min-width: 920px) {
      .warehouse-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
      }
    }

    @media (min-width: 1100px) {
      .warehouse-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
      }
    }

    .warehouse-tile {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 8px 7px;
      min-width: 0;
    }

    .warehouse-tile-name {
      font-size: 0.62rem;
      font-weight: 700;
      line-height: 1.2;
      color: var(--text-main);
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      min-height: 1.45em;
    }

    .warehouse-tile-qty {
      font-size: 0.92rem;
      font-weight: 800;
      color: var(--primary);
      margin-top: 3px;
      letter-spacing: -0.3px;
    }

    .stock-hist-table {
      font-size: 0.68rem;
    }

    .stock-hist-table th,
    .stock-hist-table td {
      padding: 4px 3px !important;
      font-size: 0.65rem !important;
    }

    .audit-table {
      width: 100%;
      border-collapse: collapse;
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      overflow: hidden;
      margin-bottom: 12px;
    }

    .audit-table th {
      font-size: 0.58rem;
      font-weight: 600;
      color: var(--text-muted);
      padding: 8px 6px;
      text-transform: uppercase;
      letter-spacing: 0.25px;
      background: transparent;
      text-align: center;
      border-bottom: 1px solid var(--border);
    }

    .audit-table th:first-child {
      text-align: left;
      padding-left: 10px;
      font-size: 0.7rem;
      font-weight: 700;
      color: var(--primary);
      text-transform: none;
      letter-spacing: 0;
    }

    .audit-table td {
      padding: 8px 6px;
      font-size: 0.72rem;
      font-weight: 500;
      color: var(--text-main);
      text-align: center;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
    }

    .audit-table td:first-child {
      text-align: left;
      padding-left: 10px;
      padding-right: 8px;
      font-weight: 600;
      white-space: normal;
    }

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

    .audit-table .audit-cell-warn {
      color: var(--danger);
      font-weight: 700;
      background: none;
      white-space: nowrap;
    }
    .menu-cards-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      width: 100%;
      margin-top: 10px;
      padding: 2px;
      box-sizing: border-box;
    }

    /* Comfortable phones / narrow tablets — 3 columns */
    @media (min-width: 390px) {
      .menu-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
      }
    }

    .menu-item-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 12px 8px;
      text-align: center;
      cursor: pointer;
      position: relative;
      transition: all 0.2s ease;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
      animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
    }

    .menu-item-card:hover {
      border-color: var(--primary);
      box-shadow: 0 4px 12px rgba(10, 68, 74, 0.08);
      transform: translateY(-2px);
    }

    .menu-item-card:active {
      transform: scale(0.96);
    }

    .menu-item-card.disabled-item {
      opacity: 0.6;
      background: var(--bg-surface-light);
      border-style: dashed;
    }

    .menu-item-card-name {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--text-main);
      line-height: 1.2;
      word-break: break-word;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      height: 28px;
      /* Fixed height for 2 lines */
    }

    .menu-item-card-price {
      font-size: 0.75rem;
      font-weight: 800;
      color: var(--primary);
    }

    .menu-item-card-cat-badge {
      font-size: 0.55rem;
      font-weight: 700;
      color: var(--text-muted);
      background: var(--bg-surface-light);
      padding: 2px 6px;
      border-radius: var(--radius-sm);
      text-transform: uppercase;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .menu-item-card-status-dot {
      position: absolute;
      top: 6px;
      right: 6px;
      width: 6px;
      height: 6px;
      border-radius: 50%;
    }

    .menu-item-card-status-dot.active {
      background: var(--success);
    }

    .menu-item-card-status-dot.disabled {
      background: var(--text-muted);
    }

    .menu-report-mark {
      position: absolute;
      top: 5px;
      right: 6px;
      font-size: 0.62rem;
      line-height: 1;
      color: #b45309;
      pointer-events: none;
    }

    /* Order Item Qty Badge Styling */
    .order-item-qty-badge {
      font-size: 0.7rem;
      font-weight: 800;
      padding: 2px 8px;
      border-radius: var(--radius-sm);
      margin-top: auto;
      border: 1px solid transparent;
      display: inline-block;
    }

    .order-item-qty-badge.empty {
      background: var(--bg-surface-light);
      color: var(--text-muted);
      border-color: var(--border);
      border-style: dashed;
    }

    .order-item-qty-badge.active {
      background: var(--success);
      color: white;
      box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
    }

    /* Inline Qty Selector on Order Cards */
    .qty-btn {
      width: 24px;
      height: 22px;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.7rem;
      cursor: pointer;
      padding: 0;
      transition: all 0.15s ease;
      border: 1px solid var(--border);
      background: var(--bg-surface-light);
      color: var(--text-muted);
    }

    .qty-btn:active {
      transform: scale(0.9);
    }

    .qty-btn.plus {
      background: var(--primary);
      border-color: var(--primary);
      color: white;
    }

    .qty-btn:hover {
      opacity: 0.85;
    }

    .qty-display {
      font-size: 0.75rem;
      font-weight: 800;
      min-width: 20px;
      text-align: center;
      color: var(--primary);
    }


    /* Stock detail badges and values styling */
    .stock-detail-val {
      font-weight: 700;
    }

    .stock-detail-val.empty {
      color: var(--text-muted);
      opacity: 0.5;
    }

    .stock-detail-val.active {
      color: var(--success);
    }

    .stock-detail-val.active-blue {
      color: #2563eb;
    }

    .stock-detail-val.active-red {
      color: var(--danger);
    }

    .stock-detail-val.active-primary {
      color: var(--primary);
    }

    /* Kitchen Packaging branch status cards styling */
    .pack-branch-cards-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      width: 100%;
      margin-bottom: 15px;
      box-sizing: border-box;
    }

    .pack-branch-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 10px 8px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      transition: all 0.2s ease;
      min-height: 64px;
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
      text-align: center;
    }

    .pack-branch-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

    .pack-branch-card.active-card {
      border-color: var(--primary);
      background: rgba(10, 68, 74, 0.05);
      box-shadow: 0 0 0 2px var(--primary);
    }

    .pack-branch-card-name {
      font-weight: 700;
      font-size: 0.8rem;
      color: var(--text-main);
    }

    .pack-branch-card-status {
      font-size: 0.65rem;
      font-weight: 600;
      padding: 2px 6px;
      border-radius: 4px;
    }

    .pack-branch-card-status.pending {
      background: rgba(245, 158, 11, 0.1);
      color: var(--warning);
    }

    .pack-branch-card-status.sent {
      background: rgba(16, 185, 129, 0.1);
      color: var(--success);
    }

    /* Switch Slider Styles */
    .switch {
      position: relative;
      display: inline-block;
      width: 40px;
      height: 20px;
    }

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

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #cbd5e1;
      transition: .4s;
      border-radius: 20px;
    }

    .slider:before {
      position: absolute;
      content: "";
      height: 14px;
      width: 14px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      transition: .4s;
      border-radius: 50%;
    }

    input:checked+.slider {
      background-color: var(--success);
    }

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

    /* Stitch-style KPI Cards: neutral by default, color reserved for real alerts only */
    .kpi-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-left: 3px solid transparent;
      border-radius: var(--radius-lg);
      padding: 12px 14px;
      text-align: left;
      cursor: pointer;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      gap: 8px;
      box-shadow: var(--admin-shadow-card);
    }

    .kpi-icon-wrapper {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 24px;
      height: 24px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.78rem;
      background: transparent;
      color: var(--text-muted);
      opacity: 0.5;
      flex-shrink: 0;
    }

    .kpi-content {
      flex: 1;
      min-width: 0;
      padding-right: 22px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .kpi-title {
      font-variant-numeric: normal;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--text-muted);
    }

    .kpi-val {
      font-variant-numeric: tabular-nums lining-nums;
      letter-spacing: -0.01em;
      color: var(--text-main);
    }

    /* Alert-severity modifiers — applied only to KPI cards that represent a real
       operational problem (loss, transit alerts, missing orders/stock, cancels).
       All other KPI cards stay neutral (no per-metric rainbow coloring). */
    .kpi-card.kpi-card--danger {
      border-left-color: var(--danger);
    }

    .kpi-card.kpi-card--danger .kpi-icon-wrapper {
      color: var(--danger);
      opacity: 1;
    }

    .kpi-card.kpi-card--danger .kpi-val {
      color: var(--danger);
    }

    .kpi-card.kpi-card--warning {
      border-left-color: var(--warning);
    }

    .kpi-card.kpi-card--warning .kpi-icon-wrapper {
      color: var(--warning);
      opacity: 1;
    }

    .kpi-card.kpi-card--warning .kpi-val {
      color: var(--warning);
    }

    /* =========================================================================
       CKOS UI ENHANCEMENT SUITE
       ========================================================================= */

    /* Hover states */
    .kpi-card {
      transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease !important;
    }

    .kpi-card:hover {
      transform: translateY(-3px) !important;
      box-shadow: var(--admin-shadow-hover) !important;
    }

    .branch-card {
      transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
    }

    .branch-card:hover {
      transform: translateY(-2px) !important;
      box-shadow: 0 6px 18px rgba(10, 68, 74, 0.10) !important;
    }

    .order-item {
      transition: background 0.15s ease, box-shadow 0.15s ease;
    }

    .order-item:hover {
      background: var(--bg-surface-light) !important;
      box-shadow: 0 2px 8px rgba(10, 68, 74, 0.06);
    }

    /* Stagger entrance */
    @keyframes ckos-slideUp {
      from {
        opacity: 0;
        transform: translateY(10px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .kpi-card {
      animation: ckos-slideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    .kpi-card:nth-child(1) {
      animation-delay: 0.00s;
    }

    .kpi-card:nth-child(2) {
      animation-delay: 0.05s;
    }

    .kpi-card:nth-child(3) {
      animation-delay: 0.10s;
    }

    .kpi-card:nth-child(4) {
      animation-delay: 0.15s;
    }

    .branch-card {
      animation: ckos-slideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    .branch-card:nth-child(1) {
      animation-delay: 0.00s;
    }

    .branch-card:nth-child(2) {
      animation-delay: 0.04s;
    }

    .branch-card:nth-child(3) {
      animation-delay: 0.08s;
    }

    .branch-card:nth-child(4) {
      animation-delay: 0.12s;
    }

    .branch-card:nth-child(5) {
      animation-delay: 0.16s;
    }

    /* Skeleton */
    .skeleton {
      background: linear-gradient(90deg, var(--border) 25%, var(--bg-surface-light) 50%, var(--border) 75%);
      background-size: 200% 100%;
      animation: ckos-shimmer 1.4s ease infinite;
      border-radius: 8px;
    }

    @keyframes ckos-shimmer {
      from {
        background-position: 200% 0;
      }

      to {
        background-position: -200% 0;
      }
    }

    /* Ripple */
    .ripple-wave {
      position: absolute;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.3);
      transform: scale(0);
      animation: ckos-ripple 0.6s ease-out forwards;
      pointer-events: none;
    }

    @keyframes ckos-ripple {
      to {
        transform: scale(4);
        opacity: 0;
      }
    }

    /* Scroll-aware header */
    .app-header {
      transition: box-shadow 0.25s ease;
    }

    .app-header.scrolled {
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    }

    /* Table row hover */
    table tbody tr {
      transition: background 0.15s ease;
    }

    table tbody tr:hover {
      background: rgba(10, 68, 74, 0.03) !important;
    }

    /* Focus rings */
    input:focus,
    select:focus,
    textarea:focus {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }

    /* Dark mode toggle */
    .dm-toggle {
      position: fixed;
      bottom: calc(var(--nav-height) + 20px);
      right: 16px;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--primary);
      color: #fff;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      z-index: 9998;
      transition: transform 0.2s ease;
    }

    .dm-toggle:hover {
      transform: scale(1.1);
    }

    .dm-toggle:active {
      transform: scale(0.9);
    }

    /* Dark mode */
    body.dark {
      --primary: #b7bfc0;
      --primary-light: #9aa6a8;
      --bg-base: #171717;
      --bg-main: #171717;
      --bg-body: #171717;
      --bg-surface: #292929;
      --bg-surface-light: #323232;
      --text-main: #e8e8e8;
      --text-muted: #a1a1a1;
      --border: #414141;
      --bg: #171717;
      --app-bg: #171717;
      --card: #292929;
      --text: #e8e8e8;
      --muted: #a1a1a1;
      --accent: #b7bfc0;
    }

    body.dark .app-header {
      background-color: rgba(23, 23, 23, 0.9) !important;
      border-bottom-color: #414141 !important;
    }

    body.dark .sub-header {
      background: #323939 !important;
    }

    body.dark .card,
    body.dark .kpi-card,
    body.dark .branch-card,
    body.dark .order-item,
    body.dark .login-card,
    body.dark .menu-item-card,
    body.dark .receipt-box,
    body.dark .dash-list,
    body.dark .dash-section {
      background: var(--bg-surface) !important;
      border-color: var(--border) !important;
      color: var(--text-main);
    }

    body.dark .branch-card.active {
      background: #292929 !important;
      box-shadow: 0 4px 12px rgba(183, 191, 192, 0.12);
    }

    body.dark .menu-item-card.disabled-item {
      background: #1f1f1f !important;
      opacity: 0.7;
    }

    body.dark .dash-list-item {
      border-color: var(--border) !important;
      color: var(--text-main);
    }

    body.dark .dash-title {
      color: var(--text-main);
    }

    body.dark input,
    body.dark select,
    body.dark textarea {
      background: #292929 !important;
      border-color: #414141 !important;
      color: var(--text-main) !important;
    }

    body.dark input::placeholder,
    body.dark textarea::placeholder {
      color: #727272 !important;
    }

    body.dark .bottom-nav {
      background-color: rgba(23, 23, 23, 0.9) !important;
      border-top-color: #414141 !important;
    }

    body.dark .nav-bar-btn {
      background: #292929;
      border-color: #414141;
      color: #e8e8e8;
    }

    body.dark .nav-bar-btn.nav-back {
      background: #171717;
      color: #a1a1a1;
    }

    body.dark .nav-bar-btn.nav-primary {
      background: var(--primary);
      border-color: var(--primary);
      color: #171717;
    }

    body.dark .nav-bar-btn.nav-save {
      background: var(--success);
      border-color: var(--success);
      color: #ffffff;
    }

    body.dark .nav-bar-btn.nav-danger {
      background: var(--danger);
      border-color: var(--danger);
      color: #ffffff;
    }

    body.dark .nav-bar-btn.nav-wa {
      background: #58ce84;
      border-color: #37bd66;
      color: #ffffff;
    }

    body.dark .nav-bar-btn.nav-excel {
      background: #217246;
      border-color: #1b5b38;
      color: #ffffff;
    }

    body.dark .nav-bar-btn.nav-print {
      background: #535353;
      border-color: #414141;
      color: #ffffff;
    }

    body.dark .nav-bar-btn.nav-info {
      background: #3f6ac7;
      border-color: #3456b4;
      color: #ffffff;
    }

    body.dark .nav-bar-btn.nav-menu {
      background: #aa5531;
      border-color: #8b4128;
      color: #ffffff;
    }

    body.dark .nav-bar-btn.nav-warn {
      background: var(--warning);
      border-color: var(--warning);
      color: #171717;
    }

    body.dark .nav-bar-btn.nav-muted {
      background: #535353;
      border-color: #414141;
      color: #e8e8e8;
    }

    body.dark #loader-overlay {
      background: rgba(23, 23, 23, 0.95) !important;
    }

    html.preload #loader-overlay,
    html.preload body.dark #loader-overlay {
      background: var(--bg) !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    body.dark .loader-spinner {
      border-color: #414141;
      border-top-color: var(--primary);
    }

    body.dark .loader-icon,
    body.dark #loader-status {
      color: var(--primary) !important;
    }

    body.dark .notice-box {
      background: #323232 !important;
      border-color: #414141 !important;
      color: var(--text-muted) !important;
    }

    body.dark .notice-green {
      background: rgba(153, 165, 166, 0.16) !important;
      color: #ccd2d3 !important;
      border-color: rgba(153, 165, 166, 0.35) !important;
    }

    body.dark .notice-yellow {
      background: rgba(211, 171, 103, 0.16) !important;
      color: #e5d7a6 !important;
      border-color: rgba(211, 171, 103, 0.35) !important;
    }

    body.dark .notice-red {
      background: rgba(209, 96, 96, 0.16) !important;
      color: #e8aeae !important;
      border-color: rgba(209, 96, 96, 0.35) !important;
    }

    body.dark .notice-error {
      border-left-color: var(--danger) !important;
      color: #e8aeae !important;
    }

    body.dark .notice-error i {
      color: #db8484 !important;
    }

    body.dark .notice-warning {
      border-left-color: var(--warning) !important;
      color: #e5d7a6 !important;
    }

    body.dark .notice-warning i {
      color: #ddc68b !important;
    }

    body.dark .notice-info {
      border-left-color: #77bad8 !important;
      color: #a3cfe4 !important;
    }

    body.dark .notice-info i {
      color: #77bad8 !important;
    }

    body.dark .notice-success {
      background: #0d2e1b !important;
      color: #ccd2d3 !important;
      border-color: #4b5656 !important;
    }

    body.dark .sub-tabs {
      background: #323232 !important;
    }

    body.dark .sub-tab-btn {
      color: var(--text-muted) !important;
    }

    body.dark .sub-tab-btn.active {
      background: #292929 !important;
      color: var(--primary) !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    }

    body.dark .admin-main-tabs {
      background: #323232 !important;
      border-color: #414141 !important;
    }

    body.dark .admin-main-tab-btn {
      background: transparent !important;
      color: var(--text-muted) !important;
    }

    body.dark .admin-main-tab-btn.active {
      background: #292929 !important;
      color: var(--primary) !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35) !important;
    }

    body.dark table thead th,
    body.dark table th {
      background: #323232 !important;
      color: var(--text-main) !important;
      border-color: var(--border) !important;
    }

    body.dark table td {
      color: var(--text-main) !important;
      border-color: var(--border) !important;
    }

    body.dark .modal-box {
      background: #292929 !important;
      border: 1px solid #414141 !important;
      color: var(--text-main) !important;
    }

    body.dark .modal-header,
    body.dark .modal-footer,
    body.dark .modal-actions {
      border-color: #414141 !important;
      background: #292929 !important;
    }

    body.dark .modal-title {
      color: var(--text-main) !important;
    }

    body.dark .modal-msg {
      color: var(--text-muted) !important;
    }

    body.dark .toast {
      color: #171717;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    }

    body.dark .btn-main:not(.btn-save):not(.btn-delete):not(.btn-danger):not(.btn-rev) {
      color: #171717;
    }

    body.dark .qty-btn.plus {
      color: #171717;
    }

    body.dark .bottom-actions {
      background-color: rgba(23, 23, 23, 0.92) !important;
      border-top-color: #414141 !important;
    }

    body.dark .tab-btn {
      background: #323232 !important;
      border-color: #414141 !important;
      color: var(--text-muted) !important;
    }

    body.dark .tab-btn.active {
      background: var(--primary) !important;
      color: #171717 !important;
      border-color: var(--primary) !important;
    }

    body.dark .btn-outline {
      background: transparent !important;
      border-color: #414141 !important;
      color: var(--text-muted) !important;
    }

    body.dark .order-row,
    body.dark .list-row,
    body.dark .item-row {
      border-color: #414141 !important;
    }

    body.dark .summary-area,
    body.dark .review-area {
      background: #292929 !important;
      border-color: #414141 !important;
    }

    body.dark .filter-grid input,
    body.dark .filter-grid select {
      background: #292929 !important;
      color: var(--text-main) !important;
      border-color: #414141 !important;
    }

    body.dark .cards-loading-placeholder {
      background: #292929 !important;
    }

    /* Laptop layout (700px+) */
    @media (min-width: 700px) {
      .kpi-grid {
        grid-template-columns: repeat(3, 1fr) !important;
      }

      .branch-cards-grid {
        grid-template-columns: repeat(3, 1fr) !important;
      }

      .content-area {
        padding: 20px 28px 100px 28px !important;
      }
    }

    /* Admin Dashboard — wide desktop layout (scoped to #adminView only) */
    @media (min-width: 1000px) {
      #adminView .kpi-grid {
        grid-template-columns: repeat(4, 1fr) !important;
      }

      #adminDashContent {
        display: grid !important;
        grid-template-columns: 1.5fr 1fr;
        gap: 20px;
        align-items: start;
      }

      #adminDashContent>.kpi-grid {
        grid-column: 1 / -1;
      }
    }
