:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172d3a;
  background: #f3f7f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
[hidden] { display: none !important; }
.shell { width: min(1100px, calc(100% - 40px)); margin: 0 auto; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #dce7e9; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #07866d; color: #fff; font-size: 23px; font-weight: 800; }
.brand strong, .brand small { display: block; letter-spacing: .08em; }
.brand strong { font-size: 14px; }
.brand small { color: #7b929a; font-size: 9px; margin-top: 3px; }
.service-label, .gateway-status { display: flex; align-items: center; gap: 9px; color: #64808a; font-size: 12px; font-weight: 650; letter-spacing: .05em; }
.pulse, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #13a982; box-shadow: 0 0 0 4px #ddf6ed; }
.intro { display: flex; justify-content: space-between; align-items: end; padding: 55px 0 32px; }
.eyebrow { margin: 0 0 8px; color: #07866d; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(32px, 5vw, 46px); letter-spacing: -.055em; }
h1 span { color: #07866d; }
.subtitle { margin-bottom: 0; color: #758c94; font-size: 14px; }
.gateway-status { padding: 10px 14px; background: #e9f7f2; border-radius: 99px; color: #087b62; letter-spacing: 0; }
.panel, .tenant-card { background: #fff; border: 1px solid #e1eaec; border-radius: 16px; box-shadow: 0 12px 32px #1c46550a; }
.login-panel { display: grid; grid-template-columns: 48px 1fr minmax(300px, 1fr); align-items: center; gap: 20px; padding: 25px; }
.panel-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #e8f7f2; color: #07866d; font-size: 24px; }
.login-panel h2, .section-heading h2 { margin-bottom: 5px; font-size: 19px; }
.login-panel p { margin-bottom: 0; color: #788d95; font-size: 12px; }
.login-panel label { display: block; margin-bottom: 7px; color: #607781; font-size: 11px; font-weight: 700; }
.input-row { display: flex; gap: 9px; }
input { min-width: 0; flex: 1; height: 42px; padding: 0 12px; border: 1px solid #dce6e8; border-radius: 9px; outline: none; }
input:focus { border-color: #07866d; box-shadow: 0 0 0 3px #07866d1c; }
.button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 700; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { background: #07866d; color: white; }
.button.primary:hover:not(:disabled) { background: #066f5a; }
.button.subtle { background: #edf3f4; color: #4b6973; }
.error-text { min-height: 15px; padding-top: 5px; color: #bf4545 !important; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 43px 0 17px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.tenant-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.tenant-card { padding: 20px; }
.tenant-header, .tenant-meta, .card-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tenant-header h3 { margin: 0; font-size: 16px; }
.tenant-meta { justify-content: flex-start; flex-wrap: wrap; margin: 18px 0; color: #758b94; font-size: 11px; }
.badge { padding: 6px 9px; border-radius: 99px; background: #f0f2f2; color: #76848a; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.badge.connected { background: #e7f7f0; color: #07866d; }
.badge.connecting { background: #fff4dd; color: #a16d0a; }
.card-actions { justify-content: flex-start; }
.queue-summary, .history { border-top: 1px solid #edf1f2; margin-top: 18px; padding-top: 14px; }
.queue-summary h4, .history h4 { margin-bottom: 10px; font-size: 11px; }
.queue-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.queue-counts span { padding: 5px 7px; border-radius: 6px; background: #f3f7f8; color: #607781; font-size: 9px; }
.history ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.history li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #70858d; font-size: 10px; }
.history-status { color: #07866d; font-weight: 800; }
.error-code { color: #b14e4e; }
.notice { margin-top: 20px; padding: 14px 16px; border-radius: 10px; background: #eaf4f5; color: #607781; font-size: 11px; line-height: 1.6; }
.dashboard-actions { display: flex; justify-content: end; margin-top: 16px; }
footer { display: flex; justify-content: space-between; margin: 42px 0 25px; color: #9aadb2; font-size: 9px; letter-spacing: .08em; }
.qr-dialog { width: min(390px, calc(100% - 28px)); padding: 25px; border: 0; border-radius: 17px; text-align: center; box-shadow: 0 20px 80px #102e3d55; }
.token-dialog { width: min(520px, calc(100% - 28px)); padding: 25px; border: 0; border-radius: 17px; box-shadow: 0 20px 80px #102e3d55; }
.token-dialog::backdrop { background: #122b35a8; }
.token-dialog h2 { font-size: 18px; }
.token-dialog p { color: #71878f; font-size: 12px; line-height: 1.6; }
.token-dialog textarea { display: block; width: 100%; margin: 14px 0 8px; padding: 11px; resize: vertical; border: 1px solid #dce6e8; border-radius: 9px; color: #145c50; font: 12px ui-monospace, monospace; overflow-wrap: anywhere; }
.token-dialog .button { margin-right: 8px; }
.token-scopes { font-size: 10px !important; }
.qr-dialog h2 { font-size: 18px; }
.qr-dialog img { width: min(260px, 100%); image-rendering: pixelated; }
.qr-dialog p { margin: 8px 0 18px; color: #748a92; font-size: 11px; }
.dialog-close { padding: 9px 16px; border: 0; border-radius: 8px; background: #edf3f4; color: #4b6973; font-weight: 700; cursor: pointer; }
@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 540px); }
  .intro { align-items: start; flex-direction: column; gap: 20px; padding: 38px 0 25px; }
  .login-panel { grid-template-columns: 44px 1fr; gap: 14px; }
  .login-panel form { grid-column: 1 / -1; }
  .service-label { font-size: 9px; }
  .tenant-list { grid-template-columns: 1fr; }
}
