:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #0f172a;
  background: #f8fafc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --teal: #2563eb;
  --teal-dark: #1d4ed8;
  --shadow: 0 8px 28px rgba(15, 23, 42, .045);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.035em; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
.eyebrow { margin: 0 0 7px; color: #87969d; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--teal); color: #fff; font-size: 25px; font-weight: 800; box-shadow: 0 7px 16px #2563eb30; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 20px; }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 5%, #e7efff, transparent 30%), #f8fafc; }
.login-card { width: min(100%, 430px); padding: 42px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 24px 80px #14414a1a; }
.login-card > .eyebrow { margin-top: 27px; color: var(--teal); }
.login-card h1 { margin-bottom: 9px; font-size: 30px; }
.stack { display: grid; gap: 16px; margin-top: 27px; }
label { display: grid; gap: 7px; color: #556870; font-size: 12px; font-weight: 600; }
input, select { width: 100%; padding: 11px 12px; border: 1px solid #dfe7e9; border-radius: 9px; outline: none; background: #fff; color: var(--ink); }
input:focus, select:focus { border-color: #42aaa2; box-shadow: 0 0 0 3px #087f7818; }
.password-control { position: relative; }
.password-control input { padding-right: 78px; }
.password-toggle { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); padding: 5px; border: 0; background: transparent; color: var(--teal); font-size: 11px; font-weight: 700; }
.text-button { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--teal); font-size: 12px; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
.button { padding: 10px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 700; transition: .15s; }
.button:disabled { opacity: .6; cursor: wait; }
.button.primary { background: var(--teal); color: #fff; }
.button.primary:hover { background: var(--teal-dark); }
.action-primary { min-height: 42px; padding-inline: 17px; border-radius: 11px; box-shadow: 0 4px 10px #2563eb20; }
.button.secondary { border-color: #cbd8eb; background: #fff; color: #1d4ed8; }
.button.secondary:hover { border-color: #93b4ef; background: #eff4ff; }
.login-foot { margin: 25px 0 0; padding-top: 17px; border-top: 1px solid var(--line); color: #8a999f; font-size: 11px; }
.error { min-height: 18px; margin: 7px 0 0; color: #bd3b3b; font-size: 12px; }
.success-message { min-height: 18px; margin: 7px 0 0; color: #177e74; font-size: 12px; }
.hint { color: #8a989e; font-size: 10px; line-height: 1.45; }
.app-shell { display: grid; min-height: 100vh; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 25px 16px 16px; border-right: 1px solid var(--line); background: #fff; color: var(--ink); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 800; letter-spacing: .09em; }
.brand small { display: block; margin-top: 2px; color: var(--teal); font-size: 9px; font-weight: 600; letter-spacing: .2em; }
.side-label { margin: 48px 10px 12px; color: #94a3b8; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.sidebar nav { display: grid; gap: 5px; }
.nav-link { padding: 11px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 12px; }
.nav-link:hover, .nav-link.active { background: #eff4ff; color: var(--teal); }
.side-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.logout-link { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 11px; }
.main-area { min-width: 0; }
.topbar { display: flex; height: 86px; align-items: center; justify-content: space-between; padding: 17px 36px; border-bottom: 1px solid var(--line); background: #fff; }
.topbar .eyebrow { margin-bottom: 4px; }
.topbar h1 { margin: 0; font-size: 18px; }
.user-pill { display: flex; align-items: center; gap: 9px; color: #65767d; font-size: 11px; }
.avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: #daf2ee; color: var(--teal); font-weight: 800; }
.content { width: min(1480px, 100%); margin: auto; padding: 28px 36px 30px; }
.notice { margin-bottom: 23px; padding: 13px 16px; border: 1px solid #f5d99f; border-radius: 12px; background: #fff9ec; color: #985a13; font-size: 12px; line-height: 1.5; }
.section-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head { margin-bottom: 17px; }
.section-head .eyebrow, .panel-head .eyebrow { margin-bottom: 5px; }
.section-head h2, .panel-head h2 { margin-bottom: 0; font-size: 20px; }
.org-picker { display: flex; align-items: center; gap: 10px; }
.org-picker select { min-width: 190px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 21px; }
.stat-card { display: flex; min-height: 116px; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.stat-icon { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border-radius: 12px; }
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.teal { background: #e0f5f1; color: var(--teal); }
.stat-icon.blue { background: #e8f0ff; color: #4779cb; }
.stat-icon.amber { background: #fff2d9; color: #bd8223; }
.stat-icon.green { background: #e8f7ee; color: #15803d; }
.stat-card p { margin: 2px 0 12px; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; font-size: 25px; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; }
.panel { margin-top: 19px; padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.panel-head { margin-bottom: 17px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); align-items: start; gap: 16px; }
.store-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.store-actions { display: flex; align-items: center; gap: 8px; }
.small-action { font-size: 11px; white-space: nowrap; }
.store-title { display: flex; justify-content: space-between; gap: 12px; }
.store-title h3 { margin: 0 0 4px; font-size: 14px; }
.store-code { color: var(--muted); font-size: 10px; }
.tag { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 20px; background: #eaf7f4; color: #177e74; font-size: 9px; font-weight: 700; }
.store-meta { display: flex; gap: 7px; margin: 12px 0; color: #7c8c92; font-size: 10px; }
.register-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid #eef2f3; color: #60727a; font-size: 10px; font-weight: 700; }
.register-head .button { min-height: 38px; padding: 8px 13px; border-radius: 10px; }
.register-list { display: grid; gap: 6px; }
.register-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; background: #f7f8fa; font-size: 11px; }
.register-identity { flex: 1; color: var(--ink); }
.register-detail { color: #8b9a9e; font-size: 10px; }
.loading, .empty { padding: 22px; color: var(--muted); font-size: 12px; text-align: center; }
.user-list { display: grid; }
.user-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto; align-items: center; gap: 15px; padding: 12px 3px; border-bottom: 1px solid #eff3f4; font-size: 11px; }
.user-row:last-child { border-bottom: 0; }
.user-name { font-weight: 700; }
.user-email { color: #72838a; }
.role-tag { padding: 4px 8px; border-radius: 12px; background: #eef2f4; color: #5c6c73; font-size: 9px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-card { position: relative; width: min(100%, 450px); max-height: 90vh; overflow: auto; padding: 26px; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 25px 90px #10283238; }
.dialog-card h2 { margin-bottom: 18px; }
.dialog-card > label, .form-row { margin-bottom: 12px; }
.dialog-x { position: absolute; top: 13px; right: 15px; border: 0; background: none; color: #8a989e; font-size: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(400px, calc(100vw - 44px)); padding: 12px 16px; border-radius: 10px; background: #173640; color: #fff; font-size: 12px; box-shadow: 0 10px 30px #10283235; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.bad { background: #a93232; }
footer { display: flex; justify-content: space-between; margin: 25px 0 0; color: #95a2a7; font-size: 10px; }
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 72px 1fr; }
  .sidebar { padding: 18px 10px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span:last-child, .side-label, .sidebar nav .nav-link:not(.active) { display: none; }
  .sidebar nav { margin-top: 38px; }
  .nav-link { text-align: center; }
  .nav-link.active::after { content: "Vue"; }
  .side-bottom { flex-wrap: wrap; justify-content: center; font-size: 0; }
  .logout-link { width: 100%; font-size: 10px; }
  .topbar { padding: 15px 22px; }
  .content { padding: 23px 22px; }
}
@media (max-width: 620px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 30; inset: auto 0 0; display: flex; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 0 8px env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--line); border-right: 0; }
  .brand, .side-label, .side-bottom { display: none; }
  .sidebar nav { display: grid; width: 100%; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 0; }
  .sidebar nav .nav-link:not(.active) { display: block; }
  .nav-link, .nav-link.active { padding: 12px 4px 10px; border-radius: 0; text-align: center; font-size: 10px; }
  .nav-link.active::after { content: none; }
  .topbar { height: auto; gap: 12px; padding: 15px; }
  .topbar h1 { font-size: 16px; }
  .user-pill { max-width: 150px; overflow: hidden; }
  .content { padding: 17px 14px 100px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .org-picker { display: grid; width: 100%; grid-template-columns: 1fr; }
  .org-picker select { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-card { padding: 13px; }
  .panel { padding: 15px; }
  .panel-head { gap: 10px; }
  .panel-head h2 { font-size: 18px; }
  .panel-head { align-items: flex-start; }
  .user-row { grid-template-columns: 1fr auto; gap: 5px; }
  .user-email { grid-column: 1; }
  .role-tag { grid-column: 2; grid-row: 1; }
  .dialog-card { padding: 23px 17px; }
  footer { flex-direction: column; gap: 10px; }
  .register-detail { max-width: 95px; text-align: right; }
}
