:root {
  --bg: #0c1119;
  --bg-2: #0f1622;
  --sidebar-bg: #0a0e15;
  --panel: #151c28;
  --panel-2: #1a2230;
  --panel-hover: #1e2737;
  --line: #263144;
  --line-soft: #1e2735;
  --text: #e7edf5;
  --text-muted: #93a1b6;
  --text-dim: #6b7889;
  --primary: #4f8cff;
  --primary-strong: #6aa0ff;
  --primary-soft: rgba(79, 140, 255, 0.14);
  --accent: #22d3ee;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 11px;
  --sidebar-w: 256px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.3);

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-primary: var(--primary);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1100px 520px at 100% -10%, rgba(79, 140, 255, 0.10), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, rgba(34, 211, 238, 0.08), transparent 58%),
    var(--bg);
  background-attachment: fixed;
}

::selection { background: var(--primary); color: #fff; }

a { color: var(--primary-strong); text-decoration: none; }
a:hover { color: #9cc0ff; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3548; border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #36435c; background-clip: content-box; }

/* ============ SIDEBAR LAYOUT ============ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0b1019, #0a0e15);
  border-right: 1px solid var(--line-soft);
  z-index: 1040;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0.3px;
  color: #fff;
  border-bottom: 1px solid var(--line-soft);
}
.sidebar-brand img { border-radius: 7px; background: #fff; padding: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }

.nav-group { margin-bottom: 14px; }
.nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 12px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.93rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--panel-hover); color: var(--text); }
.sidebar-nav .nav-link.active {
  background: var(--primary-soft);
  color: #cfe0ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
}
.avatar {
  flex: 0 0 38px;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.sidebar-user-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sidebar-user-meta strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-tag {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); font-weight: 700;
}
.logout-btn {
  margin-left: auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--text-muted);
  border: 1px solid var(--line);
}
.logout-btn:hover { background: rgba(248, 113, 113, 0.14); color: var(--danger); border-color: rgba(248,113,113,.4); }

.content { min-height: 100vh; }
body.has-sidebar .content { margin-left: var(--sidebar-w); }

.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(3, 6, 12, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1035;
  display: none;
}

.mobile-topbar { display: none; }

.app-shell {
  max-width: 1280px;
  margin: 26px auto 36px;
  padding: 0 26px;
}

/* ============ AUTH (Login) ============ */
body.auth-layout .app-shell { max-width: none; margin: 0; padding: 0; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-panel { width: min(440px, 94vw); }

/* ============ HEADERS / TYPO ============ */
.page-header {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: flex-end;
  gap: 14px; margin-bottom: 20px;
}
.page-title {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.2px;
}
.page-subtitle { margin: 6px 0 0; color: var(--text-muted); }

/* ============ PANELS / CARDS ============ */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.metric-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.metric-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.85;
}
.metric-card:hover { transform: translateY(-3px); border-color: #33425c; }
.metric-label { color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }
.metric-value { margin-top: 8px; font-size: 1.7rem; font-weight: 800; line-height: 1.05; color: #fff; font-family: "Space Grotesk", sans-serif; }

/* ============ FORMS ============ */
.form-label { color: #c6d2e2; font-weight: 600; margin-bottom: 5px; }
.form-control, .form-select, textarea.form-control {
  color: var(--text);
  background: #0e1521;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
}
.form-control::placeholder { color: var(--text-dim); }
.form-control:focus, .form-select:focus, textarea.form-control:focus {
  background: #0e1521;
  color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 0 0 0.18rem var(--primary-soft);
}
.form-select { background-color: #0e1521; }
.form-select option { background: #0e1521; color: var(--text); }
.form-control-sm, .form-select-sm { border-radius: 9px; }
.form-check-input { background-color: #0e1521; border-color: #3a475d; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-text, small, .text-muted { color: var(--text-muted) !important; }
code { color: #8be9fd; background: rgba(34,211,238,.1); padding: 1px 6px; border-radius: 6px; }

/* ============ BUTTONS ============ */
.btn { border-radius: var(--radius-sm); font-weight: 600; letter-spacing: 0.2px; padding: 8px 16px; }
.btn-primary, .btn-success {
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.28);
}
.btn-primary:hover, .btn-success:hover { color: #fff; filter: brightness(1.06); }
.btn-success { background: linear-gradient(135deg, #10b981, var(--success)); box-shadow: 0 6px 16px rgba(52,211,153,.25); }
.btn-outline-light, .btn-outline-secondary, .btn-outline-info, .btn-outline-warning {
  border-color: var(--line); color: var(--text); background: var(--panel-2);
}
.btn-outline-light:hover, .btn-outline-secondary:hover, .btn-outline-info:hover, .btn-outline-warning:hover {
  background: var(--panel-hover); color: #fff; border-color: #3a4a64;
}
.btn-outline-danger { border-color: rgba(248,113,113,.45); color: #fca5a5; background: transparent; }
.btn-outline-danger:hover { background: var(--danger); color: #1b1010; border-color: var(--danger); }

/* ============ TABLES ============ */
.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.table {
  margin-bottom: 0;
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  --bs-table-hover-bg: rgba(79, 140, 255, 0.08);
  --bs-table-border-color: var(--line-soft);
  color: var(--text);
  vertical-align: middle;
}
.table thead th {
  position: sticky; top: 0; z-index: 1;
  background: #11192600; backdrop-filter: blur(6px);
  background-color: #131b28;
  color: #aebccf;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}
.table tbody td { padding: 11px 14px; border-color: var(--line-soft); }
.editable { cursor: text; }
.editable:hover { background: rgba(79,140,255,.07); }

/* ============ BADGES / ALERTS / LIST ============ */
.badge { border-radius: 999px; font-weight: 700; padding: 0.4em 0.7em; }
.alert { border-radius: var(--radius-sm); border-width: 1px; }
.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }

.list-group { border-radius: var(--radius); overflow: hidden; }
.list-group-item {
  background: var(--panel);
  border-color: var(--line-soft);
  color: var(--text);
  padding: 13px 16px;
}
.list-group-flush > .list-group-item { background: transparent; }

/* ============ DASHBOARD TOOLS ============ */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tool-link {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; background: var(--panel-2); color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.tool-link:hover { border-color: var(--primary); transform: translateY(-2px); color: var(--text); }
.tool-link p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.92rem; }

.progress { background: #0e1521; border: 1px solid var(--line); }
.progress-bar { background: linear-gradient(90deg, var(--primary), var(--accent)); }

.remove-btn { background: var(--danger); color: #1b1010; border: none; border-radius: 999px; width: 32px; height: 32px; font-size: 1rem; font-weight: 700; }

/* ============ MODAL ============ */
.modal-content { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.modal-header, .modal-footer { border-color: var(--line-soft); }

/* ============ FOOTER ============ */
.app-footer {
  margin-top: 30px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  text-align: center; color: var(--text-dim); font-size: 0.85rem;
}

/* ============ COMPONENTS ============ */
/* Section header with icon chip */
.section-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.section-head .titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.section-head h2 { margin: 0; font-size: 1.08rem; font-weight: 700; color: #fff; font-family: "Space Grotesk", sans-serif; }
.section-head .sub { color: var(--text-muted); font-size: 0.85rem; }
.section-head .spacer { margin-left: auto; }

.icon-chip {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--primary-soft); color: var(--primary-strong);
  border: 1px solid rgba(79, 140, 255, 0.25);
}
.icon-chip.green { background: rgba(52,211,153,.12); color: #5ee9b5; border-color: rgba(52,211,153,.28); }
.icon-chip.amber { background: rgba(251,191,36,.12); color: #fcd34d; border-color: rgba(251,191,36,.28); }
.icon-chip.cyan  { background: rgba(34,211,238,.12); color: #67e8f9; border-color: rgba(34,211,238,.28); }
.icon-chip.red   { background: rgba(248,113,113,.12); color: #fca5a5; border-color: rgba(248,113,113,.28); }
.icon-chip.violet{ background: rgba(167,139,250,.14); color: #c4b5fd; border-color: rgba(167,139,250,.3); }

/* Stat / metric card with icon */
.stat-card {
  position: relative; display: flex; align-items: center; gap: 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; background: linear-gradient(160deg, var(--panel-2), var(--panel));
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.stat-card:hover { transform: translateY(-3px); border-color: #33425c; }
.stat-card .stat-body { min-width: 0; }
.stat-label { color: var(--text-muted); font-size: 0.88rem; font-weight: 600; }
.stat-value { margin-top: 3px; font-size: 1.7rem; font-weight: 800; line-height: 1.05; color: #fff; font-family: "Space Grotesk", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; border: 1px solid transparent; line-height: 1.5; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-success { color: #5ee9b5; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.3); }
.pill-danger  { color: #fca5a5; background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.3); }
.pill-warn    { color: #fcd34d; background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); }
.pill-info    { color: #93c5fd; background: rgba(79,140,255,.12); border-color: rgba(79,140,255,.3); }
.pill-muted   { color: var(--text-muted); background: rgba(147,161,182,.1); border-color: var(--line); }

/* Icon buttons */
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; border: 1px solid var(--line); color: var(--text-muted); background: var(--panel-2); transition: all 0.15s ease; font-size: 0.95rem; }
.icon-btn:hover { background: var(--panel-hover); color: #fff; border-color: #3a4a64; }
.icon-btn.edit:hover { color: #93c5fd; border-color: rgba(79,140,255,.5); background: var(--primary-soft); }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.12); }

/* Input with leading icon */
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.input-icon > .form-control { padding-left: 38px; }

/* Tag chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 0.74rem; background: var(--panel-hover); border: 1px solid var(--line); color: var(--text-muted); }

/* Empty state */
.empty-state { text-align: center; padding: 52px 20px; color: var(--text-muted); }
.empty-state i { font-size: 2.6rem; color: var(--text-dim); display: block; margin-bottom: 12px; }
.empty-state .es-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Data list rows (cards) */
.data-list { display: grid; gap: 10px; }
.data-item { display: flex; align-items: center; gap: 15px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); transition: border-color 0.15s ease, transform 0.15s ease; }
.data-item:hover { border-color: #36455f; transform: translateX(2px); }
.data-item .di-main { flex: 1; min-width: 0; }
.data-item .di-title { font-weight: 700; color: #fff; }
.data-item .di-meta { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }
.data-item .di-actions { display: flex; gap: 7px; flex: 0 0 auto; }

/* Timeline */
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 16px 42px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: 7px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--panel); border: 2px solid var(--primary); display: grid; place-items: center; font-size: 0.6rem; color: var(--primary-strong); }
.timeline-title { font-weight: 600; color: var(--text); }
.timeline-meta { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }

/* Wizard step pills */
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step-chip { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-muted); font-weight: 600; font-size: 0.85rem; background: var(--panel-2); }
.step-chip .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-hover); font-size: 0.78rem; color: var(--text-muted); }
.step-chip.active { color: #cfe0ff; border-color: rgba(79,140,255,.5); background: var(--primary-soft); }
.step-chip.active .num { background: var(--primary); color: #fff; }
.step-chip.done { color: #5ee9b5; border-color: rgba(52,211,153,.4); }
.step-chip.done .num { background: var(--success); color: #06281c; }

/* Program selection cards (onboarding) */
.prog-card { border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; background: var(--panel-2); transition: border-color 0.15s ease; }
.prog-card.selected { border-color: rgba(79,140,255,.55); background: var(--primary-soft); }

/* Brand mark for login */
.brand-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark img { width: 46px; height: 46px; border-radius: 12px; background: #fff; padding: 4px; }
.brand-mark .bm-name { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.5rem; color: #fff; }
.brand-mark .bm-sub { color: var(--text-muted); font-size: 0.85rem; }

/* misc helpers */
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 18px 0; }
.muted-link { color: var(--text-muted); }
.muted-link:hover { color: var(--text); }

/* ============ INVENTORY (end-level) ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; }
.kpi { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, var(--panel-2), var(--panel)); }
.kpi .icon-chip { width: 40px; height: 40px; font-size: 1.1rem; }
.kpi .k-val { font-size: 1.5rem; font-weight: 800; color: #fff; font-family: "Space Grotesk", sans-serif; line-height: 1; }
.kpi .k-lab { color: var(--text-muted); font-size: 0.82rem; font-weight: 600; margin-top: 3px; }

/* Distribution bars */
.dist { display: grid; gap: 9px; }
.dist-row { display: grid; grid-template-columns: 120px 1fr 38px; align-items: center; gap: 10px; }
.dist-row .d-name { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-track { height: 9px; border-radius: 999px; background: #0e1521; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.dist-row .d-count { font-size: 0.82rem; font-weight: 700; color: var(--text); text-align: right; }

/* Active filter chips */
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--primary-soft); color: #cfe0ff; border: 1px solid rgba(79,140,255,.3); }
.filter-chip button { border: 0; background: rgba(255,255,255,.08); color: inherit; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 0.7rem; line-height: 1; }
.filter-chip button:hover { background: rgba(255,255,255,.2); }

/* Sortable headers */
th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
th.th-sort:hover { color: #fff; }
th.th-sort .sort-ico { opacity: 0.35; margin-left: 4px; font-size: 0.72rem; }
th.th-sort.asc .sort-ico, th.th-sort.desc .sort-ico { opacity: 1; color: var(--primary-strong); }

/* Type icon in rows */
.type-ico { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--panel-hover); color: var(--text-muted); font-size: 0.9rem; flex: 0 0 auto; }
.sn-mono { font-family: "Space Grotesk", ui-monospace, monospace; font-size: 0.83rem; color: var(--text-muted); }

/* Stock cell */
.stock-num { font-weight: 800; font-family: "Space Grotesk", sans-serif; }

/* Bulk action bar */
.bulk-bar {
  position: sticky; bottom: 16px; z-index: 20;
  display: none; align-items: center; gap: 14px;
  margin: 14px auto 0; padding: 11px 16px; width: fit-content;
  background: rgba(21, 28, 40, 0.92); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.bulk-bar.show { display: flex; }
.bulk-bar .bb-count { font-weight: 700; color: #fff; }

.row-selected { background: rgba(79,140,255,.07) !important; }
.form-check-input { cursor: pointer; }

/* QR in modal / edit */
.qr-box { background: #fff; border-radius: 12px; padding: 14px; display: inline-block; }
.qr-box canvas { display: block; }

/* ============ ZEBRA LABELS (mm-genau) ============ */
.zlabel-grid { --lw: 50mm; --lh: 25mm; display: flex; flex-wrap: wrap; gap: 12px; }
.zlabel {
  width: var(--lw); height: var(--lh);
  background: #fff; color: #000;
  display: flex; align-items: center; gap: 1.6mm;
  padding: 1.6mm; box-sizing: border-box;
  border: 1px solid #c8d2de; border-radius: 2mm; overflow: hidden;
}
.zlabel canvas { height: calc(var(--lh) - 3.2mm); width: calc(var(--lh) - 3.2mm); flex: 0 0 auto; }
.zlabel .zl-text { min-width: 0; line-height: 1.15; }
.zlabel .zl-name { font-weight: 700; font-size: 7.5pt; color: #000; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zlabel .zl-code { font-size: 7pt; font-family: "Space Grotesk", ui-monospace, monospace; color: #222; margin-top: 0.5mm; }
.zlabel .zl-brand { font-size: 5pt; color: #666; margin-top: 0.6mm; letter-spacing: 0.04em; }
.zlabel.square { flex-direction: column; gap: 0.8mm; justify-content: center; padding: 1.5mm; }
.zlabel.square canvas { height: auto; width: calc(var(--lw) - 10mm); }
.zlabel.square .zl-name, .zlabel.square .zl-brand { display: none; }
.zlabel.square .zl-text { text-align: center; }
.zlabel.square .zl-code { font-size: 6.5pt; margin-top: 0; }

@media print {
  .sidebar, .mobile-topbar, .app-footer, .bulk-bar, .flash-stack, .no-print { display: none !important; }
  body.has-sidebar .content { margin-left: 0 !important; }
  .app-shell { padding: 0; max-width: none; margin: 0; }
  body { background: #fff !important; }
  .zlabel-grid { display: block; gap: 0; }
  .zlabel { height: calc(var(--lh) - 0.4mm); border: 0; border-radius: 0; margin: 0; break-inside: avoid; page-break-inside: avoid; }
}

/* ============ AUTH / LOGIN (Split-Screen) ============ */
.auth-split { display: flex; min-height: 100vh; }
.auth-hero {
  flex: 1.05; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 50px 54px;
  background:
    radial-gradient(820px 520px at 82% -12%, rgba(34, 211, 238, 0.26), transparent 60%),
    radial-gradient(720px 620px at -12% 105%, rgba(79, 140, 255, 0.34), transparent 55%),
    linear-gradient(150deg, #0f1a33, #0a0f1a 62%);
  border-right: 1px solid var(--line-soft);
}
.auth-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(165deg, #000, transparent 75%);
  mask-image: linear-gradient(165deg, #000, transparent 75%);
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 42px; height: 42px; border-radius: 11px; background: #fff; padding: 3px; }
.auth-brand .ab-name { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.35rem; color: #fff; letter-spacing: 0.3px; }
.auth-headline { font-family: "Space Grotesk", sans-serif; font-size: clamp(2rem, 3.2vw, 3rem); font-weight: 700; color: #fff; line-height: 1.08; margin: 0; }
.auth-headline .grad { background: linear-gradient(90deg, #6aa0ff, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-sub { color: var(--text-muted); margin-top: 16px; max-width: 440px; font-size: 1.03rem; line-height: 1.6; }
.auth-features { display: grid; gap: 14px; margin-top: 32px; }
.auth-feature { display: flex; align-items: center; gap: 13px; color: #ccd7e8; font-weight: 500; }
.auth-feature .icon-chip { width: 40px; height: 40px; font-size: 1.05rem; flex: 0 0 auto; }
.auth-foot { color: var(--text-dim); font-size: 0.85rem; }

.auth-panel { flex: 0.95; display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(400px, 100%); }
.auth-mobile-brand { display: none; margin-bottom: 24px; }
.ac-title { font-family: "Space Grotesk", sans-serif; font-size: 1.75rem; font-weight: 700; color: #fff; margin: 0; }
.ac-sub { color: var(--text-muted); margin: 6px 0 24px; }
.auth-card .form-control { padding-top: 11px; padding-bottom: 11px; }
.auth-card .btn-primary { padding: 11px; font-size: 1rem; }

@media (max-width: 900px) {
  .auth-hero { display: none; }
  .auth-panel { flex: 1; }
  .auth-mobile-brand { display: flex; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: var(--shadow); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  body.has-sidebar .content { margin-left: 0; }

  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    position: sticky; top: 0; z-index: 1030;
    background: rgba(12, 17, 25, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line-soft);
  }
  .hamburger { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); width: 40px; height: 40px; border-radius: 10px; font-size: 1.2rem; display: grid; place-items: center; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-family: "Space Grotesk", sans-serif; }
  .mobile-brand img { border-radius: 6px; background: #fff; padding: 1px; }
  .app-shell { margin-top: 18px; padding: 0 16px; }
}
