/* Main Dashboard Layout Styling */
:root {
  --admin-color: #0d6efd;
  --production-color: #198754;
  --orders-color: #ffc107;
  --inventory-color: #6f42c1;   /* purple */
  --procurement-color: #fd7e14; /* orange */
  --superadmin-color: #0dcaf0;  /* cyan */
  --catering-color: #e83e8c;    /* pink */
  --storefront-color: #10b981;  /* emerald */
  --hr-color: #6366f1;          /* indigo — Human Resources */
  --reports-color: #0f766e;     /* teal — Reports hub */
  --sidebar-width: 240px;
  --rail-width: 64px;  /* Slimmer rail for cleaner icon-only mode */
  --expanded-width: 260px;
  --navbar-height: 56px;
  --header-height: 60px;
  --action-bar-height: 70px;

  /* Rail alignment + category bookmarks */
  --rail-icon-left: 15px;   /* icon left edge in both states */
  --rail-marker-w: 28px;    /* width of the colored bookmark in the rail */
  --rail-marker-h: 3px;     /* height of the colored bookmark */
  --rail-marker-x: 18px;    /* left offset for the bookmark inside the rail */

  /* --- Dashboard refresh tokens (Apr 2026) --- */
  --surface-page: #fbf9f5;       /* warm cream page background */
  --surface-card: #ffffff;
  --surface-muted: #f5f3ee;
  --border-soft: #ebe7df;
  --border-strong: #d8d2c5;
  --text-primary: #1c1d1f;
  --text-secondary: #4b4d52;
  --text-muted: #7a7d84;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(28,29,31,.04), 0 1px 3px rgba(28,29,31,.05);
  --shadow-md: 0 6px 16px rgba(28,29,31,.07), 0 2px 4px rgba(28,29,31,.04);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --tile-min-h: 88px;
  --font-body: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

/* Absolute top of the world - force modal/backdrop out of stacking context */
.modal {
  position: fixed !important; /* make sure it's out of any containing context */
  inset: 0;                   /* ensures proper centering math */
  z-index: 20000 !important;
  pointer-events: auto !important;
}
.modal * { pointer-events: auto !important; }

.modal-backdrop {
  position: fixed !important;
  inset: 0;
  z-index: 19990 !important;
  pointer-events: auto !important; /* blocks clicks to page, as intended */
}

/* Datepicker still above page chrome but below modal */
.ui-datepicker {
  z-index: 12000 !important;
}

/* Guardrails: Always below modal/backdrop */
#detached-dropdown-menus .dropdown-menu {
  z-index: 15000 !important;
}

/* Dashboard Container Base */
.dashboard-container {
  min-height: 100vh;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}


.dashboard-content {
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #f9f9f9;
  transition: background-color .2s ease;
}

/* Week Navigation Button Fixes */
#next-week, #prev-week {
  position: relative;
  z-index: auto !important;
  pointer-events: auto;
}

/* ===== Desktop (≥992px): standard sidebar column (no auto-hide) ===== */
@media (min-width: 992px) {
  .dashboard-container {
    display: flex;
  }


  .dashboard-content-wrapper {
    flex: 1 1 auto;
    min-width: 0;
  }

  .dashboard-content {
    min-width: 0;
  }
}

/* ===== Mobile (<992px): sidebar is an off-canvas drawer ===== */
@media (max-width: 991.98px) {
  .dashboard-container {
    display: block;           /* no side-by-side */
  }


  .dashboard-content-wrapper {
    padding-left: 0;                /* content gets full width */
  }

  .dashboard-content {
    margin-left: 0 !important;
    width: 100%;
    padding-left: 0;
  }


  /* Inputs below 16px make iOS auto-zoom on focus now that pinch-zoom
     is re-enabled — keep them at 16px on mobile. */
  .form-control, .form-select {
    font-size: 1rem;
  }
}


/* Dashboard Cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  width: 100%;
}

.dashboard-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  width: 100%;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.dashboard-card .card-header {
  padding: 12px 15px;
}

.dashboard-card .card-body {
  padding: 20px;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.dashboard-card .icon {
  font-size: 36px;
  margin-bottom: 15px;
}

.dashboard-card h5 {
  word-break: break-word;
}

.dashboard-card a {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  overflow: hidden;
}

/* Newsfeed */
.newsfeed-card {
  margin-bottom: 30px;
  border-radius: 10px;
  overflow: hidden;
  max-width: 100%;
}

.newsfeed-header {
  cursor: pointer;
  padding: 15px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.newsfeed-body {
  padding: 0;
  transition: max-height 0.35s ease;
  max-width: 100%;
  overflow-x: hidden;
}

.newsfeed-body .card-body {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Mobile Tab Navigation */
.mobile-tabs {
  display: none;
  overflow-x: auto;
  white-space: nowrap;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dee2e6;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.mobile-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.mobile-tab {
  display: inline-block;
  padding: 8px 15px;
  color: #495057;
  text-decoration: none;
  font-weight: 500;
  border-radius: 20px;
  margin-right: 8px;
  font-size: 0.9rem;
}

.mobile-tab.active {
  background-color: #e9ecef;
}

.tab-indicator {
  position: absolute;
  height: 3px;
  bottom: 0;
  transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 991.98px) {
  .mobile-tabs {
    display: flex;
  }

  .dashboard-cards {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 767.98px) {
  .dashboard-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }
  
  .dashboard-card .icon {
    font-size: 30px;
  }
  
  .dashboard-card .card-body {
    padding: 15px 10px;
  }
  
  .dashboard-card h5 {
    font-size: 16px;
  }
  
  .dashboard-content {
    padding: 15px 10px;
  }
  
  .welcome-card {
    padding: 15px 10px;
  }
  
  .welcome-card h1 {
    font-size: 1.8rem;
  }
  
  .section-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .newsfeed-card {
    width: 100%;
  }
  
  /* Fix alert and list content on mobile */
  .alert {
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .list-group-item {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* Extra small devices */
@media (max-width: 575.98px) {
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .dashboard-card .icon {
    font-size: 24px;
  }
  
  .dashboard-card h5 {
    font-size: 14px;
  }
  
  .container {
    padding-left: 10px;
    padding-right: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .navbar-brand {
    font-size: 1rem;
  }
  
  .navbar {
    padding: 0.5rem;
  }
  
  /* Fix for items with long text that might cause horizontal scroll */
  h5, h4, h3, p, .text-truncate {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Welcome Card */
.welcome-card {
  background-color: #f8f9fa;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 30px;
  text-align: center;
}

.welcome-card h1 {
  margin-bottom: 10px;
  font-weight: bold;
}

/* Animation for newsfeed expand/collapse */
.icon-rotate {
  transition: transform 0.3s ease;
}

.icon-rotate.open {
  transform: rotate(180deg);
}

/* Table styles for responsive tables */
.table-responsive {
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  width: 100%;
}

/* Mobile-responsive table styles */
@media (max-width: 767.98px) {
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
  }
  
  .table th, .table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Optional: stack buttons in actions column */
  .btn-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  
  .btn-group .btn {
    width: 100%;
    margin-left: 0 !important;
  }
}

/* Bootstrap Icon Sizing */
.bi-large {
  font-size: 1.5rem;
}

/* Mobile Form Responsiveness */
@media (max-width: 767.98px) {
  .mobile-form-container {
    margin-top: 1rem !important;
    margin-bottom: 3rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    padding-bottom: 100px !important;
  }
  
  .mobile-responsive-form {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Ensure buttons stay accessible */
  .mobile-button-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
  }
  
  /* Add safe area for mobile keyboards */
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  /* Mobile table improvements */
  .table-responsive {
    border: 0;
    box-shadow: none;
  }
  
  .btn-group-vertical .btn {
    margin-bottom: 2px;
    border-radius: 4px !important;
  }
  
  .btn-group-vertical .btn:last-child {
    margin-bottom: 0;
  }
  
  /* Ensure table cells don't get too cramped */
  .table td {
    padding: 8px 4px;
    vertical-align: middle;
  }
  
  .table th {
    padding: 8px 4px;
    font-size: 0.875rem;
  }
}


/* ==========================================================================
   PORTAL UI - Customer Portal Design System
   All classes prefixed with portal-* to isolate from admin styles
   ========================================================================== */

/* --- Design Tokens --- */
:root {
  --portal-primary: #4f46e5;
  --portal-primary-light: #6366f1;
  --portal-primary-dark: #4338ca;
  --portal-accent: #f59e0b;
  --portal-accent-light: #fbbf24;
  --portal-sidebar-bg: #ffffff;
  --portal-sidebar-hover: #f1f5f9;
  --portal-sidebar-active: rgba(79, 70, 229, 0.08);
  --portal-success: #16a34a;
  --portal-success-light: #22c55e;
  --portal-danger: #dc2626;
  --portal-warning: #f59e0b;
  --portal-info: #0ea5e9;
  --portal-body-bg: #fafaf9;
  --portal-card-bg: #ffffff;
  --portal-text: #1c1917;
  --portal-text-muted: #78716c;
  --portal-border: #e7e5e4;
  --portal-radius: 0.75rem;
  --portal-radius-sm: 0.5rem;
  --portal-radius-lg: 1rem;
  --portal-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --portal-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --portal-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --portal-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --portal-transition: 0.2s ease;
  --portal-sidebar-width: 260px;
}

/* --- Portal Body --- */
.portal-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--portal-body-bg);
  color: var(--portal-text);
  min-height: 100vh;
}

/* --- Portal Layout --- */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Portal Sidebar --- */
.portal-sidebar {
  width: var(--portal-sidebar-width);
  background: var(--portal-sidebar-bg);
  border-right: 1px solid #e2e8f0;
  color: #64748b;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  transition: transform var(--portal-transition);
  overflow-y: auto;
}

.portal-sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.portal-sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #1e293b;
}

.portal-sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--portal-primary), var(--portal-primary-light));
  border-radius: var(--portal-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.portal-sidebar-logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--portal-radius-sm);
  object-fit: contain;
  flex-shrink: 0;
}

.portal-sidebar-brand-text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.portal-sidebar-brand-sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sidebar Navigation */
.portal-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.portal-nav-section {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-top: 0.5rem;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: #64748b;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--portal-transition);
  position: relative;
}

.portal-nav-link:hover {
  color: #1e293b;
  background: var(--portal-sidebar-hover);
}

.portal-nav-link.active {
  color: var(--portal-primary-light);
  background: var(--portal-sidebar-active);
}

.portal-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 3px;
  background: var(--portal-primary-light);
  border-radius: 0 2px 2px 0;
}

.portal-nav-link i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.portal-nav-cta {
  margin: 0.5rem 1rem;
  padding: 0.6rem 1rem;
  background: var(--portal-primary);
  color: #fff !important;
  border-radius: var(--portal-radius-sm);
  justify-content: center;
  font-weight: 600;
}

.portal-nav-cta:hover {
  background: var(--portal-primary-dark) !important;
  color: #fff !important;
}

/* Sidebar Account Footer */
.portal-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--portal-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.portal-sidebar-user {
  flex: 1;
  min-width: 0;
}

.portal-sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-sidebar-user-role {
  font-size: 0.7rem;
  color: #94a3b8;
}

.portal-sidebar-logout {
  color: #94a3b8;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.25rem;
  transition: color var(--portal-transition);
}

.portal-sidebar-logout:hover {
  color: #1e293b;
}

/* --- Portal Main Content --- */
.portal-main {
  flex: 1;
  margin-left: var(--portal-sidebar-width);
  min-height: 100vh;
}

.portal-content {
  padding: 2rem 2.5rem;
  max-width: 1200px;
}

/* --- Portal Mobile Top Bar --- */
.portal-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--portal-card-bg);
  border-bottom: 1px solid var(--portal-border);
  padding: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.portal-topbar-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--portal-text);
  padding: 0;
  cursor: pointer;
  /* 44px minimum tap target */
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;   /* optical alignment: keep icon flush with content edge */
}

.portal-topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--portal-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Sidebar Overlay */
.portal-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
}

/* --- Portal Alerts --- */
.portal-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--portal-radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid transparent;
  animation: portalSlideDown 0.3s ease;
}

.portal-alert-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.portal-alert-content {
  flex: 1;
}

.portal-alert-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: inherit;
}

.portal-alert-close:hover {
  opacity: 0.8;
}

.portal-alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.portal-alert-danger,
.portal-alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.portal-alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.portal-alert-info {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #075985;
}

@keyframes portalSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Portal Cards --- */
.portal-card {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow-sm);
  overflow: hidden;
}

.portal-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--portal-border);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-card-body {
  padding: 1.25rem;
}

/* --- Portal Page Header --- */
.portal-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--portal-text);
}

.portal-page-header-sub {
  font-size: 0.875rem;
  color: var(--portal-text-muted);
  margin-top: 0.125rem;
}

/* --- Portal Buttons --- */
.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--portal-radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--portal-transition);
  font-family: inherit;
}

.portal-btn-primary {
  background: var(--portal-primary);
  color: #fff;
}

.portal-btn-primary:hover {
  background: var(--portal-primary-dark);
  color: #fff;
}

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

.portal-btn-success:hover {
  background: #15803d;
  color: #fff;
}

.portal-btn-outline {
  background: transparent;
  border-color: var(--portal-border);
  color: var(--portal-text);
}

.portal-btn-outline:hover {
  background: #f5f5f4;
  border-color: #d6d3d1;
  color: var(--portal-text);
}

.portal-btn-danger-outline {
  background: transparent;
  border-color: #fecaca;
  color: var(--portal-danger);
}

.portal-btn-danger-outline:hover {
  background: #fef2f2;
}

.portal-btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.portal-btn-lg {
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
}

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

/* --- Portal Welcome Banner --- */
.portal-welcome {
  background: linear-gradient(135deg, var(--portal-primary), var(--portal-primary-light));
  color: #fff;
  border-radius: var(--portal-radius-lg);
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-welcome h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.portal-welcome p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.95rem;
}

.portal-welcome .portal-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

.portal-welcome .portal-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* --- Portal Metric Cards --- */
.portal-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.portal-metric {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 1.25rem;
  box-shadow: var(--portal-shadow-sm);
  transition: box-shadow var(--portal-transition);
}

.portal-metric:hover {
  box-shadow: var(--portal-shadow-md);
}

.portal-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.portal-metric-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--portal-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.portal-metric-icon.teal {
  background: rgba(15, 118, 110, 0.1);
  color: var(--portal-primary);
}

.portal-metric-icon.green {
  background: rgba(22, 163, 74, 0.1);
  color: var(--portal-success);
}

.portal-metric-icon.amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--portal-accent);
}

.portal-metric-icon.red {
  background: rgba(220, 38, 38, 0.1);
  color: var(--portal-danger);
}

.portal-metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-text-muted);
}

.portal-metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--portal-text);
  line-height: 1.2;
}

.portal-metric-action {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--portal-primary);
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.5rem;
}

.portal-metric-action:hover {
  color: var(--portal-primary-dark);
  text-decoration: underline;
}

/* --- Portal Recent Orders (card-list) --- */
.portal-order-list {
  display: flex;
  flex-direction: column;
}

.portal-order-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--portal-border);
  text-decoration: none;
  color: var(--portal-text);
  transition: background var(--portal-transition);
}

.portal-order-item:last-child {
  border-bottom: none;
}

.portal-order-item:hover {
  background: #fafaf9;
  color: var(--portal-text);
}

.portal-activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--portal-border);
}
.portal-activity-item:last-child { border-bottom: none; }

.portal-order-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.portal-order-dot.pending { background: var(--portal-warning); }
.portal-order-dot.confirmed { background: var(--portal-info); }
.portal-order-dot.in_production { background: var(--portal-primary); }
.portal-order-dot.ready { background: var(--portal-success); }
.portal-order-dot.delivered { background: #a8a29e; }
.portal-order-dot.cancelled { background: var(--portal-danger); }

.portal-order-info {
  flex: 1;
  min-width: 0;
}

.portal-order-number {
  font-weight: 600;
  font-size: 0.875rem;
}

.portal-order-meta {
  font-size: 0.8rem;
  color: var(--portal-text-muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.portal-order-amount {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}

.portal-order-chevron {
  color: #d6d3d1;
  font-size: 1rem;
}

/* --- Portal Empty State --- */
.portal-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--portal-text-muted);
}

.portal-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.portal-empty p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.portal-empty-dashed {
  border: 2px dashed var(--portal-border);
  border-radius: var(--portal-radius);
}

/* --- Portal Table --- */
.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table thead th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-text-muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--portal-border);
  background: #fafaf9;
}

.portal-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f5f5f4;
  font-size: 0.875rem;
  vertical-align: middle;
}

.portal-table tbody tr:hover {
  background: #fafaf9;
}

.portal-table tbody tr.clickable {
  cursor: pointer;
}

/* --- Portal Status Badges --- */
.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.portal-badge-pending { background: #fef3c7; color: #92400e; }
.portal-badge-confirmed { background: #e0f2fe; color: #075985; }
.portal-badge-in_production { background: #f0fdfa; color: var(--portal-primary-dark); }
.portal-badge-ready { background: #dcfce7; color: #166534; }
.portal-badge-delivered { background: #f5f5f4; color: #57534e; }
.portal-badge-cancelled { background: #fef2f2; color: #991b1b; }
.portal-badge-active { background: #dcfce7; color: #166534; }
.portal-badge-inactive { background: #f5f5f4; color: #57534e; }

/* --- Portal Filter Pills --- */
.portal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.portal-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--portal-border);
  color: var(--portal-text-muted);
  background: var(--portal-card-bg);
  transition: all var(--portal-transition);
}

.portal-filter-pill:hover {
  border-color: #d6d3d1;
  color: var(--portal-text);
  background: #f5f5f4;
}

.portal-filter-pill.active {
  background: var(--portal-sidebar-bg);
  border-color: var(--portal-sidebar-bg);
  color: #fff;
}

.portal-filter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Portal Pagination --- */
.portal-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
}

.portal-pagination a,
.portal-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--portal-radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--portal-transition);
}

.portal-pagination a {
  color: var(--portal-text-muted);
  border: 1px solid var(--portal-border);
  background: var(--portal-card-bg);
}

.portal-pagination a:hover {
  background: #f5f5f4;
  color: var(--portal-text);
}

.portal-pagination .active {
  background: var(--portal-primary);
  color: #fff;
  border: 1px solid var(--portal-primary);
}

.portal-pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* --- Portal Status Timeline --- */
.portal-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 0;
  position: relative;
}

.portal-timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.portal-timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  background: #e7e5e4;
  color: #a8a29e;
  border: 2px solid #e7e5e4;
  transition: all 0.3s ease;
}

.portal-timeline-step.completed .portal-timeline-dot {
  background: var(--portal-primary);
  border-color: var(--portal-primary);
  color: #fff;
}

.portal-timeline-step.active .portal-timeline-dot {
  background: #fff;
  border-color: var(--portal-primary);
  color: var(--portal-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.15);
  animation: portalPulse 2s ease-in-out infinite;
}

.portal-timeline-label {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #a8a29e;
  text-align: center;
}

.portal-timeline-step.completed .portal-timeline-label,
.portal-timeline-step.active .portal-timeline-label {
  color: var(--portal-primary);
}

.portal-timeline-line {
  position: absolute;
  top: 16px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #e7e5e4;
  z-index: 0;
}

.portal-timeline-line-fill {
  height: 100%;
  background: var(--portal-primary);
  transition: width 0.5s ease;
}

@keyframes portalPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.08); }
}

/* --- Portal Detail Grid --- */
.portal-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.portal-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.portal-detail-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--portal-radius-sm);
  background: #f5f5f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--portal-text-muted);
  flex-shrink: 0;
}

.portal-detail-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-text-muted);
}

.portal-detail-value {
  font-weight: 500;
  font-size: 0.9rem;
}

/* --- Portal Balance Banner --- */
.portal-balance-banner {
  background: linear-gradient(135deg, var(--portal-success), var(--portal-success-light));
  color: #fff;
  border-radius: var(--portal-radius-lg);
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.portal-balance-amount {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.portal-balance-label {
  font-size: 0.85rem;
  opacity: 0.85;
}

.portal-balance-banner .portal-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

.portal-balance-banner .portal-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* --- Portal Transaction Badges --- */
.portal-txn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.portal-txn-deposit { background: #dcfce7; color: #166534; }
.portal-txn-redemption { background: #e0f2fe; color: #075985; }
.portal-txn-refund { background: #fef3c7; color: #92400e; }

/* --- Portal Employee Avatar --- */
.portal-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--portal-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.portal-avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

/* --- Portal Employee Card (mobile) --- */
.portal-employee-card {
  display: none; /* shown on mobile via media query */
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.portal-employee-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-employee-card-info {
  flex: 1;
  min-width: 0;
}

.portal-employee-card-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.portal-employee-card-meta {
  font-size: 0.8rem;
  color: var(--portal-text-muted);
}

.portal-employee-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f5f5f4;
}

/* --- Portal Form Card --- */
.portal-form-card {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow-sm);
  overflow: hidden;
}

.portal-form-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--portal-border);
}

.portal-form-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.portal-form-header p {
  font-size: 0.85rem;
  color: var(--portal-text-muted);
  margin: 0.25rem 0 0;
}

.portal-form-body {
  padding: 1.5rem;
}

.portal-form-section {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--portal-border);
  margin: 1.5rem 0 1rem;
}

.portal-form-section:first-child {
  margin-top: 0;
}

/* Form inputs within portal */
.portal-form-card .form-control,
.portal-form-card .form-select {
  border-radius: var(--portal-radius-sm);
  border-color: var(--portal-border);
  font-size: 0.875rem;
}

.portal-form-card .form-control:focus,
.portal-form-card .form-select:focus {
  border-color: var(--portal-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

/* --- Portal Limits Section --- */
.portal-limits-section {
  background: #fafaf9;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  padding: 1.25rem;
}

/* --- Portal Upload Zone --- */
.portal-upload-zone {
  border: 2px dashed var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: all var(--portal-transition);
  cursor: pointer;
}

.portal-upload-zone:hover {
  border-color: var(--portal-primary);
  background: rgba(15, 118, 110, 0.03);
}

.portal-upload-zone i {
  font-size: 2.5rem;
  color: var(--portal-text-muted);
  margin-bottom: 0.75rem;
}

.portal-upload-zone p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--portal-text-muted);
}

/* --- Portal Menu Item Cards (browse_menu) --- */
.portal-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.portal-menu-card {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 1rem 1.25rem;
  transition: all var(--portal-transition);
}

.portal-menu-card:hover {
  box-shadow: var(--portal-shadow-md);
}

.portal-menu-card.in-cart {
  border-color: var(--portal-primary);
  background: #f0fdfa;
}

.portal-menu-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.portal-menu-card-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.portal-menu-card-price {
  font-weight: 700;
  color: var(--portal-primary);
  white-space: nowrap;
}

.portal-menu-card-desc {
  font-size: 0.8rem;
  color: var(--portal-text-muted);
  margin-bottom: 0.75rem;
}

.portal-qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.portal-qty-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--portal-radius-sm);
  border: 1px solid var(--portal-border);
  background: var(--portal-card-bg);
  color: var(--portal-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--portal-transition);
}

.portal-qty-btn:hover {
  background: #f5f5f4;
}

.portal-qty-input {
  width: 48px;
  text-align: center;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  padding: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.portal-qty-input:focus {
  outline: none;
  border-color: var(--portal-primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.portal-add-btn {
  margin-left: auto;
  padding: 0.35rem 0.75rem;
  background: var(--portal-primary);
  color: #fff;
  border: none;
  border-radius: var(--portal-radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--portal-transition);
}

.portal-add-btn:hover {
  background: var(--portal-primary-dark);
}

.portal-menu-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* --- Portal Cart Sidebar --- */
.portal-cart {
  position: sticky;
  top: 1rem;
}

.portal-cart-header {
  background: var(--portal-sidebar-bg);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: var(--portal-radius) var(--portal-radius) 0 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-cart-body {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-top: none;
  padding: 1rem 1.25rem;
}

.portal-cart-empty {
  text-align: center;
  color: var(--portal-text-muted);
  padding: 1.5rem 0;
  font-size: 0.875rem;
}

.portal-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f5f5f4;
}

.portal-cart-item:last-child {
  border-bottom: none;
}

.portal-cart-item-name {
  font-weight: 500;
  font-size: 0.85rem;
}

.portal-cart-item-qty {
  font-size: 0.8rem;
  color: var(--portal-text-muted);
}

.portal-cart-remove {
  background: none;
  border: none;
  color: #d6d3d1;
  cursor: pointer;
  padding: 0.2rem;
  font-size: 1rem;
  transition: color var(--portal-transition);
}

.portal-cart-remove:hover {
  color: var(--portal-danger);
}

.portal-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0;
  margin-top: 0.5rem;
  border-top: 2px solid var(--portal-border);
  font-weight: 700;
  font-size: 1.1rem;
}

.portal-cart-details {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-top: none;
  border-radius: 0 0 var(--portal-radius) var(--portal-radius);
  padding: 1.25rem;
}

/* Payment Method Pills */
.portal-pay-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-pay-pill {
  flex: 1;
  min-width: 0;
}

.portal-pay-pill input[type="radio"] {
  display: none;
}

.portal-pay-pill label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--portal-transition);
  text-align: center;
  color: var(--portal-text-muted);
  background: var(--portal-card-bg);
}

.portal-pay-pill input[type="radio"]:checked + label {
  border-color: var(--portal-primary);
  background: rgba(15, 118, 110, 0.05);
  color: var(--portal-primary);
}

.portal-pay-pill label:hover {
  border-color: #d6d3d1;
}

/* Portal Order Submit */
.portal-submit-order {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--portal-success);
  color: #fff;
  border: none;
  border-radius: var(--portal-radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background var(--portal-transition);
}

.portal-submit-order:hover {
  background: #15803d;
}

.portal-submit-order:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Portal Category Header --- */
.portal-category-header {
  font-size: 1.1rem;
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--portal-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-category-count {
  background: #f5f5f4;
  color: var(--portal-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

/* --- Portal Cancelled State --- */
.portal-cancelled-state {
  text-align: center;
  padding: 2rem;
  color: var(--portal-danger);
}

.portal-cancelled-state i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.portal-cancelled-state p {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
}

/* --- Mobile Cards (hidden on desktop) --- */
.portal-mobile-cards {
  display: none;
}

/* --- Responsive: Mobile --- */
@media (max-width: 767.98px) {
  .portal-sidebar {
    transform: translateX(-100%);
  }

  .portal-sidebar.open {
    transform: translateX(0);
  }

  .portal-sidebar-overlay.open {
    display: block;
  }

  .portal-topbar {
    display: flex;
  }

  .portal-main {
    margin-left: 0;
  }

  .portal-content {
    padding: 1.25rem 1rem;
  }

  .portal-welcome {
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-metrics {
    grid-template-columns: 1fr;
  }

  .portal-menu-grid {
    grid-template-columns: 1fr;
  }

  .portal-timeline {
    gap: 0;
  }

  .portal-timeline-label {
    font-size: 0.6rem;
  }

  .portal-timeline-dot {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }

  .portal-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .portal-balance-banner {
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-balance-amount {
    font-size: 2rem;
  }

  /* Show mobile cards, hide desktop table */
  .portal-mobile-cards {
    display: block;
  }

  .portal-desktop-table {
    display: none;
  }

  .portal-employee-card {
    display: block;
  }

  .portal-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .portal-sidebar,
  .portal-timeline-step.active .portal-timeline-dot,
  .portal-alert,
  .portal-menu-card,
  .portal-metric {
    animation: none !important;
    transition: none !important;
  }
}

/* Portal utility classes — added Jul 2026 inline-style consolidation */

/* Form field label (pairs with Bootstrap .form-label on portal forms) */
.portal-form-label {
  font-weight: 500;
  font-size: 0.85rem;
}

/* Font-size utilities (!important so they win over component rules
   such as .portal-table tbody td, mirroring Bootstrap utility behavior) */
.portal-fs-xs { font-size: 0.8rem !important; }
.portal-fs-sm { font-size: 0.85rem !important; }
.portal-fs-md { font-size: 0.9rem !important; }

/* Text color utilities */
.portal-text-muted { color: var(--portal-text-muted) !important; }
.portal-text-success { color: var(--portal-success) !important; }
.portal-text-danger { color: var(--portal-danger) !important; }
.portal-text-warning { color: var(--portal-warning) !important; }
.portal-text-info { color: var(--portal-info) !important; }

/* Small muted hint text (mobile-card meta lines, helper notes) */
.portal-hint {
  font-size: 0.8rem;
  color: var(--portal-text-muted);
}

/* Quiet link in the portal accent color */
.portal-link {
  color: var(--portal-primary);
  text-decoration: none;
}

/* Inline code chip (employee codes, CSV column names) */
.portal-code-chip {
  font-size: 0.8rem;
  background: #f5f5f4;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Extra badge palettes (used with .portal-badge / .portal-txn-badge) */
.portal-badge-neutral { background: #f5f5f4; color: #57534e; }
.portal-badge-danger { background: #fef2f2; color: #991b1b; }

/* Muted note shown inline next to a badge explaining it */
.portal-badge-note {
  color: var(--portal-text-muted);
  font-size: 0.82rem;
  margin-left: 0.25rem;
}

/* Mobile card lists inside .portal-mobile-cards */
.portal-mobile-list { padding: 0.5rem; }
.portal-mobile-list-item {
  padding: 0.75rem;
  border-bottom: 1px solid var(--portal-border);
}

/* Bold amount on mobile cards / activity rows */
.portal-amount-strong {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Mini stat cards (spending summary on employee detail) */
.portal-stat-card { text-align: center; padding: 0.75rem; }
.portal-stat-label {
  font-size: 0.75rem;
  color: var(--portal-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.portal-stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--portal-text);
}
.portal-stat-sub { font-size: 0.7rem; color: var(--portal-text-muted); }

/* Filter-pill dot colors (credits + order history filters) */
.portal-filter-dot.success { background: var(--portal-success); }
.portal-filter-dot.danger { background: var(--portal-danger); }
.portal-filter-dot.info { background: var(--portal-info); }
.portal-filter-dot.warning { background: var(--portal-warning); }
.portal-filter-dot.primary { background: var(--portal-primary); }
.portal-filter-dot.neutral { background: #a8a29e; }

/* Key/value read-only table (program overview) */
.portal-kv-table {
  width: 100%;
  font-size: 0.9rem;
  border-collapse: collapse;
}
.portal-kv-table td { padding: 0.5rem 0.75rem; }
.portal-kv-label { font-weight: 500; color: var(--portal-text-muted); }

/* ============================================================================
   Dashboard Refresh (Apr 2026) — refined / professional control plane
   ============================================================================
   Scoped under .dashboard-refresh on .dashboard-content so existing pages are
   untouched. The dashboard.html template adds the class.
   ========================================================================= */

.dashboard-refresh {
  background-color: var(--surface-page);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(28,29,31,.035) 1px, transparent 0);
  background-size: 22px 22px;
  font-family: var(--font-body);
  color: var(--text-primary);
}

.dashboard-refresh h1,
.dashboard-refresh h2,
.dashboard-refresh h3,
.dashboard-refresh h4,
.dashboard-refresh h5,
.dashboard-refresh h6 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* --- Hero / command-center header ------------------------------------- */
.dashboard-refresh .dash-hero {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-6);
  margin: 0 0 var(--space-6) 0;
  background: linear-gradient(135deg, #ffffff 0%, #fbf6ec 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.dashboard-refresh .dash-hero__greet {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dashboard-refresh .dash-hero__role {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-body);
}
.dashboard-refresh .dash-hero__name {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  line-height: 1.15;
}
.dashboard-refresh .dash-hero__name small {
  font-weight: 500;
  color: var(--text-secondary);
}
.dashboard-refresh .dash-hero__kpis {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.dashboard-refresh .dash-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  min-width: 120px;
}
.dashboard-refresh .dash-kpi__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dashboard-refresh .dash-kpi__value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: 2px;
}
.dashboard-refresh .dash-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 18px;
  background: var(--text-primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: background .15s ease, transform .15s ease;
}
.dashboard-refresh .dash-hero__cta:hover {
  background: #000;
  transform: translateY(-1px);
  color: #fff;
}

/* --- Tile search ----------------------------------------------------- */
.dashboard-refresh .dash-search {
  position: relative;
  margin: 0 0 var(--space-6) 0;
}
.dashboard-refresh .dash-search input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dashboard-refresh .dash-search input::placeholder { color: var(--text-muted); }
.dashboard-refresh .dash-search input:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(28,29,31,.06);
}
.dashboard-refresh .dash-search__icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}
.dashboard-refresh .dash-search__empty {
  display: none;
  text-align: center;
  padding: var(--space-6);
  color: var(--text-muted);
  font-style: italic;
}

/* --- Section titles -------------------------------------------------- */
.dashboard-refresh .section-container {
  margin-bottom: var(--space-8);
}
.dashboard-refresh .section-container.is-empty { display: none; }

.dashboard-refresh .section-title {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding-left: 14px;
  margin: 0 0 var(--space-5) 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text-primary);
  text-transform: uppercase;
  border-left: none; /* unify away the inline border-left */
}
.dashboard-refresh .section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--section-color, var(--text-muted));
}
.dashboard-refresh .section-count {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  background: var(--surface-muted);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}
.dashboard-refresh .section-title--orders      { --section-color: var(--orders-color); }
.dashboard-refresh .section-title--production  { --section-color: var(--production-color); }
.dashboard-refresh .section-title--admin       { --section-color: var(--admin-color); }
.dashboard-refresh .section-title--inventory   { --section-color: var(--inventory-color); }
.dashboard-refresh .section-title--procurement { --section-color: var(--procurement-color); }
.dashboard-refresh .section-title--catering    { --section-color: var(--catering-color); }
.dashboard-refresh .section-title--storefront  { --section-color: var(--storefront-color); }
.dashboard-refresh .section-title--hr          { --section-color: var(--hr-color); }
.dashboard-refresh .section-title--superadmin  { --section-color: var(--superadmin-color); }

.dashboard-refresh .section-caption {
  margin: -8px 0 var(--space-4) 14px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* --- Card grid ------------------------------------------------------- */
.dashboard-refresh .dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}
@media (max-width: 1400px) {
  .dashboard-refresh .dashboard-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  .dashboard-refresh .dashboard-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 576px) {
  .dashboard-refresh .dashboard-cards { grid-template-columns: 1fr; }
}

/* --- Tile (icon-left, title + description) -------------------------- */
.dashboard-refresh .dashboard-card {
  --accent: var(--section-color, var(--text-muted));
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  overflow: hidden;
  min-height: var(--tile-min-h);
}
.dashboard-refresh .dashboard-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.dashboard-refresh .dashboard-card > a {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 100%;
  padding: var(--space-4);
  text-decoration: none;
  color: inherit;
}
.dashboard-refresh .dashboard-card .icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-card));
  color: color-mix(in srgb, var(--accent) 80%, var(--text-primary));
  font-size: 20px;
  line-height: 1;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.dashboard-refresh .dashboard-card:hover .icon {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-card));
  color: color-mix(in srgb, var(--accent) 95%, #000);
  transform: scale(1.04);
}
.dashboard-refresh .dashboard-card .icon i { line-height: 1; }
.dashboard-refresh .dashboard-card .card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dashboard-refresh .dashboard-card h5 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-refresh .dashboard-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  hyphens: auto;
}

/* Section accent inheritance for cards */
.dashboard-refresh #ordersSection      { --section-color: var(--orders-color); }
.dashboard-refresh #productionSection  { --section-color: var(--production-color); }
.dashboard-refresh #adminSection       { --section-color: var(--admin-color); }
.dashboard-refresh #procurementSection { --section-color: var(--procurement-color); }
.dashboard-refresh #cateringSection    { --section-color: var(--catering-color); }
.dashboard-refresh #storefrontSection  { --section-color: var(--storefront-color); }
.dashboard-refresh #hrSection          { --section-color: var(--hr-color); }
.dashboard-refresh #workflowSection    { --section-color: var(--inventory-color); }
.dashboard-refresh #superadminSection  { --section-color: var(--superadmin-color); }

/* Hide the legacy bright-color icon classes inside refreshed dashboard
   (Bootstrap text-* still wins on color without this) */
.dashboard-refresh .dashboard-card .icon.text-primary,
.dashboard-refresh .dashboard-card .icon.text-success,
.dashboard-refresh .dashboard-card .icon.text-warning,
.dashboard-refresh .dashboard-card .icon.text-info,
.dashboard-refresh .dashboard-card .icon.text-danger,
.dashboard-refresh .dashboard-card .icon.text-secondary {
  color: color-mix(in srgb, var(--accent) 80%, var(--text-primary)) !important;
}

/* --- Welcome card legacy override (we keep the element for now for
       the "no locations" path, but the new hero replaces it visually) */
.dashboard-refresh .welcome-card { display: none; }

/* --- Newsfeed integration ------------------------------------------- */
.dashboard-refresh .newsfeed-card {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm) !important;
  margin: 0 0 var(--space-6) 0;
  overflow: hidden;
}
.dashboard-refresh .newsfeed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 20px !important;
  background: linear-gradient(180deg, #fbfaf6 0%, #f6f3ec 100%) !important;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  user-select: none;
  transition: background .15s ease;
}
.dashboard-refresh .newsfeed-header:hover {
  background: var(--surface-muted) !important;
}
.dashboard-refresh .newsfeed-header__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  min-width: 0;
}
.dashboard-refresh .newsfeed-header__title > .bi-megaphone-fill {
  color: var(--text-secondary);
  font-size: 18px;
}
.dashboard-refresh .newsfeed-header h4 {
  font-family: var(--font-display);
  font-size: 13px !important;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 !important;
}
.dashboard-refresh .newsfeed-summary {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.dashboard-refresh .newsfeed-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  white-space: nowrap;
}
.dashboard-refresh .newsfeed-chip i { font-size: 11.5px; line-height: 1; }
.dashboard-refresh .newsfeed-chip--alert {
  background: color-mix(in srgb, #f59e0b 14%, var(--surface-card));
  border-color: color-mix(in srgb, #f59e0b 35%, var(--border-soft));
  color: #92400e;
}
.dashboard-refresh .newsfeed-chip--danger {
  background: color-mix(in srgb, #dc2626 12%, var(--surface-card));
  border-color: color-mix(in srgb, #dc2626 32%, var(--border-soft));
  color: #991b1b;
}
.dashboard-refresh .newsfeed-chip--quiet {
  background: color-mix(in srgb, var(--production-color) 12%, var(--surface-card));
  border-color: color-mix(in srgb, var(--production-color) 28%, var(--border-soft));
  color: #14532d;
}
.dashboard-refresh .newsfeed-body {
  background: var(--surface-card);
}
.dashboard-refresh .newsfeed-body .card-body {
  padding: var(--space-6) !important;
}
.dashboard-refresh .icon-rotate {
  transition: transform .25s ease;
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
}

/* Filter section */
.dashboard-refresh #filterSection {
  background: var(--surface-muted) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-4) !important;
  margin: 0 0 var(--space-5) 0 !important;
  color: inherit !important;
}
.dashboard-refresh #filterSection h6 {
  font-family: var(--font-display);
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.dashboard-refresh #filterSection .form-label {
  font-family: var(--font-body);
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted) !important;
  margin-bottom: 4px !important;
}
.dashboard-refresh #filterSection .form-control,
.dashboard-refresh #filterSection .form-select {
  font-family: var(--font-body);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  padding: 7px 10px;
  color: var(--text-primary);
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dashboard-refresh #filterSection .form-control:focus,
.dashboard-refresh #filterSection .form-select:focus {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(28,29,31,.06);
  outline: none;
}
.dashboard-refresh #filterSection .btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
}
.dashboard-refresh #filterSection .btn-primary {
  background: var(--text-primary);
  border-color: var(--text-primary);
}
.dashboard-refresh #filterSection .btn-primary:hover,
.dashboard-refresh #filterSection .btn-primary:focus {
  background: #000;
  border-color: #000;
}
.dashboard-refresh #filterSection .btn-outline-secondary {
  background: var(--surface-card);
  border-color: var(--border-soft);
  color: var(--text-secondary);
}
.dashboard-refresh #filterSection .btn-outline-secondary:hover,
.dashboard-refresh #filterSection .btn-outline-secondary.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff;
}

/* News blocks: re-theme Bootstrap alerts to calm tinted-stripe panels */
.dashboard-refresh .newsfeed-body > .card-body > .alert,
.dashboard-refresh .newsfeed-body .alert {
  background: var(--surface-card) !important;
  border: 1px solid var(--border-soft) !important;
  border-left-width: 3px !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5) !important;
  margin: 0 0 var(--space-4) 0 !important;
  box-shadow: none !important;
}
.dashboard-refresh .newsfeed-body .alert.mt-3,
.dashboard-refresh .newsfeed-body .alert.mt-4 {
  margin-top: var(--space-4) !important;
}
.dashboard-refresh .newsfeed-body .alert h5,
.dashboard-refresh .newsfeed-body .alert h6 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}
.dashboard-refresh .newsfeed-body .alert > .d-flex h5,
.dashboard-refresh .newsfeed-body .alert > .d-flex h6 { margin: 0; }
.dashboard-refresh .newsfeed-body .alert-info {
  border-left-color: var(--admin-color) !important;
  background: color-mix(in srgb, var(--admin-color) 4%, var(--surface-card)) !important;
}
.dashboard-refresh .newsfeed-body .alert-warning {
  border-left-color: #f59e0b !important;
  background: color-mix(in srgb, #f59e0b 6%, var(--surface-card)) !important;
}
.dashboard-refresh .newsfeed-body .alert-secondary {
  border-left-color: var(--text-muted) !important;
  background: var(--surface-card) !important;
}
.dashboard-refresh .newsfeed-body .alert-danger {
  border-left-color: #dc2626 !important;
  background: color-mix(in srgb, #dc2626 5%, var(--surface-card)) !important;
}

/* Badges inside newsfeed: pill style, calm tints */
.dashboard-refresh .newsfeed-body .badge {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px !important;
  padding: 4px 9px !important;
  border-radius: 999px !important;
  letter-spacing: .02em;
}
.dashboard-refresh .newsfeed-body .badge.bg-warning {
  background: color-mix(in srgb, #f59e0b 18%, var(--surface-card)) !important;
  color: #92400e !important;
}
.dashboard-refresh .newsfeed-body .badge.bg-secondary {
  background: var(--surface-muted) !important;
  color: var(--text-secondary) !important;
}
.dashboard-refresh .newsfeed-body .badge.bg-danger {
  background: color-mix(in srgb, #dc2626 14%, var(--surface-card)) !important;
  color: #991b1b !important;
}
.dashboard-refresh .newsfeed-body .badge.bg-primary {
  background: color-mix(in srgb, var(--admin-color) 14%, var(--surface-card)) !important;
  color: color-mix(in srgb, var(--admin-color) 80%, #000) !important;
}
.dashboard-refresh .newsfeed-body .badge.bg-info {
  background: color-mix(in srgb, #0ea5e9 12%, var(--surface-card)) !important;
  color: #075985 !important;
}
.dashboard-refresh .newsfeed-body .badge.bg-success {
  background: color-mix(in srgb, var(--production-color) 14%, var(--surface-card)) !important;
  color: #14532d !important;
}

/* Tables inside newsfeed */
.dashboard-refresh .newsfeed-body .table {
  font-family: var(--font-body);
  font-size: 13.5px;
  margin-bottom: 0;
  --bs-table-bg: transparent;
}
.dashboard-refresh .newsfeed-body .table thead th {
  background: var(--surface-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 12px;
}
.dashboard-refresh .newsfeed-body .table tbody td {
  border-color: var(--border-soft);
  padding: 10px 12px;
  vertical-align: middle;
  color: var(--text-primary);
}
.dashboard-refresh .newsfeed-body .table-hover tbody tr:hover {
  background: var(--surface-muted);
}

/* List groups (daily alerts, eod loss) */
.dashboard-refresh .newsfeed-body .list-group-flush > .list-group-item {
  background: transparent;
  border-color: var(--border-soft);
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--text-primary);
}
.dashboard-refresh .newsfeed-body .list-group-flush > .list-group-item:first-child { border-top: 0; }
.dashboard-refresh .newsfeed-body .list-group-flush > .list-group-item:last-child { border-bottom: 0; }
.dashboard-refresh .newsfeed-body .list-group-item a {
  font-weight: 600;
  text-decoration: none;
}
.dashboard-refresh .newsfeed-body .list-group-item a.text-primary { color: var(--admin-color) !important; }
.dashboard-refresh .newsfeed-body .list-group-item a.text-danger { color: #dc2626 !important; }
.dashboard-refresh .newsfeed-body .list-group-item a:hover { text-decoration: underline; }

/* Accordion (user activity) */
.dashboard-refresh .newsfeed-body .accordion-item {
  background: var(--surface-card);
  border: 1px solid var(--border-soft) !important;
  border-radius: var(--radius-sm) !important;
  margin-bottom: var(--space-2);
  overflow: hidden;
}
.dashboard-refresh .newsfeed-body .accordion-button {
  background: var(--surface-card) !important;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  padding: 10px 14px !important;
}
.dashboard-refresh .newsfeed-body .accordion-button:not(.collapsed) {
  background: var(--surface-muted) !important;
  color: var(--text-primary) !important;
}
.dashboard-refresh .newsfeed-body .accordion-button:focus {
  border-color: var(--border-soft);
  box-shadow: 0 0 0 3px rgba(28,29,31,.06) !important;
}
.dashboard-refresh .newsfeed-body .accordion-body {
  background: var(--surface-card) !important;
  padding: 10px 14px !important;
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* "View Report" button on EOD loss items */
.dashboard-refresh .newsfeed-body .btn-outline-danger {
  background: var(--surface-card);
  border-color: color-mix(in srgb, #dc2626 32%, var(--border-soft));
  color: #b91c1c;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.dashboard-refresh .newsfeed-body .btn-outline-danger:hover {
  background: color-mix(in srgb, #dc2626 12%, var(--surface-card));
  border-color: #dc2626;
  color: #991b1b;
}

@media (max-width: 768px) {
  .dashboard-refresh .newsfeed-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .dashboard-refresh .newsfeed-summary { width: 100%; }
}

/* --- Mobile tabs in refreshed dashboard --- */
.dashboard-refresh .mobile-tabs {
  display: none;
}
@media (max-width: 768px) {
  .dashboard-refresh .mobile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-2);
    margin: 0 0 var(--space-4) 0;
    background: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow-x: auto;
  }
  .dashboard-refresh .mobile-tab {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
  }
  .dashboard-refresh .mobile-tab.active {
    background: var(--text-primary);
    color: #fff;
  }
}


/* ── Moved from layout.html (Sep 2026): global bits any page may use ── */
.loading-spinner {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(255, 255, 255, .8); z-index: 9999;
  display: none; align-items: center; justify-content: center; flex-direction: column;
}
#item-suggestions {
  position: absolute; z-index: 15000; /* dropdown tier: below modals (20000) */
  background: var(--cream-card); border: 1px solid var(--line-strong); width: 100%; cursor: pointer;
}
#item-suggestions li { padding: 6px 10px; list-style-type: none; }
#item-suggestions li:hover { background: var(--cream-muted); }
.no-orders { background-color: var(--brick-100); }

/* --- Notification stack + inline page alerts (Sep 2026) --------------- */
.notification-stack {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem;
  width: min(500px, calc(100vw - 32px)); pointer-events: none;
}
.notification-stack .notification-banner {
  margin: 0; pointer-events: auto; box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
  animation: nb-in .25s ease-out;
}
.notification-stack .notification-banner.slide-out { animation: nb-out .25s ease-in forwards; }
.notification-banner__text { overflow-wrap: anywhere; }
@keyframes nb-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nb-out { to { transform: translateY(-8px); opacity: 0; } }
@media (max-width: 576px) {
  .notification-stack {
    top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); left: 16px; right: 16px; width: auto;
  }
  @keyframes nb-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}
/* Persistent message region on order pages: toasts fade, this stays until the next save */
.page-alerts:empty { display: none; }
.page-alerts .alert { margin-bottom: 1rem; }
/* AppUI dialog body: multi-line results (connection tests, sync summaries) keep their line breaks */
.appui-prewrap { white-space: pre-line; }
