:root {
  --brown: #7a2f0d;
  --brown-dark: #5f2308;
  --cream: #fffaf4;
  --text: #1d1d1f;
  --muted: #737373;
  --border: #eadfd6;
  --shadow: 0 14px 40px rgba(74, 35, 15, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--cream);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button.stat-card {
  color: inherit;
  text-align: left;
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.phone-screen {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background:
    radial-gradient(circle at top, rgba(122,47,13,0.08), transparent 32%),
    #fffaf4;
  position: relative;
}

.app-loader {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--brown);
}

.loader-logo,
.logo-text {
  font-weight: 900;
  line-height: 0.86;
  color: var(--brown);
  text-shadow: 0 2px 0 #f0c28e;
}

.loader-logo {
  font-size: 38px;
}

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.login-card {
  width: 100%;
  min-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 34px;
}

.logo-text {
  font-size: 34px;
  text-align: center;
}

.logo-text span {
  font-size: 40px;
}

.login-heading {
  text-align: center;
  margin-bottom: 28px;
}

.login-heading h1 {
  font-size: 24px;
  margin: 0 0 8px;
}

.login-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.input-wrap {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.03);
}

.input-icon {
  width: 24px;
  color: var(--muted);
}

.input-wrap input {
  border: 0;
  outline: 0;
  flex: 1;
  background: transparent;
  min-width: 0;
  font-size: 15px;
}

.eye-btn {
  border: 0;
  background: transparent;
  font-size: 16px;
}

.primary-btn,
.logout-btn {
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(122,47,13,0.24);
}

.primary-btn:disabled {
  opacity: 0.65;
}

.error-box {
  background: #fff1f1;
  color: #bb1d1d;
  border: 1px solid #ffd2d2;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
}

.footer-note {
  text-align: center;
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  padding-top: 28px;
}

.dashboard-screen {
  padding: 14px 14px 92px;
}

.top-bar {
  height: 54px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}

.top-bar h1 {
  text-align: center;
  font-size: 17px;
  margin: 0;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 20px;
}

.alert-dot {
  position: relative;
}

.outlet-card,
.action-row,
.stat-card {
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.outlet-card {
  min-height: 72px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.outlet-card strong,
.outlet-card span {
  display: block;
}

.outlet-card span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

h2 {
  font-size: 16px;
  margin: 20px 0 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  min-height: 86px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-card small {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.stat-card em {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card.state-ok {
  background: #edfff1;
  border-color: #bbf7d0;
}

.stat-card.state-warn {
  background: #fff7ed;
  border-color: #fed7aa;
}

.stat-card.state-danger {
  background: #fff1f2;
  border-color: #fecdd3;
}

.stat-card.state-info {
  background: #faf5ff;
  border-color: #e9d5ff;
}

.attention-section {
  margin-top: 18px;
}

.attention-toggle {
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  text-align: left;
}

.attention-toggle span,
.attention-toggle strong,
.attention-toggle small {
  display: block;
}

.attention-toggle strong {
  font-size: 16px;
}

.attention-toggle small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.attention-toggle b {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #fff4e8;
  color: var(--brown);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.attention-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.attention-heading h2 {
  margin: 0 0 10px;
}

.attention-heading button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--brown);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.attention-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.attention-list.collapsed {
  display: none;
}

.attention-item {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  text-align: left;
}

.attention-mark {
  width: 10px;
  height: 44px;
  border-radius: 999px;
  background: #cbd5e1;
}

.attention-copy strong,
.attention-copy small,
.attention-empty strong,
.attention-empty span {
  display: block;
}

.attention-copy strong {
  font-size: 14px;
}

.attention-copy small {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}

.attention-item b {
  max-width: 84px;
  color: var(--brown);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: right;
}

.attention-item.danger {
  background: #fff1f2;
  border-color: #fecdd3;
}

.attention-item.danger .attention-mark {
  background: #e11d48;
}

.attention-item.warn {
  background: #fff7ed;
  border-color: #fed7aa;
}

.attention-item.warn .attention-mark {
  background: #f97316;
}

.attention-item.info {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.attention-item.info .attention-mark {
  background: #7c3aed;
}

.attention-more-btn {
  min-height: 44px;
  border: 1px dashed #d6c4b6;
  border-radius: 14px;
  background: #fffaf6;
  color: var(--brown);
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.attention-more-btn span {
  color: #8b6b59;
  font-size: 11px;
  font-weight: 800;
}

.attention-filter-panel {
  border: 1px solid #eadbd2;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.attention-filter-panel input,
.attention-filter-panel select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 0 12px;
}

.attention-filter-panel div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.attention-filter-panel button {
  min-height: 42px;
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff7ed;
  color: var(--brown);
  font-size: 13px;
  font-weight: 900;
  padding: 0 12px;
}

.attention-filter-panel small {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.attention-empty {
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  background: #edfff1;
  padding: 14px;
  color: #166534;
}

.attention-empty strong {
  font-size: 14px;
}

.attention-empty span {
  color: #4b5563;
  font-size: 12px;
  margin-top: 4px;
}

.stat-icon,
.action-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
}

.blue {
  background: #edf6ff;
  border-color: #cde6ff;
}

.green {
  background: #edfff1;
  border-color: #c9f2d2;
}

.orange {
  background: #fff4e8;
  border-color: #ffd9ae;
}

.purple {
  background: #f7efff;
  border-color: #e2ccff;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-actions-toggle {
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
}

.quick-actions-toggle span,
.quick-actions-toggle strong,
.quick-actions-toggle small {
  display: block;
}

.quick-actions-toggle strong {
  font-size: 16px;
}

.quick-actions-toggle small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.quick-actions-toggle b {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #fff4e8;
  color: var(--brown);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.quick-actions-panel {
  display: grid;
  gap: 10px;
}

.quick-actions-panel.collapsed {
  display: none;
}

.quick-action-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.68);
  box-shadow: var(--shadow);
  padding: 10px;
}

.quick-action-group-toggle {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  display: grid;
  grid-template-columns: 44px 1fr 28px;
  align-items: center;
  gap: 10px;
  padding: 4px;
  text-align: left;
}

.quick-action-group-toggle strong,
.quick-action-group-toggle small {
  display: block;
}

.quick-action-group-toggle strong {
  font-size: 14px;
}

.quick-action-group-toggle small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.quick-action-group-toggle b {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff4e8;
  color: var(--brown);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.quick-action-group-body {
  display: grid;
  gap: 8px;
}

.quick-action-group-body.collapsed {
  display: none;
}

.action-row {
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 44px 1fr 20px;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
}

.action-row strong,
.action-row small {
  display: block;
}

.action-row strong {
  font-size: 14px;
}

.action-row small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.logout-btn {
  width: 100%;
  margin-top: 18px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 76px;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 10px 10px;
  z-index: 20;
}

.bottom-nav button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  display: grid;
  place-items: center;
  gap: 3px;
  font-size: 18px;
}

.bottom-nav button span {
  font-size: 11px;
}

.bottom-nav button.active {
  background: var(--brown);
  color: white;
}

@media (min-width: 768px) {
  body {
    background: #f3eee8;
  }

  .phone-screen {
    min-height: 860px;
    margin-top: 30px;
    margin-bottom: 30px;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: 0 22px 70px rgba(0,0,0,0.16);
  }

  .bottom-nav {
    position: absolute;
  }
}

.empty-state-card {
  margin-top: 28px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 18px;
  text-align: center;
}

.empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: #fff4e8;
  display: grid;
  place-items: center;
  font-size: 34px;
}

.empty-state-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.empty-state-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.outlet-list-item {
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 10px;
  appearance: none;
  -webkit-appearance: none;
}

.outlet-list-item span {
  display: block;
}

.outlet-list-item strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}

.outlet-list-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.outlet-list-item b {
  font-size: 11px;
  background: #ecfdf3;
  color: #15803d;
  padding: 6px 9px;
  border-radius: 999px;
  text-transform: capitalize;
  white-space: nowrap;
}

.checkbox-list {
  display: grid;
  gap: 10px;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.03);
}

.check-row input {
  width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  box-shadow: none !important;
}

.check-row span {
  display: block;
}

.check-row strong {
  display: block;
  font-size: 14px;
}

.check-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.disabled-box {
  opacity: 0.55;
}

.mobile-form {
  display: grid;
  gap: 14px;
}

.mobile-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.mobile-form input,
.mobile-form select,
.mobile-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 12px;
  outline: 0;
}

.mobile-form textarea {
  min-height: 88px;
  resize: vertical;
}

.success-box {
  background: #ecfdf3;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
}

.summary-card,
.loading-card,
.empty-card,
.category-card {
  background: #fff;
  border: 1px solid #ead8cc;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(80, 40, 15, 0.06);
}

.summary-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.summary-card p {
  margin: 0;
  color: #6f625a;
  font-size: 13px;
}

.category-header {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 4px 0;
  cursor: pointer;
}

.category-header strong {
  display: block;
  font-size: 15px;
}

.category-header small {
  display: block;
  margin-top: 4px;
  color: #7b6b62;
  font-size: 12px;
}

.category-items {
  margin-top: 12px;
  border-top: 1px solid #f0e1d8;
}

.category-items.hidden {
  display: none;
}

.item-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid #f5ebe5;
}

.item-row:last-child {
  border-bottom: 0;
}

.item-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #fff5ee;
  display: grid;
  place-items: center;
}

.item-row strong {
  display: block;
  font-size: 14px;
}

.item-row small {
  display: block;
  margin-top: 3px;
  color: #7b6b62;
  font-size: 12px;
}

.status-active,
.status-inactive {
  font-size: 11px;
  font-style: normal;
  padding: 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-active {
  background: #e8f8ee;
  color: #159447;
}

.status-inactive {
  background: #ffecec;
  color: #d32f2f;
}







/* Include Help / Self Help Assistant */
.top-bar {
  grid-template-columns: 88px 1fr 88px;
}

.top-bar > .icon-btn:first-child {
  justify-self: start;
}

.top-bar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.top-bar-actions .icon-btn {
  flex: 0 0 42px;
}

.global-help-toggle-wrap {
  position: absolute;
  top: 14px;
  right: 58px;
  z-index: 28;
  pointer-events: none;
}

.include-help-toggle.icon-only,
button.include-help-toggle.icon-only {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--brown);
  box-shadow: none;
  display: grid;
  place-items: center;
  pointer-events: auto;
  position: relative;
}

.include-help-toggle.icon-only.active,
button.include-help-toggle.icon-only.active {
  background: #fff8df;
  box-shadow: 0 0 0 4px rgba(240, 180, 41, 0.18), 0 12px 24px rgba(122, 47, 13, 0.12);
}

.include-help-bulb {
  width: 31px;
  height: 31px;
  border-radius: 999px;
  background: #fff;
  display: grid;
  place-items: center;
  border: 1px solid #f4c987;
  box-shadow: 0 6px 16px rgba(122, 47, 13, 0.12);
  animation: helpBulbGlow 1.6s ease-in-out infinite;
  font-size: 16px;
  line-height: 1;
}

.include-help-toggle.icon-only.active .include-help-bulb {
  background: linear-gradient(135deg, #fff7cc, #fff0a3);
  border-color: #f0b429;
}

.include-help-copy,
.include-help-copy strong,
.include-help-copy small {
  display: none;
}

.action-row-with-help {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: stretch;
}

.action-row-with-help .action-row {
  min-width: 0;
}

.stat-card-with-help {
  position: relative;
  min-width: 0;
}

.stat-card-with-help .stat-card {
  width: 100%;
  height: 100%;
  padding-right: 46px;
}

.help-bulb-btn {
  width: 44px;
  min-height: 44px;
  border: 1px solid #f0c26d;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff9d9, #fff1a8);
  color: #7a4a00;
  font-size: 19px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 4px rgba(240, 194, 109, 0.14), 0 10px 22px rgba(122, 47, 13, 0.14);
  animation: helpBulbGlow 1.6s ease-in-out infinite;
}

.help-bulb-btn:active {
  transform: scale(0.96);
}

.stat-help-bulb {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 34px;
  min-height: 34px;
  border-radius: 13px;
  font-size: 16px;
}

.help-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(39, 23, 13, 0.48);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.help-modal-card {
  width: 100%;
  max-width: 430px;
  max-height: 84vh;
  overflow: auto;
  border-radius: 24px 24px 18px 18px;
  background: #fffaf4;
  border: 1px solid #f0d8c8;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  padding: 22px 18px 18px;
  position: relative;
  animation: helpModalIn 0.18s ease-out;
}

.help-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: #fff1e6;
  color: var(--brown);
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.help-modal-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff9d9, #fff1a8);
  display: grid;
  place-items: center;
  font-size: 26px;
  box-shadow: 0 0 0 6px rgba(240, 194, 109, 0.15);
  margin-bottom: 12px;
}

.help-modal-card h2 {
  margin: 0 42px 8px 0;
  font-size: 20px;
  color: #28130b;
}

.help-modal-summary {
  margin: 0 0 14px;
  color: #6b5a50;
  font-size: 14px;
  line-height: 1.45;
}

.help-modal-section {
  border: 1px solid #f0dfd2;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 13px;
  margin-top: 10px;
}

.help-modal-section strong {
  display: block;
  color: var(--brown);
  font-size: 13px;
  margin-bottom: 8px;
}

.help-modal-section ul {
  margin: 0;
  padding-left: 19px;
  color: #3f332d;
  font-size: 13px;
  line-height: 1.5;
}

.help-modal-section li + li {
  margin-top: 6px;
}

.note-section {
  background: #fff7ed;
  border-color: #fed7aa;
}

@keyframes helpBulbGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(240, 180, 41, 0.34), 0 8px 18px rgba(122, 47, 13, 0.12);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(240, 180, 41, 0), 0 12px 24px rgba(122, 47, 13, 0.18);
  }
}

@keyframes helpModalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 420px) {
  .include-help-copy small {
    display: none;
  }

  .include-help-toggle {
    padding-right: 9px;
  }
}

/* Inventory item management */
.inventory-category-card {
  display: block;
  margin-bottom: 12px;
  padding: 0;
  overflow: hidden;
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.inventory-category-toggle {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.inventory-category-toggle strong,
.inventory-category-toggle small {
  display: block;
}

.inventory-category-toggle strong {
  font-size: 16px;
}

.inventory-category-toggle small {
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.inventory-category-toggle b {
  font-size: 20px;
  color: var(--brown);
}

.inventory-category-body {
  display: none;
  padding: 0 14px 14px 14px;
}

.inventory-item-card {
  border: 1px solid #eadbd2;
  border-radius: 14px;
  padding: 12px;
  background: #fffaf6;
  margin-bottom: 10px;
  display: grid;
  gap: 10px;
}

.inventory-item-card.inactive {
  opacity: 0.68;
  background: #f8fafc;
}

.inventory-item-main strong,
.inventory-item-main small {
  display: block;
}

.inventory-item-main strong {
  font-size: 15px;
}

.inventory-item-main small {
  color: #4b5563;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.35;
}

.inventory-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  margin-top: 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.inventory-status-pill.active {
  background: #dcfce7;
  color: #166534;
}

.inventory-status-pill.inactive {
  background: #fee2e2;
  color: #991b1b;
}

.inventory-item-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inventory-item-actions button {
  min-height: 38px;
  border: 1px solid #eadbd2;
  border-radius: 10px;
  background: #fff;
  color: var(--brown);
  font-size: 13px;
  font-weight: 900;
}

.inventory-form-loading {
  margin-top: 14px;
}

.inventory-item-form select,
.inventory-item-form input {
  width: 100%;
}

.form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inventory-mandatory-row {
  align-items: flex-start;
  border: 1px solid #eadbd2;
  border-radius: 14px;
  padding: 12px;
  background: #fffaf6;
}

.inventory-mandatory-row input {
  width: auto;
  margin-top: 4px;
}

.inventory-mandatory-row strong,
.inventory-mandatory-row small {
  display: block;
}

.inventory-mandatory-row small {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}

/* Alerts build */
.alerts-filter-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.alerts-filter-card label,
.alerts-filter-card label span {
  display: block;
}

.alerts-filter-card label span {
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  margin-bottom: 6px;
}

.alerts-filter-card input,
.alerts-filter-card select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 0 12px;
}

.alerts-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.alerts-filter-actions button,
.alert-action-btn {
  min-height: 44px;
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff7ed;
  color: var(--brown);
  font-size: 13px;
  font-weight: 900;
  padding: 0 12px;
}

.alerts-summary-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.alert-summary-card {
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: center;
}

.alert-summary-card small {
  color: #6b7280;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.alert-summary-card strong {
  font-size: 20px;
}

.alert-summary-card.danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.alert-summary-card.warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.alert-summary-card.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.alert-summary-card.total {
  background: #f7efff;
  border-color: #e9d5ff;
  color: #7e22ce;
}

.alerts-list-box {
  display: grid;
  gap: 10px;
}

.alert-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.alert-card.danger {
  background: #fff1f2;
  border-color: #fecdd3;
}

.alert-card.warn {
  background: #fff7ed;
  border-color: #fed7aa;
}

.alert-card.info {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.alert-card-top,
.alert-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.alert-card-top small,
.alert-card-meta span {
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
}

.alert-card strong {
  font-size: 15px;
}

.alert-card p {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
}

.alert-severity-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.alert-severity-pill.danger {
  background: #ffe4e6;
  color: #be123c;
}

.alert-severity-pill.warn {
  background: #ffedd5;
  color: #c2410c;
}

.alert-severity-pill.info {
  background: #dbeafe;
  color: #1d4ed8;
}

.alert-action-btn {
  width: 100%;
}

/* Stock Ledger Filters & Export */
.stock-ledger-filter-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  padding: 10px;
  margin-bottom: 14px;
}

.ledger-filter-toggle {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr 28px;
  align-items: center;
  gap: 10px;
  padding: 4px;
  text-align: left;
}

.ledger-filter-toggle strong,
.ledger-filter-toggle small {
  display: block;
}

.ledger-filter-toggle strong {
  font-size: 14px;
}

.ledger-filter-toggle small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.ledger-filter-toggle b {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff4e8;
  color: var(--brown);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.stock-ledger-filter-body {
  display: grid;
  gap: 10px;
  padding: 6px 2px 2px;
}

.ledger-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ledger-filter-grid label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 800;
}

.ledger-filter-grid input,
.ledger-filter-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 0 10px;
}

.ledger-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ledger-filter-actions .compact-btn:first-child {
  grid-column: 1 / -1;
}

.compact-btn {
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
}

.secondary-btn {
  min-height: 44px;
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff7ed;
  color: var(--brown);
  font-weight: 900;
  box-shadow: none;
}

.ledger-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.ledger-summary-grid div {
  border: 1px solid #eadbd2;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.ledger-summary-grid small,
.ledger-summary-grid strong {
  display: block;
}

.ledger-summary-grid small {
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
}

.ledger-summary-grid strong {
  color: var(--brown);
  font-size: 16px;
  margin-top: 4px;
}

@media (max-width: 360px) {
  .ledger-filter-grid,
  .ledger-filter-actions,
  .ledger-summary-grid {
    grid-template-columns: 1fr;
  }

  .ledger-filter-actions .compact-btn:first-child {
    grid-column: auto;
  }
}

/* Global page scroller - available on every non-login screen */
html,
body {
  overflow-y: auto;
  scroll-behavior: smooth;
}

.phone-screen {
  min-height: 100vh;
  height: auto;
  overflow-y: visible;
  overscroll-behavior: auto;
}

body::-webkit-scrollbar {
  width: 7px;
}

body::-webkit-scrollbar-track {
  background: rgba(255, 250, 244, 0.55);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb {
  background: rgba(122, 47, 13, 0.38);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover {
  background: rgba(122, 47, 13, 0.58);
}

.page-scroll-tools {
  position: fixed;
  right: max(12px, calc((100vw - 430px) / 2 + 12px));
  bottom: 92px;
  z-index: 9999;
  display: grid;
  gap: 7px;
  pointer-events: none;
}

.page-scroll-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(122, 47, 13, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--brown);
  box-shadow: 0 10px 24px rgba(74, 35, 15, 0.18);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.page-scroll-btn:active {
  transform: scale(0.94);
}

.page-scroll-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

.page-scroll-tools.no-scroll-needed {
  opacity: 0.35;
}

@media (max-width: 430px) {
  .page-scroll-tools {
    right: 12px;
    bottom: 88px;
  }
}

/* Mobile menu visibility fix */
.dashboard-screen {
  padding-bottom: calc(138px + env(safe-area-inset-bottom));
}

.mobile-menu-screen {
  padding-bottom: calc(150px + env(safe-area-inset-bottom));
}

.mobile-menu-heading {
  margin: 12px 0 18px 0;
  padding: 14px 4px 4px 4px;
}

.mobile-menu-heading h2 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 800;
}

.mobile-menu-heading p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.mobile-menu-section {
  margin-bottom: 18px;
}

.mobile-menu-section h2 {
  margin: 10px 0 10px;
}

.locked-section-note {
  border: 1px dashed #f4c9a6;
  border-radius: 14px;
  background: #fff7ed;
  color: #8a3a0a;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.locked-action-row {
  opacity: 0.78;
  background: rgba(255,255,255,0.72);
}

.locked-action-row b {
  font-size: 16px;
}

.mobile-menu-logout {
  margin-bottom: 18px;
}

.bottom-nav {
  height: calc(76px + env(safe-area-inset-bottom));
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.page-scroll-tools.no-scroll-needed {
  display: none;
}

@media (max-width: 430px) {
  .dashboard-screen {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-scroll-tools {
    right: 10px;
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

/* Manage Users / Outlets upgrade */
.enhanced-list-item em {
  display: block;
  color: #8b6b59;
  font-size: 11px;
  font-style: normal;
  margin-top: 4px;
  line-height: 1.25;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.status-active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-inactive {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.status-hold {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-card-head h2 {
  margin: 0 0 4px;
}

.detail-card-head p {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
}

.action-button-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.secondary-btn {
  min-height: 48px;
  border: 1px solid #eadfd6;
  border-radius: 14px;
  background: #fff;
  color: var(--brown);
  font-size: 13px;
  font-weight: 900;
  padding: 0 12px;
  box-shadow: 0 8px 18px rgba(74, 35, 15, 0.06);
}

.secondary-btn.danger-soft {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.secondary-btn.success-soft {
  background: #ecfdf5;
  color: #15803d;
  border-color: #bbf7d0;
}

.secondary-btn.disabled-soft,
.secondary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.compact-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.compact-info-row strong,
.compact-info-row small {
  display: block;
}

.compact-info-row strong {
  font-size: 14px;
}

.compact-info-row small {
  color: #6b7280;
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.3;
}

.form-hint {
  display: block;
  margin-top: 7px;
  color: #8b6b59;
  font-size: 11px;
  line-height: 1.35;
}

@media (min-width: 380px) {
  .action-button-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Dashboard drill-down popup */
.dashboard-drill-card {
  position: relative;
}

.dashboard-drill-card em {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.dashboard-drill-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(39, 23, 13, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.dashboard-drill-card-wrap {
  width: 100%;
  max-width: 430px;
  max-height: 86vh;
  overflow: auto;
  border: 1px solid #f0d8c8;
  border-radius: 26px 26px 18px 18px;
  background: #fffaf4;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  padding: 18px 14px 16px;
  position: relative;
  animation: helpModalIn 0.18s ease-out;
}

.dashboard-drill-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 14px;
  background: #fff1e6;
  color: var(--brown);
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 2;
}

.dashboard-drill-header {
  padding: 4px 48px 12px 4px;
}

.dashboard-drill-header h2 {
  margin: 0 0 5px;
  color: #28130b;
  font-size: 19px;
  font-weight: 900;
}

.dashboard-drill-header p {
  margin: 0;
  color: #6b5a50;
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-drill-body {
  display: grid;
  gap: 12px;
}

.dashboard-drill-loader,
.dashboard-drill-empty {
  border: 1px solid #eadbd2;
  border-radius: 18px;
  background: rgba(255,255,255,0.86);
  padding: 16px;
  color: #6b7280;
  text-align: center;
  font-size: 13px;
}

.dashboard-drill-empty strong,
.dashboard-drill-empty span {
  display: block;
}

.dashboard-drill-empty strong {
  color: #15803d;
  font-size: 15px;
  margin-bottom: 4px;
}

.dashboard-drill-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.dashboard-drill-summary span {
  border: 1px solid #eadbd2;
  border-radius: 16px;
  background: rgba(255,255,255,0.88);
  padding: 10px;
}

.dashboard-drill-summary small,
.dashboard-drill-summary strong {
  display: block;
}

.dashboard-drill-summary small {
  color: #6b7280;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dashboard-drill-summary strong {
  margin-top: 4px;
  color: var(--brown);
  font-size: 18px;
  font-weight: 900;
}

.dashboard-drill-list {
  display: grid;
  gap: 10px;
}

.dashboard-drill-row {
  border: 1px solid #eadbd2;
  border-radius: 18px;
  background: rgba(255,255,255,0.9);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(74, 35, 15, 0.06);
}

.dashboard-drill-row.success {
  background: #edfff1;
  border-color: #bbf7d0;
}

.dashboard-drill-row.warn {
  background: #fff7ed;
  border-color: #fed7aa;
}

.dashboard-drill-row.danger {
  background: #fff1f2;
  border-color: #fecdd3;
}

.dashboard-drill-row.info {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.dashboard-drill-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-drill-row-top strong,
.dashboard-drill-row-top small {
  display: block;
}

.dashboard-drill-row-top strong {
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.dashboard-drill-row-top small {
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-drill-row-top b {
  color: var(--brown);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  text-align: right;
}

.dashboard-drill-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.dashboard-drill-status-line small {
  color: #6b7280;
  font-size: 11px;
  text-align: right;
}

.dashboard-drill-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #eadbd2;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  color: #4b5563;
  font-size: 11px;
  font-weight: 900;
}

.dashboard-drill-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
}

.dashboard-drill-details span {
  display: block;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-drill-details b {
  color: #28130b;
}

.dashboard-drill-action {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(122,47,13,0.18);
}

@media (min-width: 390px) {
  .dashboard-drill-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Reorder to Dispatch workflow */
.reorder-dispatch-toolbar {
  border: 1px solid #eadbd2;
  border-radius: 16px;
  background: #fffaf6;
  box-shadow: 0 10px 26px rgba(74, 35, 15, 0.06);
  padding: 12px;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.reorder-dispatch-toolbar strong,
.reorder-dispatch-toolbar small {
  display: block;
}

.reorder-dispatch-toolbar strong {
  font-size: 14px;
  color: #1f2937;
}

.reorder-dispatch-toolbar small {
  color: #6b7280;
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.35;
}

.reorder-dispatch-actions,
.reorder-dispatch-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.reorder-dispatch-actions button,
.reorder-dispatch-footer button {
  min-height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
}

.reorder-dispatch-actions button {
  border: 1px solid #eadbd2;
  background: #fff;
  color: #7a2f0d;
}

.reorder-dispatch-footer {
  grid-template-columns: 1fr auto;
}

.reorder-dispatch-footer span {
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.reorder-dispatch-primary {
  border: 0;
  background: linear-gradient(135deg, #7a2f0d, #5f2308);
  color: #fff;
  padding: 0 12px;
}

.reorder-select-line {
  min-height: 40px;
  border: 1px dashed #d6c4b6;
  border-radius: 12px;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  margin-bottom: 10px;
  color: #7a2f0d;
  font-size: 13px;
  font-weight: 900;
}

.reorder-select-line input {
  width: 18px;
  height: 18px;
  accent-color: #7a2f0d;
}


/* Dispatch Tracker */
.dispatch-filter-card label span {
  display: block;
  font-size: 12px;
  color: #6b7280;
  font-weight: 800;
  margin-bottom: 6px;
}

.dispatch-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dispatch-filter-grid select,
.dispatch-filter-grid input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
}

.dispatch-filter-wide {
  grid-column: 1 / -1;
}

.dispatch-filter-btn,
.dispatch-reset-btn {
  min-height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
}

.dispatch-filter-btn {
  border: 0;
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: #fff;
}

.dispatch-reset-btn {
  border: 1px solid #eadbd2;
  background: #fff7ed;
  color: var(--brown);
}

.dispatch-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.dispatch-summary-chip {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  border-radius: 14px;
  padding: 10px;
}

.dispatch-summary-chip small,
.dispatch-summary-chip strong {
  display: block;
}

.dispatch-summary-chip small {
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
}

.dispatch-summary-chip strong {
  font-size: 18px;
  margin-top: 4px;
}

.dispatch-summary-chip.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.dispatch-summary-chip.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.dispatch-summary-chip.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.dispatch-tracker-list {
  display: grid;
  gap: 12px;
}

.dispatch-tracker-card {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dispatch-tracker-card.warn {
  border-color: #fde68a;
}

.dispatch-tracker-card.danger {
  border-color: #fecaca;
}

.dispatch-tracker-card.success {
  border-color: #bbf7d0;
}

.dispatch-tracker-head {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  align-items: center;
}

.dispatch-tracker-head strong,
.dispatch-tracker-head small {
  display: block;
}

.dispatch-tracker-head strong {
  font-size: 15px;
}

.dispatch-tracker-head small {
  color: #6b7280;
  margin-top: 3px;
  font-size: 12px;
}

.dispatch-tracker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 12px;
}

.dispatch-tracker-meta span,
.dispatch-status-pill {
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 9px;
}

.dispatch-status-pill.warn {
  background: #fef3c7;
  color: #92400e;
}

.dispatch-status-pill.danger {
  background: #fee2e2;
  color: #991b1b;
}

.dispatch-status-pill.success {
  background: #dcfce7;
  color: #166534;
}

.dispatch-status-pill.info {
  background: #dbeafe;
  color: #1d4ed8;
}

.dispatch-tracker-body {
  padding: 0 14px 14px;
}

.dispatch-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.dispatch-detail-grid span {
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fffaf6;
  padding: 9px;
}

.dispatch-detail-grid small,
.dispatch-detail-grid strong {
  display: block;
}

.dispatch-detail-grid small {
  color: #6b7280;
  font-size: 10px;
  font-weight: 800;
}

.dispatch-detail-grid strong {
  font-size: 12px;
  margin-top: 3px;
  word-break: break-word;
}

.dispatch-note {
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  margin-bottom: 12px;
}

.dispatch-note strong,
.dispatch-items-list > strong,
.dispatch-followup-title strong {
  font-size: 13px;
}

.dispatch-note p {
  margin: 6px 0 0;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.dispatch-items-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.dispatch-item-line {
  border: 1px solid #eadbd2;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.dispatch-item-line strong,
.dispatch-item-line small,
.dispatch-item-line span {
  display: block;
}

.dispatch-item-line small {
  color: #6b7280;
  font-size: 11px;
  margin-top: 2px;
}

.dispatch-item-line div:last-child {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  font-size: 11px;
  color: #4b5563;
}

.dispatch-followup-timeline {
  border-top: 1px dashed #eadbd2;
  padding-top: 12px;
  margin-top: 8px;
}

.dispatch-followup-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.dispatch-followup-title button,
.dispatch-secondary-btn,
.dispatch-primary-btn {
  min-height: 38px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.dispatch-followup-title button,
.dispatch-primary-btn {
  border: 0;
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: #fff;
}

.dispatch-secondary-btn {
  border: 1px solid #eadbd2;
  background: #fff7ed;
  color: var(--brown);
}

.dispatch-followup-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 8px;
  margin-top: 8px;
}

.dispatch-followup-item > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brown);
  margin-top: 5px;
}

.dispatch-followup-item > div {
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff;
  padding: 9px;
}

.dispatch-followup-item strong,
.dispatch-followup-item small {
  display: block;
}

.dispatch-followup-item p {
  margin: 4px 0;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.dispatch-followup-item small {
  color: #6b7280;
  font-size: 11px;
}

.dispatch-empty-note {
  border: 1px dashed #d6c4b6;
  border-radius: 12px;
  background: #fffaf6;
  color: #6b7280;
  font-size: 12px;
  padding: 10px;
}

.dispatch-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.dispatch-followup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,0.32);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.dispatch-followup-modal {
  width: 100%;
  max-width: 430px;
  border-radius: 22px 22px 14px 14px;
  background: #fffaf4;
  box-shadow: 0 -16px 40px rgba(0,0,0,0.18);
  padding: 18px;
  position: relative;
}

.dispatch-followup-modal h2 {
  margin: 0 34px 4px 0;
}

.dispatch-followup-modal p {
  margin: 0 0 12px;
  color: #6b7280;
  font-size: 13px;
}

@media (max-width: 420px) {
  .dispatch-detail-grid,
  .dispatch-item-line div:last-child,
  .dispatch-card-actions {
    grid-template-columns: 1fr;
  }
}

/* Super Admin Audit Logs */
.audit-log-screen .mobile-menu-heading p {
  max-width: 92%;
}

.audit-filter-card {
  box-shadow: 0 12px 30px rgba(74, 35, 15, 0.08);
}

.audit-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.audit-filter-grid label {
  display: grid;
  gap: 5px;
}

.audit-filter-grid label span {
  font-size: 11px;
  font-weight: 900;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.audit-filter-grid input,
.audit-filter-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 0 10px;
}

.audit-filter-wide {
  grid-column: 1 / -1;
}

.audit-filter-btn,
.audit-reset-btn {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  font-weight: 900;
  font-size: 13px;
}

.audit-filter-btn {
  background: var(--brown);
  color: #fff;
}

.audit-reset-btn {
  background: #fff4e8;
  color: var(--brown);
  border: 1px solid #eadbd2;
}

.audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.audit-summary-chip {
  border: 1px solid #eadbd2;
  border-radius: 14px;
  background: #fff;
  padding: 10px 8px;
  text-align: center;
}

.audit-summary-chip small,
.audit-summary-chip strong {
  display: block;
}

.audit-summary-chip small {
  color: #6b7280;
  font-size: 10px;
  font-weight: 900;
}

.audit-summary-chip strong {
  margin-top: 4px;
  font-size: 17px;
  color: var(--brown);
}

.audit-summary-chip.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.audit-summary-chip.warn {
  background: #fff7ed;
  border-color: #fed7aa;
}

.audit-summary-chip.info {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.audit-log-list {
  display: grid;
  gap: 10px;
}

.audit-log-card {
  border: 1px solid #eadbd2;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 12px;
}

.audit-log-card.success {
  border-color: #bbf7d0;
  background: #f8fff9;
}

.audit-log-card.warn {
  border-color: #fed7aa;
  background: #fffaf4;
}

.audit-log-card.danger {
  border-color: #fecdd3;
  background: #fff7f8;
}

.audit-log-card.info {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.audit-log-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.audit-log-top strong,
.audit-log-top small,
.audit-log-meta span {
  display: block;
}

.audit-log-top strong {
  font-size: 14px;
  font-weight: 900;
}

.audit-log-top small {
  color: #6b7280;
  font-size: 12px;
  margin-top: 3px;
}

.audit-log-top b {
  font-size: 11px;
  color: var(--brown);
  text-align: right;
  max-width: 96px;
  line-height: 1.25;
}

.audit-log-meta {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  color: #4b5563;
  font-size: 12px;
}

.audit-log-meta b {
  color: #1f2937;
}

.audit-toggle-btn {
  width: 100%;
  min-height: 40px;
  border: 1px dashed #d6c4b6;
  border-radius: 12px;
  margin-top: 10px;
  background: #fffaf6;
  color: var(--brown);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.audit-value-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.audit-value-panel div {
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.audit-value-panel small {
  display: block;
  color: #6b7280;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 6px;
}

.audit-value-panel pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  max-height: 180px;
  overflow: auto;
  color: #374151;
  font-size: 11px;
  line-height: 1.35;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 380px) {
  .audit-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Audit Logs: download, outlet search, and purge controls */
.audit-download-btn,
.audit-purge-btn {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  font-weight: 900;
  font-size: 13px;
}

.audit-download-btn {
  background: #166534;
  color: #fff;
}

.audit-purge-btn {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.audit-danger-note {
  margin: 10px 0 0;
  padding: 10px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.audit-log-meta span b {
  overflow-wrap: anywhere;
}


/* System Settings */
.system-settings-screen .mobile-menu-heading p {
  max-width: 100%;
}

.system-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.system-info-chip {
  min-height: 82px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 3px;
}

.system-info-chip span {
  font-size: 20px;
}

.system-info-chip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.system-info-chip strong {
  color: var(--brown);
  font-size: 20px;
}

.system-settings-form {
  display: grid;
  gap: 12px;
}

.system-settings-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.system-settings-card h2 {
  margin: 0;
  font-size: 16px;
}

.system-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.system-settings-grid label {
  display: grid;
  gap: 6px;
}

.system-settings-grid label span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 900;
}

.system-settings-grid input,
.system-settings-grid select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #eadbd2;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 0 12px;
}

.system-help-text {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.4;
}

.system-export-card {
  margin-top: 12px;
}

.system-export-grid {
  display: grid;
  gap: 10px;
}

.system-export-btn {
  width: 100%;
  border: 1px solid #eadbd2;
  border-radius: 16px;
  background: #fffaf6;
  color: var(--text);
  padding: 12px;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
}

.system-export-btn strong,
.system-export-btn small {
  display: block;
}

.system-export-btn strong {
  font-size: 14px;
}

.system-export-btn small {
  color: #6b7280;
  font-size: 11px;
  grid-column: 1 / 2;
}

.system-export-btn b {
  color: var(--brown);
  font-size: 12px;
  font-weight: 900;
  grid-row: 1 / span 2;
  grid-column: 2;
}

.success-box {
  background: #edfff1;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
}

.system-lock-note {
  display: block;
  margin-top: 6px;
  color: #7a2f0d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.system-settings-form input[disabled] {
  background: #fff7ed;
  color: #7a2f0d;
  font-weight: 900;
  opacity: 1;
}


/* ================================
   HO Message Center + Side Menu
================================ */

.top-bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.global-message-btn {
  position: relative;
}

.global-message-btn.has-unread {
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.16), 0 8px 22px rgba(122, 47, 13, 0.14);
  animation: twsMessageGlow 1.55s ease-in-out infinite;
}

.global-message-btn.message-pulse-now {
  animation: twsMessagePop 0.7s ease both;
}

.message-unread-badge,
.side-menu-row em {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.28);
}

.message-unread-badge {
  position: absolute;
  top: -2px;
  right: -2px;
}

@keyframes twsMessageGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.12), 0 8px 22px rgba(122, 47, 13, 0.12); }
  50% { box-shadow: 0 0 0 6px rgba(242, 140, 40, 0.22), 0 10px 26px rgba(122, 47, 13, 0.2); }
}

@keyframes twsMessagePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.side-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 10, 4, 0.32);
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

.side-menu-panel {
  width: min(86vw, 360px);
  height: 100vh;
  background: #fffaf4;
  border-right: 1px solid var(--border);
  box-shadow: 24px 0 60px rgba(0,0,0,0.22);
  padding: 18px 14px 22px;
  overflow-y: auto;
  animation: twsSideIn 0.22s ease both;
}

@keyframes twsSideIn {
  from { transform: translateX(-100%); opacity: 0.7; }
  to { transform: translateX(0); opacity: 1; }
}

.side-menu-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 14px;
}

.side-menu-head strong,
.side-menu-head small,
.side-menu-row strong,
.side-menu-row small {
  display: block;
}

.side-menu-head strong {
  font-size: 18px;
}

.side-menu-head small,
.side-menu-row small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.side-menu-head button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--brown);
  font-size: 28px;
  line-height: 1;
}

.side-menu-list {
  display: grid;
  gap: 8px;
}

.side-menu-row {
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.86);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
}

.side-menu-row > span {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: #fff7ed;
  display: grid;
  place-items: center;
}

.side-menu-row b {
  color: var(--brown);
}

.side-menu-row.locked {
  opacity: 0.72;
}

.side-menu-logout {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: #fff;
  font-weight: 900;
}

.messages-layout {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-bottom: 90px;
}

.messages-conversations-card,
.message-thread-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,0.86);
  box-shadow: var(--shadow);
  padding: 12px;
}

.messages-section-head strong,
.messages-section-head small {
  display: block;
}

.messages-section-head strong {
  font-size: 15px;
}

.messages-section-head small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.message-conversation-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 315px;
  overflow: auto;
  padding-right: 2px;
}

.message-conversation-row {
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
}

.message-conversation-row strong,
.message-conversation-row small,
.message-conversation-row em {
  display: block;
}

.message-conversation-row strong {
  font-size: 14px;
}

.message-conversation-row small {
  color: #6b7280;
  font-size: 12px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 285px;
}

.message-conversation-row em {
  color: #9ca3af;
  font-size: 10px;
  margin-top: 4px;
  font-style: normal;
}

.message-conversation-row.active {
  border-color: #f28c28;
  background: #fff7ed;
}

.message-conversation-row.unread {
  border-color: #fdba74;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.12);
}

.message-conversation-row b {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
}

.message-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.message-thread-head strong,
.message-thread-head small {
  display: block;
}

.message-thread-head strong {
  font-size: 15px;
}

.message-thread-head small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.message-thread-head button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  color: var(--brown);
  font-weight: 900;
}

.message-thread-list {
  display: grid;
  gap: 8px;
  max-height: 390px;
  overflow: auto;
  padding: 12px 2px;
}

.message-bubble {
  max-width: 86%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 12px;
  background: #fff;
}

.message-bubble.mine {
  justify-self: end;
  background: #fff7ed;
  border-color: #fed7aa;
}

.message-bubble.theirs {
  justify-self: start;
  background: #f8fafc;
  border-color: #e5e7eb;
}

.message-bubble-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 5px;
}

.message-bubble-meta strong {
  font-size: 12px;
}

.message-bubble-meta small {
  color: #6b7280;
  font-size: 10px;
}

.message-bubble p {
  margin: 0;
  font-size: 13px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.message-attachment-link {
  display: inline-flex;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--brown);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.message-send-form {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.message-send-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 10px 12px;
  resize: vertical;
  outline: 0;
  font: inherit;
  font-size: 14px;
}

.message-send-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.secondary-btn {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--brown);
  font-weight: 900;
  padding: 0 12px;
}

.message-send-actions .primary-btn {
  min-height: 46px;
  padding: 0 18px;
}

.message-attachment-preview {
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fff7ed;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.message-attachment-preview span {
  min-width: 0;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment-preview button {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
}

.message-help-text {
  color: #6b7280;
  font-size: 11px;
  line-height: 1.35;
}

.message-loader,
.message-empty-state {
  border: 1px dashed #d6c4b6;
  border-radius: 16px;
  background: #fffaf6;
  padding: 14px;
  color: #7a2f0d;
  text-align: center;
}

.message-empty-state strong,
.message-empty-state span {
  display: block;
}

.message-empty-state span {
  color: #6b7280;
  font-size: 12px;
  margin-top: 4px;
}

.message-empty-state.compact {
  padding: 12px;
}

@media (max-width: 420px) {
  .top-bar-actions {
    gap: 2px;
  }

  .top-bar-actions .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .message-send-actions {
    grid-template-columns: 1fr;
  }
}


.top-bar { grid-template-columns: 44px 1fr auto; }


/* Message Center Filters + Admin Delete */
.message-filter-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-top: 12px;
}

.message-filter-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.message-filter-grid select,
.message-filter-grid input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 0 12px;
  outline: 0;
}

.message-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.secondary-btn.light {
  background: #fffaf6;
  color: #7a2f0d;
}

.message-delete-btn {
  margin-top: 8px;
  min-height: 28px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 900;
  padding: 0 10px;
}

.message-delete-btn:active {
  transform: scale(0.98);
}

@media (min-width: 560px) {
  .message-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .message-filter-grid input {
    grid-column: 1 / -1;
  }
}


/* ================================
   Final Production GUI Polish
================================ */
.side-menu-row.active {
  border-color: #f28c28;
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.12), var(--shadow);
}

.side-menu-row.active > span {
  background: #fff;
}

.side-menu-version {
  display: block;
  margin-top: 12px;
  color: #9a7b68;
  font-size: 11px;
  text-align: center;
  font-weight: 800;
}

.message-admin-retention-note {
  display: block;
  border: 1px dashed #fed7aa;
  border-radius: 12px;
  background: #fffaf6;
  color: #7c2d12;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
}

.tws-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 500;
  width: min(92vw, 390px);
  border-radius: 16px;
  padding: 12px 14px;
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.22);
  animation: twsToastIn 0.2s ease both;
}

.tws-toast.success { background: #15803d; }
.tws-toast.warn { background: #b45309; }
.tws-toast.error { background: #b91c1c; }

@keyframes twsToastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

button:disabled,
.primary-btn:disabled,
.secondary-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.08);
}

.messages-screen .outlet-card,
.messages-screen .message-filter-card,
.messages-screen .messages-conversations-card,
.messages-screen .message-thread-card {
  scroll-margin-top: 12px;
}

@media (max-width: 430px) {
  .side-menu-panel {
    width: min(88vw, 360px);
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .message-thread-list {
    max-height: 46vh;
  }

  .tws-toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
}

/* ================================
   Production GUI Icon Consistency v1.4.3
   Orange / Brown / Green icon system
================================ */
:root {
  --icon-orange: #f28c28;
  --icon-orange-soft: #fff4e8;
  --icon-brown: #7a2f0d;
  --icon-brown-soft: #fff1e8;
  --icon-green: #15803d;
  --icon-green-soft: #edfff1;
}

.top-bar {
  grid-template-columns: 56px 1fr 132px;
  gap: 4px;
}

.icon-btn {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-size: 28px;
  color: var(--icon-brown);
}

.top-bar > .icon-btn:first-child {
  background: var(--icon-brown-soft);
  color: var(--icon-brown);
}

.top-bar-actions {
  gap: 8px;
}

.top-bar-actions .icon-btn {
  flex: 0 0 54px;
}

.include-help-toggle.icon-only,
.global-message-btn,
.alert-dot,
.top-bar-actions .icon-btn,
.global-help-toggle-wrap .icon-btn {
  background: var(--icon-orange-soft);
  border: 1px solid rgba(242, 140, 40, 0.28);
  box-shadow: 0 10px 22px rgba(122, 47, 13, 0.10);
}

.global-message-btn {
  color: var(--icon-brown);
}

.global-message-btn.has-unread {
  background: var(--icon-orange-soft);
  color: var(--icon-brown);
  box-shadow: 0 0 0 4px rgba(242, 140, 40, 0.18), 0 12px 26px rgba(122, 47, 13, 0.16);
}

.stat-icon,
.action-icon,
.side-menu-row > span,
.attention-item .attention-mark,
.message-conversation-row b {
  width: 57px;
  height: 57px;
  min-width: 57px;
  border-radius: 18px;
  font-size: 27px;
  background: var(--icon-orange-soft);
  color: var(--icon-orange);
  border: 1px solid rgba(242, 140, 40, 0.20);
}

.stat-card:nth-child(3n + 1) .stat-icon,
.quick-action-group:nth-child(3n + 1) .action-icon,
.action-row:nth-child(3n + 1) .action-icon,
.side-menu-row:nth-child(3n + 1) > span {
  background: var(--icon-orange-soft);
  color: var(--icon-orange);
  border-color: rgba(242, 140, 40, 0.24);
}

.stat-card:nth-child(3n + 2) .stat-icon,
.quick-action-group:nth-child(3n + 2) .action-icon,
.action-row:nth-child(3n + 2) .action-icon,
.side-menu-row:nth-child(3n + 2) > span {
  background: var(--icon-brown-soft);
  color: var(--icon-brown);
  border-color: rgba(122, 47, 13, 0.20);
}

.stat-card:nth-child(3n + 3) .stat-icon,
.quick-action-group:nth-child(3n + 3) .action-icon,
.action-row:nth-child(3n + 3) .action-icon,
.side-menu-row:nth-child(3n + 3) > span {
  background: var(--icon-green-soft);
  color: var(--icon-green);
  border-color: rgba(21, 128, 61, 0.20);
}

.bottom-nav button {
  font-size: 27px;
}

.bottom-nav button span {
  font-size: 12px;
}

.bottom-nav button.active {
  background: var(--icon-brown);
  color: #fff;
}

.alert-action-btn,
.alerts-filter-actions button,
.message-filter-actions button,
.dashboard-drill-action {
  min-height: 52px;
}

.alert-action-btn:active,
.alerts-filter-actions button:active,
.message-filter-actions button:active,
.dashboard-drill-action:active {
  transform: translateY(1px);
}

@media (max-width: 430px) {
  .top-bar {
    grid-template-columns: 50px 1fr 122px;
  }

  .icon-btn,
  .top-bar-actions .icon-btn {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    font-size: 26px;
  }

  .stat-icon,
  .action-icon,
  .side-menu-row > span {
    width: 54px;
    height: 54px;
    min-width: 54px;
    font-size: 26px;
  }
}


/* ================================
   Professional Icon + Layout + Animation Polish v1.4.4
   Goal: smaller icons, no text cutting, Apple-like motion
================================ */
:root {
  --motion-fast: 160ms;
  --motion-mid: 260ms;
  --motion-slow: 420ms;
  --ease-apple: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Top bar: keep titles readable even with help/message/bell icons */
.top-bar {
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
  gap: 8px !important;
}

.top-bar h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}

.top-bar-actions {
  min-width: 0;
  gap: 6px !important;
}

.icon-btn,
.top-bar-actions .icon-btn,
.global-help-toggle-wrap .icon-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  flex-basis: 42px !important;
  border-radius: 15px !important;
  font-size: 21px !important;
}

/* Reduce oversized icons by around 25% and restore breathing room */
.stat-icon,
.action-icon,
.side-menu-row > span,
.message-conversation-row b {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  border-radius: 15px !important;
  font-size: 21px !important;
}

/* Action rows: prevent labels from getting clipped */
.action-row {
  grid-template-columns: 44px minmax(0, 1fr) 18px !important;
  gap: 16px !important;
  padding: 14px 16px !important;
  min-height: 76px;
  overflow: visible !important;
}

.action-row > span:not(.action-icon),
.quick-action-group-toggle > span:not(.action-icon),
.side-menu-row > div,
.message-conversation-row > div {
  min-width: 0;
}

.action-row strong,
.action-row small,
.quick-action-group-toggle strong,
.quick-action-group-toggle small,
.side-menu-row strong,
.side-menu-row small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}

.action-row strong {
  font-size: 15px;
}

.action-row small {
  font-size: 12px;
  line-height: 1.35;
}

/* Dashboard cards should remain balanced with smaller icons */
.stat-card {
  gap: 14px !important;
  padding: 14px !important;
}

.stat-card > div {
  min-width: 0;
}

.stat-card small,
.stat-card strong,
.stat-card em {
  white-space: normal;
}

/* Side drawer rows get the same layout discipline */
.side-menu-row {
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
  gap: 14px !important;
  padding: 12px 14px !important;
}

.side-menu-panel {
  animation: twsDrawerSlideIn var(--motion-slow) var(--ease-apple) both !important;
}

.side-menu-backdrop {
  animation: twsBackdropFade var(--motion-mid) ease both;
}

/* Bottom navigation icon size back to professional scale */
.bottom-nav button {
  font-size: 21px !important;
  transition: transform var(--motion-fast) var(--ease-apple),
              background-color var(--motion-mid) ease,
              color var(--motion-mid) ease;
}

.bottom-nav button span {
  font-size: 12px !important;
}

.bottom-nav button:active {
  transform: scale(0.94);
}

/* Smooth, Apple-like transitions across cards, buttons and panels */
button,
.action-row,
.stat-card,
.outlet-card,
.quick-actions-toggle,
.quick-action-group,
.mobile-menu-section,
.mobile-menu-card,
.message-conversation-row,
.message-bubble,
.messages-conversations-card,
.message-thread-card,
.message-filter-card,
.alert-card,
.alert-action-btn,
.dashboard-drill-row,
.secondary-btn,
.primary-btn {
  transition:
    transform var(--motion-fast) var(--ease-apple),
    box-shadow var(--motion-mid) var(--ease-apple),
    border-color var(--motion-mid) ease,
    background-color var(--motion-mid) ease,
    opacity var(--motion-mid) ease;
}

button:active,
.action-row:active,
.stat-card:active,
.message-conversation-row:active,
.dashboard-drill-row:active,
.mobile-menu-card:active {
  transform: scale(0.985);
}

.quick-actions-panel:not(.collapsed),
.quick-action-group-body:not(.collapsed),
.attention-list:not(.collapsed),
.mobile-menu-section,
.messages-layout,
.alerts-list,
.dashboard-drill-card-wrap,
.help-modal-card,
.message-thread-card,
.messages-conversations-card {
  animation: twsSoftOpen var(--motion-slow) var(--ease-apple) both;
}

.phone-screen:not(.login-screen) {
  animation: twsScreenEnter 280ms var(--ease-apple) both;
}

.outlet-card,
.stat-card,
.quick-actions-toggle,
.quick-action-group,
.action-row,
.message-filter-card,
.messages-conversations-card,
.message-thread-card,
.alert-card {
  will-change: transform, opacity;
}

/* Keep cards from sitting under bottom nav on mobile */
.phone-screen {
  padding-bottom: max(108px, calc(96px + env(safe-area-inset-bottom))) !important;
}

.dashboard-screen,
.mobile-menu-screen,
.messages-screen {
  padding-bottom: calc(128px + env(safe-area-inset-bottom)) !important;
}

/* More readable top-right icons on very small phones */
@media (max-width: 430px) {
  .top-bar {
    grid-template-columns: 42px minmax(0, 1fr) auto !important;
    gap: 6px !important;
  }

  .icon-btn,
  .top-bar-actions .icon-btn,
  .global-help-toggle-wrap .icon-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex-basis: 40px !important;
    border-radius: 14px !important;
    font-size: 20px !important;
  }

  .stat-icon,
  .action-icon,
  .side-menu-row > span,
  .message-conversation-row b {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 14px !important;
    font-size: 20px !important;
  }

  .action-row {
    grid-template-columns: 42px minmax(0, 1fr) 18px !important;
    gap: 14px !important;
    padding: 13px 14px !important;
  }

  .action-row strong {
    font-size: 14px;
  }

  .action-row small {
    font-size: 12px;
  }
}

/* Motion keyframes */
@keyframes twsSoftOpen {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

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

@keyframes twsDrawerSlideIn {
  from {
    opacity: 0.88;
    transform: translateX(-28px) scale(0.985);
    filter: blur(1px);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes twsBackdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
