:root {
  --bg: #f8f8f8;
  --card: #fff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #dbeafe;
  --text: #1a1a1a;
  --muted: #525252;
  --border: #e0e0e0;
  --ok: #16a34a;
  --warn: #ca8a04;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { scrollbar-width: thin; scrollbar-color: #cbd5e1 #f5f7fb; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track { background: #f5f7fb; }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
  border: 2px solid #f5f7fb;
}
html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: .04em; }
.brand img { height: 36px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.thumb { height: 160px; background: linear-gradient(135deg, #dbeafe, #eff6ff); }
.card-body { padding: 1.1rem 1.15rem 1.25rem; }
.nav a.muted { color: var(--muted); font-weight: 600; font-size: .92rem; }
.nav a.muted:hover { color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.15rem; border-radius: 10px; font-weight: 700; border: 0; cursor: pointer;
  font-family: inherit; font-size: .95rem;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; border: 1px solid var(--border); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.row-actions form { margin: 0; }
.key-edit {
  display: flex; gap: .45rem; align-items: center; margin: 0;
}
.key-edit input {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .82rem;
  margin: 0;
  min-width: 220px;
}
.link-danger {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 700;
  color: #dc2626; cursor: pointer; text-decoration: underline;
}
.link-danger:hover { color: #991b1b; }
.grid { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.05);
}
.card img, .thumb { width: 100%; height: 160px; object-fit: cover; background: #eef2ff; }
.card-body { padding: 1.1rem 1.15rem 1.25rem; }
.price { font-size: 1.25rem; font-weight: 800; color: var(--accent); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef9c3; color: #854d0e; }
.badge.no { background: #fee2e2; color: #991b1b; }
.hero-mini { padding: 2.4rem 0 1.4rem; }
.hero-mini h1 { margin: 0 0 .4rem; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.muted { color: var(--muted); }
form label { display: block; font-weight: 600; font-size: .88rem; margin: .7rem 0 .3rem; }
input, textarea, select {
  width: 100%; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 1rem; background: #fff;
}
textarea { min-height: 110px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .7rem .55rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.flash { background: #dcfce7; color: #166534; padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.flash.no { background: #fee2e2; color: #991b1b; }
.layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: #eef2f7;
  transition: grid-template-columns .22s ease;
}
.side {
  margin: 0;
  height: 100vh;
  background: #fff;
  color: #0f172a;
  padding: 1.1rem .9rem 1rem;
  display: flex;
  flex-direction: column;
  border: 0;
  border-right: 1px solid #e6ebf2;
  border-radius: 0;
  box-shadow: none;
  position: sticky;
  top: 0;
  overflow: hidden;
}
.side-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .4rem;
  margin-bottom: .35rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid #eef2f7;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .15rem .35rem;
  color: #0f172a;
  min-width: 0;
}
.side-brand img {
  width: 38px; height: 38px; object-fit: contain;
  background: #f4f7fb; border-radius: 8px; padding: 4px;
  box-shadow: inset 0 0 0 1px #e8edf4;
}
.side-brand strong {
  display: block; letter-spacing: .12em; font-size: .9rem; font-weight: 800;
}
.side-brand small {
  display: block; color: #64748b; font-size: .72rem; letter-spacing: .02em; font-weight: 600;
}
.side-toggle {
  width: 32px; height: 32px; flex-shrink: 0;
  border: 0; background: #f4f7fb; color: #475569;
  border-radius: 8px; cursor: pointer;
  display: grid; place-items: center;
}
.side-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.side-toggle:hover { background: #e8eef8; color: #1d4ed8; }
.side-nav {
  flex: 1;
  padding: .2rem 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.side-nav::-webkit-scrollbar { width: 0; height: 0; }
.side-label {
  margin: .9rem .55rem .35rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #94a3b8;
}
.side-nav a, .side-logout {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #475569;
  padding: .38rem .45rem;
  margin: .14rem 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  border: 0;
  background: transparent;
  transition: background .15s ease, color .15s ease;
}
.side-ico {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #f4f7fb;
  color: #64748b;
}
.side-nav a svg, .side-logout svg { width: 17px; height: 17px; fill: currentColor; }
.side-nav a:hover, .side-logout:hover {
  background: #f6f8fc;
  color: #0f172a;
}
.side-nav a:hover .side-ico, .side-logout:hover .side-ico { background: #e8eef8; color: #1d4ed8; }
.side-nav a.on {
  background: #eef4ff;
  color: #1d4ed8;
}
.side-nav a.on .side-ico {
  background: #2563eb;
  color: #fff;
  box-shadow: none;
}
.side-foot {
  margin-top: auto;
  padding: .85rem .2rem 0;
  border-top: 1px solid #eef2f7;
}
.side-nav-foot {
  flex: none;
  padding: 0 0 .35rem;
  overflow: visible;
  margin: 0;
}
.side-user {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .35rem .7rem;
}
.side-avatar {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: .9rem; flex-shrink: 0;
}
.side-user b { display: block; font-size: .85rem; color: #0f172a; font-weight: 700; }
.side-user small { display: block; color: #64748b; font-size: .72rem; }
.side-logout {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  color: #64748b;
}
.side-logout:hover { color: #b91c1c; }
.side-logout:hover .side-ico { background: #fef2f2; color: #b91c1c; }
.main { padding: 1.55rem 1.8rem 2.6rem; background: transparent; min-width: 0; }
.main-head { margin-bottom: 1.15rem; }
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .85rem 0 0;
}
.page-tabs a {
  padding: .36rem .8rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  color: #64748b;
  background: #f4f7fb;
}
.page-tabs a:hover { background: #e8eef8; color: #1d4ed8; }
.page-tabs a.on {
  background: #2563eb;
  color: #fff;
}
.main-kicker {
  margin: 0 0 .2rem;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #94a3b8;
}
.main-head h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.03em; color: #0f172a; }
body.side-mini .layout { grid-template-columns: 96px 1fr; }
body.side-mini .side { padding: .85rem .55rem; }
body.side-mini .side-text,
body.side-mini .side-label { display: none; }
body.side-mini .side-brand { justify-content: center; padding: .15rem 0; }
body.side-mini .side-top { justify-content: center; flex-direction: column; align-items: center; gap: .55rem; }
body.side-mini .side-toggle svg { transform: rotate(180deg); }
body.side-mini .side-nav a,
body.side-mini .side-logout { justify-content: center; padding: .35rem; }
body.side-mini .side-user { justify-content: center; padding: .5rem 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin: 0 0 1.4rem; }
.stat {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  padding: 1rem 1.05rem 1.05rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.stat .muted {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: .35rem;
}
.stat b { display: block; font-size: 1.35rem; letter-spacing: -.03em; color: #0f172a; }
.kpi-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.55rem;
}
.kpi {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 18px;
  padding: 1.05rem 1.1rem 1.1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .045);
  min-width: 0;
}
a.kpi {
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.kpi:hover {
  transform: translateY(-2px);
  border-color: #dbe7f5;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .08);
}
.kpi-featured {
  padding: 1.25rem 1.3rem 1.3rem;
  background:
    radial-gradient(1200px 180px at 100% -20%, rgba(37, 99, 235, .14), transparent 55%),
    linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.kpi-slate {
  background:
    radial-gradient(1200px 180px at 100% -20%, rgba(15, 23, 42, .1), transparent 55%),
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.kpi-amber {
  background:
    radial-gradient(1200px 180px at 100% -20%, rgba(245, 158, 11, .18), transparent 55%),
    linear-gradient(180deg, #fff 0%, #fffbeb 100%);
}
.kpi-ico {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
}
.kpi-featured .kpi-ico {
  width: 48px; height: 48px;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .28);
}
.kpi-slate .kpi-ico {
  background: #0f172a;
  box-shadow: 0 10px 20px rgba(15, 23, 42, .22);
}
.kpi-amber .kpi-ico {
  background: #d97706;
  box-shadow: 0 10px 20px rgba(217, 119, 6, .28);
}
.kpi-ico svg { width: 20px; height: 20px; fill: currentColor; }
.kpi-ico-blue { background: #eff6ff; color: #1d4ed8; }
.kpi-ico-amber { background: #fffbeb; color: #b45309; }
.kpi-ico-violet { background: #f5f3ff; color: #6d28d9; }
.kpi-ico-cyan { background: #ecfeff; color: #0e7490; }
.kpi-ico-green { background: #ecfdf5; color: #047857; }
.kpi-body { min-width: 0; }
.kpi-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: .2rem;
}
.kpi-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: #0f172a;
  line-height: 1.15;
}
.kpi-featured .kpi-value { font-size: clamp(1.7rem, 2.4vw, 2.05rem); }
.kpi-int { font-variant-numeric: tabular-nums; }
.kpi-alert { color: #b91c1c; }
.kpi-hint {
  display: block;
  margin-top: .4rem;
  color: #64748b;
  font-size: .82rem;
  font-weight: 500;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}
.kpi-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-block { margin: 0 0 1.55rem; }
.dash-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .8rem;
  margin: 0 0 .7rem;
}
.dash-head h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: #0f172a;
}
.dash-link {
  font-size: .82rem;
  font-weight: 700;
  color: #2563eb;
}
.dash-link:hover { text-decoration: underline; }
.kpi-foot {
  margin: .75rem 0 0;
  color: #64748b;
  font-size: .82rem;
  max-width: 52rem;
}
.panel {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .045);
}
.table-soft { margin: 0; background: transparent; }
.table-soft th {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom-color: #eef2f7;
}
.table-soft tr:last-child td { border-bottom: 0; }
.table-soft tr:not(:first-child):hover td { background: #f8fbff; }
.mono-cell { font-weight: 800; letter-spacing: .01em; }
.amount-cell { font-weight: 800; color: #0f172a; white-space: nowrap; }
.panel-empty { margin: 0; padding: 1.3rem 1.1rem; color: #64748b; }
@media (max-width: 1100px) {
  .kpi-hero { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .kpi-grid, .kpi-grid-2 { grid-template-columns: 1fr; }
}
.table { width: 100%; border-collapse: collapse; font-size: .92rem; background: #fff; }
.table th, .table td { text-align: left; padding: .7rem .55rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.keybox { background: #0b1220; color: #fff; font-family: ui-monospace, Consolas, monospace; padding: 1rem; border-radius: 10px; word-break: break-all; }
.setup-card {
  margin: 1.3rem 0 1rem;
  padding: 1.05rem 1.1rem 1.1rem;
  background: #f8fafc;
  border: 1px solid #e6ebf2;
  border-radius: 16px;
}
.setup-card h2 { margin: 0 0 .75rem; font-size: 1.05rem; }
.setup-card ol { margin: .2rem 0 .8rem; padding-left: 1.2rem; }
.setup-card li { margin: .35rem 0; line-height: 1.45; }
.guide-block {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid #eef2f7;
}
.guide-block h2 { margin: 0 0 .35rem; font-size: 1.02rem; }
.error-box { max-width: 560px; margin: 4rem auto; background: #fff; padding: 2rem; border-radius: 14px; border: 1px solid var(--border); }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef9c3; color: #854d0e; }
.badge.no { background: #fee2e2; color: #991b1b; }
.week-scroll, .cal-scroll { overflow-x: auto; margin: .4rem 0 1rem; }
.week-grid { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 820px; }
.week-grid th, .week-grid td { text-align: center; font-size: .78rem; padding: 0; }
.week-grid th:first-child, .week-grid td:nth-child(1) { text-align: left; font-weight: 700; padding: .3rem .4rem; white-space: nowrap; }
.slot-toggle { display: block; cursor: pointer; margin: 0; }
.slot-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.slot-toggle span {
  display: block; padding: .45rem .2rem; border-radius: 8px;
  background: #f1f5f9; color: #64748b; font-weight: 700; font-size: .72rem;
}
.slot-toggle input:checked + span { background: #2563eb; color: #fff; }
.slot-toggle:hover span { outline: 2px solid #bfdbfe; }
.btn-mini {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: .35rem .5rem; font-size: .72rem; font-weight: 700; cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.cal-grid {
  display: grid;
  grid-template-columns: 64px repeat(var(--days, 7), minmax(132px, 1fr));
  gap: 6px;
  min-width: 980px;
}
.cal-corner { }
.cal-hour {
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: .4rem; font-size: .75rem; font-weight: 700; color: var(--muted);
}
.cal-dayhead {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: .55rem .65rem; text-align: left;
}
.cal-dayhead strong { display: block; font-size: .88rem; }
.cal-dayhead span { color: var(--muted); font-size: .78rem; }
.cal-dayhead em { display: block; font-style: normal; color: #b91c1c; font-size: .72rem; font-weight: 700; }
.cal-dayhead.today { border-color: #2563eb; background: #eff6ff; }
.cal-dayhead.closed { background: #f8fafc; opacity: .75; }
.cal-cell {
  min-height: 76px; border-radius: 10px; padding: .45rem .5rem; font-size: .75rem;
  border: 1px solid var(--border);
}
.cal-cell.free { background: #ecfdf5; color: #166534; font-weight: 700; display: flex; align-items: center; }
.cal-cell.off { background: #f1f5f9; border-style: dashed; }
.cal-cell.booked { background: #dbeafe; border-color: #93c5fd; }
.cal-cell.booked.mine { background: #2563eb; color: #fff; border-color: #1d4ed8; }
.cal-cell.booked.mine .muted { color: #dbeafe; }
.cal-cell.booked strong, .cal-cell.booked span { display: block; line-height: 1.25; }
.cal-cell.booked form { margin-top: .35rem; }
.cal-cell.booked select { font-size: .72rem; padding: .25rem; }
.overdue-box {
  background: #fff7ed; border: 1px solid #fdba74; border-radius: 16px;
  padding: 1rem 1.1rem 1.05rem; margin: 0 0 1.15rem;
}
.overdue-head { margin-bottom: .75rem; }
.overdue-head strong { display: block; font-size: .95rem; color: #9a3412; }
.overdue-head span { display: block; margin-top: .2rem; color: #9a3412; font-size: .85rem; }
.overdue-list { display: grid; gap: .55rem; }
.overdue-card {
  display: flex; gap: .8rem; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid #fed7aa; border-radius: 12px; padding: .7rem .85rem;
}
.overdue-card strong, .overdue-card span { display: block; line-height: 1.3; }
.overdue-card form { margin: 0; flex-shrink: 0; }
.link-quiet {
  background: none; border: 0; padding: 0; color: #2563eb; font: inherit; cursor: pointer;
  font-weight: 700;
}
.link-quiet:hover { text-decoration: underline; }
.table-scroll { overflow-x: auto; }
.btn-sm { padding: .38rem .7rem; font-size: .8rem; white-space: nowrap; }
.link-tools { min-width: 220px; }
.link-input {
  font-size: .78rem; padding: .55rem .7rem; margin: 0;
  font-family: ui-monospace, Consolas, monospace;
  background: #f8fafc;
  color: #334155;
}
.page-lead {
  margin: -.35rem 0 1.15rem;
  color: var(--muted);
  max-width: 52rem;
}
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .85rem 1.2rem;
  margin: -.2rem 0 1.25rem;
}
.count-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.count-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #fff; border: 1px solid #e8edf5;
  border-radius: 999px; padding: .35rem .7rem;
  font-size: .78rem; font-weight: 600; color: #64748b;
}
.count-pill b { color: #0f172a; font-size: .9rem; }
.count-pill.count-warn b { color: #b45309; }
.count-pill.count-no b { color: #b91c1c; }
.empty-card {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 2.2rem 1.4rem;
  text-align: center;
  color: var(--muted);
}
.ticket-list { display: grid; gap: 1rem; }
.ticket {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .82fr);
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .05);
  position: relative;
}
.ticket::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: #cbd5e1;
}
.ticket-paid::before { background: linear-gradient(180deg, #34d399, #059669); }
.ticket-pending::before { background: linear-gradient(180deg, #fbbf24, #d97706); }
.ticket-failed::before { background: linear-gradient(180deg, #f87171, #dc2626); }
.ticket-failed { background: #fcfcfd; }
.ticket-main { padding: 1.2rem 1.3rem 1.25rem 1.4rem; min-width: 0; }
.ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.ticket-idrow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .7rem; }
.ticket-code {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .02em;
  background: #f1f5f9;
  color: #334155;
  border-radius: 8px;
  padding: .22rem .5rem;
}
.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .68rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; border-radius: 999px; padding: .2rem .55rem;
}
.pill-ok { background: #ecfdf5; color: #047857; }
.pill-warn { background: #fffbeb; color: #b45309; }
.pill-no { background: #fef2f2; color: #b91c1c; }
.ticket-person { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.ticket-av {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #fff; font-weight: 800; display: grid; place-items: center;
}
.ticket-failed .ticket-av { background: linear-gradient(180deg, #94a3b8, #64748b); }
.ticket-name {
  display: block; font-weight: 800; font-size: 1.05rem;
  text-transform: capitalize; color: #0f172a; line-height: 1.2;
}
a.ticket-name:hover { color: var(--accent); }
.ticket-mail { display: block; color: #64748b; font-size: .82rem; word-break: break-all; }
.ticket-sum { text-align: right; flex-shrink: 0; }
.ticket-sum span {
  display: block; font-size: .68rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: #94a3b8;
}
.ticket-sum strong {
  display: block; font-size: 1.55rem; font-weight: 800;
  letter-spacing: -.04em; color: #0f172a; line-height: 1.15;
}
.ticket-paid .ticket-sum strong { color: #047857; }
.ticket-failed .ticket-sum strong { color: #94a3b8; text-decoration: line-through; }
.ticket-sum em { display: block; font-style: normal; color: #64748b; font-size: .78rem; margin-top: .15rem; }
.ticket-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
}
.ticket-facts > div { padding: .75rem .9rem; border-right: 1px solid #eef2f7; }
.ticket-facts > div:last-child { border-right: 0; }
.ticket-facts dt {
  font-size: .65rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #94a3b8; margin-bottom: .2rem;
}
.ticket-facts dd { margin: 0; font-weight: 700; color: #0f172a; font-size: .92rem; }
.ticket-key {
  margin-top: .85rem;
  display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
  background: #0f172a; color: #e2e8f0;
  border-radius: 12px; padding: .7rem .85rem;
}
.ticket-key span {
  font-size: .65rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: #94a3b8;
}
.ticket-key code {
  flex: 1; min-width: 120px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: .85rem; word-break: break-all; color: #fff;
}
.ticket-key .btn-mini { background: #1e293b; color: #fff; border-color: #334155; }
.ticket-note {
  margin-top: .85rem; padding: .85rem .95rem;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px;
}
.ticket-note p { margin: 0 0 .65rem; font-size: .85rem; color: #854d0e; }
.ticket-side {
  padding: 1.15rem 1.15rem 1.2rem;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
  border-left: 1px solid #eef2f7;
  display: flex; flex-direction: column; gap: .55rem;
}
.ticket-sidehead {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.ticket-sidehead strong { font-size: .82rem; color: #0f172a; }
.ticket-exp { margin: 0; font-size: .78rem; color: #64748b; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .15rem; }
.ticket-actions form { margin: 0; }
.order-list { display: grid; gap: 1rem; }
.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .95fr);
  gap: 1.15rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem 1.2rem 1.2rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.order-card:hover { border-color: #bfdbfe; }
.order-top { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .35rem; }
.order-code {
  font-weight: 800;
  letter-spacing: .02em;
  font-size: .95rem;
}
.order-name {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: capitalize;
  color: #0f172a;
}
a.order-name:hover { color: var(--accent); }
.order-mail { margin: .1rem 0 .9rem; color: var(--muted); font-size: .88rem; word-break: break-all; }
.order-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem 1rem;
  margin: 0;
}
.order-meta dt {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: .15rem;
}
.order-meta dd { margin: 0; font-weight: 600; }
.order-total { color: var(--accent); font-weight: 800; }
.order-key {
  display: block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: .78rem;
  word-break: break-all;
  margin-bottom: .35rem;
}
.order-linkbox {
  background: linear-gradient(180deg, #f8fbff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.order-linkhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.order-linkhead strong { font-size: .88rem; }
.order-exp { margin: 0; font-size: .78rem; }
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.order-actions form { margin: 0; }
.btn-danger-ghost {
  background: #fff;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.btn-danger-ghost:hover { background: #fef2f2; }
@media (max-width: 980px) {
  .order-card, .ticket { grid-template-columns: 1fr; }
  .order-meta { grid-template-columns: 1fr 1fr; }
  .ticket-facts { grid-template-columns: 1fr; }
  .ticket-facts > div { border-right: 0; border-bottom: 1px solid #eef2f7; }
  .ticket-facts > div:last-child { border-bottom: 0; }
  .ticket-side { border-left: 0; border-top: 1px solid #eef2f7; }
  .ticket-sum { text-align: left; }
}
@media (max-width: 860px) {
  .layout, body.side-mini .layout { grid-template-columns: 1fr; }
  .side, body.side-mini .side {
    position: relative; height: auto;
    margin: 0;
    border-right: 0;
    border-bottom: 1px solid #e6ebf2;
    flex-direction: column;
  }
  .side-toggle { display: none; }
  body.side-mini .side-text,
  body.side-mini .side-label { display: block; }
  body.side-mini .side-nav a,
  body.side-mini .side-logout { justify-content: flex-start; }
  .side-nav { display: flex; flex-wrap: wrap; gap: .2rem; }
  .side-nav a { flex: 1 1 auto; }
  .side-label { width: 100%; margin: .5rem .4rem .15rem; }
  .side-foot {
    border-top: 0;
    padding-top: .5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .8rem;
  }
  .side-nav-foot {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
    padding-bottom: 0;
  }
  .side-nav-foot a { flex: 1 1 auto; }
  .side-foot form { margin-left: auto; }
  .side-logout { width: auto; }
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  margin: 0 0 1.15rem;
}
.toolbar-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  flex: 1;
  min-width: 0;
}
.filters input, .filters select { width: auto; min-width: 160px; margin: 0; flex: 1; }
.split-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
  align-items: start;
}
.pad-card { padding: 1.15rem 1.2rem 1.25rem; }
.card-title { margin: 0 0 .7rem; font-size: 1.05rem; }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.pick-list li a, .pick-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .65rem .75rem;
  cursor: pointer;
  font-family: inherit;
  font-size: .88rem;
}
.pick-list li a:hover, .pick-item:hover { border-color: #93c5fd; background: #eff6ff; }
.pick-list li a span { display: block; }
.inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .55rem .7rem;
  align-items: end;
  margin-top: .8rem;
}
.inline-grid label { margin: 0; }
.stock-out { color: #b91c1c; }
.stock-low { color: #b45309; }
.job-card { grid-template-columns: minmax(0, 1.5fr) minmax(200px, .7fr); }
@media (max-width: 980px) {
  .job-card { grid-template-columns: 1fr; }
}
.form-sheet {
  max-width: 760px;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 20px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .05);
}
.form-step { margin: 0 0 1.15rem; }
.form-step-line {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid #eef2f7;
}
.form-stephead {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .9rem;
}
.form-stephead h2 { margin: 0 0 .15rem; font-size: 1.05rem; }
.form-stephead p { margin: 0; color: #64748b; font-size: .85rem; }
.form-num {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 8px;
  background: #2563eb; color: #fff;
  font-size: .8rem; font-weight: 800;
  display: grid; place-items: center;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .15rem .9rem;
}
.choice { display: flex; gap: .5rem; align-items: flex-start; font-weight: 600; margin: .35rem 0; }
.choice input { width: auto; margin-top: .2rem; }
.form-span { grid-column: 1 / -1; }
.search-help { margin: 0 0 .85rem; }
.search-help label { margin-top: 0; }
.search-help-row { display: flex; gap: .5rem; }
.search-help-row input { margin: 0; flex: 1; }
.search-help-row .btn { flex-shrink: 0; }
.search-help-label {
  margin: 0 0 .4rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.chosen-client {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: .85rem 1rem;
}
.chosen-client div { flex: 1; min-width: 0; }
.chosen-client strong { display: block; }
.chosen-client span { display: block; color: #64748b; font-size: .85rem; word-break: break-all; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .search-help-row { flex-direction: column; }
}
