/* Desktop command center: dark technical workspace requested from the supplied reference. */
@media (min-width: 1100px) {
  body.dashboard-active {
    color: #e7eef9;
    background: #07111f;
  }

  .dashboard:not(.hidden) {
    color-scheme: dark;
    background: #07111f;
  }

  .desktop-sidebar {
    color: #c7d5e8;
    background: #050b16;
    box-shadow: 10px 0 34px rgba(0, 0, 0, 0.28);
  }

  .desktop-brand {
    border-bottom-color: #17253a;
  }

  .desktop-brand-mark,
  .desktop-nav button.active {
    background: #0878ff;
  }

  .desktop-brand span:last-child,
  .desktop-nav p,
  .desktop-system-state {
    color: #6f86a5;
  }

  .desktop-nav button {
    color: #91a6c2;
  }

  .desktop-nav button:hover {
    color: #f3f8ff;
    background: #101d31;
  }

  .desktop-nav button.active::after {
    background: #5de1ff;
  }

  .dashboard > .topbar {
    border-bottom-color: #18304d;
    color: #eff6ff;
    background: #0a1728;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  }

  .desktop-workspace-title {
    border-right-color: #203854;
    color: #45c8ff;
  }

  .topbar h1 {
    color: #f2f7ff;
  }

  .topbar #storeAddress,
  .topbar .admin-role-badge,
  .topbar-store {
    color: #8fa4c0;
  }

  .topbar-store select,
  .dashboard input,
  .dashboard select,
  .dashboard textarea {
    border-color: #28415f;
    color: #e9f2ff;
    background: #081425;
  }

  .topbar-store select:hover,
  .dashboard input:hover,
  .dashboard select:hover,
  .dashboard textarea:hover {
    border-color: #3d628e;
  }

  .dashboard input::placeholder,
  .dashboard textarea::placeholder {
    color: #617895;
  }

  .dashboard option {
    color: #e9f2ff;
    background: #0a1728;
  }

  .topbar .link-button.secondary,
  .topbar button.secondary,
  .dashboard button.secondary,
  .dashboard .link-button.secondary {
    border-color: #294767;
    color: #cfe0f5;
    background: #10233a;
  }

  .topbar .link-button.secondary:hover,
  .topbar button.secondary:hover,
  .dashboard button.secondary:hover,
  .dashboard .link-button.secondary:hover {
    color: #ffffff;
    background: #173454;
  }

  .dashboard button:not(.secondary):not(.danger),
  .dashboard .link-button:not(.secondary) {
    background: #0878ff;
  }

  .dashboard button:not(.secondary):not(.danger):hover,
  .dashboard .link-button:not(.secondary):hover {
    background: #2590ff;
  }

  .desktop-nav button,
  .desktop-nav button:not(.secondary):not(.danger) {
    background: transparent;
  }

  .desktop-nav button:hover,
  .desktop-nav button:not(.secondary):not(.danger):hover {
    background: #101d31;
  }

  .desktop-nav button.active,
  .desktop-nav button.active:not(.secondary):not(.danger) {
    background: #0878ff;
  }

  .stats article {
    border-color: #1e3857;
    background: #0d1c31;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(74, 177, 255, 0.18);
  }

  .stats article:nth-child(3n + 2) {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(52, 211, 153, 0.2);
  }

  .stats article:nth-child(3n) {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(93, 225, 255, 0.2);
  }

  .stats span,
  .metric-card span,
  .metric-card small {
    color: #7f95b1;
  }

  .stats strong,
  .metric-card strong {
    color: #f4f8ff;
  }

  .dashboard > .panel {
    border-color: #1c3553;
    background: #0b192b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(87, 176, 255, 0.08);
  }

  .panel-head {
    border-bottom-color: #1a304b;
  }

  .panel h2,
  .section-title,
  .dashboard label,
  .dashboard strong {
    color: #e8f1ff;
  }

  .panel-head .muted,
  .dashboard .muted,
  .dashboard .hint {
    color: #8196b1;
  }

  .metric-card,
  .user-summary div,
  .store-manage-item,
  .device-store-assignment,
  .device-integration-panel,
  .operation-box,
  .group-buy-plan-item,
  .integration-status,
  .device-control-info,
  .equipment-row,
  .camera-text-editor,
  .recharge-setting-meta,
  .recharge-mode-setting,
  .duration-recharge-plan-row,
  .package-item,
  .device-item,
  .ad-item,
  .manager-item,
  .user-detail,
  .cost-summary-item,
  .device-record-form,
  .device-create-form,
  .store-device-row,
  .store-device-empty {
    border-color: #203a59;
    color: #dbe8f8;
    background: #081526;
    box-shadow: none;
  }

  .tutorial-list-head {
    border-top-color: #203a59;
  }

  .tutorial-step-item {
    border-color: #203a59;
    color: #dbe8f8;
    background: #081526;
  }

  .tutorial-step-order,
  .tutorial-step-order strong,
  .tutorial-step-fields label {
    color: #b9cbe2;
  }

  .tutorial-step-image > span {
    border-color: #36506d;
    color: #8298b5;
    background: #0c1a2d;
  }

  .ad-preview {
    color: #8298b5;
    background: #0c1a2d;
  }

  .command-row.payment-failed {
    background: #241722;
  }

  .command-row.payment-pending {
    background: #2a2215;
  }

  .danger-zone {
    border-color: #65432a;
    color: #f5c28e;
    background: #271d17;
  }

  .dashboard .danger-zone strong,
  .dashboard .danger-zone .muted {
    color: #f5c28e;
  }

  .group-buy-plan-item span {
    color: #9ab0cc;
  }

  .camera-volume-field input {
    accent-color: #0878ff;
  }

  .device-integration-group,
  .camera-http-summary,
  .camera-binding-row {
    border-color: #203a59;
  }

  .camera-http-summary > div {
    border-color: #203a59;
  }

  .device-integration-group-head span,
  .camera-binding-head span,
  .camera-http-summary span,
  .camera-http-token-row label,
  .camera-path-row label,
  .camera-binding-row > label {
    color: #8298b5;
  }

  .camera-photo-policy {
    border-left-color: #38d99a;
    background: #0c1d31;
  }

  .camera-auto-start-settings {
    border-left-color: #2f9dff;
    background: #0c1d31;
  }

  .camera-auto-start-settings label,
  .camera-auto-bay-toggle {
    color: #b9cbe2;
  }

  .camera-auto-start-toggle {
    color: #e8f1ff;
  }

  .camera-capture-row,
  .camera-capture-empty {
    border-color: #203a59;
  }

  .device-record-grid input:disabled {
    color: #7388a3;
    background: #0c1a2d;
  }

  .badge {
    color: #b9d8ff;
    background: #153254;
  }

  .badge.success {
    color: #6ce6ad;
    background: #0d3b31;
  }

  .badge.warning {
    color: #ffc875;
    background: #493118;
  }

  .segmented {
    background: #071321;
  }

  .dashboard .segmented button,
  .dashboard .segmented button:not(.secondary):not(.danger) {
    color: #7890ad;
    background: transparent;
  }

  .dashboard .segmented button.active,
  .dashboard .segmented button.active:not(.secondary):not(.danger) {
    color: #eaf4ff;
    background: #173657;
    box-shadow: none;
  }

  .camera-capture-head .badge {
    color: #b9d8ff;
  }

  #dashboardView .desktop-sidebar .desktop-nav button,
  #dashboardView .desktop-sidebar .desktop-nav button:not(.secondary):not(.danger) {
    color: #91a6c2;
    background: transparent;
  }

  #dashboardView .desktop-sidebar .desktop-nav button:hover,
  #dashboardView .desktop-sidebar .desktop-nav button:not(.secondary):not(.danger):hover {
    color: #f3f8ff;
    background: #101d31;
  }

  #dashboardView .desktop-sidebar .desktop-nav button.active,
  #dashboardView .desktop-sidebar .desktop-nav button.active:not(.secondary):not(.danger) {
    color: #ffffff;
    background: #0878ff;
  }

  .data-table-wrap {
    border-color: #1f3855;
  }

  .data-table th {
    border-color: #203a58;
    color: #89a0bc;
    background: #0e2138;
  }

  .data-table td,
  .table-list > *,
  .row {
    border-color: #1b324d;
    color: #d9e5f5;
    background: #091729;
  }

  .data-table tbody tr:hover {
    background: #102744;
  }

  .trend-row {
    border-color: #1d3551;
  }

  .trend-bars progress {
    background: #071321;
  }

  .trend-bars progress::-webkit-progress-bar {
    background: #071321;
  }

  .trend-bars .income::-webkit-progress-value,
  .trend-bars .income::-moz-progress-bar {
    background: #0878ff;
  }

  .trend-bars .wash::-webkit-progress-value,
  .trend-bars .wash::-moz-progress-bar {
    background: #22c8d6;
  }

  .dashboard > .stats {
    order: 10;
  }

  #performancePanel {
    order: 20;
  }

  #trendPanel {
    order: 21;
  }

  #settlementPanel {
    order: 30;
  }

  #todayOrdersPanel,
  #recentOrdersPanel {
    order: 40;
  }

  .pricing-preview,
  .empty,
  .device-bind-list,
  .manager-store-grid,
  .camera-connection-row > div {
    border-color: #203a58;
    color: #a9bdd4;
    background: #091729;
  }

  .dashboard button.danger,
  .dashboard button.switch.danger {
    border-color: #613337;
    color: #ff999f;
    background: #351b23;
  }

  .dashboard button.danger:hover,
  .dashboard button.switch.danger:hover {
    background: #48232c;
  }

  .login-card {
    border-color: #244563;
    color: #e8f1ff;
    background: #0b192b;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.34);
    backdrop-filter: none;
  }

  .login-card h1,
  .login-card label {
    color: #eef6ff;
  }

  .login-store-name {
    color: #8196b1;
  }

  body.dashboard-active .site-footer,
  body.dashboard-active .site-footer a {
    border-top-color: #172b44;
    color: #6f86a4;
    background: #07111f;
  }
}

/* Keep dense settlement data inside the command-center palette. Pure white
   tiles created a distracting light wall inside the authenticated workspace. */
@media (min-width: 1100px) {
  #settlementPanel .settlement-money-row div {
    border: 1px solid #203b59;
    background: linear-gradient(145deg, #102238, #0c1a2c);
    box-shadow: inset 0 1px 0 rgba(143, 185, 226, 0.06);
  }

  #settlementPanel .settlement-money-row dt {
    color: #91a7c1;
  }

  #settlementPanel .settlement-money-row dd {
    color: #edf5ff;
  }

  #settlementPanel .settlement-proof-row button:not(.secondary):not(:disabled) {
    border-color: #2d6695;
    color: #dceeff;
    background: #174b78;
    box-shadow: none;
  }

  #settlementPanel .settlement-proof-row button:not(.secondary):not(:disabled):hover {
    border-color: #4388bd;
    background: #1c5b8f;
  }
}

.login {
  min-height: calc(100vh - 64px);
  padding: clamp(24px, 5vw, 64px);
  background: #eef2f6;
}

.login-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  width: min(920px, 100%);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(31, 41, 55, 0.12);
  animation: login-shell-enter 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 48px;
  color: #20292f;
  background: #dce2e4;
  isolation: isolate;
}

.login-brand::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(110deg, transparent 0 54%, rgba(31, 43, 49, 0.04) 54% 54.5%, transparent 54.5%),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(31, 43, 49, 0.025) 48px);
  content: "";
  pointer-events: none;
}

.login-brand::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(55, 69, 77, 0.28), transparent);
  content: "";
  opacity: 0.8;
}

.login-brand-mark {
  position: relative;
  display: block;
  width: 148px;
  height: 64px;
  margin-bottom: 72px;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 10px 16px rgba(28, 38, 43, 0.18));
  animation: login-item-enter 560ms 120ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: filter 220ms ease, transform 220ms ease;
}

.login-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-brand-mark:hover {
  filter: drop-shadow(0 14px 22px rgba(28, 38, 43, 0.25));
  transform: translateY(-2px);
}

.login-brand-kicker,
.login-eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.login-brand-kicker {
  color: #53636b;
}

.login-brand h1 {
  margin: 0;
  color: #20292f;
  font-size: 36px;
  line-height: 1.15;
}

.login-brand > div > p:last-child {
  margin: 12px 0 0;
  color: #56656d;
  font-size: 16px;
  line-height: 1.6;
}

.login-brand > div:not(.login-brand-status):not(.login-brand-visual) {
  animation: login-item-enter 620ms 210ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand-visual {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px 14px;
  margin-top: 44px;
  animation: login-item-enter 680ms 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-flow-line {
  position: relative;
  grid-column: 1 / -1;
  height: 1px;
  overflow: visible;
  background: rgba(55, 71, 79, 0.24);
}

.login-flow-line::before,
.login-flow-line::after {
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(67, 85, 94, 0.68);
  border-radius: 50%;
  background: #dce2e4;
  content: "";
}

.login-flow-line::before { left: 0; }
.login-flow-line::after { right: 0; }

.login-flow-line i {
  position: absolute;
  top: -1px;
  left: 0;
  width: 34%;
  height: 3px;
  background: #5c707a;
  box-shadow: 0 0 9px rgba(62, 80, 89, 0.3);
  animation: login-flow 3.8s ease-in-out infinite;
}

.login-flow-label,
.login-flow-value {
  color: #65757d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.login-flow-label { letter-spacing: 1.4px; }

.login-flow-value {
  color: #2a373d;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.login-brand-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  color: #46555d;
  font-size: 13px;
  animation: login-item-enter 620ms 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c77b;
  box-shadow: 0 0 0 4px rgba(52, 199, 123, 0.15);
  animation: login-status-pulse 2.8s ease-out infinite;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: auto;
  min-width: 0;
  padding: 56px 64px;
  border: 0;
  border-radius: 0;
  color: #182230;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

.login-card > * {
  animation: login-form-enter 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-card > :nth-child(1) { animation-delay: 180ms; }
.login-card > :nth-child(2) { animation-delay: 220ms; }
.login-card > :nth-child(3) { animation-delay: 260ms; }
.login-card > :nth-child(4) { animation-delay: 300ms; }
.login-card > :nth-child(5) { animation-delay: 340ms; }
.login-card > :nth-child(6) { animation-delay: 380ms; }
.login-card > :nth-child(7) { animation-delay: 420ms; }
.login-card > :nth-child(8) { animation-delay: 460ms; }
.login-card > :nth-child(9) { animation-delay: 500ms; }

.login-eyebrow {
  color: #0878d1;
}

.login-card h2 {
  margin: 0;
  color: #182230;
  font-size: 30px;
  line-height: 1.25;
}

.login-card .login-store-name {
  margin: 10px 0 24px;
  color: #667085;
  font-size: 14px;
}

.login-card label {
  display: block;
  margin: 14px 0 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 650;
}

.login-card input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #cfd7e1;
  border-radius: 6px;
  color: #182230;
  background: #ffffff;
  outline: 0;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.login-card input:focus {
  border-color: #0878d1;
  box-shadow: 0 0 0 3px rgba(8, 120, 209, 0.13);
  background: #fbfdff;
  transform: translateY(-1px);
}

.login-card #loginButton {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 48px;
  margin-top: 24px;
  border-radius: 6px;
  background: #0878d1;
  box-shadow: 0 10px 22px rgba(8, 120, 209, 0.18);
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.login-card #loginButton::after {
  position: absolute;
  top: 0;
  left: -45%;
  width: 34%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  content: "";
  transform: skewX(-18deg);
  transition: left 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.login-card #loginButton:hover {
  background: #0664af;
  box-shadow: 0 14px 28px rgba(8, 120, 209, 0.24);
  transform: translateY(-2px);
}

.login-card #loginButton:hover::after { left: 115%; }

.login-card #loginButton:active {
  box-shadow: 0 5px 12px rgba(8, 120, 209, 0.2);
  transform: translateY(0);
}

@keyframes login-shell-enter {
  from { opacity: 0; transform: translateY(18px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes login-item-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes login-form-enter {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes login-flow {
  0%, 100% { left: 0; width: 22%; opacity: 0.45; }
  50% { left: 66%; width: 34%; opacity: 1; }
}

@keyframes login-status-pulse {
  0%, 55%, 100% { box-shadow: 0 0 0 4px rgba(52, 199, 123, 0.15); }
  72% { box-shadow: 0 0 0 9px rgba(52, 199, 123, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell,
  .login-brand-mark,
  .login-brand > div,
  .login-card > *,
  .login-flow-line i,
  .login-brand-status i {
    animation: none !important;
  }

  .login-card input,
  .login-card #loginButton,
  .login-card #loginButton::after {
    transition: none !important;
  }
}

@media (min-width: 1100px) {
  .dashboard .dashboard-connection-status {
    border-color: #785520;
    border-left-color: #f6a832;
    color: #ffdca3;
    background: #2a1d0c;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
  }

  .dashboard .dashboard-connection-status strong {
    color: #fff2d7;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

.login-card .hint {
  margin: 16px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .login {
    align-items: start;
    min-height: calc(100vh - 76px);
    padding: 16px;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .login-brand {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 24px;
  }

  .login-brand-mark {
    width: 96px;
    height: 44px;
    margin: 0;
    grid-row: span 2;
  }

  .login-brand h1 {
    font-size: 24px;
  }

  .login-brand-kicker,
  .login-brand > div > p:last-child,
  .login-brand-visual,
  .login-brand-status {
    display: none;
  }

  .login-card {
    padding: 30px 24px 32px;
  }

  .login-card h2 {
    font-size: 25px;
  }
}

.monthly-performance {
  display: grid;
  min-width: 0;
  gap: 18px;
  margin-top: 14px;
}

.monthly-table-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--ui-border, #dfe1e5);
  border-radius: 7px;
}

.monthly-performance-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.monthly-performance-table th,
.monthly-performance-table td {
  min-width: 72px;
  padding: 11px 9px;
  border-right: 1px solid var(--ui-border, #dfe1e5);
  border-bottom: 1px solid var(--ui-border, #dfe1e5);
  text-align: right;
  white-space: nowrap;
}

.monthly-performance-table th:first-child,
.monthly-performance-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 92px;
  text-align: left;
}

.monthly-performance-table thead th {
  color: #ffffff;
  background: #1769e0;
  font-weight: 700;
}

.monthly-performance-table tbody th {
  background: #f3f6fa;
}

.monthly-performance-table tr:last-child th,
.monthly-performance-table tr:last-child td {
  border-bottom: 0;
}

.monthly-performance-table th:last-child,
.monthly-performance-table td:last-child {
  border-right: 0;
  font-weight: 750;
}

.monthly-share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ui-border, #dfe1e5);
  border-bottom: 1px solid var(--ui-border, #dfe1e5);
}

.monthly-chart-card {
  min-width: 0;
  padding: 18px;
}

.monthly-chart-card + .monthly-chart-card {
  border-left: 1px solid var(--ui-border, #dfe1e5);
}

.monthly-chart-card h3,
.monthly-line-card h3 {
  margin: 0;
  font-size: 15px;
}

.monthly-chart-card p,
.monthly-line-card p {
  margin: 5px 0 0;
  color: var(--ui-muted, #6e6e73);
  font-size: 12px;
}

.monthly-donut-canvas,
.monthly-line-canvas {
  display: block;
  width: 100%;
}

.monthly-donut-canvas {
  height: 230px;
}

.monthly-line-canvas {
  height: 290px;
}

.monthly-chart-legend {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px 10px;
  font-size: 11px;
}

.monthly-chart-legend span,
.monthly-line-legend span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.monthly-legend-swatch,
.monthly-line-legend i {
  width: 10px;
  min-width: 10px;
  height: 3px;
  border-radius: 1px;
}

.monthly-color-1 { background: #0878ff; }
.monthly-color-2 { background: #00a8ff; }
.monthly-color-3 { background: #22c8d6; }
.monthly-color-4 { background: #2fd19a; }
.monthly-color-5 { background: #6dd17c; }
.monthly-color-6 { background: #a6d659; }
.monthly-color-7 { background: #f0c94b; }
.monthly-color-8 { background: #ff9f43; }
.monthly-color-9 { background: #ff6b6b; }
.monthly-color-10 { background: #d66efd; }
.monthly-color-11 { background: #8d7cff; }
.monthly-color-12 { background: #5a91ff; }

.monthly-line-card {
  padding: 2px 18px 4px;
}

.monthly-line-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.monthly-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ui-muted, #6e6e73);
  font-size: 11px;
}

.monthly-line-legend .income {
  background: #0878ff;
}

.monthly-line-legend .orders {
  background: #22c8d6;
}

@media (max-width: 760px) {
  .legacy-migration-head,
  .legacy-bonus-action {
    display: grid;
  }

  .legacy-preview,
  .legacy-migration-summary,
  .legacy-migration-fields {
    grid-template-columns: 1fr;
  }

  .monthly-share-grid {
    grid-template-columns: 1fr;
  }

  .monthly-chart-card + .monthly-chart-card {
    border-top: 1px solid var(--ui-border, #dfe1e5);
    border-left: 0;
  }

  .monthly-chart-legend {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .monthly-line-head {
    display: grid;
  }
}

/* Active wash cards mirror a physical bay status plaque: bay first, then the
   two facts staff need before deciding whether an intervention is safe. */
.active-wash-row {
  align-items: stretch;
  border-left: 3px solid #1b9b68;
}

.active-wash-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.active-wash-title {
  font-size: 16px;
  line-height: 1.4;
}

.active-wash-customer,
.active-wash-started {
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.active-wash-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin: 3px 0 1px;
}

.active-wash-fact {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #dbe5e9;
  border-radius: 6px;
  background: #f5f9fa;
}

.active-wash-fact dt {
  color: #657681;
  font-size: 12px;
  font-weight: 650;
}

.active-wash-fact dd {
  min-width: 0;
  margin: 0;
  color: #1d3038;
  font-size: 15px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.active-wash-balance {
  white-space: nowrap;
}

.active-wash-mode-value {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.active-wash-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 4px;
  color: #13724c;
  background: #e5f5ed;
  font-size: 13px;
  line-height: 1.35;
}

.active-wash-mode-detail {
  color: #536872;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.active-wash-row > button.danger {
  align-self: center;
  min-width: 120px;
  min-height: 44px;
}

@media (min-width: 1100px) {
  .active-wash-row {
    border-left-color: #38d99a;
  }

  .active-wash-fact {
    border-color: #203b59;
    background: #0c1d31;
  }

  .active-wash-fact dt,
  .active-wash-mode-detail {
    color: #8fa6c1;
  }

  .active-wash-fact dd {
    color: #edf5ff;
  }

  .active-wash-mode-badge {
    color: #6ce6ad;
    background: #0d3b31;
  }
}

@media (max-width: 760px) {
  .active-wash-row > button.danger {
    width: 100%;
  }
}

/* Account security stays ahead of the long-form website content editor. */
.dashboard > #adminAccountPanel {
  order: 10;
}

.dashboard > #websiteContentPanel {
  order: 20;
}

.account-save-button {
  width: 100%;
  margin-top: 14px;
}

@media (min-width: 1100px) {
  .legacy-migration-box {
    border-top-color: #203a59;
  }

  .legacy-preview > div {
    background: #102743;
  }

  .legacy-preview strong,
  .legacy-migration-summary,
  .legacy-complete {
    color: #dbe8f8;
  }

  .legacy-warning {
    color: #ff9d94;
  }

  #trendPanel {
    grid-column: span 12;
    min-height: 0;
    order: 20;
  }

  #performancePanel,
  #settlementPanel {
    grid-column: span 6;
    min-height: 0;
  }

  #performancePanel {
    order: 30;
  }

  #settlementPanel {
    order: 31;
  }

  .monthly-table-scroll,
  .monthly-share-grid {
    border-color: #1f3a59;
  }

  .monthly-performance-table th,
  .monthly-performance-table td {
    border-color: #1d3653;
    color: #c9d8eb;
    background: #091729;
  }

  .monthly-performance-table thead th {
    color: #eaf4ff;
    background: #0c6fe6;
  }

  .monthly-performance-table tbody th {
    color: #90a7c4;
    background: #0d2036;
  }

  .monthly-share-grid,
  .monthly-chart-card + .monthly-chart-card {
    border-color: #1c3552;
  }

  .monthly-chart-card p,
  .monthly-line-card p,
  .monthly-chart-legend,
  .monthly-line-legend {
    color: #8196b1;
  }
}

/* Keep daily operations ahead of long-range reporting in the command center. */
@media (min-width: 1100px) {
  .dashboard > .stats {
    order: 10;
  }

  #performancePanel {
    order: 20;
  }

  #settlementPanel {
    order: 21;
  }

  #todayOrdersPanel,
  #recentOrdersPanel {
    order: 30;
  }

  #trendPanel {
    order: 40;
  }
}

.display-menu {
  position: relative;
  min-width: 112px;
}

.display-menu summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.display-menu summary::-webkit-details-marker {
  display: none;
}

.display-menu summary::after {
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: margin-top 140ms ease, transform 140ms ease;
}

.display-menu[open] summary::after {
  margin-top: 4px;
  transform: rotate(225deg);
}

.display-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  display: grid;
  width: 260px;
  padding: 6px;
  border: 1px solid var(--ui-border, #dfe1e5);
  border-radius: 8px;
  background: var(--ui-surface, #ffffff);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}

.display-menu-popover a {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--ui-text, #1d1d1f);
  text-decoration: none;
}

.display-menu-popover a:hover,
.display-menu-popover a:focus-visible {
  background: var(--ui-fill, #f2f2f7);
  outline: none;
}

.display-menu-popover strong {
  font-size: 14px;
}

.display-menu-popover span {
  color: var(--ui-muted, #6e6e73);
  font-size: 12px;
}

@media (min-width: 1100px) {
  .display-menu-popover {
    border-color: #294767;
    background: #0d1d31;
  }

  .display-menu-popover a {
    color: #e9f2ff;
  }

  .display-menu-popover a:hover,
  .display-menu-popover a:focus-visible {
    background: #173454;
  }

  .display-menu-popover span {
    color: #8fa4c0;
  }
}

@media (max-width: 520px) {
  .display-menu {
    width: 100%;
    min-width: 0;
  }

  .display-menu summary {
    width: 100%;
  }

  .display-menu-popover {
    right: auto;
    left: 0;
    width: min(300px, calc(100vw - 28px));
  }
}

.login-password-field {
  position: relative;
}

.login-card .login-password-field input {
  width: 100%;
  padding-right: 68px;
}

.login-card .login-password-field #toggleLoginPassword {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 7px;
  width: auto;
  min-width: 48px;
  min-height: 36px;
  margin: 0;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: #0c6f84;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  transform: translateY(-50%);
}

.login-card .login-password-field #toggleLoginPassword:hover,
.login-card .login-password-field #toggleLoginPassword:focus-visible {
  color: #064a5a;
  background: #e6f4f6;
  transform: translateY(-50%);
}

.login-caps-hint {
  min-height: 18px;
  margin: -10px 0 -4px;
  color: #a84817;
  font-size: 12px;
}

.login-status {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #d7542a;
  border-radius: 4px;
  color: #8b2f12;
  background: #fff1eb;
  font-size: 12px;
  line-height: 1.55;
}

.login-status.visible {
  display: block;
}

.login-card input[aria-invalid="true"] {
  border-color: #c94720;
  box-shadow: 0 0 0 3px rgba(201, 71, 32, 0.12);
}

.login-card #loginButton:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.user-detail.search-error {
  border-left: 3px solid #d7542a;
  color: #8b2f12;
  background: #fff1eb;
}

.user-detail.search-loading {
  border-left: 3px solid #1685a0;
  color: #315b66;
  background: #edf8fa;
}

#userKeyword[aria-invalid="true"] {
  border-color: #c94720;
  box-shadow: 0 0 0 3px rgba(201, 71, 32, 0.12);
}

.balance-edit.balance-adjustment {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 16px;
  border: 1px solid #d9e2e8;
  border-radius: 8px;
  background: #f8fafb;
}

.balance-adjustment-head,
.balance-adjustment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.balance-adjustment-head label {
  font-weight: 700;
}

.balance-adjustment-head span,
.balance-adjustment > p {
  margin: 0;
  color: #667783;
  font-size: 12px;
}

.balance-adjustment-actions input {
  min-width: 0;
  flex: 1 1 auto;
}

.balance-adjustment-actions button {
  flex: 0 0 auto;
}

.balance-status {
  min-height: 18px;
}

.operation-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: #52636d;
  font-size: 13px;
  line-height: 1.6;
}

.operation-status.error { color: #a43324; }
.operation-status.success { color: #13724c; }
.operation-status:focus { outline: 3px solid rgba(255, 138, 52, 0.45); outline-offset: 3px; }
.admin-confirm-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid #d5c6bd;
  border-radius: 14px;
  color: #21313a;
  background: #fff;
  box-shadow: 0 28px 80px rgba(8, 21, 38, 0.32);
}
.admin-confirm-dialog::backdrop { background: rgba(4, 15, 27, 0.72); backdrop-filter: blur(3px); }
.admin-confirm-dialog-head h2 { margin: 5px 0 0; }
.danger-label { color: #a43324; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.manager-label { color: #16778a; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.admin-confirm-target { padding: 12px 14px; border-left: 3px solid #c94a38; background: #fff5f1; }
.admin-confirm-dialog label { display: grid; gap: 7px; margin-top: 18px; font-weight: 700; }
.admin-confirm-dialog input { width: 100%; }
.admin-confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.account-form input[aria-invalid="true"],
.website-editor-grid input[aria-invalid="true"],
.website-editor-grid textarea[aria-invalid="true"],
#tutorialManagementPanel input[aria-invalid="true"],
#tutorialManagementPanel textarea[aria-invalid="true"] {
  border-color: #c94a38;
  box-shadow: 0 0 0 3px rgba(201, 74, 56, 0.12);
}

@media (max-width: 520px) {
  .balance-adjustment-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .admin-module-nav {
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 10px 34px;
    scroll-snap-type: inline proximity;
    scrollbar-width: none;
  }

  .admin-module-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-module-nav button {
    scroll-snap-align: start;
  }

  .admin-module-nav.has-overflow:not(.at-end)::after {
    content: "›";
    position: sticky;
    right: 0;
    display: grid;
    flex: 0 0 30px;
    height: 40px;
    place-items: center;
    color: #16778a;
    background: linear-gradient(90deg, rgba(239, 245, 246, 0), #eff5f6 55%);
    font-size: 25px;
    font-weight: 700;
    pointer-events: none;
  }
}
