@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #172f3b;
  --muted: #647782;
  --faint: #edf2f2;
  --line: #dce5e4;
  --paper: #f5f8f7;
  --surface: #ffffff;
  --teal: #15766f;
  --teal-deep: #0c5853;
  --lime: #dcebb1;
  --amber: #be751b;
  --danger: #a9352b;
  --shadow: 0 18px 48px rgba(27, 55, 62, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, .button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
button:hover, .button:hover { background: var(--teal-deep); transform: translateY(-1px); }
input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd8d7;
  border-radius: 5px;
  outline: none;
}
input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21, 118, 111, .12); }
label { display: block; margin: 0 0 7px; color: #36525c; font-size: 12px; font-weight: 700; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(360px, 1fr);
  background: var(--paper);
}
.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 40px clamp(28px, 6vw, 88px);
  color: #f5fbf8;
  background: #123b43;
  background-image: linear-gradient(145deg, rgba(14, 63, 69, .98), rgba(15, 91, 82, .96));
}
.brand { display: flex; align-items: center; gap: 12px; font-family: Manrope, sans-serif; font-size: 16px; font-weight: 800; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--lime);
  color: #174940;
  font: 800 17px Manrope, sans-serif;
}
.auth-aside-copy { max-width: 440px; margin: auto 0; padding: 48px 0; }
.auth-aside-copy .eyebrow { color: #b6d6c9; }
.auth-aside-copy h1 { max-width: 450px; margin: 14px 0; font: 700 clamp(32px, 4vw, 52px)/1.08 Manrope, sans-serif; }
.auth-aside-copy p { max-width: 370px; color: #d1e4dc; font-size: 15px; }
.auth-aside-foot { color: #b4cbc6; font-size: 12px; }
.auth-main { display: grid; place-items: center; padding: 36px 22px; }
.auth-panel { width: min(100%, 430px); padding: 38px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.auth-panel h2 { margin: 0 0 6px; font: 700 25px Manrope, sans-serif; }
.auth-panel > p { margin: 0 0 27px; color: var(--muted); }
.form-row { margin: 18px 0; }
.form-actions { margin-top: 24px; }
.form-actions button { width: 100%; }
.form-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.alert { margin: 0 0 18px; padding: 11px 13px; border-radius: 5px; background: #fff0ee; color: var(--danger); font-size: 13px; }
.alert.success { background: #eaf5ee; color: #27623d; }

.dashboard-shell { min-height: 100vh; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand-dark { color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.admin-identity { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: #dcebb1; color: #275b4e; font-weight: 800; }
.logout-form { margin: 0; }
.logout-button { min-height: 36px; padding: 0 12px; background: #edf3f2; color: #33535b; font-size: 12px; }
.logout-button:hover { background: #dce9e7; }
.dashboard-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 73px); }
.sidebar { padding: 26px 16px; background: #eef4f2; border-right: 1px solid var(--line); }
.sidebar-label { margin: 0 12px 12px; color: #809196; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; margin: 4px 0; padding: 0 12px; border-radius: 5px; color: #526972; font-weight: 600; }
.nav-item.active { color: var(--teal-deep); background: #dcebe6; }
.nav-glyph { display: inline-grid; width: 22px; height: 22px; place-items: center; border-radius: 5px; background: rgba(21, 118, 111, .1); font-size: 12px; }
.sidebar-rule { height: 1px; margin: 23px 10px; background: #d9e3e1; }
.integration-list { display: grid; gap: 11px; padding: 0 12px; color: #546b73; font-size: 12px; }
.integration { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.status-dot { width: 7px; height: 7px; margin-right: 7px; display: inline-block; border-radius: 50%; background: #338756; }
.status-dot.off { background: #c78832; }
.main-content { width: min(100%, 1450px); margin: 0 auto; padding: 34px clamp(20px, 3.2vw, 48px) 56px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.eyebrow { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.page-heading h1 { margin: 5px 0 0; font: 700 29px Manrope, sans-serif; letter-spacing: 0; }
.page-heading p { margin: 5px 0 0; color: var(--muted); }
.as-of { color: var(--muted); font-size: 12px; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.metric { min-height: 126px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-value { margin-top: 13px; font: 700 27px Manrope, sans-serif; }
.metric-foot { margin-top: 4px; color: #839298; font-size: 11px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font: 700 18px Manrope, sans-serif; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.search-form { display: flex; width: min(100%, 560px); gap: 8px; }
.search-form input { min-width: 130px; flex: 1 1 230px; }
.search-form select { min-width: 135px; min-height: 44px; padding: 0 10px; border: 1px solid #cbd8d7; border-radius: 5px; background: #fff; color: var(--ink); }
.search-form button { min-height: 44px; }
.business-name:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 12px 15px; color: #62777d; background: #f4f8f7; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
td { padding: 14px 15px; border-bottom: 1px solid #edf1f0; color: #405961; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.business-name { color: var(--ink); font-weight: 700; }
.business-phone { margin-top: 3px; color: #819198; font-size: 11px; }
.amount-cell { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.usage-cell { min-width: 112px; }
.usage-track { height: 5px; margin-top: 5px; overflow: hidden; border-radius: 5px; background: #e8efed; }
.usage-fill { height: 100%; background: var(--teal); }
.empty-state { padding: 38px 20px; text-align: center; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px; color: var(--muted); font-size: 12px; }
.page-links { display: flex; gap: 8px; }
.page-link { padding: 7px 11px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.page-link.disabled { opacity: .45; pointer-events: none; }
.flash-list { margin-bottom: 16px; }
.settings-form { display: grid; gap: 18px; max-width: 930px; }
.settings-section, .detail-section { padding: 21px 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.settings-section-heading h2, .detail-section .section-heading h2 { margin: 4px 0; font: 700 18px Manrope, sans-serif; }
.settings-section-heading p, .detail-section .section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin-top: 21px; }
.settings-fields .form-row { margin: 0; }
.settings-fields small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.input-prefix { display: flex; align-items: center; border: 1px solid #cbd8d7; border-radius: 5px; background: #fff; }
.input-prefix span { padding: 0 11px; color: #60777c; font-weight: 700; }
.input-prefix input { border: 0; box-shadow: none; }
.settings-actions { display: flex; justify-content: flex-end; gap: 10px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; background: #e8efed; color: #31535b; }
.secondary-button:hover { background: #dbe7e4; }
.back-link { display: inline-block; margin-bottom: 17px; color: var(--teal-deep); font-size: 12px; font-weight: 700; }
.business-page-heading { align-items: center; }
.account-chip { padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #61777e; font-size: 11px; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.detail-section .section-heading { margin-bottom: 14px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.detail-list div { min-width: 0; padding: 12px 10px 12px 0; border-top: 1px solid #edf1f0; }
.detail-list dt { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.detail-list dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 600; }
.empty-inline { padding: 18px 0; color: var(--muted); font-size: 12px; }
.records-section { margin: 18px 0; }
.records-grid { margin-top: 18px; }

@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .topbar { padding: 0 20px; }
}
@media (max-width: 700px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { min-height: 220px; padding: 22px; }
  .auth-aside-copy { padding: 25px 0 4px; }
  .auth-aside-copy h1 { font-size: 30px; }
  .auth-aside-foot { display: none; }
  .auth-panel { padding: 26px 22px; }
  .dashboard-layout { display: block; }
  .sidebar { display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-label, .sidebar-rule, .integration-list { display: none; }
  .nav-item { flex: 0 0 auto; margin: 0; padding: 0 10px; font-size: 12px; }
  .nav-glyph { display: none; }
  .main-content { padding: 24px 15px 40px; }
  .page-heading { align-items: start; flex-direction: column; }
  .page-heading h1 { font-size: 25px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .search-form { width: 100%; }
  .settings-fields, .detail-grid { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .business-page-heading { align-items: start; }
  .metrics { gap: 9px; }
  .metric { min-height: 108px; padding: 14px; }
  .metric-value { font-size: 22px; }
  .topbar { min-height: 62px; padding: 0 14px; }
  .admin-identity { display: none; }
}
