:root {
  --sidebar: #0e2238;
  --sidebar-2: #132c48;
  --sidebar-text: #c5d2e2;
  --sidebar-dim: #8ea2b8;
  --active: #1f6feb;
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #e4ebf3;
  --text: #1c2b3a;
  --muted: #6b7c90;
  --primary: #1f6feb;
  --primary-dark: #1558c0;
  --ok: #17803d;
  --ok-bg: #e7f6ee;
  --warn: #b45309;
  --warn-bg: #fff4e5;
  --bad: #c2410c;
  --bad-bg: #fdecea;
  --info-bg: #e8f1ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 34, 56, .05), 0 10px 28px rgba(16, 34, 56, .05);
  --sidebar-w: 252px;
  --top: 64px;
  --font: "Segoe UI", "Liberation Sans", "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; z-index: 30;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 18px 18px 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary);
  color: #fff; display: grid; place-items: center; font-weight: 700;
}
.brand strong { display: block; color: #fff; font-size: 15px; }
.brand span { color: var(--sidebar-dim); font-size: 12px; }
.nav { overflow: auto; padding: 8px 12px 18px; flex: 1; }
.nav-section {
  margin: 16px 8px 6px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--sidebar-dim);
}
.nav a.item {
  display: flex; align-items: center; gap: 10px; color: var(--sidebar-text);
  padding: 9px 10px; border-radius: 10px; margin: 2px 0; font-size: 14px;
  min-width: 0;
}
.nav-ico {
  width: 18px; height: 18px; flex: 0 0 18px;
  color: #9fb4c9; stroke: currentColor;
}
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a.item:hover { background: var(--sidebar-2); color: #fff; }
.nav a.item:hover .nav-ico,
.nav a.item.active .nav-ico { color: #fff; }
.nav a.item.active { background: var(--active); color: #fff; }
.nav .badge {
  margin-left: auto; background: #e11d48; color: #fff; border-radius: 999px;
  min-width: 20px; text-align: center; font-size: 11px; padding: 1px 6px;
}
.shell { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  height: var(--top); display: flex; align-items: center; gap: 12px;
  padding: 0 20px; position: sticky; top: 0; background: rgba(243,246,251,.92);
  backdrop-filter: blur(8px); z-index: 20;
}
.search {
  flex: 1; display: flex; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 0 14px; max-width: 560px; height: 40px;
}
.search input { border: 0; outline: 0; width: 100%; background: transparent; }
.kbd { color: var(--muted); font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.demo-pill {
  background: #f6c445; color: #3f2d00; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; border-radius: 999px; padding: 6px 10px; white-space: nowrap;
}
.icon-btn, .btn {
  border: 0; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn { background: var(--primary); color: #fff; padding: 9px 14px; font-weight: 600; }
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.warn { background: #fff; color: var(--bad); border: 1px solid #f3c7be; }
.icon-btn { width: 40px; height: 40px; background: var(--primary); color: #fff; justify-content: center; font-size: 20px; }
.bell { position: relative; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.bell em {
  position: absolute; top: -4px; right: -4px; background: #e11d48; color: #fff;
  font-style: normal; font-size: 10px; border-radius: 99px; padding: 1px 4px;
}
.who { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #12345a; color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.who small { display: block; color: var(--muted); }
.content { padding: 8px 22px 40px; }
.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin: 8px 0 16px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
}
.card .label { color: var(--muted); font-size: 13px; }
.card .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.card .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid var(--line); }
.filters input, .filters select, .field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff; color: var(--text);
}
.filters input { min-width: 220px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #f8fbff; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.muted { background: #eef2f6; color: #526275; }
.pill.info { background: var(--info-bg); color: #1d4ed8; }
.flash { background: #e7f6ee; color: #14532d; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.errors { background: var(--bad-bg); color: #7f1d1d; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; }
.req::after { content: " *"; color: var(--bad); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.machine-bar {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: #0e2238; color: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
}
.machine-bar a { color: #9ec1ff; }
.section-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.section-card h2 { margin: 0 0 12px; font-size: 16px; }
.voice {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: #1f6feb; color: #fff; cursor: pointer;
}
.voice.live { background: #dc2626; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.inline { display: flex; gap: 8px; align-items: center; }
.sticky-actions {
  position: sticky; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  padding: 10px; display: flex; gap: 8px; justify-content: flex-end; margin: 0 -16px -16px; border-radius: 0 0 14px 14px;
}
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { font-size: 12px; color: var(--muted); text-align: center; padding: 4px; }
.day {
  min-height: 108px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.day.out { background: #f7f9fc; color: #9aa8b8; }
.day.today { outline: 2px solid var(--primary); }
.day .num { font-size: 12px; font-weight: 700; }
.chip {
  font-size: 11px; border-radius: 8px; padding: 3px 5px; background: #eef4ff; color: #1e3a8a;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip.p-low { background: #eef2f6; }
.chip.p-high, .chip.p-urgent { background: #fdecea; color: #9a3412; }
.chip.st-planned { box-shadow: inset 3px 0 #7c3aed; }
.chip.st-done { box-shadow: inset 3px 0 #17803d; }
.chip.st-in_progress { box-shadow: inset 3px 0 #1f6feb; }
.add-day { margin-top: auto; font-size: 12px; color: var(--primary); background: transparent; border: 0; cursor: pointer; text-align: left; padding: 0; }
.kanban { display: grid; grid-template-columns: repeat(7, minmax(160px, 1fr)); gap: 8px; overflow: auto; }
.kanban.orders { grid-template-columns: repeat(6, minmax(180px, 1fr)); }
.column { background: #eef3f8; border-radius: 12px; padding: 8px; min-height: 240px; }
.column h3 { margin: 4px 6px 8px; font-size: 13px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.person-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.modal {
  position: fixed; inset: 0; background: rgba(8, 18, 32, .72); z-index: 50;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal.open { display: flex; }
.modal .sheet { background: #111; color: #fff; width: min(480px, 100%); border-radius: 16px; padding: 16px; }
#scanVideo, #scanCanvas { width: 100%; border-radius: 12px; background: #000; max-height: 50vh; }
.sign-pad { border: 1px dashed #b7c3d1; border-radius: 12px; background: #fff; touch-action: none; width: 100%; height: 180px; }
.menu-toggle { display: none; }
.pager { color: var(--muted); font-size: 13px; padding: 10px 12px; }
.empty { padding: 28px; color: var(--muted); text-align: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a, .tabs span {
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--text); font-size: 13px;
}
.tabs a.active, .tabs span.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #0e2238, #1f6feb 140%); }
.auth-card { width: min(440px, 100%); background: #fff; border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 8px 0 4px; }
.muted { color: var(--muted); }
.ss{position:relative;display:block;min-width:0}
.ss>select{position:absolute;left:0;bottom:0;width:1px;height:1px;min-height:0;padding:0;border:0;opacity:0;pointer-events:none}
.ss-btn{display:flex;align-items:center;gap:.5rem;width:100%;min-height:44px;padding:.55rem .7rem;font:inherit;text-align:left;color:inherit;background:#fff;border:1px solid var(--line);border-radius:10px;cursor:pointer}
.ss-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ss-placeholder .ss-text{color:var(--muted)}
.ss-caret{color:var(--muted)}
.ss-panel{position:absolute;z-index:30;left:0;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);padding:.4rem}
.ss-search{width:100%;margin:0 0 .35rem}
.ss-list{list-style:none;margin:0;padding:0;max-height:min(320px,50vh);overflow:auto}
.ss-list li{padding:.5rem;border-radius:8px;cursor:pointer}
.ss-list li.is-active{background:var(--info-bg)}
.ss-empty,.ss-more{margin:.3rem .4rem;color:var(--muted)}
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; margin: 8px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
@media (max-width: 1100px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .grid-2, .row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; width: min(var(--sidebar-w), 88vw); }
  .sidebar.open { transform: none; }
  .nav a.item { padding: 11px 10px; }
  .shell { margin-left: 0; }
  .demo-pill, .who span, .kbd { display: none; }
  .content { padding: 8px 12px 80px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .cards, .row-2, .week { grid-template-columns: 1fr; }
  .calendar { grid-template-columns: repeat(2, 1fr); }
  table.data { display: block; overflow: auto; }
  .sticky-actions { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
}
