:root {
  color-scheme: light;
  --ink: #12211b;
  --muted: #66756f;
  --paper: #f7f8f4;
  --surface: #ffffff;
  --line: #e2e7e2;
  --green: #176b4b;
  --green-dark: #0e4c35;
  --lime: #c9ef6b;
  --blue: #315b86;
  --amber: #c9801d;
  --red: #b94343;
  --shadow: 0 20px 55px rgba(20, 51, 39, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); }
a { color: inherit; }
button, input { font: inherit; }
.brand { align-items: center; display: inline-flex; font-size: 1.1rem; font-weight: 750; gap: .7rem; text-decoration: none; }
.brand-mark { align-items: center; background: var(--lime); border-radius: 12px; color: var(--green-dark); display: inline-flex; font-family: Georgia, serif; font-size: 1.4rem; height: 2.5rem; justify-content: center; width: 2.5rem; }
.eyebrow { color: var(--green); font-size: .73rem; font-weight: 800; letter-spacing: .14em; margin: 0 0 .8rem; text-transform: uppercase; }

.auth-page { background: #edf2eb; }
.auth-shell { display: grid; min-height: 100vh; }
.brand-panel { background: var(--green-dark); color: #fff; display: flex; flex-direction: column; min-height: 42vh; overflow: hidden; padding: 1.5rem; position: relative; }
.brand-panel::before { background: radial-gradient(circle, rgba(201,239,107,.2) 0 2px, transparent 3px); background-size: 24px 24px; content: ""; height: 20rem; opacity: .55; position: absolute; right: -5rem; top: -4rem; transform: rotate(12deg); width: 20rem; }
.brand-panel .brand { position: relative; z-index: 1; }
.brand-copy { margin: auto 0; max-width: 42rem; position: relative; z-index: 1; }
.brand-copy .eyebrow { color: var(--lime); }
.brand-copy h1 { font-family: Georgia, serif; font-size: clamp(2.1rem, 7vw, 4.8rem); font-weight: 500; letter-spacing: -.045em; line-height: .98; margin: 0; }
.brand-copy > p:last-child { color: #c9d9d0; font-size: 1.05rem; line-height: 1.6; max-width: 34rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: .6rem; position: relative; z-index: 1; }
.trust-row span { border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #dfeae4; font-size: .73rem; font-weight: 700; letter-spacing: .08em; padding: .45rem .7rem; text-transform: uppercase; }
.login-panel { align-items: center; display: flex; flex-direction: column; justify-content: center; padding: 2rem 1.2rem; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); max-width: 29rem; padding: clamp(1.6rem, 6vw, 2.7rem); width: 100%; }
.login-card h2 { font-family: Georgia, serif; font-size: 2.4rem; font-weight: 500; margin: 0 0 1.5rem; }
.notice { background: #fff8e8; border: 1px solid #f0d99d; border-radius: 12px; color: #73521a; margin-bottom: 1rem; padding: .8rem 1rem; }
.setup-state { align-items: flex-start; background: #f2f5f1; border-radius: 14px; display: flex; gap: .85rem; margin: 0 0 1.2rem; padding: 1rem; }
.setup-state p { color: var(--muted); font-size: .9rem; line-height: 1.45; margin: .3rem 0 0; }
.status-dot { background: var(--amber); border: 4px solid #f7dfbd; border-radius: 50%; flex: 0 0 auto; height: 14px; margin-top: .25rem; width: 14px; }
.primary-button, .passkey-button { align-items: center; border: 0; border-radius: 12px; cursor: pointer; display: flex; font-weight: 750; justify-content: center; min-height: 3.2rem; padding: .8rem 1rem; text-align: center; text-decoration: none; width: 100%; }
.primary-button { background: var(--green); color: #fff; }
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { background: #9aa59f; cursor: not-allowed; }
.passkey-button { background: #eef7f1; color: var(--green-dark); margin-top: .8rem; }
.privacy-note, .support-link { color: var(--muted); font-size: .79rem; line-height: 1.5; text-align: center; }
.privacy-note { margin: 1.2rem 0 0; }
.support-link { max-width: 29rem; }

.topbar { align-items: center; background: var(--green-dark); color: #fff; display: flex; height: 4.6rem; justify-content: space-between; padding: 0 1.1rem; }
.admin-identity { align-items: center; display: flex; font-size: .86rem; gap: 1rem; }
.admin-identity form { margin: 0; }
.admin-identity button { background: transparent; border: 1px solid rgba(255,255,255,.3); border-radius: 9px; color: #fff; cursor: pointer; padding: .45rem .7rem; }
.admin-layout { min-height: calc(100vh - 4.6rem); }
.sidebar { background: #fff; border-bottom: 1px solid var(--line); display: flex; gap: .4rem; overflow-x: auto; padding: .7rem; }
.sidebar a { border-radius: 9px; color: var(--muted); flex: 0 0 auto; font-size: .82rem; font-weight: 650; padding: .65rem .8rem; text-decoration: none; }
.sidebar a.active { background: #e9f3ed; color: var(--green-dark); }
.dashboard { margin: 0 auto; max-width: 92rem; padding: 1.4rem 1rem 3rem; }
.page-heading { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 1.5rem; }
.page-heading h1 { font-family: Georgia, serif; font-size: clamp(2.1rem, 5vw, 3rem); font-weight: 500; margin: 0; }
.page-heading > div > p:last-child { color: var(--muted); margin: .4rem 0 0; }
.secure-badge { background: #e5f4e9; border: 1px solid #c4e2cc; border-radius: 999px; color: var(--green); display: none; font-size: .77rem; font-weight: 750; padding: .55rem .8rem; }
.metric-grid { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; min-width: 0; padding: 1rem; }
.metric-card p { color: var(--muted); font-size: .76rem; font-weight: 700; margin: 0; }
.metric-card strong { display: block; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; margin: .45rem 0 .35rem; overflow: hidden; text-overflow: ellipsis; }
.metric-card span { color: var(--muted); font-size: .7rem; }
.dashboard-grid { display: grid; gap: 1rem; margin-top: 1rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; min-height: 20rem; padding: 1.1rem; }
.panel-heading h2 { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; margin: 0; }
.panel-heading p { color: var(--muted); font-size: .8rem; margin: .3rem 0 1rem; }
.empty-state { align-items: center; color: var(--muted); display: flex; font-size: .9rem; justify-content: center; min-height: 13rem; }
.event-row { align-items: center; border-top: 1px solid var(--line); display: grid; gap: .7rem; grid-template-columns: auto 1fr auto; padding: .8rem 0; }
.event-row strong { font-size: .82rem; }
.event-row p, .event-row time { color: var(--muted); font-size: .7rem; margin: .15rem 0 0; }
.severity { background: var(--blue); border-radius: 50%; height: 9px; width: 9px; }
.severity.warning { background: var(--amber); }
.severity.critical { background: var(--red); }
.cost-list > div { border-top: 1px solid var(--line); display: grid; gap: .2rem; grid-template-columns: 1fr auto; padding: .85rem 0; }
.cost-list span { font-size: .86rem; font-weight: 650; }
.cost-list strong { color: var(--green-dark); font-size: .86rem; }
.cost-list small { color: var(--muted); grid-column: 1 / -1; }
.error-page { align-items: center; background: #edf2eb; display: flex; justify-content: center; min-height: 100vh; padding: 1.2rem; }
.error-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); max-width: 32rem; padding: 2rem; }
.error-card .eyebrow { margin-top: 3rem; }
.error-card h1 { font-family: Georgia, serif; font-size: 2.2rem; font-weight: 500; margin: 0; }
.error-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; margin-bottom: 1.5rem; }

@media (min-width: 800px) {
  .auth-shell { grid-template-columns: minmax(0, 1.15fr) minmax(28rem, .85fr); }
  .brand-panel { min-height: 100vh; padding: 2.2rem 3rem; }
  .login-panel { padding: 3rem; }
  .admin-layout { display: grid; grid-template-columns: 15rem 1fr; }
  .sidebar { border-bottom: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: visible; padding: 1.2rem .8rem; }
  .secure-badge { display: inline-flex; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(18rem, .6fr); }
}

@media (min-width: 1180px) {
  .dashboard { padding: 2.2rem 2.5rem 4rem; }
  .metric-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

