:root {
  color-scheme: dark;
  --bg: #0b1018;
  --bg-deep: #080c12;
  --surface: rgba(22, 30, 42, .88);
  --surface-solid: #161e2a;
  --surface-2: #1b2533;
  --surface-3: #222e3e;
  --ink: #f7f9fc;
  --muted: #97a4b7;
  --muted-2: #68768a;
  --line: rgba(255, 255, 255, .085);
  --line-gold: rgba(245, 169, 10, .28);
  --green: #22c990;
  --green-dark: #0f171f;
  --green-soft: rgba(34, 201, 144, .13);
  --honey: #f5a90a;
  --honey-light: #ffd464;
  --honey-dark: #bc6f00;
  --honey-soft: rgba(245, 169, 10, .14);
  --danger: #ef6b67;
  --danger-soft: rgba(239, 107, 103, .13);
  --blue: #5b96ff;
  --blue-soft: rgba(91, 150, 255, .14);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, .14);
  --shadow: 0 20px 55px rgba(0, 0, 0, .28);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .18);
  --glow: 0 0 32px rgba(245, 169, 10, .12);
  --radius: 18px;
  --sidebar: 274px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 12%, rgba(245, 169, 10, .07), transparent 28rem),
    radial-gradient(circle at 91% 82%, rgba(34, 201, 144, .045), transparent 32rem),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Segoe UI Variable", "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #2d3949; border: 2px solid var(--bg-deep); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--honey-dark); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(245, 169, 10, .34);
  outline-offset: 2px;
}
h1, h2, h3, h4, p { margin-top: 0; }
h1 {
  margin-bottom: 5px;
  font-size: clamp(1.65rem, 2vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -.04em;
}
h2 { font-size: 1.48rem; letter-spacing: -.025em; }
h3 { margin-bottom: 4px; font-size: 1rem; }
h4 { margin: 0; }
small { color: var(--muted); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  overflow-y: auto;
  padding: 22px 15px;
  border-right: 1px solid var(--line);
  background: rgba(14, 20, 29, .94);
  box-shadow: 16px 0 46px rgba(0, 0, 0, .12);
  backdrop-filter: blur(20px);
  transition: transform .24s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 10px 25px;
  border-bottom: 1px solid var(--line);
}
.brand-home {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.brand-home:hover { background: rgba(245, 169, 10, .06); }
.sidebar-brand strong {
  display: block;
  background: linear-gradient(120deg, #fff 20%, var(--honey-light));
  background-clip: text;
  color: transparent;
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: -.02em;
}
.sidebar-brand small {
  display: block;
  margin-top: 1px;
  color: var(--honey);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand-mark {
  width: 43px;
  height: 43px;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 0 13px rgba(245, 169, 10, .32));
}
.nav-label {
  margin: 19px 12px 7px;
  color: #5f6c7e;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .19em;
  text-transform: uppercase;
}
.nav-label:first-child { margin-top: 17px; }
.nav {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #98a5b7;
  text-align: left;
  transition: .17s ease;
}
.nav span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #7f8b9c;
  font-size: 17px;
}
.nav:hover {
  transform: translateX(3px);
  border-color: var(--line);
  background: rgba(255, 255, 255, .035);
  color: #fff;
}
.nav.active {
  border-color: var(--line-gold);
  background: linear-gradient(110deg, rgba(245, 169, 10, .17), rgba(245, 169, 10, .035));
  color: #fff;
  font-weight: 760;
  box-shadow: inset 0 0 22px rgba(245, 169, 10, .035);
}
.nav.active::before {
  position: absolute;
  left: -2px;
  width: 3px;
  height: 24px;
  border-radius: 5px;
  background: var(--honey);
  box-shadow: 0 0 12px rgba(245, 169, 10, .55);
  content: "";
}
.nav.active span { color: var(--honey); }
.sidebar-foot {
  margin-top: auto;
  padding: 18px 10px 2px;
  border-top: 1px solid var(--line);
}
.sidebar-foot small { color: var(--muted-2); }
.sync-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: #c9d2df;
  font-size: 12px;
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 201, 144, .1), 0 0 13px rgba(34, 201, 144, .3);
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 0 34px 54px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 23px 0 18px;
  background: linear-gradient(var(--bg) 77%, rgba(11, 16, 24, 0));
}
.page-heading { display: flex; align-items: center; gap: 12px; }
.page-heading p:last-child { margin: 0; color: var(--muted); }
.eyebrow {
  margin: 0 0 5px;
  color: var(--honey);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.mobile-menu {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
}
.top-actions { display: flex; align-items: flex-end; gap: 10px; }
.filter { display: grid; gap: 5px; }
.filter span { color: var(--muted); font-size: 10px; font-weight: 800; }
select, input, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #121a25;
  color: var(--ink);
  transition: .15s ease;
}
select:hover, input:hover, textarea:hover { border-color: rgba(245, 169, 10, .35); }
select:focus, input:focus, textarea:focus { border-color: var(--honey); }
option { background: #151e2a; }
textarea { resize: vertical; }
.filter select { min-width: 180px; padding: 10px 34px 10px 12px; }
.cloud-status {
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.cloud-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(34, 201, 144, .4);
  content: "";
}
.mobile-cloud-action { display: none; white-space: nowrap; }
.primary, .secondary, .ghost, .action {
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 760;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.primary {
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--honey-light), var(--honey-dark));
  color: #1c1305;
  box-shadow: 0 8px 22px rgba(245, 169, 10, .2);
}
.primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #ffe18c, var(--honey));
  box-shadow: 0 10px 27px rgba(245, 169, 10, .3);
}
.secondary {
  padding: 10px 14px;
  border-color: var(--line);
  background: rgba(255, 255, 255, .045);
}
.secondary:hover, .ghost:hover { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); }
.ghost { padding: 10px 13px; border-color: var(--line); background: transparent; }
.action {
  display: inline-block;
  padding: 7px 10px;
  background: var(--honey-soft);
  color: var(--honey-light);
  font-size: 12px;
  text-decoration: none;
}
.action:hover { background: rgba(245, 169, 10, .23); }
.action.danger { background: var(--danger-soft); color: #ffaaa7; }
.danger-button {
  padding: 11px 16px;
  border: 0;
  border-radius: 11px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
}
.confirm-message { color: var(--muted); line-height: 1.65; }
.record-actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.card-actions {
  display: flex;
  gap: 7px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.card-actions button { flex: 1; }

.create-wrap { position: relative; }
.create-menu {
  position: absolute;
  top: 52px;
  right: 0;
  z-index: 60;
  display: grid;
  width: 320px;
  grid-template-columns: 1fr 1fr;
  padding: 10px;
  border: 1px solid var(--line-gold);
  border-radius: 17px;
  background: rgba(20, 28, 39, .97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.create-menu[hidden] { display: none; }
.create-menu button {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 8px;
  padding: 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}
.create-menu button:hover { background: rgba(255, 255, 255, .05); }
.create-menu button span {
  display: grid;
  width: 29px;
  height: 29px;
  grid-row: 1/3;
  place-items: center;
  border: 1px solid var(--line-gold);
  border-radius: 9px;
  background: var(--honey-soft);
  color: var(--honey-light);
}
.create-menu b { font-size: 13px; }
.create-menu small { font-size: 10px; }

#app { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.offline-banner {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid var(--line-gold);
  border-radius: 12px;
  background: var(--honey-soft);
  color: var(--honey-light);
}
.onboarding {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 30px;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--line-gold);
  border-radius: 24px;
  background: linear-gradient(130deg, #172031, #101722);
  box-shadow: var(--shadow);
}
.onboarding::after {
  position: absolute;
  top: -110px;
  right: -80px;
  width: 270px;
  height: 270px;
  border: 48px solid rgba(245, 169, 10, .1);
  border-radius: 50%;
  content: "";
}
.onboarding h2 { margin-bottom: 8px; font-size: 1.82rem; }
.onboarding p { max-width: 620px; color: #aeb9c9; }
.setup-steps { position: relative; z-index: 1; display: grid; gap: 9px; }
.setup-step {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .045);
  backdrop-filter: blur(8px);
}
.setup-step > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  border-radius: 9px;
  background: var(--honey);
  color: #201504;
  font-weight: 900;
}
.setup-step b, .setup-step small { display: block; }
.setup-step button { margin-left: auto; }

.action-hub {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(110deg, rgba(27, 37, 51, .95), rgba(20, 28, 39, .82));
  box-shadow: var(--shadow-soft);
}
.action-hub::after {
  position: absolute;
  right: 15%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(245, 169, 10, .07);
  filter: blur(28px);
  content: "";
}
.action-hub.urgent { border-color: rgba(239, 107, 103, .42); }
.action-hub.attention { border-color: var(--line-gold); }
.action-hub.clear { border-color: rgba(34, 201, 144, .25); }
.hub-signal {
  position: relative;
  z-index: 1;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line-gold);
  border-radius: 15px;
  background: var(--honey-soft);
  color: var(--honey-light);
  font-size: 20px;
  font-weight: 900;
}
.urgent .hub-signal { border-color: rgba(239, 107, 103, .38); background: var(--danger-soft); color: #ff9a97; }
.clear .hub-signal { border-color: rgba(34, 201, 144, .3); background: var(--green-soft); color: var(--green); }
.hub-signal span {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.6s infinite;
}
.hub-signal span + * { position: relative; }
.action-hub h2 { margin: 0 0 2px; font-size: 1.18rem; }
.action-hub p { margin: 0; color: var(--muted); }
.action-hub .eyebrow { margin-bottom: 2px; }
.hub-count {
  position: relative;
  z-index: 1;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: #d7deea;
  font-size: 12px;
  font-weight: 800;
}
button.hub-count:hover { border-color: var(--line-gold); color: var(--honey-light); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 107, 103, .55); }
  50% { box-shadow: 0 0 0 8px rgba(239, 107, 103, 0); }
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(125px, 1fr));
  gap: 12px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  text-align: left;
  backdrop-filter: blur(12px);
  transition: .17s ease;
}
.quick-action:hover {
  transform: translateY(-3px);
  border-color: var(--line-gold);
  box-shadow: var(--glow), var(--shadow-soft);
}
.quick-action span {
  display: grid;
  width: 39px;
  height: 39px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line-gold);
  border-radius: 12px;
  background: var(--honey-soft);
  color: var(--honey-light);
  font-size: 17px;
}
.quick-action b, .quick-action small { display: block; }
.quick-action small { margin-top: 2px; font-size: 10px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
}
.kpi {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(26, 35, 48, .92), rgba(18, 25, 35, .9));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  transition: .17s ease;
}
.kpi::after {
  position: absolute;
  right: -35px;
  bottom: -55px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(245, 169, 10, .035);
  content: "";
}
.kpi[role="button"]:hover {
  transform: translateY(-2px);
  border-color: var(--line-gold);
  box-shadow: var(--glow), var(--shadow-soft);
}
.kpi-top { display: flex; justify-content: space-between; gap: 12px; }
.kpi small { color: var(--muted); font-weight: 700; }
.kpi strong {
  display: block;
  margin: 9px 0 4px;
  font-size: 1.77rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  line-height: 1.2;
}
.kpi-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(34, 201, 144, .2);
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 17px;
}
.kpi.warning .kpi-icon { border-color: var(--line-gold); background: var(--honey-soft); color: var(--honey-light); }
.kpi.danger .kpi-icon { border-color: rgba(239, 107, 103, .3); background: var(--danger-soft); color: #ff9d99; }
.kpi.info .kpi-icon { border-color: rgba(91, 150, 255, .3); background: var(--blue-soft); color: var(--blue); }
.kpi-note { color: var(--muted); font-size: 11px; }
.kpi-note.good { color: #62d7af; }

.dashboard-grid, .grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, .72fr);
  gap: 16px;
}
.grid-equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(13px);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.panel:hover { border-color: rgba(255, 255, 255, .12); }
.panel-head, .section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}
.panel-head h3 { font-size: 1.02rem; }
.panel-head p, .section-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-note { margin: 0; color: var(--muted); }

.chart-shell { min-height: 245px; }
.trend-chart { width: 100%; height: 250px; overflow: visible; }
.chart-grid { stroke: rgba(255, 255, 255, .075); stroke-width: 1; }
.chart-label, .axis-label { fill: #7e8a9c; font-size: 10px; }
.bar-revenue { fill: var(--honey); transition: filter .15s ease, opacity .15s ease; }
.bar-expense { fill: #56718f; transition: filter .15s ease, opacity .15s ease; }
.chart-group:hover .bar-revenue, .chart-group:hover .bar-expense { filter: brightness(1.25); }
.chart-group:hover .chart-label { fill: #fff; }
.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.chart-legend small { margin-left: auto; font-size: 10px; }
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
}
.legend-dot.revenue { background: var(--honey); box-shadow: 0 0 8px rgba(245, 169, 10, .35); }
.legend-dot.expense { background: #56718f; }

.donut-wrap {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.donut {
  position: relative;
  display: grid;
  width: 142px;
  flex: none;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .18), 0 0 20px rgba(0, 0, 0, .12);
}
.donut::after {
  position: absolute;
  width: 86px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-solid);
  content: "";
}
.donut-center { position: relative; z-index: 1; max-width: 78px; text-align: center; }
.donut-center b { display: block; font-size: 1.42rem; letter-spacing: -.04em; }
.donut-center small { font-size: 9px; }
.expense-donut .donut { width: 154px; }
.expense-donut .donut::after { width: 94px; }
.expense-donut .donut-center b { font-size: .92rem; }
.legend-list { display: grid; min-width: 145px; gap: 9px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-item i { width: 9px; height: 9px; flex: none; border-radius: 50%; }
.legend-item span { flex: 1; color: var(--muted); }
.legend-item b { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.task-list { display: grid; gap: 9px; }
.task {
  display: flex;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid #657387;
  border-radius: 13px;
  background: rgba(255, 255, 255, .026);
}
.task.warning { border-left-color: var(--honey); background: var(--honey-soft); }
.task.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.task-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: currentColor; }
.task b, .task small { display: block; }
.task small { margin-top: 3px; }

.statline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.statline:last-child { border-bottom: 0; }
.statline span { color: var(--muted); }
.statline b { font-variant-numeric: tabular-nums; }
.apiary-cards { display: grid; grid-template-columns: repeat(3, minmax(210px, 1fr)); gap: 13px; }
.apiary-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(30, 41, 56, .9), rgba(18, 25, 35, .9));
  transition: .17s ease;
}
.apiary-card:hover { transform: translateY(-2px); border-color: var(--line-gold); box-shadow: var(--glow); }
.apiary-card .card-code {
  display: inline-flex;
  padding: 4px 7px;
  border: 1px solid var(--line-gold);
  border-radius: 7px;
  background: var(--honey-soft);
  color: var(--honey-light);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}
.apiary-card h3 { margin: 12px 0 2px; font-size: 1.08rem; }
.apiary-card > p { color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.table-wrap table { width: 100%; min-width: 720px; border-collapse: collapse; }
.table-wrap th {
  padding: 11px 13px;
  background: rgba(8, 12, 18, .5);
  color: #7f8b9c;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .1em;
  text-align: left;
  text-transform: uppercase;
}
.table-wrap td { padding: 13px; border-top: 1px solid var(--line); vertical-align: middle; }
.table-wrap tr:hover td { background: rgba(255, 255, 255, .025); }
.table-wrap td small { display: inline-block; margin-top: 3px; }
.row-actions { white-space: nowrap; }
.empty-cell { padding: 0 !important; }
.empty-state { padding: 36px 18px; text-align: center; }
.empty-state > span {
  display: grid;
  width: 49px;
  height: 49px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid var(--line-gold);
  border-radius: 15px;
  background: var(--honey-soft);
  color: var(--honey-light);
  font-size: 21px;
}
.empty-state h3 { margin-bottom: 5px; }
.empty-state p { max-width: 410px; margin: 0 auto 15px; color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(34, 201, 144, .2);
  border-radius: 99px;
  background: var(--green-soft);
  color: #69deb8;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.badge.warn { border-color: var(--line-gold); background: var(--honey-soft); color: var(--honey-light); }
.badge.danger { border-color: rgba(239, 107, 103, .28); background: var(--danger-soft); color: #ffa29e; }
.badge.info { border-color: rgba(91, 150, 255, .28); background: var(--blue-soft); color: #8bb7ff; }
.stock-name { min-width: 190px; }
.progress {
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #25303f;
}
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.progress.warning i { background: var(--honey); }
.progress.danger i { background: var(--danger); }
.hbars { display: grid; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 78px; align-items: center; gap: 10px; }
.hbar-row > span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; overflow: hidden; border-radius: 99px; background: #25303f; }
.hbar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--honey-dark), var(--honey)); }
.hbar-row b { font-size: 11px; text-align: right; }
.tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 2px;
  overflow-x: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8, 12, 18, .52);
}
.tabs button {
  flex: none;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.tabs button.active { background: var(--surface-3); color: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
.quick-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line-gold);
  border-radius: 22px;
  background: linear-gradient(130deg, #182232, #101720);
  box-shadow: var(--glow);
}
.quick-hero p { max-width: 680px; margin-bottom: 0; color: #aeb9c9; }
.quick-hero h2 { margin-bottom: 7px; font-size: 1.72rem; }
.searchbox { position: relative; }
.searchbox input { min-width: 260px; padding-left: 38px; }
.searchbox::before {
  position: absolute;
  top: 8px;
  left: 13px;
  z-index: 1;
  color: var(--muted);
  font-size: 18px;
  content: "⌕";
}

.order-alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid var(--line-gold);
  border-radius: 15px;
  background: var(--honey-soft);
}
.order-alert.danger { border-color: rgba(239, 107, 103, .4); background: var(--danger-soft); }
.order-alert p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.order-alert > strong { font-size: 1.3rem; }
.alert-pulse {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--honey);
  animation: pulse 1.6s infinite;
}
.order-alert.danger .alert-pulse { background: var(--danger); }
.order-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.view-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 12, 18, .52);
}
.view-switch button {
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.view-switch button.active { background: var(--honey-soft); color: var(--honey-light); }
.kanban-board {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(245px, 1fr));
  gap: 13px;
  overflow-x: auto;
  padding: 1px 1px 9px;
}
.kanban-col {
  display: flex;
  min-height: 470px;
  flex-direction: column;
  padding: 13px;
  border: 1px solid var(--line);
  border-top: 2px solid #657387;
  border-radius: 16px;
  background: rgba(10, 15, 23, .5);
}
.kanban-col.gold { border-top-color: var(--honey); }
.kanban-col.blue { border-top-color: var(--blue); }
.kanban-col.purple { border-top-color: var(--purple); }
.kanban-col.green { border-top-color: var(--green); }
.kanban-col-header { min-height: 66px; padding: 2px 2px 11px; border-bottom: 1px solid var(--line); }
.kanban-col-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.kanban-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 820; }
.kanban-title i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kanban-col.gold .kanban-title { color: var(--honey-light); }
.kanban-col.blue .kanban-title { color: #8eb9ff; }
.kanban-col.purple .kanban-title { color: #c0adff; }
.kanban-col.green .kanban-title { color: #6ee0b9; }
.kanban-counter {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: #cbd4e1;
  font-size: 10px;
}
.kanban-cards { display: flex; flex: 1; flex-direction: column; gap: 10px; padding-top: 11px; }
.order-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(28, 38, 52, .96), rgba(18, 25, 35, .96));
  box-shadow: 0 7px 20px rgba(0, 0, 0, .17);
  transition: .16s ease;
}
.order-card:hover { transform: translateY(-2px); border-color: var(--line-gold); box-shadow: var(--glow), 0 10px 25px rgba(0, 0, 0, .23); }
.order-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.order-no { color: var(--honey-light); font-size: 10px; font-weight: 850; letter-spacing: .05em; }
.order-card h4 { margin-bottom: 8px; font-size: .94rem; }
.order-meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
.order-items-list { display: grid; gap: 5px; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.order-items-list span { display: flex; justify-content: space-between; gap: 8px; color: #bac4d2; font-size: 11px; }
.order-items-list b { color: #fff; }
.order-card-total { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 2px; }
.order-card-total small { font-size: 10px; }
.order-card-total strong { font-size: 1.08rem; letter-spacing: -.02em; }
.tracking-code { margin-top: 8px; padding: 7px 8px; border-radius: 8px; background: var(--purple-soft); color: #c7b7ff; font-size: 10px; }
.order-card-actions { display: flex; gap: 6px; margin-top: 10px; }
.order-card-actions .action { flex: 1; padding: 7px 6px; font-size: 10px; }
.empty-lane { display: grid; flex: 1; place-items: center; align-content: center; color: var(--muted-2); text-align: center; }
.empty-lane span { font-size: 26px; }
.empty-lane p { margin: 5px 0 0; font-size: 11px; }

.workflow-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 25px;
  border: 1px solid var(--line-gold);
  border-radius: 20px;
  background: linear-gradient(120deg, #182231, #101721);
}
.workflow-intro h2 { margin-bottom: 5px; font-size: 1.65rem; }
.workflow-intro p:last-child { margin: 0; color: var(--muted); }
.workflow-health {
  display: grid;
  grid-template-columns: 12px 1fr;
  align-items: center;
  column-gap: 9px;
  min-width: 230px;
  padding: 12px 14px;
  border: 1px solid rgba(34, 201, 144, .22);
  border-radius: 13px;
  background: var(--green-soft);
}
.workflow-health > span { width: 9px; height: 9px; grid-row: 1/3; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(34, 201, 144, .4); }
.workflow-health b, .workflow-health small { display: block; }
.workflow-health small { font-size: 9px; }
.workflow { overflow: auto; }
.process-svg { min-width: 900px; width: 100%; height: auto; }
.flow-node { cursor: default; }
.flow-node rect { fill: #17212e; stroke: #2d3949; stroke-width: 1; transition: .17s ease; }
.flow-node circle { fill: #2a3544; stroke: #3b485a; }
.flow-node .flow-title { fill: #f7f9fc; font-size: 13px; font-weight: 750; }
.flow-node .flow-sub { fill: #8794a7; font-size: 9px; }
.flow-node .flow-count { fill: #fff; font-size: 9px; font-weight: 850; }
.flow-node:hover rect, .flow-node:focus rect { transform: translateY(-2px); stroke: var(--honey); filter: url(#nodeGlow) brightness(1.08); }
.flow-node.gold circle { fill: var(--honey-soft); stroke: var(--honey); }
.flow-node.gold .flow-count { fill: var(--honey-light); }
.flow-node.green circle { fill: var(--green-soft); stroke: var(--green); }
.flow-node.green .flow-count { fill: #6ee0b9; }
.flow-node.blue circle { fill: var(--blue-soft); stroke: var(--blue); }
.flow-node.blue .flow-count { fill: #9bc1ff; }
.flow-node.purple circle { fill: var(--purple-soft); stroke: var(--purple); }
.flow-node.purple .flow-count { fill: #c7b6ff; }
.flow-node.red circle { fill: var(--danger-soft); stroke: var(--danger); }
.flow-node.red .flow-count { fill: #ffaaa7; }
.workflow-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.workflow-notes article {
  display: flex;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.reminder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.reminder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(245, 169, 10, .24);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 169, 10, .09), rgba(22, 29, 40, .8));
}

.reminder-card h4 { margin: 8px 0 3px; }
.reminder-card p { margin: 0; color: var(--muted); font-size: .84rem; }
.workflow-notes article > span { color: var(--honey); font-size: 11px; font-weight: 900; }
.workflow-notes b { display: block; margin-bottom: 3px; }
.workflow-notes p { margin: 0; color: var(--muted); font-size: 11px; }

dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line-gold);
  border-radius: 22px;
  background: #141c27;
  color: var(--ink);
  box-shadow: 0 35px 100px rgba(0, 0, 0, .55);
}
dialog::backdrop { background: rgba(3, 6, 10, .72); backdrop-filter: blur(5px); }
dialog form, dialog:not(:has(form)) { padding: 24px; }
.small-dialog { width: min(460px, calc(100vw - 28px)); padding: 24px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-head h2 { margin-bottom: 4px; }
.dialog-head p:last-child { margin-bottom: 0; color: var(--muted); }
.icon-btn {
  display: grid;
  width: 39px;
  height: 39px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .045);
  font-size: 22px;
  line-height: 1;
}
.icon-btn:hover { border-color: var(--line-gold); background: var(--honey-soft); color: var(--honey-light); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid label { display: grid; gap: 6px; color: #c1cad6; font-size: 12px; font-weight: 750; }
.span-2 { grid-column: 1/-1; }
.form-note { margin: 15px 0 0; padding: 10px 12px; border: 1px solid var(--line-gold); border-radius: 11px; background: var(--honey-soft); color: #ffd880; font-size: 12px; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.data-actions { display: grid; gap: 9px; }
.upload { display: block; text-align: center; }
.upload input { display: none; }
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  padding: 13px 17px;
  border: 1px solid var(--line-gold);
  border-radius: 12px;
  background: #151e29;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: none; }
.mobile-add { display: none; }

@media (max-width: 1250px) {
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .apiary-cards { grid-template-columns: repeat(2, 1fr); }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .kanban-board { grid-template-columns: repeat(4, 255px); }
}

@media (max-width: 980px) {
  :root { --sidebar: 242px; }
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 60px rgba(0, 0, 0, .4); }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-left: 0; padding: 0 20px 85px; }
  .mobile-menu { display: grid; place-items: center; }
  .topbar { position: relative; display: grid; min-height: auto; padding: 18px 0; }
  .top-actions { align-items: center; justify-content: flex-start; }
  .desktop-only { display: none; }
  .mobile-cloud-action { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 13px; }
  .dashboard-grid, .grid-2, .grid-equal { grid-template-columns: 1fr; }
  .onboarding { grid-template-columns: 1fr; }
  .mobile-add {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    display: grid;
    width: 57px;
    height: 57px;
    place-items: center;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--honey-light), var(--honey-dark));
    color: #1d1304;
    box-shadow: 0 15px 38px rgba(245, 169, 10, .28);
    font-size: 26px;
  }
  .create-wrap .primary { display: none; }
  .create-menu { position: fixed; top: auto; right: 14px; bottom: 82px; width: min(360px, calc(100vw - 28px)); }
}

@media (max-width: 650px) {
  .workspace { padding-inline: 14px; }
  .page-heading p:last-child, .cloud-status { display: none; }
  .top-actions { width: 100%; }
  .filter { flex: 1; }
  .filter select { min-width: 0; }
  .mobile-cloud-action { min-height: 40px; padding: 9px 12px; font-size: 12px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .quick-action { padding: 12px; }
  .quick-action small { display: none; }
  .action-hub { grid-template-columns: auto 1fr; padding: 15px; }
  .action-hub .hub-count { grid-column: 1/-1; width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 116px; padding: 14px; }
  .kpi strong { font-size: 1.35rem; }
  .kpi-icon { width: 33px; height: 33px; }
  .panel { padding: 15px; border-radius: 15px; }
  .panel-head, .section-head { align-items: stretch; flex-direction: column; }
  .panel-actions, .toolbar-actions { width: 100%; }
  .panel-actions button, .toolbar-actions button { flex: 1; }
  .chart-legend small { display: none; }
  .donut-wrap { display: grid; }
  .apiary-cards { grid-template-columns: 1fr; }
  .quick-hero { display: grid; padding: 21px; }
  .quick-hero .primary { width: 100%; }
  .hbar-row { grid-template-columns: 90px 1fr 60px; }
  .searchbox, .searchbox input { width: 100%; min-width: 0; }
  .order-toolbar { align-items: stretch; }
  .order-controls { align-items: stretch; flex-direction: column; }
  .view-switch { align-self: flex-end; }
  .kanban-board {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    grid-template-columns: repeat(4, 82vw);
    scroll-snap-type: x proximity;
  }
  .kanban-col { min-height: 390px; scroll-snap-align: start; }
  .workflow-intro { align-items: stretch; flex-direction: column; padding: 20px; }
  .workflow-health { min-width: 0; }
  .workflow-notes { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  dialog {
    width: 100vw;
    max-width: none;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }
  dialog form, dialog:not(:has(form)) { padding: 20px 16px; }
  .dialog-actions { position: sticky; bottom: -20px; padding-bottom: 8px; background: #141c27; }
  .toast { right: 14px; bottom: 86px; left: 14px; text-align: center; }
}

@media (max-width: 390px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-action b { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
