/* ============================================================
   Flameowl Admin — design system
   Ported from Flameowl-Admin reference, default theme: Ember
   ============================================================ */

/* ============ TOKENS ============ */
:root {
  --green: #37a86a;
  --green-d: #247a4b;
  --flame: #ff6600;
  --flame-d: #c96a22;
  --blue: #3f7bd6;
  --violet: #7a5ce0;
  --teal: #26a59a;
  --bad: #e0533a;

  --radius: 12px;

  --ink: #16201b;
  --mute: #67726b;
  --mute2: #a9b1aa;
  --line: #e4e8e1;
  --canvas: #f2efec;
  --card: #ffffff;

  /* Ember shell (default) */
  --shell: #ff6600;
  --shell-2: rgba(255, 255, 255, 0.16);
  --shell-3: rgba(255, 255, 255, 0.28);
  --shell-ink: #ffffff;
  --shell-mute: #ffd2b0;
  --mark-bg: #ff6600;
  --owl-filter: brightness(0) invert(1);

  --sans: 'Instrument Sans', system-ui, sans-serif;
  --disp: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --sb-w: 250px;

  --shadow-sm: 0 1px 2px rgba(20, 32, 26, 0.05), 0 1px 1px rgba(20, 32, 26, 0.04);
  --shadow: 0 4px 16px rgba(18, 30, 24, 0.07), 0 1px 3px rgba(18, 30, 24, 0.05);
  --shadow-lg: 0 24px 60px rgba(12, 22, 18, 0.22), 0 6px 18px rgba(12, 22, 18, 0.12);
}

[data-theme="forest"] {
  --shell: #0e1712;
  --shell-2: rgba(255, 255, 255, 0.06);
  --shell-3: rgba(255, 255, 255, 0.10);
  --shell-ink: #dbe6de;
  --shell-mute: #7d8f84;
  --mark-bg: #0e1712;
  --canvas: #eef1ec;
  --owl-filter: brightness(0) invert(1);
}
[data-theme="midnight"] {
  --shell: #0a0d0c;
  --shell-2: rgba(255, 255, 255, 0.06);
  --shell-3: rgba(255, 255, 255, 0.10);
  --shell-ink: #cdd8d0;
  --shell-mute: #6f7d74;
  --mark-bg: #0a0d0c;
  --canvas: #e9ece8;
  --owl-filter: brightness(0) invert(1);
}
[data-theme="slate"] {
  --shell: #f3f5f1;
  --shell-2: rgba(22, 32, 27, 0.05);
  --shell-3: rgba(22, 32, 27, 0.09);
  --shell-ink: #28332c;
  --shell-mute: #7a857d;
  --mark-bg: #16201b;
  --canvas: #eceee9;
  --owl-filter: brightness(0);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  background: var(--shell);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
#app, #root { height: 100%; }

.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(255, 102, 0, 0.3); }

/* ============ APP SHELL ============ */
.app { height: 100%; display: flex; flex-direction: column; background: var(--shell); }
.app__body { flex: 1; display: flex; min-height: 0; }
.main {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: var(--canvas);
  overflow: hidden;
}
.content { flex: 1; overflow: auto; padding: 26px 30px 60px; }
.content::-webkit-scrollbar { width: 11px; }
.content::-webkit-scrollbar-thumb {
  background: #cfd6cd; border-radius: 8px; border: 3px solid var(--canvas);
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sb-w); background: var(--shell);
  display: flex; flex-direction: column;
  padding: 18px 14px; flex-shrink: 0; transition: width 0.22s ease;
}
.sidebar__brand { padding: 6px 8px 20px; }
.brandlock { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.owlmark { display: block; flex-shrink: 0; filter: var(--owl-filter, brightness(0) invert(1)); }
.brandlock__txt {
  font-family: var(--disp); font-weight: 700; font-size: 14px; letter-spacing: 0.26em;
  color: var(--shell-ink); padding-left: 3px; line-height: 1;
}
.sidebar__nav {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px;
  margin: 0 -4px; padding: 0 4px;
}
.sidebar__nav::-webkit-scrollbar { width: 0; }
.navitem {
  display: flex; align-items: center; gap: 11px; width: 100%; border: 0;
  background: transparent; color: var(--shell-mute); padding: 9px 11px;
  border-radius: 9px; font-size: 13.5px; font-weight: 500;
  text-align: left; transition: 0.14s; position: relative;
}
.navitem:hover { background: var(--shell-2); color: var(--shell-ink); }
.navitem--on { background: var(--shell-3); color: #fff; }
.navitem--on .navitem__dot { background: #fff; }
.navitem__txt { white-space: nowrap; overflow: hidden; }
.navitem--sub { padding-left: 32px; font-weight: 450; }
.navitem__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--shell-mute); flex-shrink: 0; margin-left: 1px; transition: 0.14s;
}
.navgroup { margin-top: 7px; }
.navgroup__head {
  display: flex; align-items: center; gap: 11px; width: 100%; border: 0;
  background: transparent; color: var(--shell-mute); padding: 9px 11px;
  border-radius: 9px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; transition: 0.14s;
}
.navgroup__head:hover { color: var(--shell-ink); }
.navgroup__label { flex: 1; text-align: left; }
.navgroup__chev { transition: transform 0.2s; opacity: 0.7; }
.navgroup__chev--closed { transform: rotate(-90deg); }
.sidebar__foot {
  padding-top: 12px; margin-top: 8px;
  border-top: 1px solid var(--shell-2);
  display: flex; flex-direction: column; gap: 4px;
}
.userchip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; margin-top: 4px; }
.userchip:hover { background: var(--shell-2); }
.userchip__info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.userchip__name {
  font-size: 13px; font-weight: 600; color: var(--shell-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.userchip__role { font-size: 11.5px; color: var(--shell-mute); white-space: nowrap; }

/* ============ TOPBAR ============ */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 30px; border-bottom: 1px solid var(--line);
  background: #fff;
}
.topbar__menu {
  display: none;
  width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--mute);
  align-items: center; justify-content: center;
  transition: 0.15s;
}
.topbar__menu:hover { color: var(--ink); border-color: var(--mute2); }
.topbar__crumbs { flex: 0 1 auto; min-width: 0; }
.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* User avatar + dropdown */
.topbar__user { position: relative; }
.topbar__avatar-btn {
  background: transparent; border: 0; padding: 0;
  border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center;
  transition: box-shadow 0.15s;
}
.topbar__avatar-btn:hover {
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.18);
}
.topbar__pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 70;
  overflow: hidden;
}
.topbar__pop-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.topbar__pop-name {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  line-height: 1.2;
}
.topbar__pop-role {
  font-size: 11.5px; color: var(--mute);
  margin-top: 2px;
}
.topbar__pop-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 9px 11px;
  background: transparent; border: 0;
  border-radius: 7px;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--ink); cursor: pointer; text-align: left;
  transition: background 0.12s, color 0.12s;
}
.topbar__pop-item:hover { background: var(--canvas); color: var(--ink); }
.topbar__pop-item--danger { color: var(--ink); }
.topbar__pop-item--danger:hover { background: var(--canvas); color: var(--bad); }

/* Change-password modal */
.cp-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(14, 22, 18, 0.5);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: cp-fadeIn 0.18s ease;
}
@keyframes cp-fadeIn { from { opacity: 0; } to { opacity: 1; } }

.cp-modal {
  width: 100%; max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cp-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes cp-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.cp-modal__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.cp-modal__title {
  font-family: var(--disp);
  font-weight: 600; font-size: 19px;
  letter-spacing: -0.01em;
  margin: 0; color: var(--ink);
}
.cp-modal__sub {
  margin: 4px 0 0;
  font-size: 12.5px; color: var(--mute);
}
.cp-modal__close {
  background: transparent; border: 0; padding: 6px;
  border-radius: 8px; color: var(--mute); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cp-modal__close:hover { background: var(--canvas); color: var(--ink); }

.cp-form {
  padding: 18px 22px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.cp-field { display: flex; flex-direction: column; gap: 6px; }
.cp-field label {
  font-size: 12px; font-weight: 600; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.cp-field input {
  width: 100%; box-sizing: border-box;
  height: 40px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  font-family: inherit; font-size: 14px; color: var(--ink);
  outline: 0; transition: 0.15s;
}
.cp-field input:hover:not(:disabled) { border-color: var(--mute2); }
.cp-field input:focus {
  border-color: var(--flame);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.16);
}
.cp-field input:disabled { opacity: 0.6; cursor: not-allowed; }

.cp-msg {
  display: flex; align-items: center; gap: 7px;
  border-radius: 9px; padding: 9px 12px;
  font-size: 13px; font-weight: 500;
}
.cp-msg--error { background: rgba(224, 83, 58, 0.10); color: var(--bad); }
.cp-msg--ok    { background: rgba(55, 168, 106, 0.14); color: var(--green-d); }

.cp-modal__foot {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 6px;
}

/* Sidebar backdrop (only used on mobile) */
.sidebar-backdrop { display: none; }
.topbar__crumbs { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.crumb { color: var(--mute); font-weight: 500; }
.crumb--cur { color: var(--ink); font-weight: 600; }
.crumb__sep { color: var(--mute2); }
.topbar__tools { display: flex; align-items: center; gap: 10px; }
.topbar__search {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 11px; height: 38px; width: 300px;
  color: var(--mute); transition: 0.15s;
}
.topbar__search:focus-within {
  border-color: var(--flame);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.16);
}
.topbar__search input {
  border: 0; outline: 0; background: transparent; flex: 1;
  font-size: 13.5px; font-family: inherit; color: var(--ink);
}
.topbar__search kbd {
  font-family: var(--mono); font-size: 10.5px; color: var(--mute);
  background: var(--canvas); border: 1px solid var(--line);
  border-radius: 5px; padding: 2px 5px;
}
.topbar__date {
  display: flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; height: 38px; padding: 0 13px;
  font-size: 13px; font-weight: 500; color: var(--ink);
}
.topbar__date:hover { border-color: var(--mute2); }

.searchinput {
  position: relative; display: inline-flex; align-items: center;
  height: 38px;
}
.searchinput__icon {
  position: absolute; left: 12px; color: var(--mute); pointer-events: none;
}
.searchinput input {
  width: 100%; height: 38px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 32px 0 36px;
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  outline: 0; transition: 0.15s;
}
.searchinput input::placeholder { color: var(--mute); }
.searchinput input:focus {
  border-color: var(--flame);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.16);
}
.searchinput__clear {
  position: absolute; right: 8px; background: transparent; border: 0;
  color: var(--mute); display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 6px;
}
.searchinput__clear:hover { background: var(--canvas); color: var(--ink); }

.yearpicker {
  position: relative; display: inline-flex; align-items: center;
}
.yearpicker__icon {
  position: absolute; left: 12px; color: var(--mute); pointer-events: none;
  display: flex; align-items: center;
}
.yearpicker select {
  appearance: none; -webkit-appearance: none;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; height: 38px;
  padding: 0 32px 0 36px;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  cursor: pointer; transition: 0.15s;
}
.yearpicker select:hover { border-color: var(--mute2); }
.yearpicker select:focus { outline: 0; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.16); }
.yearpicker__chev {
  position: absolute; right: 11px; color: var(--mute); pointer-events: none;
  display: flex; align-items: center;
}
.yearpicker.is-disabled select { opacity: 0.5; cursor: not-allowed; }
.yearpicker.is-disabled .yearpicker__chev { opacity: 0.4; }

.periodpicker {
  display: inline-flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.iconbtn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--mute); position: relative; transition: 0.15s;
}
.iconbtn:hover { color: var(--ink); border-color: var(--mute2); }
.iconbtn--sm { width: 30px; height: 30px; border-radius: 8px; }
.iconbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.dotbadge {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--flame); border: 1.5px solid var(--card);
}

/* ============ PAGE HEADER ============ */
.screen { max-width: 1280px; margin: 0 auto; }
.pagehead { margin-bottom: 22px; }
.pagehead__row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.pagehead__row > div:first-child { flex: 1 1 auto; min-width: 0; }
.pagehead__title {
  font-family: var(--disp); font-size: 27px; font-weight: 600;
  letter-spacing: -0.02em; margin: 0; line-height: 1.15;
}
.pagehead__sub { margin: 5px 0 0; color: var(--mute); font-size: 14px; }
.pagehead__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.minikpis {
  display: flex; gap: 30px; margin-top: 18px; padding: 15px 20px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  width: fit-content; flex-wrap: wrap;
}
.minikpi { display: flex; flex-direction: column; gap: 3px; }
.minikpi__label {
  font-size: 11.5px; color: var(--mute); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.minikpi__value { font-size: 19px; font-weight: 600; color: var(--ink); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 10px; border: 1px solid transparent;
  font-family: inherit; font-weight: 600; font-size: 13.5px;
  padding: 0 15px; height: 38px; transition: 0.15s; white-space: nowrap;
}
.btn--sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn--primary { background: var(--flame); color: #fff; box-shadow: 0 1px 2px rgba(180, 90, 20, 0.25); }
.btn--primary:hover { background: var(--flame-d); }
.btn--default { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn--default:hover { border-color: var(--mute2); }
.btn--ghost { background: transparent; color: var(--mute); border-color: transparent; }
.btn--ghost:hover { background: var(--card); color: var(--ink); border-color: var(--line); }

/* ============ CARDS ============ */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card--pad { padding: 20px; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__title { font-family: var(--disp); font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.card__sub { margin: 3px 0 0; font-size: 12.5px; color: var(--mute); }
.card__link {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 12.5px; font-weight: 600; color: var(--flame-d); text-decoration: none;
}
.card__link:hover { gap: 5px; }

.card-tabs {
  display: flex; gap: 18px;
  border-bottom: 1px solid var(--line);
  margin: -4px 0 0;
}
.card-tab {
  background: transparent; border: 0;
  padding: 4px 0 10px;
  margin-bottom: -1px;
  font-family: var(--disp);
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--mute2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.card-tab:hover { color: var(--mute); }
.card-tab.is-active { color: var(--ink); border-bottom-color: var(--flame); }

/* ============ STATS ============ */
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stats3 > .stat:only-child { max-width: 360px; }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stats5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 18px; }
.stats-flex {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow-sm);
}
.stat__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.stat__label { font-size: 12.5px; color: var(--mute); font-weight: 500; }
.stat__icon {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--canvas); color: var(--mute);
}
.stat__value { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; }
.stat__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; gap: 8px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; }
.delta--up { color: var(--green-d); }
.delta--down { color: var(--flame-d); }

/* ============ GRIDS ============ */
.grid2 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid2b { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }

/* ============ CHARTS ============ */
.chartwrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__xlab { fill: var(--mute); font-size: 10px; font-family: var(--mono); }
.chart__cursor { stroke: var(--mute2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart__tip {
  position: absolute; top: 6px; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 9px; padding: 9px 11px;
  font-size: 11.5px; pointer-events: none; box-shadow: var(--shadow-lg); min-width: 148px;
}
.chart__tipm { font-weight: 600; margin-bottom: 6px; font-family: var(--mono); font-size: 11px; opacity: 0.8; }
.chart__tipr { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.chart__tipr b { margin-left: auto; font-family: var(--mono); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--green { background: var(--green); }
.dot--flame { background: var(--flame); }
.legend-inline { display: flex; gap: 14px; font-size: 12px; color: var(--mute); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }

.donutwrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut { flex-shrink: 0; }
.donut__val { font-size: 17px; font-weight: 600; fill: var(--ink); }
.donut__lab { font-size: 10px; fill: var(--mute); text-transform: uppercase; letter-spacing: 0.08em; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 150px; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend__dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.legend__name { color: var(--ink); flex: 1; }
.legend__val { color: var(--mute); font-weight: 500; }

.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.barlist li { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.barlist__name { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barlist__track { height: 8px; background: var(--canvas); border-radius: 5px; overflow: hidden; }
.barlist__fill {
  display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--green), var(--teal));
}
.barlist__val { color: var(--mute); font-weight: 500; font-size: 12.5px; }

/* Privacy blur for charts when data is hidden */
.dash-blur {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.18s ease;
}

/* ============ NATIVE TABLE ============ */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--card);
}
.table td {
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  color: var(--ink); white-space: nowrap;
}
.table tr:last-child td { border-bottom: 0; }
.table--compact td { padding: 9px 16px; }
.table--comfy td { padding: 17px 16px; }

/* ============ BALANCE SHEET ============ */
.bs-recon {
  display: flex; align-items: stretch; gap: 4px;
  padding: 18px 20px; margin-bottom: 18px;
}
.bs-recon__cell { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bs-recon__cell--result {
  background: var(--canvas); border-radius: 10px; padding: 10px 14px; margin: -10px 0;
  justify-content: center;
}
.bs-recon__label {
  font-size: 11.5px; font-weight: 600; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.bs-recon__value { font-size: 21px; font-weight: 600; color: var(--ink); }
.bs-recon__hint { font-size: 12px; color: var(--mute); }
.bs-recon__op {
  align-self: center; padding: 0 10px;
  font-family: var(--mono); font-size: 20px; color: var(--mute2);
}

.bs-table th.num, .bs-table td.num { text-align: right; }
.bs-table tbody tr.is-idle td { color: var(--mute2); }
.bs-table tfoot td {
  border-top: 2px solid var(--line); border-bottom: 0;
  background: var(--canvas); font-weight: 600;
}
.bs-zero { color: var(--mute2); }
.bs-pos { color: var(--green-d); }
.bs-neg { color: var(--bad); }

@media (max-width: 768px) {
  .bs-recon { flex-direction: column; gap: 10px; }
  .bs-recon__op { display: none; }
  .bs-recon__cell--result { margin: 0; }
  .bs-table { font-size: 12.5px; }
  .bs-table td, .bs-table th { padding-left: 10px; padding-right: 10px; }
}

/* ============ BADGES ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 20px; padding: 3px 10px;
  font-size: 11.5px; font-weight: 600;
  text-transform: capitalize; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--good { background: rgba(55, 168, 106, 0.14); color: var(--green-d); }
.badge--bad { background: rgba(224, 83, 58, 0.13); color: var(--bad); }
.badge--warn { background: rgba(255, 102, 0, 0.15); color: var(--flame-d); }
.badge--info { background: rgba(63, 123, 214, 0.13); color: var(--blue); }
.badge--neutral { background: var(--canvas); color: var(--mute); }

/* ============ AVATAR ============ */
.avatar {
  display: inline-grid; place-items: center; border-radius: 50%;
  font-family: var(--disp); font-weight: 600; flex-shrink: 0;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .stats3 { grid-template-columns: repeat(2, 1fr); }
  .stats4 { grid-template-columns: repeat(2, 1fr); }
  .stats5 { grid-template-columns: repeat(3, 1fr); }
  .grid2, .grid2b { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* Sidebar becomes an off-canvas drawer.
     Specificity is bumped (.app .sidebar) so it overrides sb-admin-2's own
     .sidebar mobile rules loaded earlier in the cascade. */
  .app aside.sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 260px !important;
    padding: 18px 14px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.30);
    background: var(--shell);
  }
  .app.is-sidebar-open aside.sidebar { transform: translateX(0); }

  .sidebar-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(14, 22, 18, 0.45);
    backdrop-filter: blur(2px);
    z-index: 50;
    opacity: 0; pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .app.is-sidebar-open .sidebar-backdrop {
    opacity: 1; pointer-events: auto;
  }

  /* Main panel fills the viewport */
  .app__body { display: block; }
  .main { width: 100%; min-height: 100vh; }

  /* Topbar: show hamburger */
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar__menu { display: inline-flex; }
  .topbar__crumbs { font-size: 13px; }

  /* Content */
  .content { padding: 18px 16px 50px; }
  .stats3, .stats4, .stats5 { grid-template-columns: 1fr; }
  .minikpis { gap: 18px; }
  .pagehead__row { gap: 12px; }
  .pagehead__title { font-size: 22px; }
}

/* Lock page scroll while the drawer is open */
.app.is-sidebar-open { overflow: hidden; }

/* ============================================================
   PrimeReact override layer — aligns PrimeReact components with
   the Flameowl design tokens. Keep this AFTER the lara-light-amber
   theme import in App.tsx so these rules win.
   ============================================================ */

.p-component { font-family: var(--sans); font-size: 13.5px; }

/* Buttons */
.p-button {
  font-family: inherit; font-weight: 600; font-size: 13.5px;
  border-radius: 10px; padding: 0 15px; height: 38px;
  background: var(--flame); border-color: var(--flame); color: #fff;
  box-shadow: 0 1px 2px rgba(180, 90, 20, 0.25);
  transition: 0.15s;
}
.p-button:enabled:hover, .p-button:not(button):not(a):not(.p-disabled):hover {
  background: var(--flame-d); border-color: var(--flame-d);
}
.p-button.p-button-secondary, .p-button.p-button-outlined {
  background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: none;
}
.p-button.p-button-secondary:enabled:hover, .p-button.p-button-outlined:enabled:hover {
  background: var(--canvas); color: var(--ink); border-color: var(--mute2);
}
.p-button.p-button-text {
  background: transparent; color: var(--mute); border-color: transparent; box-shadow: none;
}
.p-button.p-button-text:enabled:hover {
  background: var(--canvas); color: var(--ink);
}
.p-button.p-button-danger { background: var(--bad); border-color: var(--bad); }
.p-button.p-button-danger:enabled:hover { background: #b13a26; border-color: #b13a26; }
.p-button.p-button-warning { background: #f2a23a; border-color: #f2a23a; }
.p-button.p-button-warning:enabled:hover { background: #d8861a; border-color: #d8861a; }
.p-button.p-button-success { background: var(--green); border-color: var(--green); }
.p-button.p-button-success:enabled:hover { background: var(--green-d); border-color: var(--green-d); }
.p-button.p-button-info { background: var(--blue); border-color: var(--blue); }
.p-button.p-button-info:enabled:hover { background: #2f63b3; border-color: #2f63b3; }

/* Size variants */
.p-button.p-button-sm {
  height: 32px; padding: 0 12px;
  font-size: 12.5px; border-radius: 8px;
}
.p-button.p-button-lg {
  height: 44px; padding: 0 18px;
  font-size: 14.5px; border-radius: 11px;
}

/* Icon-only buttons are square */
.p-button.p-button-icon-only { width: 38px; padding: 0; justify-content: center; }
.p-button.p-button-icon-only.p-button-sm { width: 32px; }
.p-button.p-button-icon-only.p-button-lg { width: 44px; }

/* Internal icon spacing */
.p-button .p-button-icon-left { margin-right: 7px; }
.p-button .p-button-icon-right { margin-left: 7px; }
.p-button .p-button-icon-only,
.p-button.p-button-icon-only .p-button-icon-left,
.p-button.p-button-icon-only .p-button-icon-right { margin: 0; }

/* Row of table action buttons */
.row-actions { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Convert action (invoice <-> quotation).
   A quiet pill that sits next to the document number without competing with it.
   `white-space: nowrap` is the important bit: these live in a narrow column and
   the label was breaking across two lines around the icon. */
.p-button.btn-convert {
  white-space: nowrap;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--mute);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.p-button.btn-convert .p-button-icon-left,
.p-button.btn-convert .p-button-icon-right { font-size: 11px; transition: transform 0.15s ease; }
.p-button.btn-convert .p-button-icon-left { margin-right: 6px; }
.p-button.btn-convert .p-button-icon-right { margin-left: 6px; }

/* Direction cue: on hover the arrow leans the way the document is heading. */
.p-button.btn-convert--back:enabled:hover {
  color: var(--flame-d);
  border-color: rgba(255, 102, 0, 0.45);
  background: rgba(255, 102, 0, 0.07);
}
.p-button.btn-convert--back:enabled:hover .p-button-icon-left { transform: translateX(-2px); }

.p-button.btn-convert--fwd:enabled:hover {
  color: var(--blue);
  border-color: rgba(63, 123, 214, 0.45);
  background: rgba(63, 123, 214, 0.08);
}
.p-button.btn-convert--fwd:enabled:hover .p-button-icon-right { transform: translateX(2px); }

.p-button.btn-convert:enabled:active { transform: translateY(1px); }
.p-button.btn-convert:focus-visible { outline: 2px solid rgba(255, 102, 0, 0.35); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .p-button.btn-convert,
  .p-button.btn-convert .p-button-icon-left,
  .p-button.btn-convert .p-button-icon-right { transition: none; }
  .p-button.btn-convert:enabled:hover .p-button-icon-left,
  .p-button.btn-convert:enabled:hover .p-button-icon-right { transform: none; }
}

/* Inputs (base) */
.p-inputtext, .p-inputtextarea, .p-inputnumber-input, .p-password-input,
.p-dropdown, .p-multiselect, .p-calendar > .p-inputtext {
  font-family: inherit; font-size: 13.5px;
  border-radius: 9px; border: 1px solid var(--line);
  color: var(--ink); background: var(--card);
  transition: 0.15s; box-shadow: none;
}
.p-inputtext, .p-inputnumber-input, .p-password-input,
.p-calendar > .p-inputtext {
  height: 38px; padding: 0 11px;
}
.p-inputtextarea { padding: 8px 11px; height: auto; min-height: 38px; line-height: 1.5; }
.p-inputtext:enabled:hover,
.p-dropdown:not(.p-disabled):hover,
.p-multiselect:not(.p-disabled):hover {
  border-color: var(--mute2);
}
.p-inputtext:enabled:focus, .p-inputnumber-input:focus,
.p-password-input:enabled:focus, .p-calendar > .p-inputtext:focus,
.p-dropdown:not(.p-disabled).p-focus,
.p-multiselect:not(.p-disabled).p-focus {
  border-color: var(--flame);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.16);
  outline: 0;
}
.p-inputtext::placeholder, .p-dropdown .p-dropdown-label.p-placeholder,
.p-multiselect .p-multiselect-label.p-placeholder {
  color: var(--mute);
}

/* Form fluid containers: inputs fill width */
.p-fluid .p-inputtext, .p-fluid .p-inputtextarea, .p-fluid .p-password-input,
.p-fluid .p-dropdown, .p-fluid .p-multiselect, .p-fluid .p-calendar,
.p-fluid .p-inputnumber, .p-fluid .p-inputnumber .p-inputnumber-input {
  width: 100%;
}
.p-calendar { display: inline-flex; }

/* Dropdown */
.p-dropdown {
  display: inline-flex; align-items: center; width: 100%;
  height: 38px; padding: 0;
}
.p-dropdown .p-dropdown-label {
  padding: 0 11px; line-height: 38px;
  border: 0; background: transparent;
  font-size: 13.5px; color: var(--ink);
  flex: 1; min-width: 0;
}
.p-dropdown .p-dropdown-clear-icon {
  right: 36px; color: var(--mute);
}
.p-dropdown .p-dropdown-trigger {
  width: 34px; background: transparent; color: var(--mute);
  border-left: 0; display: grid; place-items: center;
}
.p-dropdown .p-dropdown-trigger .p-dropdown-trigger-icon {
  font-size: 11px;
}

/* Dropdown panel (popup) */
.p-dropdown-panel,
.p-multiselect-panel,
.p-autocomplete-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-top: 4px;
  font-family: var(--sans);
}
.p-dropdown-panel .p-dropdown-header,
.p-multiselect-panel .p-multiselect-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}
.p-dropdown-panel .p-dropdown-filter,
.p-multiselect-panel .p-multiselect-filter {
  font-family: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 0 11px 0 32px; height: 34px;
  background: var(--canvas); color: var(--ink);
}
.p-dropdown-panel .p-dropdown-filter:focus,
.p-multiselect-panel .p-multiselect-filter:focus {
  border-color: var(--flame); background: var(--card);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.16); outline: 0;
}
.p-dropdown-panel .p-dropdown-filter-icon,
.p-multiselect-panel .p-multiselect-filter-icon {
  color: var(--mute); left: 11px; font-size: 13px;
}
.p-dropdown-panel .p-dropdown-items,
.p-multiselect-panel .p-multiselect-items {
  padding: 6px;
}
.p-dropdown-panel .p-dropdown-item,
.p-multiselect-panel .p-multiselect-item {
  padding: 8px 11px; border-radius: 7px;
  font-size: 13.5px; color: var(--ink);
  transition: background 0.12s, color 0.12s;
}
.p-dropdown-panel .p-dropdown-item:hover,
.p-multiselect-panel .p-multiselect-item:hover {
  background: var(--canvas); color: var(--ink);
}
.p-dropdown-panel .p-dropdown-item.p-highlight,
.p-multiselect-panel .p-multiselect-item.p-highlight {
  background: rgba(255, 102, 0, 0.12);
  color: var(--flame-d); font-weight: 600;
}
.p-dropdown-panel .p-dropdown-empty-message,
.p-multiselect-panel .p-multiselect-empty-message {
  padding: 14px 12px; color: var(--mute); font-size: 13px; text-align: center;
}

/* Calendar / InputNumber wrappers */
.p-calendar { width: auto; }
.p-calendar .p-button {
  background: var(--card); border: 1px solid var(--line); border-left: 0;
  border-top-right-radius: 9px; border-bottom-right-radius: 9px;
  color: var(--mute); box-shadow: none; height: 38px; width: 38px;
}
.p-calendar .p-button:enabled:hover {
  background: var(--canvas); border-color: var(--mute2); color: var(--ink);
}
.p-calendar > .p-inputtext {
  border-top-right-radius: 0; border-bottom-right-radius: 0;
}

/* Datepicker overlay */
.p-datepicker {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 12px; font-family: var(--sans);
}
.p-datepicker .p-datepicker-header {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 6px 0 10px; font-weight: 600; color: var(--ink);
}
.p-datepicker .p-datepicker-prev, .p-datepicker .p-datepicker-next {
  color: var(--mute); width: 30px; height: 30px;
}
.p-datepicker .p-datepicker-prev:hover, .p-datepicker .p-datepicker-next:hover {
  background: var(--canvas); color: var(--ink);
}
.p-datepicker table { font-size: 13px; }
.p-datepicker table th { color: var(--mute); font-weight: 600; padding: 6px 0; }
.p-datepicker table td { padding: 2px; }
.p-datepicker table td > span {
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--ink); transition: background 0.12s, color 0.12s;
}
.p-datepicker table td > span:hover { background: var(--canvas); }
.p-datepicker table td > span.p-highlight {
  background: var(--flame); color: #fff; font-weight: 600;
}
.p-datepicker table td.p-datepicker-today > span {
  background: rgba(255, 102, 0, 0.10); color: var(--flame-d);
}

/* InputNumber buttons */
.p-inputnumber { display: inline-flex; align-items: stretch; width: auto; }
.p-inputnumber-buttons-stacked .p-inputnumber-button,
.p-inputnumber-buttons-horizontal .p-inputnumber-button {
  background: var(--card); border: 1px solid var(--line);
  color: var(--mute); width: 32px;
}
.p-inputnumber-buttons-stacked .p-inputnumber-button:enabled:hover,
.p-inputnumber-buttons-horizontal .p-inputnumber-button:enabled:hover {
  background: var(--canvas); border-color: var(--mute2); color: var(--ink);
}

/* MultiSelect trigger */
.p-multiselect {
  display: inline-flex; align-items: center; height: 38px;
}
.p-multiselect .p-multiselect-label {
  padding: 0 11px; line-height: 38px;
  font-size: 13.5px; color: var(--ink);
}
.p-multiselect .p-multiselect-trigger {
  width: 34px; color: var(--mute);
}

/* DataTable */
.p-datatable {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.p-datatable .p-datatable-header {
  background: var(--card); border: 0; border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}
.p-datatable .p-datatable-thead > tr > th {
  background: var(--card); color: var(--mute);
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 11px 16px; border-bottom: 1px solid var(--line); border-top: 0;
}
.p-datatable .p-datatable-tbody > tr > td {
  padding: 13px 16px; font-size: 13.5px; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.p-datatable .p-datatable-tbody > tr:last-child > td { border-bottom: 0; }
.p-datatable .p-datatable-tbody > tr:hover {
  background: rgba(255, 102, 0, 0.04);
}
.p-paginator {
  background: var(--card); border: 0; border-top: 1px solid var(--line);
  padding: 10px 16px;
}
.p-paginator .p-paginator-page.p-highlight {
  background: var(--flame); border-color: var(--flame); color: #fff;
}

/* Dialog */
.p-dialog {
  border-radius: 16px; box-shadow: var(--shadow-lg);
  min-width: auto; max-width: 720px; width: 92vw; overflow: hidden;
}
.p-dialog .p-dialog-header {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 18px 22px; font-family: var(--disp); font-weight: 600;
  font-size: 18px; color: var(--ink);
}
.p-dialog .p-dialog-content {
  background: var(--card); padding: 20px 22px;
}
.p-dialog .p-dialog-footer {
  background: var(--canvas); border-top: 1px solid var(--line); padding: 14px 22px;
}
.p-dialog-mask.p-component-overlay { background: rgba(14, 22, 18, 0.5); backdrop-filter: blur(3px); }

/* Message */
.p-message { border-radius: 10px; border: 0; font-size: 13px; }
.p-message.p-message-error { background: rgba(224, 83, 58, 0.12); color: var(--bad); }
.p-message.p-message-success { background: rgba(55, 168, 106, 0.14); color: var(--green-d); }
.p-message.p-message-warn { background: rgba(255, 102, 0, 0.14); color: var(--flame-d); }
.p-message.p-message-info { background: rgba(63, 123, 214, 0.13); color: var(--blue); }

/* Progress spinner */
.p-progress-spinner-svg { width: 30px; height: 30px; }
.loading-center {
  width: 60px; height: 60px; position: fixed; z-index: 1000;
  top: calc(50vh - 30px); left: calc(50vw - 30px);
}
.loading-center .p-progress-spinner-svg { width: 60px; height: 60px; }

/* ============ LOGIN (ported from Flameowl-Login reference) ============ */
.lo-stage {
  --lo-flame: #FF6A1A;
  --lo-flame-bright: #FF8A2B;
  --lo-flame-deep: #E2540B;
  --ember: #FFB25A;
  --lo-paper: #FBF9F7;
  --lo-surface: #FFFFFF;
  --lo-text: #1A1411;
  --lo-text-soft: #5C534D;
  --lo-muted: #9A8F87;
  --lo-line: #ECE6E0;
  --lo-line-strong: #DED6CE;
  --lo-field: #F6F2EE;
  --lo-danger: #D6452B;
  --ok: #1E9E5A;
  --lo-rlg: 26px;
  --lo-rmd: 13px;
  --lo-rsm: 9px;
  --lo-disp: "Space Grotesk", system-ui, sans-serif;
  --lo-body: "Manrope", system-ui, sans-serif;

  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  font-family: var(--lo-body);
  background:
    radial-gradient(900px 600px at 18% 30%, rgba(255,106,26,0.10), transparent 60%),
    radial-gradient(1000px 700px at 85% 90%, rgba(226,84,11,0.10), transparent 55%);
  background-color: #0A0705;
  color: var(--lo-text);
}

.lo-frame {
  position: relative;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  width: min(1060px, 95vw);
  height: min(700px, 92vh);
  background: var(--lo-surface);
  border-radius: var(--lo-rlg);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04),
    0 40px 90px -30px rgba(0,0,0,0.8),
    0 0 0 1px rgba(255,255,255,0.04);
  animation: lo-frameIn 0.7s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes lo-frameIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

/* Brand panel */
.lo-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 118%, rgba(255,138,43,0.55), transparent 55%),
    radial-gradient(90% 70% at 50% 120%, rgba(226,84,11,0.6), transparent 60%),
    linear-gradient(180deg, #140D08 0%, #0C0806 60%, #080605 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 38px 36px 34px;
  isolation: isolate;
}
.lo-panel::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(80% 50% at 50% -10%, rgba(255,178,90,0.18), transparent 60%);
  pointer-events: none;
  z-index: 3;
}
.lo-panel::before {
  content: "";
  position: absolute; left: -10%; right: -10%; bottom: -18%;
  height: 60%;
  background:
    radial-gradient(60% 100% at 50% 100%, rgba(255,138,43,0.5), transparent 70%),
    radial-gradient(40% 80% at 32% 100%, rgba(255,106,26,0.45), transparent 72%),
    radial-gradient(40% 80% at 70% 100%, rgba(255,178,90,0.4), transparent 72%);
  filter: blur(6px);
  z-index: 2; pointer-events: none;
  transform-origin: 50% 100%;
  animation: lo-flicker 3.4s ease-in-out infinite;
}
@keyframes lo-flicker {
  0% { opacity: 0.75; transform: scaleY(1) scaleX(1) translateX(0); }
  20% { opacity: 0.95; transform: scaleY(1.06) scaleX(0.98) translateX(-4px); }
  40% { opacity: 0.68; transform: scaleY(0.97) scaleX(1.03) translateX(3px); }
  60% { opacity: 0.9; transform: scaleY(1.04) scaleX(0.99) translateX(-2px); }
  80% { opacity: 0.72; transform: scaleY(0.99) scaleX(1.02) translateX(2px); }
  100% { opacity: 0.75; transform: scaleY(1) scaleX(1) translateX(0); }
}
.lo-embers {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 8; pointer-events: none;
}

/* Owl emblem with idle animation chain */
.lo-owl-emblem {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  pointer-events: none;
}
.lo-owl-emblem::before {
  content: "";
  position: absolute;
  width: 46%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,43,0.42), rgba(255,106,26,0.12) 45%, transparent 68%);
  filter: blur(8px);
  animation: lo-owlGlow 4.2s ease-in-out infinite;
}
@keyframes lo-owlGlow {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}
.lo-owl-bob { width: 52%; animation: lo-owlBob 4.6s ease-in-out infinite; }
@keyframes lo-owlBob {
  0%, 100% { transform: translateY(4px); }
  50% { transform: translateY(-8px); }
}
.lo-owl-flutter { width: 100%; animation: lo-owlFlutter 6.5s ease-in-out infinite; }
@keyframes lo-owlFlutter {
  0%, 86%, 100% { transform: scaleX(1) scaleY(1); }
  89% { transform: scaleX(1.05) scaleY(0.95); }
  92% { transform: scaleX(0.97) scaleY(1.04); }
  95% { transform: scaleX(1.03) scaleY(0.98); }
  98% { transform: scaleX(0.99) scaleY(1.01); }
}
.lo-owl-img {
  display: block; width: 100%;
  opacity: 0.94;
  filter: drop-shadow(0 12px 38px rgba(255,106,26,0.5));
  transform-origin: 50% 60%;
  animation: lo-owlSway 8.5s ease-in-out infinite;
}
@keyframes lo-owlSway {
  0%, 100% { transform: rotate(-1.6deg) scale(1); }
  25% { transform: rotate(0.8deg) scale(1.018); }
  50% { transform: rotate(1.8deg) scale(1); }
  75% { transform: rotate(-0.5deg) scale(1.018); }
}

.lo-panel-foot {
  position: relative; z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: rgba(255,255,255,0.42);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
}
.lo-secure { display: flex; align-items: center; gap: 7px; }

/* Form side */
.lo-form-side {
  position: relative;
  background: var(--lo-surface);
  display: flex; flex-direction: column;
  padding: 44px clamp(36px, 5vw, 64px);
  overflow-y: auto;
}
.lo-form-inner { margin: auto 0; width: 100%; max-width: 380px; align-self: center; }
.lo-mobile-owl-bg { display: none; }

.lo-head { margin-bottom: 26px; }
.lo-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--lo-flame-deep);
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px;
}
.lo-eyebrow .lo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lo-flame-bright);
  box-shadow: 0 0 0 0 rgba(255,138,43,0.7);
  animation: lo-live 2.4s ease-out infinite;
}
@keyframes lo-live {
  0% { box-shadow: 0 0 0 0 rgba(255,138,43,0.6); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(255,138,43,0); }
}
.lo-head h2 {
  font-family: var(--lo-disp);
  font-weight: 600; font-size: 27px;
  letter-spacing: -0.01em;
  margin: 0 0 7px; color: var(--lo-text);
}
.lo-head p { margin: 0; font-size: 14.5px; color: var(--lo-text-soft); }

/* Segmented toggle (Password / Login code) */
.lo-seg {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--lo-field);
  border-radius: var(--lo-rmd);
  padding: 4px; margin-bottom: 22px;
  border: 1px solid var(--lo-line);
}
.lo-seg-pill {
  position: absolute; top: 4px; bottom: 4px;
  width: calc(50% - 4px);
  border-radius: 9px;
  background: var(--lo-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.02);
  transition: transform 0.32s cubic-bezier(0.65,0,0.35,1);
  z-index: 0;
}
.lo-seg button {
  position: relative; z-index: 1;
  appearance: none; border: 0; background: none; cursor: pointer;
  font-family: var(--lo-body); font-weight: 600; font-size: 13.5px;
  color: var(--lo-muted); padding: 9px 0;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: color 0.25s ease;
}
.lo-seg button.is-active { color: var(--lo-flame-deep); }

.lo-helper {
  font-size: 13px; color: var(--lo-text-soft);
  margin: -8px 0 18px; line-height: 1.55;
}

/* Code input row */
.lo-code-row { display: flex; gap: 10px; margin-bottom: 10px; }
.lo-code-box {
  flex: 1 1 0; min-width: 0; height: 56px; text-align: center;
  font-family: var(--lo-disp); font-size: 24px; font-weight: 600;
  color: var(--lo-text);
  background: var(--lo-field);
  border: 1.5px solid var(--lo-line);
  border-radius: var(--lo-rmd);
  transition: all 0.18s ease;
}
.lo-code-box:focus {
  outline: none; border-color: var(--lo-flame);
  background: var(--lo-surface);
  box-shadow: 0 0 0 4px rgba(255,106,26,0.13);
}
.lo-code-box.is-filled {
  border-color: var(--lo-flame);
  background: #FFF6EF;
  animation: lo-pop 0.22s ease;
}
@keyframes lo-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.lo-sent-to { font-size: 13.5px; color: var(--lo-text-soft); margin: 0 0 18px; }
.lo-sent-to b { color: var(--lo-text); font-weight: 700; }

.lo-resend {
  text-align: center; margin-top: 16px;
  font-size: 13px; color: var(--lo-muted);
}
.lo-link {
  background: none; border: 0; cursor: pointer; padding: 0;
  font-family: var(--lo-body); font-size: 13px; font-weight: 600;
  color: var(--lo-flame-deep); transition: color 0.18s ease;
}
.lo-link:hover { color: var(--lo-flame); text-decoration: underline; text-underline-offset: 2px; }

/* Shake on bad code */
.lo-shake { animation: lo-shake 0.4s cubic-bezier(0.36,0.07,0.19,0.97); }
@keyframes lo-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.lo-field { margin-bottom: 16px; }
.lo-field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--lo-text-soft); margin-bottom: 7px;
}
.lo-input-wrap { position: relative; }
.lo-input {
  width: 100%; height: 48px;
  background: var(--lo-field);
  border: 1.5px solid var(--lo-line);
  border-radius: var(--lo-rmd);
  padding: 0 15px;
  font-family: var(--lo-body); font-size: 15px; color: var(--lo-text);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.lo-input::placeholder { color: var(--lo-muted); }
.lo-input:focus {
  outline: none;
  background: var(--lo-surface);
  border-color: var(--lo-flame);
  box-shadow: 0 0 0 4px rgba(255,106,26,0.13);
}
.lo-input.lo-has-btn { padding-right: 46px; }
.lo-input.is-error { border-color: var(--lo-danger); background: #FDF4F2; }
.lo-input.is-error:focus { box-shadow: 0 0 0 4px rgba(214,69,43,0.12); }

.lo-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--lo-muted);
  border-radius: 8px; transition: color 0.18s ease, background 0.18s ease;
}
.lo-eye:hover { color: var(--lo-text-soft); background: var(--lo-field); }

.lo-field-err {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--lo-danger); margin-top: 7px;
  animation: lo-errIn 0.25s ease;
}
@keyframes lo-errIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; } }

.lo-row-between {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 22px;
}
.lo-check { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.lo-check input { position: absolute; opacity: 0; pointer-events: none; }
.lo-box {
  width: 18px; height: 18px; border-radius: 6px;
  border: 1.5px solid var(--lo-line-strong); background: var(--lo-surface);
  display: grid; place-items: center; transition: all 0.18s ease; flex: 0 0 auto;
}
.lo-check input:checked + .lo-box { background: var(--lo-flame); border-color: var(--lo-flame); }
.lo-box svg { width: 11px; height: 11px; color: #fff; opacity: 0; transform: scale(0.5); transition: all 0.18s ease; }
.lo-check input:checked + .lo-box svg { opacity: 1; transform: scale(1); }
.lo-check .lo-lbl { font-size: 13.5px; color: var(--lo-text-soft); }

.lo-form-err {
  display: flex; align-items: center; gap: 8px;
  background: #FDF4F2; border: 1px solid #F3D2CB;
  color: var(--lo-danger); border-radius: var(--lo-rmd);
  padding: 10px 13px; font-size: 13px; font-weight: 600;
  margin-bottom: 16px;
}

.lo-btn {
  position: relative; overflow: hidden;
  width: 100%; height: 50px;
  border: 0; border-radius: var(--lo-rmd); cursor: pointer;
  font-family: var(--lo-body); font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(180deg, var(--lo-flame-bright), var(--lo-flame-deep));
  box-shadow: 0 8px 22px -8px rgba(226,84,11,0.7), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.12s ease, box-shadow 0.25s ease, filter 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.lo-btn::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120px 60px at var(--mx,50%) -20%, rgba(255,255,255,0.4), transparent 70%);
  opacity: 0; transition: opacity 0.25s ease;
}
.lo-btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-18deg);
  animation: lo-sheen 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lo-sheen {
  0%, 22% { left: -60%; }
  45%, 100% { left: 130%; }
}
.lo-btn:hover { box-shadow: 0 12px 30px -8px rgba(226,84,11,0.85), inset 0 1px 0 rgba(255,255,255,0.3); filter: brightness(1.04); }
.lo-btn:hover::before { opacity: 1; }
.lo-btn:active { transform: translateY(1px) scale(0.995); }
.lo-btn:disabled { cursor: default; filter: saturate(0.7) brightness(0.96); }
.lo-arr { transition: transform 0.25s ease; }
.lo-btn:hover:not(:disabled) .lo-arr { transform: translateX(3px); }

.lo-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: lo-spin 0.7s linear infinite;
}
@keyframes lo-spin { to { transform: rotate(360deg); } }

.lo-form-foot {
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--lo-line);
  text-align: center; font-size: 13px; color: var(--lo-text-soft);
}

/* Stagger entrance */
.lo-stagger > * { opacity: 0; animation: lo-rise 0.5s cubic-bezier(0.22,1,0.36,1) forwards; }
.lo-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.lo-stagger > *:nth-child(2) { animation-delay: 0.11s; }
.lo-stagger > *:nth-child(3) { animation-delay: 0.17s; }
.lo-stagger > *:nth-child(4) { animation-delay: 0.23s; }
.lo-stagger > *:nth-child(5) { animation-delay: 0.29s; }
@keyframes lo-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.lo-fade-key { animation: lo-fadeKey 0.34s cubic-bezier(0.22,1,0.36,1); }
@keyframes lo-fadeKey { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Success overlay */
.lo-success {
  position: absolute; inset: 0; z-index: 10;
  background: linear-gradient(180deg, #140D08, #0A0705);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; text-align: center;
  animation: lo-fadeKey 0.4s ease;
}
.lo-ring { position: relative; width: 110px; height: 110px; display: grid; place-items: center; }
.lo-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,43,0.55), transparent 68%);
  animation: lo-glowPulse 1.8s ease-in-out infinite;
}
.lo-ring img { width: 86px; position: relative; z-index: 1; filter: drop-shadow(0 0 14px rgba(255,138,43,0.6)); }
@keyframes lo-glowPulse { 0%, 100% { transform: scale(0.9); opacity: 0.6; } 50% { transform: scale(1.15); opacity: 1; } }
.lo-success h3 { font-family: var(--lo-disp); font-weight: 600; font-size: 24px; margin: 0; }
.lo-success p { margin: 0; color: rgba(255,255,255,0.6); font-size: 14px; display: flex; align-items: center; gap: 8px; }

@media (max-width: 880px) {
  .lo-stage { padding: 0; background: var(--lo-surface); }
  .lo-frame {
    grid-template-columns: 1fr;
    width: 100vw; height: 100vh; min-height: 100dvh;
    border-radius: 0; box-shadow: none;
  }
  .lo-panel { display: none; }
  .lo-mobile-owl-bg {
    display: block; position: absolute;
    left: 50%; top: 50%;
    width: min(78%, 380px);
    transform: translate(-50%, -50%);
    opacity: 0.06; pointer-events: none; z-index: 0;
    animation: lo-owlBob 4.6s ease-in-out infinite;
  }
  .lo-form-side { padding: 36px 24px calc(36px + env(safe-area-inset-bottom)); justify-content: center; }
  .lo-form-inner { margin: auto; max-width: 420px; position: relative; z-index: 1; }
}
@media (max-width: 560px) {
  .lo-form-side { padding: 30px 20px calc(30px + env(safe-area-inset-bottom)); }
  .lo-head h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .lo-stage *, .lo-stage *::before, .lo-stage *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
  }
}

/* === Legacy .login-* styles below are preserved unused for safety === */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--canvas);
}

/* Left: brand panel */
.login__brand {
  position: relative;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: #fff;
  background:
    radial-gradient(1000px 600px at 20% 0%, rgba(255, 255, 255, 0.12), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(0, 0, 0, 0.20), transparent 60%),
    linear-gradient(135deg, var(--flame) 0%, var(--flame-d) 100%);
  overflow: hidden;
}
.login__brand::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.6;
  pointer-events: none;
}
.login__brand > * { position: relative; z-index: 1; }

.login__brand-top {
  display: flex; align-items: center; gap: 14px;
}
.login__brand-top .owlmark {
  filter: brightness(0) invert(1);
}
.login__brand-name {
  font-family: var(--disp);
  font-size: 17px; font-weight: 700;
  letter-spacing: 0.28em;
  color: #fff;
}

.login__brand-pitch h2 {
  font-family: var(--disp);
  font-size: 42px; font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 16px;
  color: #fff;
}
.login__brand-pitch p {
  font-size: 15px; line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  margin: 0; max-width: 380px;
}

.login__brand-foot {
  display: flex; justify-content: space-between; align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 18px;
}

/* Right: form panel */
.login__form-side {
  display: grid; place-items: center;
  padding: 48px 56px;
  background: var(--card);
}
.login__form-wrap {
  width: 100%;
  max-width: 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.login__title {
  font-family: var(--disp);
  font-size: 30px; font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
}
.login__sub {
  margin: 8px 0 28px;
  color: var(--mute);
  font-size: 14px;
}

.login__form {
  display: flex; flex-direction: column;
  gap: 16px;
  width: 100%;
}
.field {
  display: flex; flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.field label {
  font-size: 12px; font-weight: 600; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.login__input {
  position: relative;
  display: block;
  width: 100%;
}
.login__input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mute);
  pointer-events: none;
  transition: color 0.15s;
}
.login__input input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 44px;
  padding: 0 14px 0 36px;
  font-size: 14px; font-family: inherit;
  color: var(--ink); background: var(--card);
  outline: 0; transition: 0.15s;
}
.login__input input::placeholder { color: var(--mute2); }
.login__input input:hover { border-color: var(--mute2); }
.login__input input:focus {
  border-color: var(--flame);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.16);
}
.login__input:focus-within .login__input-icon { color: var(--flame-d); }

.login__error {
  display: flex; align-items: center; gap: 8px;
  background: rgba(224, 83, 58, 0.10);
  color: var(--bad);
  border-radius: 10px; padding: 10px 12px;
  font-size: 13px; font-weight: 500;
}

.login__form .btn--primary {
  height: 46px; margin-top: 6px;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(255, 102, 0, 0.30);
}
.login__form .btn--primary:disabled { opacity: 0.65; cursor: not-allowed; }

.login__hint {
  margin: 28px 0 0;
  font-size: 12.5px;
  color: var(--mute);
  text-align: center;
}

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; min-height: 100vh; }
  .login__brand {
    padding: 24px 24px;
    min-height: auto;
  }
  .login__brand-pitch { display: none; }
  .login__brand-foot { display: none; }
  .login__form-side {
    padding: 32px 24px;
    align-items: flex-start;
  }
  .login__form-wrap { max-width: 100%; margin: 0 auto; }
}
@media (max-width: 480px) {
  .login__brand { padding: 18px 16px; }
  .login__brand-name { font-size: 14px; letter-spacing: 0.2em; }
  .login__form-side { padding: 24px 16px; }
  .login__title { font-size: 24px; }
  .login__sub { margin: 6px 0 20px; }
  .login__input input { height: 42px; font-size: 15px; } /* avoid iOS zoom on focus */
}

/* Legacy summary blocks used by some pages */
.data-summary {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.data-summary .title {
  color: var(--mute); font-size: 12.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.data-summary .value {
  color: var(--ink); font-size: 22px; font-weight: 600; margin-top: 4px;
}

/* Session expired card (lives inside .lo-stage for the brand backdrop) */
.se-card {
  position: relative;
  width: min(440px, 92vw);
  background: var(--lo-surface);
  border-radius: var(--lo-rlg);
  padding: 38px 32px 30px;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04),
    0 40px 90px -30px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.04);
  animation: lo-frameIn 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
  font-family: var(--lo-body);
  color: var(--lo-text);
}
.se-ring {
  width: 72px; height: 72px; margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle, rgba(255,138,43,0.18), rgba(226,84,11,0.05) 70%);
  border: 1px solid rgba(226,84,11,0.18);
}
.se-ring img { width: 44px; height: 44px; }
.se-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--lo-flame-deep);
  margin-bottom: 10px;
}
.se-card h2 {
  font-family: var(--lo-disp);
  margin: 0 0 8px;
  font-size: 24px; font-weight: 700; letter-spacing: -0.01em;
}
.se-card p {
  margin: 0 0 22px;
  font-size: 14.5px; line-height: 1.55;
  color: var(--lo-text-soft);
}
.se-btn { margin-bottom: 14px; }
.se-count {
  font-size: 13px; color: var(--lo-muted);
}
.se-count b { color: var(--lo-flame-deep); font-weight: 700; }
