@import url('sidebar-shell.css');

:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --success: 142 71% 45%;
  --radius: 0.625rem;
  --sidebar: 240 4.8% 97.5%;
  --font: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 1.1rem 1.5rem 0.4rem;
}
.page-title { margin: 0; font-size: 1.35rem; font-weight: 650; letter-spacing: -0.03em; }
.page-desc { margin: 0.25rem 0 0; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.content { padding: 0.85rem 1.5rem 2.5rem; max-width: 1120px; }

.stat { padding: 1.05rem 1.1rem; position: relative; overflow: hidden; }
.stat-label { margin: 0 0 0.3rem; font-size: 0.8rem; color: hsl(var(--muted-foreground)); }
.stat-value { margin: 0; font-size: 1.55rem; font-weight: 650; letter-spacing: -0.03em; }
.stat-hint { margin: 0.35rem 0 0; font-size: 0.72rem; color: hsl(var(--muted-foreground)); }
.stat-icon {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  display: grid;
  place-items: center;
  background: hsl(var(--sidebar-accent-soft));
  color: hsl(var(--sidebar-accent-fg));
}
.stat-icon .nav-icon { width: 1rem; height: 1rem; opacity: 1; }
.stat-icon-ok {
  background: color-mix(in oklab, hsl(var(--success)) 14%, white);
  color: #166534;
}

.dash-hero { margin-bottom: 1rem; border-color: hsl(var(--sidebar-accent) / 0.22); }
.dash-hero-body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  flex-wrap: wrap;
}
.dash-hero-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, hsl(var(--sidebar-accent)), hsl(var(--sidebar-accent-fg)));
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px hsl(var(--sidebar-accent) / 0.25);
}
.dash-hero-icon .nav-icon { width: 1.35rem; height: 1.35rem; opacity: 1; }
.dash-hero-text { flex: 1; min-width: 200px; }
.dash-hero-title { margin: 0 0 0.35rem; font-size: 1.05rem; font-weight: 650; letter-spacing: -0.02em; }
.dash-hero-desc { margin: 0 0 0.65rem; font-size: 0.84rem; color: hsl(var(--muted-foreground)); line-height: 1.45; max-width: 52ch; }
.dash-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dash-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  font-size: 0.72rem;
  font-weight: 550;
  color: hsl(var(--muted-foreground));
}
.dash-pill.ok {
  background: color-mix(in oklab, hsl(var(--success)) 12%, white);
  border-color: color-mix(in oklab, hsl(var(--success)) 28%, white);
  color: #166534;
}
.pill-icon { width: 0.85rem; height: 0.85rem; flex-shrink: 0; opacity: 0.9; }

.dash-stats { margin-bottom: 1.15rem; }
.section-head { margin-bottom: 0.75rem; }

.menu-card-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 132px;
}
.menu-card-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  background: hsl(var(--sidebar-accent-soft));
  color: hsl(var(--sidebar-accent-fg));
  margin-bottom: 0.55rem;
}
.menu-card-icon .nav-icon { width: 1rem; height: 1rem; opacity: 1; }

.dash-empty { padding: 2.25rem 1rem; }
.dash-empty-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.75rem;
  border-radius: 0.65rem;
  display: grid;
  place-items: center;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.dash-empty-icon .nav-icon { width: 1.2rem; height: 1.2rem; }
.dash-empty p { margin: 0 0 1rem; }

@media (min-width: 901px) {
  .menu-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.badge {
  display: inline-flex; align-items: center;
  border: 1px solid hsl(var(--border)); background: hsl(var(--muted));
  color: hsl(var(--muted-foreground)); border-radius: 999px;
  padding: 0.15rem 0.55rem; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-ok {
  background: color-mix(in oklab, hsl(var(--success)) 16%, white);
  border-color: color-mix(in oklab, hsl(var(--success)) 35%, white);
  color: #166534;
}

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.card-header { padding: 1rem 1.1rem 0.3rem; }
.card-title { margin: 0; font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.card-desc { margin: 0.2rem 0 0; font-size: 0.8rem; color: hsl(var(--muted-foreground)); }
.card-body { padding: 0.85rem 1.1rem 1.15rem; }

.grid { display: grid; gap: 0.85rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.menu-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.menu-card {
  display: block; border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: 1rem 1.05rem; background: hsl(var(--card)); min-height: 110px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.menu-card:hover {
  border-color: hsl(var(--foreground) / 0.22);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.menu-card-kicker {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); margin-bottom: 0.35rem;
}
.menu-card-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.25rem; }
.menu-card-desc { font-size: 0.78rem; color: hsl(var(--muted-foreground)); line-height: 1.4; }

.field { margin-bottom: 0.95rem; }
.field-label { display: block; font-size: 0.8rem; font-weight: 500; margin: 0 0 0.4rem; }
.hint { margin: 0.35rem 0 0; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.input, .select, .textarea {
  width: 100%; background: hsl(var(--background));
  border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px);
  padding: 0.55rem 0.7rem; color: hsl(var(--foreground)); outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}
.textarea { min-height: 100px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  border: 1px solid transparent; border-radius: calc(var(--radius) - 2px);
  padding: 0.55rem 0.95rem; font-size: 0.875rem; font-weight: 550; cursor: pointer;
}
.btn:hover { opacity: 0.92; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border-color: hsl(var(--border)); }
.btn-ghost { background: transparent; color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }
.btn-danger { background: hsl(var(--destructive)); color: #fff; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; }

.alert {
  border-radius: var(--radius); padding: 0.75rem 0.95rem; font-size: 0.875rem;
  margin-bottom: 1rem; border: 1px solid hsl(var(--border));
}
.alert-ok {
  background: color-mix(in oklab, hsl(var(--success)) 12%, white);
  border-color: color-mix(in oklab, hsl(var(--success)) 30%, white); color: #166534;
}
.alert-err {
  background: color-mix(in oklab, hsl(var(--destructive)) 10%, white);
  border-color: color-mix(in oklab, hsl(var(--destructive)) 28%, white); color: #991b1b;
}
.alert-info {
  background: hsl(var(--muted)); color: hsl(var(--foreground));
}

.table-wrap { overflow: auto; border: 1px solid hsl(var(--border)); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.data th, table.data td {
  text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid hsl(var(--border)); vertical-align: top;
}
table.data th {
  background: hsl(var(--muted)); font-weight: 550; color: hsl(var(--muted-foreground));
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
}
table.data tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--mono); font-size: 0.78rem; }
.muted { color: hsl(var(--muted-foreground)); }
.empty { padding: 2rem 1rem; text-align: center; color: hsl(var(--muted-foreground)); font-size: 0.9rem; }

.flow-strip { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0 0 1rem; }
.flow-strip-item {
  display: flex; align-items: center; gap: 0.4rem; flex: 0 0 auto;
  padding: 0.4rem 0.7rem; border: 1px solid hsl(var(--border)); border-radius: 999px;
  background: hsl(var(--background)); font-size: 0.75rem; color: hsl(var(--muted-foreground));
}
.flow-strip-item.current {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent;
}
.flow-strip-n {
  width: 1.2rem; height: 1.2rem; border-radius: 999px; display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 700; background: hsl(var(--muted)); color: hsl(var(--foreground));
}
.flow-strip-item.current .flow-strip-n { background: hsl(var(--primary-foreground) / 0.2); color: hsl(var(--primary-foreground)); }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: radial-gradient(800px 400px at 20% 0%, rgba(15, 23, 42, 0.06), transparent 60%), hsl(var(--background));
}
.login-card { width: min(400px, 100%); }
.qr-box {
  text-align: center; padding: 1rem; border: 1px dashed hsl(var(--border));
  border-radius: var(--radius); background: hsl(var(--muted));
}
.qr-box img { max-width: 260px; width: 100%; border-radius: 8px; background: #fff; }
.steps { margin: 0; padding-left: 1.1rem; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.steps li { margin: 0.35rem 0; }
.steps strong { color: hsl(var(--foreground)); font-weight: 550; }

.section { margin-bottom: 1.35rem; }
.section-title { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 650; letter-spacing: -0.02em; }
.section-desc { margin: 0 0 0.75rem; font-size: 0.825rem; color: hsl(var(--muted-foreground)); }

.mobile-nav {
  display: none; gap: 0.35rem; padding: 0 1rem 0.65rem; overflow-x: auto;
}
.mobile-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-width: 3.1rem;
  padding: 0.42rem 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  font-size: 0.78rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--background));
}
.mobile-nav .nav-icon {
  width: 1rem;
  height: 1rem;
  opacity: 0.85;
}
.mobile-nav .nav-label {
  font-size: 0.62rem;
  line-height: 1.1;
  font-weight: 550;
}
.mobile-nav a.on {
  background: hsl(var(--sidebar-accent-soft));
  color: hsl(var(--sidebar-accent-fg));
  border-color: hsl(var(--sidebar-accent) / 0.35);
  font-weight: 600;
}
.mobile-nav a.on .nav-icon { opacity: 1; }
.menu-toggle { display: none; padding: 0.45rem 0.55rem; }
.menu-toggle .nav-icon { width: 1.1rem; height: 1.1rem; }
.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 40; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .mobile-nav { display: flex; }
  .menu-cards, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 1rem; padding-right: 1rem; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .menu-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
