:root {
  --cw-bg: #f5f7fb;
  --cw-ink: #1f2937;
  --cw-muted: #6b7280;
  --cw-line: #d9e2ec;
  --cw-accent: #0f766e;
  --cw-warm: #f59e0b;
}

body {
  background: var(--cw-bg);
  color: var(--cw-ink);
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  background: #111827;
  color: #fff;
  display: flex;
  flex-direction: column;
  width: 248px;
}

.desktop-sidebar {
  bottom: 0;
  left: 0;
  position: fixed;
  top: 0;
  z-index: 1030;
}

.sidebar-brand {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  min-height: 76px;
  padding: 16px 18px;
}

.sidebar-brand > a {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--cw-accent);
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 40px;
  font-size: 1.2rem;
  height: 40px;
  justify-content: center;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: .92rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-copy small {
  color: #9ca3af;
  font-size: .7rem;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.sidebar-section-label {
  color: #6b7280;
  font-size: .68rem;
  font-weight: 700;
  margin: 18px 10px 7px;
  text-transform: uppercase;
}

.sidebar-section-label:first-child {
  margin-top: 4px;
}

.sidebar-link {
  align-items: center;
  border-radius: 6px;
  color: #cbd5e1;
  display: flex;
  font-size: .9rem;
  gap: 12px;
  margin-bottom: 3px;
  min-height: 42px;
  padding: 9px 11px;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.sidebar-link i {
  flex: 0 0 20px;
  font-size: 1rem;
  text-align: center;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.sidebar-link.active {
  background: var(--cw-accent);
  color: #fff;
  font-weight: 600;
}

.sidebar-user {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  gap: 10px;
  min-height: 76px;
  padding: 14px 16px;
}

.sidebar-user-profile {
  align-items: center;
  color: #fff;
  display: flex;
  flex: 1;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.sidebar-user-profile:hover .sidebar-user-copy strong {
  text-decoration: underline;
}

.sidebar-avatar,
.mobile-avatar {
  align-items: center;
  background: #f59e0b;
  border-radius: 50%;
  color: #111827;
  display: inline-flex;
  flex: 0 0 36px;
  font-size: .85rem;
  font-weight: 700;
  height: 36px;
  justify-content: center;
}

.sidebar-user-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-copy strong,
.sidebar-user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy strong {
  font-size: .82rem;
}

.sidebar-user-copy span {
  color: #9ca3af;
  font-size: .72rem;
}

.sidebar-logout {
  align-items: center;
  color: #9ca3af;
  display: inline-flex;
  flex: 0 0 32px;
  font-size: 1rem;
  height: 32px;
  justify-content: center;
}

.sidebar-logout:hover {
  color: #fff;
}

.app-content {
  margin-left: 248px;
  min-height: 100vh;
}

.app-main {
  margin: 0 auto;
  max-width: 1600px;
  padding: 24px;
}

.mobile-header,
.mobile-sidebar {
  display: none;
}

.auth-shell {
  align-items: center;
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.auth-panel {
  background: #fff;
  border: 1px solid var(--cw-line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(31, 41, 55, .12);
  margin: 0 auto;
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.page-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.metric {
  background: #fff;
  border: 1px solid var(--cw-line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  min-height: 132px;
  padding: 18px;
}

.metric span {
  color: var(--cw-muted);
  display: block;
  font-size: .86rem;
}

.metric strong {
  display: block;
  font-size: 1.65rem;
  margin-top: 4px;
}

.metric-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.metric-head i {
  color: #64748b;
  font-size: 1.15rem;
}

.metric-success { border-left-color: #15803d; }
.metric-info { border-left-color: #2563eb; }
.metric-primary { border-left-color: #0f766e; }
.metric-warning { border-left-color: #d97706; }
.metric-danger { border-left-color: #be123c; }
.metric-neutral { border-left-color: #64748b; }

.metric-success .metric-head i { color: #15803d; }
.metric-info .metric-head i { color: #2563eb; }
.metric-primary .metric-head i { color: #0f766e; }
.metric-warning .metric-head i { color: #d97706; }
.metric-danger .metric-head i { color: #be123c; }

.metric-note,
.trend {
  font-size: .76rem;
  margin-top: 9px;
}

.metric-note {
  color: var(--cw-muted);
}

.trend {
  align-items: center;
  display: flex;
  font-weight: 600;
  gap: 4px;
}

.trend-up { color: #15803d; }
.trend-down { color: #be123c; }

.eyebrow {
  color: #64748b;
  font-size: .68rem;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.analytics-heading {
  margin-bottom: 24px;
}

.dashboard-toolbar {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--cw-line);
  border-radius: 8px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 18px;
  position: relative;
}

.dashboard-toolbar-title {
  flex: 0 0 auto;
}

.dashboard-filter-stack {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.segmented-control {
  background: #eef2f7;
  border: 1px solid #dbe3ec;
  border-radius: 7px;
  display: inline-flex;
  max-width: 100%;
  padding: 3px;
}

.segment-button {
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #475569;
  font-size: .75rem;
  font-weight: 600;
  min-height: 34px;
  padding: 6px 11px;
  white-space: nowrap;
}

.segment-button:hover {
  color: #111827;
}

.segment-button.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
  color: #0f766e;
}

.segment-button:focus-visible,
.mobile-menu-button:focus-visible,
.sidebar-link:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .28);
  outline-offset: 2px;
}

.dashboard-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.branch-filter {
  align-items: center;
  display: flex;
  position: relative;
}

.branch-filter > i {
  color: #0f766e;
  left: 11px;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.branch-filter .form-select {
  font-size: .8rem;
  min-width: 190px;
  padding-left: 34px;
}

.dashboard-loading {
  align-items: center;
  background: rgba(255, 255, 255, .92);
  bottom: 0;
  color: #0f766e;
  display: flex;
  font-size: .72rem;
  gap: 7px;
  left: 0;
  padding: 5px 18px;
  position: absolute;
  right: 0;
}

.dashboard-toolbar.is-loading .dashboard-filter-stack {
  opacity: .68;
}

.insight-strip {
  background: #fff;
  border: 1px solid var(--cw-line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.insight-strip > div {
  border-right: 1px solid var(--cw-line);
  padding: 13px 16px;
}

.insight-strip > div:last-child {
  border-right: 0;
}

.insight-strip span,
.insight-strip strong {
  display: block;
}

.insight-strip span {
  color: var(--cw-muted);
  font-size: .72rem;
}

.insight-strip strong {
  font-size: .95rem;
  margin-top: 2px;
}

.panel {
  background: #fff;
  border: 1px solid var(--cw-line);
  border-radius: 8px;
  padding: 18px;
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-panel {
  height: 100%;
}

.chart-frame {
  height: 260px;
  position: relative;
}

.chart-frame-wide {
  height: 300px;
}

.legend-note {
  color: var(--cw-muted);
  font-size: .72rem;
  white-space: nowrap;
}

.legend-note i {
  font-size: .5rem;
  vertical-align: middle;
}

.analytics-table thead th {
  color: #64748b;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.analytics-table tbody td {
  font-size: .84rem;
}

.table-subtext {
  color: var(--cw-muted);
  font-size: .72rem;
  margin-top: 2px;
}

.empty-state {
  align-items: center;
  color: var(--cw-muted);
  display: flex;
  flex-direction: column;
  gap: 9px;
  justify-content: center;
  min-height: 220px;
  text-align: center;
}

.empty-state i {
  font-size: 1.5rem;
}

.empty-state.compact {
  min-height: 100px;
}

.performance-list {
  display: flex;
  flex-direction: column;
}

.performance-item {
  align-items: center;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  gap: 12px;
  padding: 12px 0;
}

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

.performance-rank {
  align-items: center;
  background: #e6f4f1;
  border-radius: 50%;
  color: #0f766e;
  display: inline-flex;
  flex: 0 0 28px;
  font-size: .75rem;
  font-weight: 700;
  height: 28px;
  justify-content: center;
}

.performance-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.performance-copy strong,
.performance-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-copy strong {
  font-size: .84rem;
}

.performance-copy span {
  color: var(--cw-muted);
  font-size: .72rem;
}

.performance-item > strong {
  font-size: .82rem;
  white-space: nowrap;
}

.performance-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  min-width: 58px;
  padding: 4px 8px;
  text-align: center;
}

.performance-good {
  background: #dcfce7;
  color: #166534;
}

.performance-watch {
  background: #fef3c7;
  color: #92400e;
}

.performance-poor {
  background: #fee2e2;
  color: #991b1b;
}

.report-filter {
  background: #f8fafc;
}

.access-assignment-form {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(118px, 1fr) minmax(130px, 1fr) auto;
  min-width: 360px;
}

.branch-field-muted {
  opacity: .48;
}

.table {
  vertical-align: middle;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: .78rem;
  padding: 4px 10px;
}

.status-completed,
.status-active,
.status-paid {
  background: #dcfce7;
  color: #166534;
}

.status-pending,
.status-washing,
.status-queued {
  background: #fef3c7;
  color: #92400e;
}

.status-cancelled,
.status-inactive,
.status-disabled,
.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.receipt {
  background: #fff;
  margin: 0 auto;
  max-width: 420px;
  padding: 24px;
}

.customer-card {
  background: #fff;
  border: 2px solid #111827;
  border-radius: 8px;
  margin: 40px auto;
  max-width: 540px;
  padding: 32px;
  text-align: center;
}

.customer-card-brand {
  font-size: 1.25rem;
  font-weight: 700;
}

.customer-card-label {
  color: var(--cw-muted);
  font-size: .8rem;
  margin-top: 28px;
}

.customer-card-number {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.customer-card-note,
.customer-card-phone {
  margin-top: 18px;
}

.account-summary {
  text-align: center;
}

.account-avatar {
  align-items: center;
  background: #0f766e;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 1.8rem;
  font-weight: 700;
  height: 76px;
  justify-content: center;
  margin-bottom: 14px;
  width: 76px;
}

.account-meta {
  border-top: 1px solid var(--cw-line);
  text-align: left;
}

.account-meta > div {
  align-items: center;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  justify-content: space-between;
  min-height: 46px;
}

.account-meta > div:last-child {
  border-bottom: 0;
}

.account-meta span:first-child {
  color: var(--cw-muted);
  font-size: .78rem;
}

.account-meta strong {
  font-size: .82rem;
}

.security-confirmation {
  align-items: end;
  background: #f8fafc;
  border: 1px solid var(--cw-line);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  padding: 16px;
}

@media print {
  .app-sidebar,
  .mobile-header,
  .no-print,
  .alert {
    display: none !important;
  }

  body {
    background: #fff;
  }

  main {
    padding: 0 !important;
  }

  .app-content {
    margin-left: 0;
  }

  .receipt {
    border: 0;
    box-shadow: none;
    max-width: none;
  }
}

@media (max-width: 991.98px) {
  .desktop-sidebar {
    display: none;
  }

  .mobile-sidebar {
    display: flex;
  }

  .mobile-sidebar .sidebar-brand {
    justify-content: space-between;
  }

  .app-content {
    margin-left: 0;
  }

  .mobile-header {
    align-items: center;
    background: #111827;
    color: #fff;
    display: flex;
    height: 60px;
    justify-content: space-between;
    padding: 0 14px;
    position: sticky;
    top: 0;
    z-index: 1020;
  }

  .mobile-menu-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #fff;
    display: inline-flex;
    font-size: 1.5rem;
    height: 40px;
    justify-content: center;
    width: 40px;
  }

  .mobile-brand {
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-avatar {
    flex-basis: 32px;
    height: 32px;
  }

  .app-main {
    padding: 16px;
  }

  .insight-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insight-strip > div:nth-child(2) {
    border-right: 0;
  }

  .insight-strip > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--cw-line);
  }

  .dashboard-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-filter-stack {
    align-items: stretch;
  }

  .segmented-control {
    overflow-x: auto;
    width: 100%;
  }

  .segment-button {
    flex: 1 0 auto;
  }

  .dashboard-actions {
    justify-content: space-between;
  }
}

@media (max-width: 575.98px) {
  .app-main {
    padding: 12px;
  }

  .page-title {
    align-items: stretch;
  }

  .page-title > .d-flex {
    width: 100%;
  }

  .page-title .btn {
    flex: 1;
  }

  .metric {
    min-height: 122px;
    padding: 14px;
  }

  .metric strong {
    font-size: 1.35rem;
  }

  .insight-strip {
    grid-template-columns: 1fr;
  }

  .insight-strip > div,
  .insight-strip > div:nth-child(2) {
    border-bottom: 1px solid var(--cw-line);
    border-right: 0;
  }

  .insight-strip > div:last-child {
    border-bottom: 0;
  }

  .chart-frame,
  .chart-frame-wide {
    height: 250px;
  }

  .legend-note {
    display: none;
  }

  .dashboard-toolbar {
    padding: 14px;
  }

  .dashboard-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .branch-filter .form-select {
    width: 100%;
  }

  .security-confirmation {
    grid-template-columns: 1fr;
  }
}
