/*
 * PausalPro — Console design system
 * Ported from design_handoff_pausalpro_console/source/variant-console.jsx
 * Data-dense, keyboard-first, Stripe Sigma / Linear Insights vibe.
 */

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Root tokens ────────────────────────────────────────────────── */
.con {
  --ink:         #0b0d12;
  --ink-2:       #2c3340;
  --muted:       #6c7280;
  --muted-2:     #9ca2ad;
  --line:        #e6e8ec;
  --line-2:      #f0f1f4;
  --bg:          #f7f8fa;
  --paper:       #ffffff;
  --teal:        #0f766e;
  --teal-bright: #14b8a6;
  --teal-soft:   #ccfbf1;
  --teal-50:     #f0fdfa;
  --blue:        #1e40af;
  --amber:       #a16207;
  --red:         #991b1b;
  --green:       #15803d;

  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 12.5px;
  line-height: 1.45;
  min-height: 100vh;
}

html, body { margin: 0; padding: 0; height: 100%; }

.con .mono { font-family: 'JetBrains Mono', 'Geist Mono', monospace; font-feature-settings: 'tnum'; letter-spacing: -0.01em; }
.con .num  { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ── Topbar ─────────────────────────────────────────────────────── */
.con .topbar {
  display: flex; align-items: center; gap: 0; padding: 0 16px;
  height: 44px; background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.con .brand {
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px;
  letter-spacing: -0.005em; padding-right: 18px; border-right: 1px solid var(--line);
  height: 100%; text-decoration: none; color: inherit;
}
.con .brand img { height: 18px; width: auto; display: block; }
.con .ctxbar { display: flex; align-items: center; gap: 0; height: 100%; }
.con .ctx {
  display: flex; align-items: center; gap: 6px; padding: 0 12px; height: 100%;
  font-size: 12px; cursor: pointer; color: var(--ink-2);
  border-right: 1px solid var(--line); user-select: none; position: relative;
}
.con .ctx:hover { background: var(--bg); }
.con .ctx .lbl { color: var(--muted); font-size: 11px; }
.con .ctx .chev { color: var(--muted-2); font-size: 9px; margin-left: 4px; }
.con .topbar .right { margin-left: auto; display: flex; align-items: center; gap: 6px; height: 100%; }
.con .kbd {
  font-family: 'JetBrains Mono', monospace; padding: 1px 5px; border-radius: 3px;
  background: var(--bg); border: 1px solid var(--line); font-size: 10px; color: var(--muted);
}
.con .search {
  display: flex; align-items: center; gap: 8px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; width: 220px;
  font-size: 11.5px; color: var(--muted); cursor: pointer;
}
.con .search:hover { border-color: var(--ink-2); }
.con .avatar {
  width: 24px; height: 24px; border-radius: 4px; background: var(--ink);
  color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 600;
  margin-left: 6px; flex-shrink: 0;
}
.con .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.con .fiskal-status {
  display: flex; align-items: center; gap: 4px;
  padding: 0 8px; font-size: 11px; color: var(--muted);
  border-left: 1px solid var(--line); height: 100%;
}

/* Context dropdown */
.con .ctx-menu {
  position: absolute; top: 44px; left: 0; min-width: 200px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08); z-index: 100; padding: 4px 0;
}
.con .ctx-menu a {
  display: block; padding: 6px 12px; font-size: 12px; color: var(--ink-2);
  cursor: pointer; text-decoration: none;
}
.con .ctx-menu a:hover { background: var(--teal-50); color: var(--teal); }
.con .ctx-menu a.active { color: var(--teal); font-weight: 600; background: var(--teal-50); }
.con .ctx-menu .menu-label {
  padding: 6px 12px 3px; font-size: 10px; color: var(--muted-2); text-transform: uppercase;
  letter-spacing: 0.06em; font-family: 'JetBrains Mono', monospace;
}
.con .ctx-menu.menu-right { left: auto; right: 0; }
.con .topbar .right .support-ctx { border-right: none; border-left: 1px solid var(--line); white-space: nowrap; }

/* ── Tabs ───────────────────────────────────────────────────────── */
.con .tabs {
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 0 16px; display: flex; gap: 0; height: 36px;
  position: sticky; top: 44px; z-index: 40; font-size: 12px;
}
.con .tab {
  padding: 0 12px; height: 100%; display: flex; align-items: center; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-weight: 500; text-decoration: none; user-select: none;
}
.con .tab:hover { color: var(--ink); }
.con .tab.active { color: var(--ink); border-bottom-color: var(--teal-bright); }
.con .tab-count {
  margin-left: 6px; padding: 0 5px; height: 16px; line-height: 16px; border-radius: 3px;
  background: var(--bg); color: var(--muted); font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Page ───────────────────────────────────────────────────────── */
.con .page { padding: 14px 16px 60px; width: 100%; }
.con .pageHead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.con .pageHead h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.con .pageHead .sub {
  color: var(--muted); font-size: 11.5px; margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}
.con .crumbs {
  color: var(--muted); font-size: 11px; display: flex; gap: 5px; align-items: center;
  font-family: 'JetBrains Mono', monospace; margin-bottom: 4px;
}
.con .crumbs a { color: var(--muted); cursor: pointer; text-decoration: none; }
.con .crumbs a:hover { color: var(--ink); }

/* ── Cards ──────────────────────────────────────────────────────── */
.con .card { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.con .card-pad { padding: 14px 14px; }
.con .card-head {
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.con .card-head h3 { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em; }
.con .card-head .sub { color: var(--muted); font-size: 11px; font-family: 'JetBrains Mono', monospace; }

/* ── Grid helpers ───────────────────────────────────────────────── */
.con .grid  { display: grid; gap: 10px; }
.con .g2    { grid-template-columns: repeat(2, 1fr); }
.con .g3    { grid-template-columns: repeat(3, 1fr); }
.con .g4    { grid-template-columns: repeat(4, 1fr); }
.con .g5    { grid-template-columns: repeat(5, 1fr); }
.con .gauto { grid-template-columns: 2fr 1fr; }

/* ── KPI tiles ──────────────────────────────────────────────────── */
.con .kpi { padding: 12px 14px; }
.con .kpi .k {
  color: var(--muted); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 6px;
}
.con .kpi .v {
  font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
}
.con .kpi .v .unit { font-size: 14px; color: var(--muted); }
.con .kpi .d {
  margin-top: 8px; font-size: 11px; color: var(--muted);
  font-family: 'JetBrains Mono', monospace; display: flex; align-items: center; gap: 4px;
}
.con .delta-up   { color: var(--green); }
.con .delta-down { color: var(--red); }

/* ── Tables ─────────────────────────────────────────────────────── */
/* overflow visible so row dropdowns (.status-menu / .act-menu) aren't
   clipped at the bottom edge of the list */
.con .table-wrap { overflow: visible; }
.con table { width: 100%; border-collapse: collapse; font-size: 12px; }
.con thead { background: var(--bg); }
.con th {
  text-align: left; padding: 7px 10px; color: var(--muted); font-weight: 500;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-2); position: relative;
}
.con th:last-child { border-right: none; }
.con td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.con tr:last-child td { border-bottom: none; }
.con tr.clickable { cursor: pointer; }
.con tr.clickable:hover td { background: var(--teal-50); }
.con td.num, .con th.num {
  text-align: right; font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}
.con .customer-cell { display: flex; align-items: center; gap: 8px; }
.con .ini {
  width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center;
  font-size: 9.5px; font-weight: 600; color: #fff; flex-shrink: 0; letter-spacing: 0;
}
.con .nm { font-weight: 500; font-size: 12px; }
.con .em { color: var(--muted); font-size: 10.5px; font-family: 'JetBrains Mono', monospace; }
.con .row-id { font-family: 'JetBrains Mono', monospace; color: var(--muted); font-size: 11px; }

/* ── Badges ─────────────────────────────────────────────────────── */
.con .badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px;
  border-radius: 3px; font-size: 10px; font-weight: 500;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.02em; text-transform: uppercase;
}
.con .badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ── Status picker (inline dropdown on badge click) ─────────────── */
.con .status-picker { position: relative; display: inline-block; }
.con .status-picker .badge { cursor: pointer; user-select: none; }
.con .status-picker .badge .sp-caret { opacity: 0.55; font-size: 8px; margin-left: 2px; font-style: normal; }
.con .status-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 900;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.13);
  min-width: 168px; padding: 4px 0; white-space: nowrap;
}
.con .status-menu.open { display: block; }
/* flip upward when there isn't room below (last rows / short lists) */
.con .status-menu.flip-up { top: auto; bottom: calc(100% + 4px); }
.con .status-menu button {
  display: block; width: 100%; text-align: left; padding: 6px 12px;
  font-size: 11.5px; background: none; border: none; cursor: pointer;
  color: var(--ink); font-family: 'Inter', system-ui, sans-serif; line-height: 1;
}
.con .status-menu button:hover { background: var(--teal-50); color: var(--teal); }
.con .status-menu button.active { font-weight: 600; color: var(--teal); }
.con .status-menu .sm-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ── Action menu (⋯ row dropdown) ───────────────────────────────── */
.con .act-wrap { position: relative; display: inline-block; }
.con .act-menu {
  display: none; position: absolute; top: calc(100% + 4px); right: 0; left: auto; z-index: 900;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.13);
  min-width: 180px; padding: 4px 0; white-space: nowrap;
}
.con .act-menu.open { display: block; }
/* flip upward when there isn't room below (last rows / short lists) */
.con .act-menu.flip-up { top: auto; bottom: calc(100% + 4px); }
.con .act-menu a, .con .act-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left; padding: 7px 14px;
  font-size: 12px; background: none; border: none; cursor: pointer; text-decoration: none;
  color: var(--ink); font-family: 'Inter', system-ui, sans-serif; line-height: 1;
  box-sizing: border-box;
}
.con .act-menu a:hover, .con .act-menu button:hover { background: var(--teal-50); color: var(--teal); }
.con .act-menu .act-danger { color: var(--red) !important; }
.con .act-menu .act-danger:hover { background: #fee2e2 !important; color: var(--red) !important; }
.con .act-menu .sm-sep { height: 1px; background: var(--line); margin: 4px 0; }
.con .b-green  { background: #dcfce7; color: #15803d; }
.con .b-blue   { background: #dbeafe; color: #1e40af; }
.con .b-amber  { background: #fef3c7; color: #854d0e; }
.con .b-red    { background: #fee2e2; color: #991b1b; }
.con .b-teal   { background: var(--teal-soft); color: var(--teal); }
.con .b-grey   { background: #e5e7eb; color: #374151; }

/* ── Buttons ────────────────────────────────────────────────────── */
.con .btn {
  padding: 5px 10px; border-radius: 5px; font: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center;
  gap: 5px; white-space: nowrap; text-decoration: none; line-height: 1.4;
}
.con .btn-primary   { background: var(--teal); color: #fff; }
.con .btn-primary:hover { background: #0d6a64; }
.con .btn-success   { background: var(--green); color: #fff; }
.con .btn-success:hover { background: #126b34; }
.con .btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.con .btn-secondary:hover { background: var(--bg); border-color: var(--ink-2); }
.con .btn-ghost     { background: transparent; color: var(--ink-2); padding: 4px 7px; }
.con .btn-ghost:hover { background: var(--bg); }
.con .btn-danger    { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.con .btn-danger:hover { background: #fecaca; }
.con .btn-sm { padding: 3px 8px; font-size: 11px; }

/* ── Inputs ─────────────────────────────────────────────────────── */
.con input, .con select, .con textarea {
  font: inherit; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink);
  width: 100%; font-size: 12px;
}
.con input:focus, .con select:focus, .con textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft);
}
.con input.mono { font-family: 'JetBrains Mono', monospace; }
.con input[type="checkbox"] { width: auto; margin-top: 2px; }

/* ── Toolbar ────────────────────────────────────────────────────── */
.con .toolbar {
  display: flex; gap: 8px; align-items: center; padding: 8px 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px;
}

/* ── Sparkline + Bar charts ─────────────────────────────────────── */
.con .bars {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px;
  align-items: end; height: 90px; margin-top: 8px;
}
.con .bar-col { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; }
.con .bar { width: 100%; background: var(--teal); border-radius: 2px 2px 0 0; min-height: 2px; }
.con .bar.empty { background: var(--line); }
.con .bar-lbl { font-size: 9.5px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* ── Limit gauge ────────────────────────────────────────────────── */
.con .gauge {
  height: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  position: relative; overflow: hidden; margin-top: 8px;
}
.con .gauge .seg { position: absolute; top: 0; bottom: 0; }
.con .gauge .seg.used { left: 0; background: var(--teal); }
.con .gauge .seg.pending {
  background: repeating-linear-gradient(
    45deg, var(--amber), var(--amber) 4px, #ca8a04 4px, #ca8a04 8px
  );
  opacity: 0.7;
}
.con .gauge .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0,0,0,.08); }
.con .tick-lbl {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: 9.5px; color: var(--muted); font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* ── Flatpickr theme overrides ──────────────────────────────────── */
.flatpickr-calendar {
  font-family: 'Inter', system-ui, sans-serif; font-size: 12px;
  border: 1px solid #e6e8ec; border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.startRange, .flatpickr-day.endRange {
  background: #0f766e !important; border-color: #0f766e !important;
}
.flatpickr-day:hover { background: #f0fdfa; color: #0f766e; }
.flatpickr-day.today { border-color: #0f766e; }
.flatpickr-months .flatpickr-month,
.flatpickr-weekdays, span.flatpickr-weekday { background: #f7f8fa; color: #374151; }
.flatpickr-current-month .numInputWrapper span.arrowUp:after  { border-bottom-color: #0f766e; }
.flatpickr-current-month .numInputWrapper span.arrowDown:after { border-top-color: #0f766e; }

/* ── Form sections ──────────────────────────────────────────────── */
.con .form-section { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.con .form-section:last-child { border-bottom: none; }
.con .form-section h3 {
  font-size: 11px; margin: 0 0 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.con .form-row { display: grid; gap: 10px; margin-bottom: 10px; }
.con .lbl {
  font-size: 10.5px; color: var(--ink-2); margin-bottom: 4px; font-weight: 500; display: block;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.con .lbl .req { color: var(--red); }
.con .hint { font-size: 10.5px; color: var(--muted); margin-top: 3px; font-family: 'JetBrains Mono', monospace; }
.con .field { display: flex; flex-direction: column; }

/* Items table */
.con .items-table { width: 100%; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.con .items-table th { background: var(--bg); }
.con .items-table td { padding: 0; }
.con .items-table td input, .con .items-table td select {
  border: none; border-radius: 0; background: transparent; padding: 6px 8px; font-size: 12px;
}
.con .items-table td input:focus { box-shadow: inset 0 0 0 2px var(--teal); outline: none; }
.con .items-table tr:nth-child(even) td { background: var(--bg); }
.con .items-table .row-num {
  width: 30px; text-align: center; color: var(--muted);
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
}

/* ── Summary sidebar ────────────────────────────────────────────── */
.con .summary { position: sticky; top: 90px; }
.con .sum-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; }
.con .sum-row.tot {
  border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px;
  font-weight: 600; font-size: 14px;
}

/* ── Settings nav tree ──────────────────────────────────────────── */
.con .set-nav a {
  padding: 6px 10px; border-radius: 4px; font-size: 12px; color: var(--ink-2);
  cursor: pointer; display: block; text-decoration: none;
}
.con .set-nav a:hover { background: var(--bg); }
.con .set-nav a.active {
  background: var(--teal-50); color: var(--teal); font-weight: 600;
  border-left: 2px solid var(--teal); padding-left: 8px;
}

/* ── AUTH — split layout ────────────────────────────────────────── */
.con .auth {
  height: 100vh; width: 100%; display: grid;
  grid-template-columns: 460px 1fr; background: var(--paper);
}
.con .auth-left {
  background: #0b0d12; color: #d5d8df; padding: 28px 32px;
  display: flex; flex-direction: column; gap: 24px; position: relative; overflow: hidden;
}
.con .auth-left::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px; pointer-events: none;
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
}
.con .auth-left > * { position: relative; }
.con .auth-left .brand-dark {
  display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: #fff;
}
.con .auth-left .brand-dark img { height: 22px; filter: brightness(0) invert(1) opacity(0.95); }
.con .auth-left h2 {
  font-size: 22px; line-height: 1.25; letter-spacing: -0.02em;
  color: #fff; margin: 0; font-weight: 600; max-width: 340px;
}
.con .auth-left .feat { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: #9ca2ad; line-height: 1.5; }
.con .auth-left .feat .dot {
  width: 14px; height: 14px; border-radius: 3px; background: rgba(20,184,166,0.18);
  color: var(--teal-bright); display: grid; place-items: center;
  font-size: 9px; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; margin-top: 2px;
}
.con .auth-left .feat b { color: #e5e7eb; font-weight: 500; }
.con .auth-left .sysblock {
  margin-top: auto; padding-top: 20px; border-top: 1px solid #1f2229;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: #6c7280; line-height: 1.7;
}
.con .auth-left .sysblock .row { display: flex; gap: 6px; }
.con .auth-left .sysblock .row b { color: #9ca2ad; font-weight: 500; }
.con .auth-left .sysblock .stat { color: #14b8a6; }

.con .auth-right { padding: 48px 60px; display: flex; flex-direction: column; justify-content: center; }
.con .auth-card { width: 100%; max-width: 420px; }
.con .auth-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted);
  margin-bottom: 18px; display: flex; gap: 8px; align-items: center;
}
.con .auth-card h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 6px; }
.con .auth-card .lede { font-size: 12.5px; color: var(--muted); margin-bottom: 24px; line-height: 1.55; }
.con .auth-form { display: flex; flex-direction: column; gap: 14px; }
.con .auth-form .field input { padding: 9px 12px; font-size: 13px; }
.con .auth-form .field input.mono { font-size: 12.5px; }
.con .auth-form .row-split {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--muted);
}
.con .auth-form .row-split a { color: var(--teal); text-decoration: none; cursor: pointer; }
.con .auth-form .btn-big { padding: 10px 14px; font-size: 13px; justify-content: center; width: 100%; }
.con .divider {
  display: flex; align-items: center; gap: 10px; color: var(--muted);
  font-size: 10.5px; font-family: 'JetBrains Mono', monospace; margin: 6px 0;
}
.con .divider::before, .con .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.con .auth-foot { margin-top: 32px; font-size: 11.5px; color: var(--muted); }
.con .auth-foot a { color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none; }
.con .auth-foot a:hover { color: var(--teal); }
.con .check-row { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--ink-2); }

/* ── Onboarding ─────────────────────────────────────────────────── */
.con .auth.onboarding { grid-template-columns: 320px 1fr; }
.con .ob-steps { display: flex; flex-direction: column; gap: 2px; }
.con .ob-step {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border-radius: 5px; cursor: pointer;
}
.con .ob-step:hover { background: rgba(255,255,255,0.04); }
.con .ob-step .n {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid #2c3340;
  display: grid; place-items: center; font-size: 11px; font-family: 'JetBrains Mono', monospace;
  color: #9ca2ad; flex-shrink: 0;
}
.con .ob-step.done   .n { background: var(--teal); color: #fff; border-color: var(--teal); }
.con .ob-step.active .n { border-color: var(--teal-bright); color: var(--teal-bright); background: rgba(20,184,166,0.12); }
.con .ob-step .lbl-st { color: #9ca2ad; font-size: 12px; line-height: 1.4; }
.con .ob-step .lbl-st b { color: #fff; font-weight: 500; display: block; font-size: 12.5px; }
.con .ob-step .lbl-st .mini { font-size: 10.5px; color: #6c7280; font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.con .ob-right { padding: 36px 48px; overflow: auto; display: flex; flex-direction: column; }
.con .ob-head { margin-bottom: 22px; }
.con .ob-head .step-of {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted);
  margin-bottom: 8px; display: flex; gap: 8px; align-items: center;
}
.con .ob-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.con .ob-head .lede { font-size: 13px; color: var(--muted); max-width: 560px; line-height: 1.55; }
.con .ob-body { flex: 1; }
.con .ob-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line);
}
.con .ob-progress { display: flex; gap: 10px; align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); }
.con .ob-progress-bar { width: 120px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.con .ob-progress-bar .fill { height: 100%; background: var(--teal-bright); border-radius: 2px; transition: width 0.3s; }

/* ── Chips ──────────────────────────────────────────────────────── */
.con .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.con .chip {
  padding: 3px 8px; border-radius: 3px; background: var(--bg);
  border: 1px solid var(--line); font-size: 10.5px; font-family: 'JetBrains Mono', monospace;
  color: var(--ink-2);
}
.con .chip .x { color: var(--muted); margin-left: 4px; cursor: pointer; }

/* ── Dropzone ───────────────────────────────────────────────────── */
.con .dropzone {
  border: 1px dashed var(--line); border-radius: 6px; padding: 24px 18px;
  text-align: center; background: var(--bg); cursor: pointer;
}
.con .dropzone:hover { border-color: var(--teal); background: var(--teal-50); }
.con .dropzone .glyph {
  width: 36px; height: 36px; border-radius: 6px; background: var(--paper);
  border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 8px; font-size: 14px;
}
.con .dropzone .t  { font-size: 12.5px; font-weight: 500; }
.con .dropzone .h  { font-size: 11px; color: var(--muted); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }

/* ── Radio opt-tiles ────────────────────────────────────────────── */
.con .opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.con .opt { border: 1px solid var(--line); border-radius: 5px; padding: 12px 14px; cursor: pointer; background: var(--paper); }
.con .opt:hover { border-color: var(--ink-2); }
.con .opt.sel { border-color: var(--teal); background: var(--teal-50); box-shadow: inset 0 0 0 1px var(--teal); }
.con .opt .t { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.con .opt .t .pip {
  width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; flex-shrink: 0;
}
.con .opt.sel .t .pip { border-color: var(--teal); }
.con .opt.sel .t .pip::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.con .opt .h { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* ── Invoice document ───────────────────────────────────────────── */
.con .doc {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 36px 40px; min-height: 780px; box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* ── Timeline (audit log) ───────────────────────────────────────── */
.con .timeline { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.con .tl-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 8px 0; position: relative; }
.con .tl-item:not(:last-child)::before {
  content: ''; position: absolute; left: 8px; top: 22px; bottom: -4px;
  width: 1px; background: var(--line);
}
.con .tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin: 7px 0 0 5px; position: relative; z-index: 1; }
.con .tl-dot.muted { background: var(--line); border: 1px solid var(--muted-2); }
.con .tl-item .what { font-size: 12px; color: var(--ink); font-weight: 500; }
.con .tl-item .when { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.con .tl-item .by   { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* ── Alert / info block ─────────────────────────────────────────── */
.con .alert { padding: 10px 14px; border-radius: 5px; font-size: 12px; margin-bottom: 10px; }
.con .alert-info    { background: var(--teal-50); border: 1px solid var(--teal-soft); color: var(--teal); }
.con .alert-warning { background: #fef3c7; border: 1px solid #fde68a; color: #854d0e; }
.con .alert-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.con .alert-success { background: #dcfce7; border: 1px solid #bbf7d0; color: #15803d; }

/* ── Context dropdown (active) ──────────────────────────────────── */
.con .ctx .ctx-menu { display: none; }
.con .ctx.open .ctx-menu { display: block; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .con .auth { grid-template-columns: 1fr; }
  .con .auth-left { display: none; }
  .con .auth.onboarding { grid-template-columns: 1fr; }
  .con .g5 { grid-template-columns: repeat(2, 1fr); }
  .con .gauto { grid-template-columns: 1fr; }
}

/* ── Responsive table (rt) ──────────────────────────────────────── */
/*
 * Usage: add class="rt" to <table>, add data-title="Stupac" to every <td>.
 * On mobile (<640px): thead hidden, each row becomes a card, labels shown via ::before.
 * On desktop: normal table. Works alongside existing .table-wrap and .clickable.
 */
@media (max-width: 640px) {
  .con .table-wrap { overflow: visible; }

  /* Hide column headers */
  .con table.rt thead {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px; width: 1px; overflow: hidden;
  }

  /* Hide tfoot on mobile */
  .con table.rt tfoot { display: none; }

  /* Each row = stacked card */
  .con table.rt, .con table.rt tbody { display: block; }
  .con table.rt tbody tr {
    display: block;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    overflow: hidden;
  }
  .con table.rt tbody tr:last-child { margin-bottom: 0; }

  /* Clickable rows — disable row hover, keep individual cell tap */
  .con table.rt tr.clickable { cursor: default; }
  .con table.rt tr.clickable:hover td { background: none !important; }

  /* Each cell = label + value row */
  .con table.rt td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line-2);
    border-right: none;
    text-align: right;
    font-size: 12.5px;
  }
  .con table.rt td:last-child { border-bottom: none; }

  /* Label via data-title */
  .con table.rt td[data-title]::before {
    content: attr(data-title);
    font-size: 10px;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    flex-shrink: 0;
    padding-right: 12px;
    text-align: left;
  }

  /* Action/icon cells — right-aligned, no label */
  .con table.rt td.rt-act {
    justify-content: flex-end;
    padding: 6px 12px;
  }
  .con table.rt td.rt-act::before { display: none; }

  /* Customer cell — avatar left, name right */
  .con table.rt td .customer-cell { flex-direction: row-reverse; }
  .con table.rt td .ini { display: none; }

  /* num cells keep right-align */
  .con table.rt td.num { text-align: right; }
}

/* ── Per-page selector ───────────────────────────────────────────── */
.con .pp-select {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted);
}
.con .pp-select select {
  font-size: 11px; padding: 2px 4px; border: 1px solid var(--line);
  border-radius: 3px; background: var(--bg); color: var(--ink);
  font-family: 'JetBrains Mono', monospace; cursor: pointer;
}

/* ── Utility ────────────────────────────────────────────────────── */
.con .flex { display: flex; }
.con .flex-center { display: flex; align-items: center; }
.con .gap-4 { gap: 4px; }
.con .gap-6 { gap: 6px; }
.con .gap-8 { gap: 8px; }
.con .gap-10 { gap: 10px; }
.con .ml-auto { margin-left: auto; }
.con .text-muted { color: var(--muted); }
.con .text-right { text-align: right; }
.con .fw-600 { font-weight: 600; }
.con .mb-10 { margin-bottom: 10px; }
.con .mb-14 { margin-bottom: 14px; }

/* ── SweetAlert2 custom theme (pp-swal-*) ───────────────────────── */
/* SweetAlert2 montira popup u <body>, izvan .con — design tokeni se
   moraju ponoviti na njegovom kontejneru da var(--…) ne ispadne prazan
   (prozirna pozadina popupa). Vrijednosti drži u sinku s .con gore. */
.swal2-container {
  --ink:         #0b0d12;
  --ink-2:       #2c3340;
  --muted:       #6c7280;
  --muted-2:     #9ca2ad;
  --line:        #e6e8ec;
  --line-2:      #f0f1f4;
  --bg:          #f7f8fa;
  --paper:       #ffffff;
  --teal:        #0f766e;
  --teal-bright: #14b8a6;
  --teal-soft:   #ccfbf1;
  --teal-50:     #f0fdfa;
  --blue:        #1e40af;
  --amber:       #a16207;
  --red:         #991b1b;
  --green:       #15803d;
  --hover:       #f0f1f4;
}
.pp-swal-popup {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 13px !important;
  border-radius: 6px !important;
  border: 1px solid var(--line) !important;
  background: var(--bg) !important;
  color: var(--ink) !important;
  padding: 28px 28px 22px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.18) !important;
  max-width: 380px !important;
}
.pp-swal-popup .swal2-icon {
  transform: scale(0.72);
  margin: 0 auto 8px !important;
}
.pp-swal-popup .swal2-html-container,
.pp-swal-popup .swal2-content {
  font-size: 13px !important;
  color: var(--ink) !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  line-height: 1.5 !important;
}
.pp-swal-popup .swal2-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  padding: 0 0 10px !important;
}
.pp-swal-popup .swal2-textarea {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 13px !important;
  color: var(--ink) !important;
  background: var(--paper) !important;
  border: 1px solid var(--line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  margin: 0 0 14px !important;
  min-height: 120px !important;
}
.pp-swal-popup .swal2-textarea:focus {
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 2px var(--teal-50) !important;
}
.pp-swal-popup .swal2-footer {
  border-top: 1px solid var(--line-2) !important;
  margin: 14px 0 0 !important;
  padding: 10px 0 0 !important;
}
.pp-swal-popup .swal2-validation-message {
  background: transparent !important;
  color: var(--red) !important;
  font-size: 12px !important;
}
.pp-swal-popup .swal2-actions {
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  justify-content: flex-end !important;
  width: 100% !important;
}
.pp-swal-confirm,
.pp-swal-cancel {
  display: inline-flex !important;
  align-items: center !important;
  height: 30px !important;
  padding: 0 14px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  transition: opacity .15s !important;
  white-space: nowrap !important;
}
.pp-swal-confirm {
  background: var(--teal) !important;
  color: #fff !important;
  border-color: var(--teal) !important;
}
.pp-swal-confirm:hover  { opacity: .85 !important; }
.pp-swal-cancel  {
  background: var(--bg) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.pp-swal-cancel:hover   { background: var(--line-2) !important; }

/* ============================================================================
 * Help mode — launcher, task picker overlay, coach-marks
 * ========================================================================== */

/* Floating launcher */
#help-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 1200;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--teal); color: #fff; border: none; cursor: pointer;
  font-size: 22px; font-weight: 700; line-height: 1;
  box-shadow: 0 4px 14px rgba(15,118,110,.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
#help-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,118,110,.45); }

/* Task picker overlay */
#help-overlay {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(11,13,18,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
#help-overlay[hidden] { display: none; }
.help-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  width: 100%; max-width: 420px; box-shadow: 0 18px 50px rgba(11,13,18,.25);
  overflow: hidden;
}
.help-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 0; font-size: 15px; font-weight: 600; color: var(--ink);
}
.help-x {
  background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--muted-2); padding: 0 2px;
}
.help-x:hover { color: var(--ink); }
.help-sub { padding: 4px 16px 10px; font-size: 12px; color: var(--muted); }
.help-list { list-style: none; margin: 0; padding: 4px 8px 10px; }
.help-item {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 10px 10px; border-radius: 7px;
}
.help-item:hover { background: var(--teal-50); }
.help-item-ico {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 7px;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.help-item-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.help-item-naziv { font-size: 13px; font-weight: 600; color: var(--ink); }
.help-item-opis  { font-size: 11.5px; color: var(--muted); }
.help-item-go    { color: var(--muted-2); font-size: 18px; }
.help-item:hover .help-item-go { color: var(--teal); }

/* Coach-mark pin (pulsing badge on the target) */
#help-pin {
  position: fixed; z-index: 1250; width: 18px; height: 18px; padding: 0;
  border-radius: 50%; border: 2px solid #fff; cursor: pointer;
  background: var(--teal); box-shadow: 0 0 0 0 rgba(20,184,166,.6);
  animation: help-pulse 1.8s infinite;
}
#help-pin[hidden] { display: none; }
@keyframes help-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(20,184,166,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(20,184,166,0); }
  100% { box-shadow: 0 0 0 0 rgba(20,184,166,0); }
}

/* Highlight ring on the targeted control */
.help-target-on {
  outline: 2px solid var(--teal-bright) !important;
  outline-offset: 2px; border-radius: 6px;
}

/* Coach-mark bubble */
#help-coach {
  position: fixed; z-index: 1260; width: 260px;
  background: var(--ink); color: #fff; border-radius: 9px;
  padding: 12px 13px 10px; box-shadow: 0 10px 30px rgba(11,13,18,.35);
  font-size: 12.5px; line-height: 1.5;
}
#help-coach[hidden] { display: none; }
.help-coach-text b { color: var(--teal-soft); }
.help-coach-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.help-coach-step { font-size: 11px; color: var(--muted-2); }
.help-coach-skip {
  background: none; border: none; color: var(--muted-2); cursor: pointer;
  font-size: 11.5px; padding: 4px 6px;
}
.help-coach-skip:hover { color: #fff; }
.help-coach-next {
  background: var(--teal); color: #fff; border: none; border-radius: 5px;
  cursor: pointer; font-size: 11.5px; font-weight: 600; padding: 5px 12px;
  font-family: inherit;
}
.help-coach-next:hover { background: var(--teal-bright); }
.help-coach-arrow { position: absolute; width: 0; height: 0; }
.help-coach-arrow.top    { top: -7px;    border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid var(--ink); }
.help-coach-arrow.bottom { bottom: -7px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 7px solid var(--ink); }
