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

:root {
  --navy: #0D1B2A;
  --mid: #1C3B5A;
  --yellow: #F5C518;
  --light: #D6E4F0;
  --gray: #F2F4F7;
  --border: #D0D4DA;
  --green-bg: #D4EDDA; --green-fg: #155724;
  --yellow-bg: #FFF3CD; --yellow-fg: #856404;
  --red-bg: #F8D7DA; --red-fg: #721C24;
  --gray-bg: #E2E3E5; --gray-fg: #555;
  --blue-bg: #CCE5FF; --blue-fg: #004085;
  --ecl-orange: #f15d22;
  --new-bg: #e8f5e9; --new-fg: #1b5e20;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f3f6fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
  color: var(--navy);
}

button, input, select, textarea {
  font: inherit;
}

button { cursor: pointer; }

.hidden { display: none !important; }

.header {
  background: var(--navy);
  border-bottom: 3px solid var(--yellow);
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.header-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-logo { height: 30px; width: auto; border-radius: 4px; flex-shrink: 0; }
.header h1 { color: var(--yellow); font-size: 12px; letter-spacing: .3px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header p { color: #7a96ae; font-size: 10px; margin-top: 2px; display: none; }
@media (max-width: 599px) { .header-brand > div { display: none; } }
@media (min-width: 480px) {
  .header { padding: 10px 14px; }
  .header h1 { font-size: 17px; }
  .header p { display: block; }
  .header-logo { height: 46px; }
}
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-divider { width: 1px; height: 24px; background: rgba(255,255,255,.25); margin: 0 4px; }
@media (min-width: 480px) { .header-right { gap: 10px; } .header-divider { margin: 0 8px; } }
.client-tag { background: var(--yellow); color: var(--navy); font-size: 8px; font-weight: bold; padding: 3px 6px; border-radius: 20px; white-space: nowrap; max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 480px) { .client-tag { font-size: 10px; max-width: none; padding: 3px 8px; } }
.logout-btn { background: #dc3545; color: white; border: none; padding: 5px 8px; font-size: 10px; font-weight: bold; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.logout-btn:active { background: #bd2130; }
@media (min-width: 480px) { .logout-btn { font-size: 11px; padding: 5px 10px; } }

.notification-anchor { position: relative; }
.notification-button { width: 32px; height: 32px; position: relative; background: transparent; border: 1px solid #7a96ae; border-radius: 4px; color: white; font-size: 16px; }
.notification-button:focus-visible, .notification-row:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.notification-badge { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 1px 3px; background: #c83232; color: white; border-radius: 9px; font-size: 10px; font-weight: bold; line-height: 16px; }
.notification-panel { position: fixed; top: 56px; right: 10px; width: min(340px, calc(100vw - 20px)); max-height: min(420px, 70vh); overflow-y: auto; background: white; color: var(--navy); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 10px 24px rgba(0,0,0,.2); z-index: 120; }
.notification-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid var(--border); }
.notification-heading button { border: none; background: transparent; color: var(--mid); font-size: 12px; font-weight: bold; }
.notification-list { padding: 8px 12px; font-size: 12px; }
.notification-row { display: block; width: 100%; padding: 10px 0; border: none; border-bottom: 1px solid var(--border); background: transparent; color: var(--navy); text-align: left; }
.notification-row:last-child { border-bottom: none; }
.notification-row strong { display: block; font-size: 11px; margin-bottom: 3px; }
.notification-row span { display: block; overflow-wrap: anywhere; }

.admin-switcher { display: none; align-items: center; gap: 6px; padding: 5px 10px 5px; background: rgba(245,197,24,.08); border-bottom: 1px solid rgba(245,197,24,.2); }
.admin-switcher.show { display: flex; flex-wrap: wrap; }
.admin-switcher label { color: var(--yellow); font-size: 10px; font-weight: bold; white-space: nowrap; }
.admin-switcher-btn { padding: 4px 10px; border-radius: 20px; border: 1.5px solid rgba(245,197,24,.4); background: transparent; color: #8ca0b5; font-size: 10px; font-weight: bold; cursor: pointer; white-space: nowrap; }
.admin-switcher-btn.active { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }

.tabs { display: flex; gap: 4px; padding: 8px max(12px, calc((100vw - 1048px) / 2)); background: white; border-bottom: 1px solid #dfe7f1; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; min-width: 72px; padding: 10px 12px; text-align: center; color: #526378; background: transparent; font-size: 13px; font-weight: 600; cursor: pointer; border: 0; border-radius: 8px; user-select: none; white-space: nowrap; }
.tab:hover { background: #f1f5f9; color: var(--navy); }
.tab.active { color: white; background: var(--mid); }
.tab:focus-visible, .section-panel > summary:focus-visible { outline: 3px solid var(--mid); outline-offset: 2px; }

.content { flex: 1; padding: 18px 12px; max-width: 1080px; margin: 0 auto; width: 100%; min-width: 0; }
@media (min-width: 600px) { .content { padding: 28px 16px; } }
.page { display: none; }
.page.active { display: block; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.summary-card { background: white; border-radius: 10px; padding: 10px 4px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.summary-card .num { font-size: 20px; font-weight: bold; color: var(--navy); }
.summary-card .lbl { font-size: 8px; font-weight: bold; color: var(--mid); margin-top: 2px; }
.summary-card.warn { background: var(--yellow-bg); } .summary-card.warn .num { color: var(--yellow-fg); }
.summary-card.danger { background: var(--red-bg); } .summary-card.danger .num { color: var(--red-fg); }
@media (min-width: 480px) {
  .summary-grid { gap: 8px; margin-bottom: 14px; }
  .summary-card { padding: 12px 8px; }
  .summary-card .num { font-size: 28px; }
  .summary-card .lbl { font-size: 10px; }
}

.filter-bar { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.filter-bar input { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; background: white; }
.filter-bar input:focus { outline: none; border-color: var(--mid); }
.filter-btn-row { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-btn { flex: 1 1 auto; padding: 7px 8px; border: 1.5px solid var(--border); border-radius: 6px; background: white; font-size: 10px; font-weight: bold; cursor: pointer; color: var(--mid); white-space: nowrap; }
.filter-btn.active { background: var(--mid); color: white; border-color: var(--mid); }
@media (min-width: 480px) { .filter-btn { font-size: 11px; padding: 8px 10px; } }

.data-cards { display: flex; flex-direction: column; gap: 8px; }
.data-card { background: white; border-radius: 10px; padding: 12px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.data-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.data-card-title { font-weight: bold; color: var(--navy); font-size: 13px; line-height: 1.3; }
.data-card-sub { color: #777; font-size: 11px; margin-top: 2px; }
.data-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; margin-top: 8px; font-size: 12px; }
.data-card-grid .dcg-lbl { color: #888; font-size: 9px; font-weight: bold; text-transform: uppercase; letter-spacing: .3px; }
.data-card-grid .dcg-val { color: #222; font-weight: 600; }
.data-card-actions { display: flex; gap: 6px; margin-top: 10px; justify-content: flex-end; align-items: center; }

.table-shell { position: relative; }
.table-wrap { background: white; border-radius: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 480px; }
.table-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 1px solid rgba(13, 27, 42, 0.18);
  border-radius: 50%;
  background: rgba(13, 27, 42, 0.88);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(13, 27, 42, 0.18);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}
.table-scroll-btn.left { left: 6px; }
.table-scroll-btn.right { right: 6px; }
.table-scroll-btn.visible { opacity: 1; pointer-events: auto; }
.table-scroll-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}
.table-scroll-btn:hover { background: rgba(13, 27, 42, 1); }
thead tr { background: var(--mid); }
thead th { padding: 9px 10px; color: white; font-size: 10px; text-align: left; font-weight: bold; letter-spacing: .4px; white-space: nowrap; }
thead th.center { text-align: center; }
tbody tr { border-bottom: 1px solid #eef0f3; }
tbody tr:nth-child(even) { background: var(--gray); }
tbody tr:hover { background: var(--light); }
td { padding: 8px 10px; vertical-align: middle; }
td.center { text-align: center; }
.sku-cell { font-weight: bold; color: var(--navy); font-size: 11px; white-space: nowrap; }
.title-cell { color: #333; font-size: 12px; }
.qty-cell { font-weight: bold; font-size: 14px; color: var(--navy); text-align: center; white-space: nowrap; }
.data-cards { display: none; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: bold; white-space: nowrap; }
.badge-in { background: var(--green-bg); color: var(--green-fg); }
.badge-low { background: var(--yellow-bg); color: var(--yellow-fg); }
.badge-out { background: var(--red-bg); color: var(--red-fg); }
.badge-fully { background: var(--green-bg); color: var(--green-fg); }
.badge-partial { background: var(--yellow-bg); color: var(--yellow-fg); }
.badge-not { background: var(--red-bg); color: var(--red-fg); }
.badge-nodata { background: var(--gray-bg); color: var(--gray-fg); }

.quick-edit { display: flex; align-items: center; gap: 4px; justify-content: center; }
.qe-btn { width: 30px; height: 30px; border: none; border-radius: 5px; font-size: 17px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qe-btn.minus { background: var(--red-bg); color: var(--red-fg); }
.qe-btn.plus { background: var(--green-bg); color: var(--green-fg); }
.qe-btn:active { opacity: .6; }

.no-results { text-align: center; padding: 36px 16px; color: #888; font-size: 13px; }

.update-card { background: white; border: 1px solid #dfe7f1; border-radius: 14px; padding: 18px; box-shadow: 0 2px 8px rgba(13,27,42,.04); margin-bottom: 16px; }
@media (min-width: 480px) { .update-card { padding: 16px; } }
.update-card h2 { color: var(--mid); font-size: 14px; margin-bottom: 12px; border-bottom: 2px solid var(--yellow); padding-bottom: 7px; }
label { display: block; font-size: 11px; font-weight: bold; color: var(--mid); margin-bottom: 4px; }

.search-wrap { position: relative; margin-bottom: 12px; }
.search-wrap input { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 14px; background: #f9fafb; }
.search-wrap input:focus { outline: none; border-color: var(--mid); background: white; }
.search-results { position: absolute; width: 100%; background: white; border: 1.5px solid var(--mid); border-radius: 6px; max-height: 220px; overflow-y: auto; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.sri { padding: 9px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.sri:hover, .sri:active { background: var(--light); }
.sri .sc { font-weight: bold; color: var(--navy); }
.sri .st { color: #666; font-size: 11px; }

.selected-banner { background: var(--light); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.selected-banner .sl { font-size: 10px; color: var(--mid); font-weight: bold; }
.selected-banner .ss { font-size: 15px; font-weight: bold; color: var(--navy); }
.selected-banner .st { font-size: 12px; color: #555; }

.qty-display { background: var(--gray); border-radius: 8px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.qty-display .ql { font-size: 10px; color: #666; font-weight: bold; }
.qty-display .qv { font-size: 30px; font-weight: bold; color: var(--navy); }

.divider { border: none; border-top: 1px solid #e8eaed; margin: 14px 0; }

.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.big-btn { padding: 14px 10px; border: none; border-radius: 8px; font-size: 17px; font-weight: bold; cursor: pointer; }
.big-btn:active { opacity: .7; }
.big-btn.minus { background: var(--red-bg); color: var(--red-fg); }
.big-btn.plus { background: var(--green-bg); color: var(--green-fg); }

.amt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.amt-row label { margin: 0; white-space: nowrap; }

.ac-label { display: block; font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 6px; }
.ac-check { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #334155; }
.ac-field-row { display: grid; grid-template-columns: 2fr 1fr 2fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.ac-field-row input, .ac-field-row select { width: 100%; padding: 9px 10px; border: 1px solid #dfe7f1; border-radius: 8px; font-size: 12px; }
.ac-field-remove { background: var(--red-bg); color: var(--red-fg); border: none; border-radius: 8px; padding: 9px 12px; font-weight: 700; cursor: pointer; }
.ac-field-toggles { grid-column: 1 / -1; display: flex; gap: 16px; flex-wrap: wrap; margin-top: -2px; }
.ac-field-row .ac-field-toggles input { width: auto; padding: 0; }
.ac-field-row input:disabled, .ac-field-row select:disabled { background: #f1f5f9; color: #64748b; }
.ac-input { width: 100%; padding: 10px 12px; border: 1px solid #dfe7f1; border-radius: 8px; font-size: 13px; background: white; }
.ac-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.ac-note { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; border-radius: 8px; padding: 8px 10px; font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.drive-link-disabled { color: #94a3b8 !important; cursor: not-allowed; pointer-events: none; text-decoration: none; }
.filter-bar { position: relative; }
.filter-toolbar { display: flex; gap: 8px; align-items: stretch; }
.filter-toolbar input { flex: 1; min-width: 0; }
.filter-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1.5px solid var(--border); border-radius: 6px; background: white; color: var(--mid); font-size: 12px; font-weight: bold; cursor: pointer; white-space: nowrap; }
.filter-toggle[aria-expanded="true"], .filter-toggle.has-filters { border-color: var(--mid); }
.filter-toggle:focus-visible, .filter-option:focus-visible, .active-filter-chip:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.filter-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--mid); color: white; font-size: 10px; line-height: 18px; text-align: center; }
.active-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.active-filters::-webkit-scrollbar { display: none; }
.active-filters:empty { display: none; }
.active-filter-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: none; border-radius: 12px; background: #e8eef5; color: var(--mid); font-size: 11px; font-weight: bold; cursor: pointer; }
.active-filter-clear { flex: 0 0 auto; border: none; background: none; color: #64748b; font-size: 11px; font-weight: bold; text-decoration: underline; cursor: pointer; }
.filter-backdrop { display: none; }
.update-card[hidden], .ac-note[hidden], .filter-count[hidden] { display: none; }
.billing-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--yellow); margin-bottom: 12px; padding-bottom: 7px; }
.billing-head h2 { border: none; margin: 0; padding: 0; }
.billing-month { display: flex; align-items: center; gap: 8px; margin: 0; }
.billing-month input { width: auto; padding: 6px 8px; }
.billing-totals { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.billing-total { background: #f4f7fa; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.billing-total span { font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #64748b; }
.billing-total strong { font-size: 20px; color: var(--navy); }
.billing-total.primary { background: var(--navy); }
.billing-total.primary span { color: var(--yellow); }
.billing-total.primary strong { color: white; font-size: 26px; }
.billing-total.primary small { color: #cbd5e1; font-size: 11px; line-height: 1.3; }
.history-form { grid-template-columns: 150px 120px 120px 150px; }
.billing-progress { height: 6px; background: #e8eef5; border-radius: 3px; margin-top: 12px; overflow: hidden; }
.billing-progress div { height: 100%; background: var(--yellow); }
.billing-progress-label { font-size: 11px; color: #64748b; margin-top: 4px; }
.billing-lines { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.billing-lines th { text-align: left; padding: 8px; }
.billing-lines td { padding: 8px; border-bottom: 1px solid #eef1f4; color: var(--navy); overflow-wrap: anywhere; }
.billing-lines .num { width: 34%; text-align: right; white-space: normal; }
.billing-lines .billing-detail { color: #64748b; font-size: 12px; }
.billing-lines .billing-sum td { font-weight: 800; border-top: 2px solid var(--navy); border-bottom: none; }
.billing-updated, .billing-hint { font-size: 11px; color: #64748b; margin: 10px 0; }
.billing-subhead { font-size: 12px; color: var(--mid); margin: 16px 0 8px; }
.billing-invoice { margin-top: 14px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.billing-invoice-head { font-weight: 800; color: var(--navy); font-size: 13px; }
.billing-line-name { font-weight: 700; }
.billing-line-rate { font-size: 12px; color: #64748b; margin-top: 2px; }
.billing-line-desc { font-size: 11px; color: #64748b; font-style: italic; margin-top: 2px; }
.billing-lines tfoot td { border-bottom: none; padding: 4px 8px; }
.billing-empty { color: #64748b; text-align: center; }
.billing-entry-form { display: grid; grid-template-columns: 150px 2fr 110px 120px; gap: 8px; align-items: end; }
.billing-entry-form [hidden] { display: none; }
.billing-entry-note { grid-column: 1 / -1; }
.billing-day { border: 1px solid #eef1f4; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.billing-day-head { display: flex; justify-content: space-between; padding: 8px 10px; background: #f4f7fa; font-size: 12px; font-weight: 800; color: var(--mid); }
.billing-entry { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-top: 1px solid #eef1f4; font-size: 13px; color: var(--navy); }
.billing-entry.editing { grid-template-columns: 1fr; background: #fffbea; }
.billing-entry-desc { font-size: 11px; color: #64748b; font-style: italic; }
.billing-entry-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
.billing-entry-amount { font-weight: 800; white-space: nowrap; }
.billing-entry-actions { display: flex; gap: 10px; align-items: center; }
.billing-link { border: none; background: none; color: var(--mid); font-size: 12px; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; }
.billing-link.danger { color: var(--red-fg); }
.billing-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.billing-edit-grid label { font-size: 11px; display: flex; flex-direction: column; gap: 4px; margin: 0; }
.billing-edit-note { grid-column: 1 / -1; }
.rc-service-row { display: grid; grid-template-columns: 2fr 110px 2fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.rc-service-head { font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #64748b; margin-bottom: 4px; }
.billing-link:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.badge-awaiting { background: #e8eef5; color: #475569; }
.shipment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shipment-preview { margin: 12px 0; font-size: 12px; color: #64748b; display: flex; align-items: center; gap: 8px; }
#shipmentEditor[hidden], #stockEditor[hidden], #detailsEditor[hidden] { display: none; }
.detail-grid { margin-top: 0; }
.detail-grid .detail-wide { grid-column: 1 / -1; }
.detail-grid textarea { resize: vertical; font-family: inherit; }
@media (max-width: 699px) {
  .billing-totals { grid-template-columns: 1fr 1fr; }
  .billing-total.primary { grid-column: 1 / -1; }
  .billing-entry-form { grid-template-columns: 1fr 1fr; }
  .billing-entry-service { grid-column: 1 / -1; }
  .billing-entry { grid-template-columns: 1fr auto; }
  .billing-entry .billing-entry-actions { grid-column: 1 / -1; }
  .rc-service-row { grid-template-columns: 1fr 90px auto; }
  .rc-service-row input:nth-child(3) { grid-column: 1 / 3; }
  .rc-service-head { display: none; }
}
.filter-panel { position: absolute; top: 44px; right: 0; z-index: 140; width: min(420px, 100%); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 32px rgba(13,27,42,.22); }
.filter-panel[hidden] { display: none; }
.filter-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--navy); font-size: 14px; }
.filter-panel-close { border: none; background: none; font-size: 16px; color: #64748b; cursor: pointer; padding: 2px 6px; }
.filter-panel-body { overflow-y: auto; padding: 4px 14px 10px; }
.filter-section { padding: 10px 0; border-bottom: 1px solid #eef1f4; }
.filter-section:last-child { border-bottom: none; }
.filter-section-title { font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #64748b; margin-bottom: 8px; }
.filter-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 6px; background: white; color: var(--navy); font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.filter-option::before { content: ''; flex: 0 0 14px; height: 14px; border: 1.5px solid #94a3b8; border-radius: 3px; background: white; }
.filter-option[aria-pressed="true"] { border-color: var(--mid); background: #eef3f8; }
.filter-option[aria-pressed="true"]::before { content: '✓'; border-color: var(--mid); background: var(--mid); color: white; font-size: 10px; line-height: 12px; text-align: center; }
.filter-panel-foot { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.filter-clear { flex: 0 0 auto; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 6px; background: white; color: var(--mid); font-weight: bold; cursor: pointer; }
.filter-done { flex: 1; padding: 10px 14px; border: none; border-radius: 6px; background: var(--mid); color: white; font-weight: bold; cursor: pointer; }
@media (max-width: 699px) {
  .filter-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(13,27,42,.45); z-index: 139; }
  .filter-panel { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 80dvh; border-radius: 14px 14px 0 0; }
  .ac-field-row { grid-template-columns: 1fr 1fr; }
  .ac-field-row > input[style*="visibility:hidden"], .ac-field-row > span:empty { display: none; }
}
.amt-row input { flex: 1; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 14px; background: #f9fafb; min-width: 0; }
.set-row { display: flex; gap: 8px; align-items: center; }
.set-row input { flex: 1; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 14px; background: #f9fafb; min-width: 0; }
.btn-set { padding: 11px 16px; background: var(--mid); color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: bold; cursor: pointer; white-space: nowrap; }
.btn-set:active { opacity: .8; }

.chat-container { display: flex; flex-direction: column; width: 100%; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.2); height: calc(100vh - 210px); min-height: 320px; max-height: 680px; }
.chat-subheading { background: var(--navy); color: white; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--ecl-orange); flex-shrink: 0; }
.chat-subheading h2 { font-size: 13px; font-weight: bold; letter-spacing: .5px; }
.status-dot { width: 7px; height: 7px; background: #10b981; border-radius: 50%; display: inline-block; margin-right: 5px; animation: pulse 1.4s infinite; }
.status-text { font-size: 10px; color: #94a3b8; display: flex; align-items: center; }
.identity-bar { background: #f4f7fa; padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }
.staff-presence { font-size: 10px; color: #10b981; font-weight: bold; display: none; align-items: center; gap: 4px; }
.staff-presence.show { display: inline-flex; }
.staff-presence .pdot { width: 6px; height: 6px; background: #10b981; border-radius: 50%; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.35; } }

.typing-indicator { display:none !important; font-size:11px; color:#64748b; padding: 0 12px 8px; }
.messages-box { flex:1; padding:12px; overflow-y:auto; display:flex; flex-direction:column; gap:10px; background:#fafafa; }
.msg-wrap { display:flex; flex-direction:column; max-width:78%; }
.msg-wrap.me { align-self:flex-end; }
.msg-wrap.them { align-self:flex-start; }
.msg-meta { font-size:10px; color:#718096; margin-bottom:3px; padding:0 3px; display:flex; align-items:center; gap:4px; }
.msg-wrap.me .msg-meta { justify-content:flex-end; }
.msg-wrap.pending .msg-bubble { opacity: .7; }
.msg-status { font-style: italic; }
.msg-status.failed { color: var(--red-fg); font-style: normal; font-weight: bold; }
.msg-retry { border: none; background: none; color: var(--red-fg); font-size: 10px; font-weight: bold; text-decoration: underline; cursor: pointer; padding: 0; }
.msg-bubble { padding:9px 13px; border-radius:14px; font-size:13px; line-height:1.4; word-break:break-word; }
.msg-wrap.me .msg-bubble { background: var(--mid); color: white; border-bottom-right-radius: 4px; }
.msg-wrap.them .msg-bubble { background: white; color: #2d3748; border-bottom-left-radius: 4px; border:1px solid var(--border); }

.input-area { padding: 10px 12px; background: white; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.action-btn { background: none; border: none; color: #64748b; cursor: pointer; font-size: 17px; display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 50%; }
.action-btn:active { color: var(--ecl-orange); }
.input-wrapper { flex:1; min-width:0; }
.input-area input[type=text] { width:100%; padding:9px 13px; border:1.5px solid var(--border); border-radius:20px; font-size:13px; outline:none; }
.input-area input[type=text]:focus { border-color: var(--mid); }
.send-btn { background: var(--ecl-orange); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send-btn:active { background: #d44d1a; }

.portal-login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #0a1520; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.portal-login-box { background: white; padding: 28px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 360px; width: 100%; text-align: center; border-top: 4px solid var(--yellow); }
.portal-login-box img { height: 54px; width: auto; border-radius: 4px; margin-bottom: 10px; }
.portal-login-box h2 { color: var(--navy); font-size: 18px; margin-bottom: 4px; }
.portal-login-box p { color: #666; font-size: 12px; margin-bottom: 18px; }
.portal-login-form { text-align: left; margin-bottom: 14px; }
.portal-login-form input { width: 100%; padding: 10px 12px; font-size: 14px; border: 1.5px solid var(--border); border-radius: 6px; margin-bottom: 10px; color: var(--navy); outline: none; }
.portal-login-form input:focus { border-color: var(--mid); }
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-toggle { position: absolute; top: 0; right: 0; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border: none; background: none; color: #64748b; cursor: pointer; border-radius: 6px; }
.password-toggle:hover { color: var(--navy); }
.password-toggle:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-closed, .password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.portal-login-btn { width: 100%; padding: 12px; background: var(--mid); color: white; font-weight: bold; font-size: 15px; border: none; border-radius: 6px; cursor: pointer; }
.portal-login-btn:active { background: var(--navy); }
.login-error { color: #dc3545; font-size: 12px; font-weight: bold; margin-bottom: 8px; display: none; }

.portal-auth-links { margin-top: 14px; font-size: 12px; color: #64748b; display: flex; align-items: center; justify-content: center; gap: 8px; }
.portal-auth-links a { color: var(--mid); font-weight: 700; text-decoration: none; }
.portal-auth-links a:hover { text-decoration: underline; }
.recovery-code-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 12px; margin-bottom: 14px; text-align: left; }
.recovery-code-box p { color: #166534; font-size: 12px; margin-bottom: 8px; }
.recovery-code-value { font-family: 'Courier New', monospace; font-size: 20px; font-weight: 800; letter-spacing: 2px; color: var(--navy); text-align: center; background: white; border: 1px dashed #16a34a; border-radius: 6px; padding: 10px; }

.pin-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,21,32,.95); z-index: 1000; align-items: center; justify-content: center; padding: 16px; }
.pin-box { background: white; padding: 28px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 320px; width: 100%; text-align: center; border-top: 4px solid var(--yellow); }
.pin-box h3 { color: var(--navy); font-size: 17px; margin-bottom: 6px; }
.pin-box p { color: #666; font-size: 12px; margin-bottom: 16px; }
.pin-box input { width: 100%; padding: 12px; font-size: 22px; text-align: center; letter-spacing: 6px; border: 2px solid var(--border); border-radius: 8px; margin-bottom: 14px; font-weight: bold; color: var(--navy); }
.pin-box input:focus { outline: none; border-color: var(--mid); }
.pin-actions { display: flex; gap: 8px; }
.pin-btn { flex: 1; padding: 12px; font-weight: bold; font-size: 14px; border: none; border-radius: 6px; cursor: pointer; }
.pin-btn.confirm { background: var(--mid); color: white; }
.pin-btn.cancel { background: var(--gray-bg); color: #333; }

.loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50vh; color: #8ca0b5; }
.spinner { width: 38px; height: 38px; border: 3px solid var(--mid); border-top-color: var(--yellow); border-radius: 50%; animation: spin .7s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--navy); color: white; padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: bold; box-shadow: 0 4px 16px rgba(0,0,0,.4); border-left: 4px solid var(--yellow); transition: transform .25s ease; z-index: 3000; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: #28a745; }
.toast.error { border-color: #dc3545; }

.footer { text-align: center; color: #3a5060; font-size: 10px; padding: 10px 16px 18px; }

  display: block;
  font-size: clamp(1.6rem, 2vw, 2.3rem);
  margin-bottom: 8px;
}

.stat-card small {
  color: var(--muted);
}

.stat-card.blue { border-top: 4px solid #3b82f6; }
.stat-card.green { border-top: 4px solid #22c55e; }
.stat-card.orange { border-top: 4px solid #f59e0b; }
.stat-card.purple { border-top: 4px solid #8b5cf6; }

.inventory-panel {
  margin-top: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px 20px 10px;
}

.search-box {
  min-width: 280px;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fafcff;
}

.activity-description { color: #666; font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
.activity-wrap:focus-visible { outline: 2px solid var(--mid); outline-offset: 3px; }
.activity-table { table-layout: fixed; min-width: 640px; }
.activity-caption { padding: 12px; text-align: left; color: #555; font-size: 12px; line-height: 1.5; }
.activity-table th:nth-child(1) { width: 23%; }
.activity-table th:nth-child(2) { width: 19%; }
.activity-table th:nth-child(3) { width: 18%; }
.activity-table th:nth-child(4) { width: 40%; }
.activity-table thead { background: var(--navy); }
.activity-table thead th { color: white; }
.activity-table td { vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.activity-table tbody tr:nth-child(odd) { background: white; }
.activity-table tbody tr:nth-child(even) { background: var(--gray); }
.activity-table tbody tr:hover { background: var(--light); }
.activity-client { display: block; color: #555; font-size: 11px; margin-bottom: 4px; }
.activity-notice { padding: 12px; color: var(--red-fg); background: var(--red-bg); line-height: 1.6; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge.in-stock {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.badge.low-stock {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.badge.out-of-stock {
  background: rgba(217, 45, 32, 0.1);
  color: var(--danger);
}

.badge.on-order {
  background: rgba(59, 130, 246, 0.12);
  color: #2463eb;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 8px 10px;
  font-size: 0.8rem;
}

.action-btn.edit {
  background: #edf3ff;
  color: var(--text);
}

.action-btn.delete {
  background: rgba(217, 45, 32, 0.08);
  color: var(--danger);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 30;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(700px, calc(100vw - 32px));
  background: var(--panel);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.close-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #edf3ff;
  color: var(--text);
  font-size: 1.5rem;
  padding: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
}

.form-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 26px 0;
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 640px) {
  .main-panel {
    padding: 18px 14px 30px;
  }

  .topbar,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box {
    width: 100%;
    min-width: 0;
  }

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

  .toolbar,
  .form-actions {
    width: 100%;
  }

  .toolbar > button,
  .form-actions > button {
    flex: 1;
  }
}

/* Inventory table: one two-axis scroll container on every screen, like a spreadsheet. */
.table-shell .table-wrap {
  margin-top: 0;
  overflow: auto;
  max-height: 70vh;
  max-height: 70dvh;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.table-shell thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--mid);
}
.table-shell thead th:first-child,
.table-shell tbody td:first-child {
  position: sticky;
  left: 0;
}
.table-shell thead th:first-child { z-index: 3; }
.table-shell tbody td:first-child {
  z-index: 1;
  background: white;
  box-shadow: 1px 0 0 var(--border);
}
.table-shell tbody tr:nth-child(even) td:first-child { background: var(--gray); }
.table-shell tbody tr:hover td:first-child { background: var(--light); }

@media (max-width: 699px) {
  .table-shell { padding-top: 44px; }
  .table-shell .table-scroll-btn { top: 2px; transform: none; }
  .table-shell .table-wrap {
    max-height: calc(100vh - 230px);
    max-height: calc(100dvh - 230px);
    min-height: 260px;
  }
  .table-shell table { font-size: 11px; }
  .table-shell thead th:first-child,
  .table-shell tbody td:first-child {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .table-scroll-btn { width: 40px; height: 40px; }
}

.page-heading { margin-bottom: 22px; }
.page-heading h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: -.5px; line-height: 1.25; color: var(--navy); }
.page-heading p { margin-top: 8px; color: #526378; font-size: 14px; line-height: 1.6; max-width: 720px; }
.update-card h3 { font-size: 16px; font-weight: 650; color: var(--mid); line-height: 1.4; margin-bottom: 14px; }
.update-card p { line-height: 1.65; }
.update-card .ac-label { font-size: 12px; line-height: 1.5; color: #475569; }
.update-card input:not([type="checkbox"]), .update-card select, .update-card textarea { min-height: 42px; max-width: 100%; }
.update-card input:focus-visible, .update-card select:focus-visible, .update-card textarea:focus-visible { outline: 2px solid var(--mid); outline-offset: 2px; }
.section-panel { border: 1px solid #dfe7f1; border-radius: 12px; background: white; margin: 16px 0; min-width: 0; }
.section-panel[hidden] { display: none; }
.update-card.section-panel { padding: 0; margin: 0 0 16px; }
.section-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; cursor: pointer; list-style: none; color: var(--navy); font-size: 15px; font-weight: 650; border-radius: 12px; line-height: 1.4; }
.section-panel > summary::-webkit-details-marker { display: none; }
.section-panel > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid #526378; border-bottom: 2px solid #526378; transform: rotate(45deg); flex-shrink: 0; margin: 0 4px; }
.section-panel[open] > summary::after { transform: rotate(225deg); }
.section-panel > summary:hover { background: #f8fafc; }
.section-panel > summary small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: #526378; }
.section-panel[open] > summary { border-bottom: 1px solid #e8edf3; border-radius: 12px 12px 0 0; }
.section-body { padding: 18px; min-width: 0; }
.section-body > :last-child { margin-bottom: 0; }
.portal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.portal-form-grid > div, .ac-settings-grid > div, .billing-entry-form > div, .item-create-grid > div { min-width: 0; }
.item-create-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px auto; gap: 12px; align-items: end; }
.selected-banner { margin: 18px 0; }
.admin-switcher { background: #e8eef5; border-bottom-color: #dfe7f1; padding: 8px 16px; }
.admin-switcher label { color: #475569; }
.admin-switcher-btn { color: var(--mid); border-color: #becddd; background: white; padding: 7px 12px; font-size: 12px; }
.admin-switcher-btn.active { background: var(--mid); color: white; border-color: var(--mid); }
.chat-container { box-shadow: 0 2px 8px rgba(13,27,42,.04); border: 1px solid #dfe7f1; height: calc(100dvh - 320px); }
@media (max-width: 599px) {
  .portal-form-grid, .item-create-grid { grid-template-columns: minmax(0, 1fr); }
  .section-panel > summary, .section-body { padding: 14px; }
  .section-panel > summary small { font-size: 12px; }
  .update-card { padding: 16px; }
  .billing-head { align-items: flex-start; flex-direction: column; }
  .billing-entry-form, .ac-settings-grid { grid-template-columns: minmax(0, 1fr); }
  .rc-service-row { grid-template-columns: minmax(0, 1fr) 80px auto; }
  .ac-field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ac-field-row input, .ac-field-row select, .rc-service-row input { min-width: 0; }
}

/* Surface definition: tinted canvas, outlined cards, and visible section structure. */
:root {
  --canvas: #dbe3ec;
  --surface-border: #9fb0c4;
  --surface-border-strong: #8597ad;
  --surface-head: #eef3f8;
  --surface-shadow: 0 1px 3px rgba(13,27,42,.14), 0 8px 20px rgba(13,27,42,.10);
}
html, body { background: var(--canvas); }
.tabs { border-bottom: 1px solid var(--surface-border); box-shadow: 0 1px 3px rgba(13,27,42,.06); }
.tab:not(.active):hover { background: #eaf0f6; }
.page-heading { padding-bottom: 16px; border-bottom: 2px solid var(--surface-border); }
.update-card, .section-panel, .table-wrap, .chat-container, .data-card, .summary-card {
  border: 2px solid var(--surface-border);
  box-shadow: var(--surface-shadow);
}
.summary-card { border-top: 3px solid var(--mid); }
.summary-card.warn { border-color: #e6d08a; border-top-color: #d4a106; }
.summary-card.danger { border-color: #e7b5ba; border-top-color: #c0392b; }
.section-panel > summary { background: var(--surface-head); }
.section-panel > summary:hover { background: #edf2f7; }
.section-panel[open] > summary { border-bottom: 1px solid var(--surface-border); }
.section-panel:not([open]) > summary { border-radius: 11px; }
.section-body .section-panel { box-shadow: 0 1px 3px rgba(13,27,42,.08); border-color: var(--surface-border); }
.section-body .section-panel > summary { background: #fafbfd; }
.billing-total { border: 1px solid var(--surface-border); }
.billing-invoice, .billing-day { border-color: var(--surface-border); }
.billing-day-head { border-bottom: 1px solid var(--surface-border); }
.ac-input, .filter-bar input, .search-wrap input, .update-card input:not([type="checkbox"]):not([type="radio"]), .update-card select, .update-card textarea {
  border: 1px solid var(--surface-border-strong);
}
.ac-input:hover, .update-card input:not([type="checkbox"]):not([type="radio"]):hover, .update-card select:hover, .update-card textarea:hover { border-color: #8fa2b8; }
.ac-input:focus, .filter-bar input:focus, .update-card input:focus, .update-card select:focus, .update-card textarea:focus { border-color: var(--mid); box-shadow: 0 0 0 3px rgba(28,59,90,.12); outline: none; }
.filter-btn, .filter-toggle, .admin-switcher-btn { border-color: var(--surface-border-strong); }
.table-wrap td, .activity-table td { border-bottom: 1px solid #ccd6e2; }
.admin-switcher { border-bottom: 1px solid var(--surface-border); }

/* Personalized dashboard welcome banner */
.welcome-banner.is-personalized {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px 26px; border: 0; border-radius: 14px; border-left: 5px solid var(--yellow);
  background: linear-gradient(120deg, var(--navy) 0%, var(--mid) 100%);
  box-shadow: var(--surface-shadow);
}
.welcome-banner .welcome-copy { min-width: 0; }
.welcome-banner .welcome-greeting { display: none; }
.welcome-banner.is-personalized .welcome-greeting {
  display: block; margin: 0 0 6px; color: var(--yellow); font-size: 12px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
}
.welcome-banner.is-personalized h2 { color: white; overflow-wrap: anywhere; }
.welcome-banner.is-personalized #welcomeSubtitle { color: #c7d5e4; }
.welcome-banner .welcome-date:empty { display: none; }
.welcome-banner .welcome-date {
  margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2); color: #e6edf5; font-size: 12px; font-weight: 600; white-space: nowrap;
}
@media (max-width: 599px) {
  .welcome-banner.is-personalized { padding: 18px; align-items: flex-start; }
  .welcome-banner .welcome-date { white-space: normal; }
}

/* Faded diagonal ECL logo watermark behind the sign-in, activation, and reset screens. */
.portal-login-overlay {
  background: radial-gradient(ellipse at center, #16314d 0%, #0a1520 70%);
  isolation: isolate;
  overflow-y: auto;
}
.portal-login-overlay::before {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  background-image: url("https://static.wixstatic.com/media/32ab39_dfd6e4b0422f4d30ac72594477453225~mv2.png");
  background-size: 110px auto;
  background-repeat: space;
  transform: rotate(-22deg);
  opacity: .09;
}
.portal-login-overlay .portal-login-box { position: relative; margin: auto; }
@media (max-width: 599px) { .portal-login-overlay::before { background-size: 80px auto; } }
@media (prefers-reduced-transparency: reduce) { .portal-login-overlay::before { display: none; } }
/* Help & FAQ */
.help-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.help-tour-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 10px 18px;
  border: 2px solid var(--mid); border-radius: 10px; background: var(--mid); color: white;
  font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; white-space: nowrap;
}
.help-tour-btn span { color: var(--yellow); font-size: 11px; }
.help-tour-btn:hover { background: var(--navy); border-color: var(--navy); }
.help-tour-btn:focus-visible, .tour-btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.help-search-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 650; color: var(--navy); }
.help-card #faqSearch { width: 100%; }
.faq-count { margin: 8px 0 14px; font-size: 12px; color: #526378; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--surface-border); border-radius: 10px; background: white; overflow: hidden; }
.faq-item[hidden] { display: none; }
.faq-item > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px;
  cursor: pointer; list-style: none; background: var(--surface-head); color: var(--navy);
  font-size: 15px; font-weight: 650; line-height: 1.4;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: ''; width: 8px; height: 8px; flex-shrink: 0; margin: 0 4px;
  border-right: 2px solid #526378; border-bottom: 2px solid #526378; transform: rotate(45deg); transition: transform .15s ease;
}
.faq-item[open] > summary::after { transform: rotate(225deg); }
.faq-item > summary:hover { background: #e6edf5; }
.faq-item > summary:focus-visible { outline: 3px solid var(--mid); outline-offset: -3px; }
.faq-item[open] { border-color: var(--surface-border-strong); box-shadow: 0 2px 8px rgba(13,27,42,.08); }
.faq-item[open] > summary { border-bottom: 1px solid var(--surface-border); border-left: 4px solid var(--yellow); padding-left: 12px; }
.faq-answer { padding: 14px 16px 16px; color: #334155; font-size: 14px; line-height: 1.65; }
.faq-answer p + p, .faq-answer ul + p, .faq-answer p + ul { margin-top: 10px; }
.faq-answer ul { padding-left: 20px; }
.faq-answer li + li { margin-top: 4px; }
.faq-empty { padding: 24px 16px; text-align: center; color: #526378; border: 1px dashed var(--surface-border); border-radius: 10px; }
.faq-empty[hidden] { display: none; }

/* First-time guided tour */
body.tour-open { overflow-x: hidden; }
.tour-overlay[hidden] { display: none; }
.tour-overlay { position: fixed; inset: 0; z-index: 1500; }
.tour-overlay.is-centered { background: rgba(10,21,32,.62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tour-spotlight {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 4px var(--yellow), 0 0 0 9999px rgba(10,21,32,.62);
  transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}
.tour-spotlight[hidden] { display: none; }
.tour-card {
  position: fixed; width: min(380px, calc(100vw - 32px)); padding: 20px 20px 16px;
  background: white; border-radius: 14px; border-top: 4px solid var(--yellow);
  box-shadow: 0 18px 48px rgba(0,0,0,.35); color: var(--navy);
}
.tour-overlay.is-centered .tour-card { position: relative; top: auto !important; left: auto !important; width: min(440px, 100%); }
.tour-step { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: #8a6d00; }
.tour-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 1.3; }
.tour-body { margin: 0; font-size: 14px; line-height: 1.6; color: #334155; }
.tour-progress { display: flex; gap: 6px; margin: 16px 0 14px; }
.tour-progress span { width: 8px; height: 8px; border-radius: 999px; background: #cbd5e1; transition: width .2s ease, background .2s ease; }
.tour-progress span.is-done { background: var(--mid); }
.tour-progress span.is-active { width: 22px; background: var(--yellow); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-nav { display: flex; gap: 8px; margin-left: auto; }
.tour-btn { min-height: 38px; padding: 8px 16px; border-radius: 9px; border: 1px solid var(--surface-border-strong); background: white; color: var(--navy); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tour-btn[hidden] { display: none; }
.tour-btn:hover { background: var(--gray); }
.tour-skip { border-color: transparent; background: transparent; color: #526378; padding-left: 4px; padding-right: 4px; text-decoration: underline; text-underline-offset: 3px; }
.tour-skip:hover { background: transparent; color: var(--navy); }
.tour-next { background: var(--mid); border-color: var(--mid); color: white; }
.tour-next:hover { background: var(--navy); border-color: var(--navy); }
@media (max-width: 599px) {
  .help-heading { align-items: stretch; }
  .help-tour-btn { width: 100%; justify-content: center; }
  .tour-overlay:not(.is-centered) .tour-card { top: auto !important; left: 16px !important; right: 16px; bottom: 16px; width: auto; }
  .tour-overlay.is-centered { align-items: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-spotlight, .tour-progress span, .faq-item > summary::after { transition: none; }
}
