:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #f0ebe2;
  --ink: #181713;
  --muted: #6a665d;
  --line: #ded6c8;
  --green: #276749;
  --green-2: #e6f1e9;
  --amber: #9a6a13;
  --amber-2: #fff4d8;
  --red: #b23b33;
  --red-2: #fde9e7;
  --blue: #315f72;
  --blue-2: #e7f0f3;
  --violet: #5c4b73;
  --shadow: 0 18px 50px rgba(35, 30, 22, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 243, 238, 0.96)),
    var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(49, 95, 114, 0.26);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.7fr);
}

.login-visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 68px);
  background:
    linear-gradient(135deg, rgba(39, 103, 73, 0.94), rgba(24, 23, 19, 0.94)),
    #1e3528;
  color: #fffaf0;
}

.brand-lockup,
.sidebar-brand,
.login-card-head,
.panel-head,
.topbar,
.topbar-actions,
.role-tabs,
.view-toolbar,
.modal-head {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 18px;
  max-width: 760px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  font-weight: 900;
  font-size: 24px;
}

.brand-mark.compact {
  width: 42px;
  height: 42px;
  font-size: 16px;
  background: var(--green);
  color: white;
}

.eyebrow {
  margin: 0 0 8px;
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(40px, 5.8vw, 76px);
  line-height: 0.96;
  font-weight: 900;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.1;
}

h3 {
  margin-bottom: 3px;
  font-size: 18px;
  line-height: 1.2;
}

.market-board {
  width: min(720px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #10120f;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.board-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 15px 18px;
  color: #6eff79;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(18px, 2.2vw, 30px);
  font-weight: 900;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.board-row span:not(:first-child) {
  text-align: right;
}

.board-row.board-head {
  color: #f2e5b7;
  background: #20221d;
  font-size: 14px;
  text-transform: uppercase;
}

.board-row.gold {
  color: #ffd76a;
}

.login-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
}

.login-insight-grid > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: inherit;
  opacity: 0.68;
  font-size: 12px;
  font-weight: 700;
}

.login-insight-grid strong {
  font-size: clamp(22px, 3vw, 36px);
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
}

.login-card {
  width: min(460px, 100%);
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.status-pill,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--green-2);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill-green {
  color: var(--green);
  background: var(--green-2);
}

.pill-amber {
  color: var(--amber);
  background: var(--amber-2);
}

.pill-red {
  color: var(--red);
  background: var(--red-2);
}

.pill-blue {
  color: var(--blue);
  background: var(--blue-2);
}

.role-tabs,
.report-tabs {
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  gap: 4px;
}

.role-tab,
.report-tab {
  min-height: 42px;
  flex: 1;
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  font-weight: 800;
}

.role-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.role-tab.active,
.report-tab.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(20, 18, 14, 0.12);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #3d3a33;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfc6b8;
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 0 12px;
}

.primary-action,
.ghost-action,
.icon-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 850;
}

.primary-action {
  background: var(--green);
  color: white;
  box-shadow: 0 10px 22px rgba(39, 103, 73, 0.2);
  padding: 0 15px;
}

.primary-action:hover {
  background: #20593d;
}

.ghost-action {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  padding: 0 12px;
}

.icon-button {
  width: 42px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.compact-action {
  min-height: 40px;
}

.login-mini-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 18px;
  color: #fff7ea;
  background: #201f1a;
}

.sidebar-brand {
  gap: 12px;
  min-height: 52px;
}

.sidebar-brand span {
  display: block;
  color: rgba(255, 247, 234, 0.7);
  font-size: 12px;
  font-weight: 700;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: rgba(255, 247, 234, 0.76);
  background: transparent;
  border-radius: 6px;
  text-align: left;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.11);
}

.shortcut-strip {
  margin-top: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.shortcut-strip span {
  padding: 5px 7px;
  color: #fff4ce;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
}

.workspace {
  min-width: 0;
  padding: 20px;
}

.topbar {
  min-height: 72px;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.topbar-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-field {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.toolbar-field select {
  min-height: 40px;
}

.role-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--blue-2);
  color: #234754;
  border: 1px solid #c8dde4;
  border-radius: var(--radius);
  font-weight: 800;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-card,
.panel,
.branch-card,
.cash-row,
.alert-item,
.device-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.kpi-card {
  min-width: 0;
  padding: 16px;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.kpi-card strong {
  display: block;
  font-size: clamp(20px, 1.55vw, 27px);
  line-height: 1;
  white-space: nowrap;
}

.kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.flat-panel {
  padding: 0;
  overflow: hidden;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.panel-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

canvas {
  width: 100%;
  max-width: 100%;
  background: #fffdf9;
  border: 1px solid #eee5d8;
  border-radius: 6px;
}

.mix-list,
.bar-list,
.cash-list,
.alert-list,
.device-list,
.report-body {
  display: grid;
  gap: 10px;
}

.mix-row,
.bar-row {
  display: grid;
  gap: 8px;
}

.mix-label,
.bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.track {
  position: relative;
  height: 10px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 999px;
}

.fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.fill.amber {
  background: var(--amber);
}

.fill.blue {
  background: var(--blue);
}

.fill.red {
  background: var(--red);
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #fbf8f2;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
  font-weight: 700;
}

.view-toolbar {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.search-box {
  min-width: min(520px, 100%);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-box input {
  min-height: 40px;
  padding: 0;
  border: 0;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.branch-card {
  min-width: 0;
  padding: 16px;
}

.branch-card h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.branch-metrics {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.branch-metrics div,
.rule-impact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.branch-metrics strong,
.rule-impact strong {
  color: var(--ink);
}

.cash-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(4, minmax(120px, 0.7fr)) minmax(150px, 0.7fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.cash-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.cash-check input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--green);
}

.alert-item {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  align-items: center;
}

.severity {
  display: inline-flex;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.severity.CRITICAL {
  background: var(--red);
}

.severity.WARNING {
  background: var(--amber);
}

.severity.INFO {
  background: var(--blue);
}

.rule-card {
  display: grid;
  gap: 18px;
}

input[type="range"] {
  min-height: 24px;
  padding: 0;
  accent-color: var(--green);
}

.led-preview {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: #11130f;
  border-radius: var(--radius);
  border: 4px solid #2d2c27;
}

.led-line {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  color: #77ff67;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 950;
  font-size: clamp(18px, 2.7vw, 34px);
}

.led-line span:not(:first-child) {
  text-align: right;
}

.device-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.device-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.report-tabs {
  display: flex;
  margin-bottom: 12px;
}

.report-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.report-card:last-child {
  border-bottom: 0;
}

.report-card strong {
  font-size: 18px;
}

.modal {
  width: min(480px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(18, 17, 14, 0.44);
}

.modal form {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.modal-head {
  justify-content: space-between;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.change-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
  padding: 16px;
  background: var(--green-2);
  border: 1px solid #c5dec9;
  border-radius: var(--radius);
  font-weight: 850;
}

.change-result strong {
  font-size: 28px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(460px, calc(100% - 36px));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 13px 15px;
  color: #fff;
  background: #201f1a;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  font-weight: 800;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
  flex: 0 0 auto;
}

.trend-up {
  color: var(--green);
}

.trend-down {
  color: var(--red);
}

.muted {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .kpi-grid,
  .branch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }
}

@media (max-width: 900px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: auto;
    gap: 38px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
  }

  .nav-item svg {
    display: none;
  }

  .shortcut-strip {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .toolbar-field {
    grid-template-columns: 1fr;
    flex: 1;
  }

  .cash-row {
    grid-template-columns: 1fr 1fr;
  }

  .cash-check {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .login-panel,
  .workspace,
  .login-visual {
    padding: 16px;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-insight-grid,
  .kpi-grid,
  .branch-grid,
  .nav-list {
    grid-template-columns: 1fr;
  }

  .board-row,
  .led-line {
    font-size: 17px;
  }

  .login-card {
    padding: 18px;
  }

  .role-banner,
  .panel-head,
  .view-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }
}

/* Executive demo polish */
:root {
  --bg: #f3f5f6;
  --surface: #ffffff;
  --surface-2: #eef1f2;
  --ink: #111411;
  --muted: #66706a;
  --line: #d8dfda;
  --green: #17624a;
  --green-2: #e5f2ed;
  --amber: #9b6b15;
  --amber-2: #fff4db;
  --red: #aa352e;
  --red-2: #fdebea;
  --blue: #265b73;
  --blue-2: #e4f0f5;
  --shadow: 0 12px 34px rgba(17, 20, 17, 0.08);
}

body {
  background: var(--bg);
}

.sidebar {
  background: #171916;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.workspace {
  background: #f7f8f7;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px 0;
  background: rgba(247, 248, 247, 0.92);
  backdrop-filter: blur(10px);
}

.panel,
.kpi-card,
.branch-card,
.cash-row,
.alert-item,
.device-row,
.login-card {
  box-shadow: 0 1px 0 rgba(17, 20, 17, 0.03);
}

.panel:hover,
.kpi-card:hover,
.branch-card:hover {
  border-color: #c3cec7;
}

.executive-strip,
.sales-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.executive-strip > div,
.sales-summary-card {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #111411;
  color: #f8fbf8;
  border-radius: var(--radius);
}

.executive-strip span,
.sales-summary-card span {
  display: block;
  margin-bottom: 8px;
  color: rgba(248, 251, 248, 0.68);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.executive-strip strong,
.sales-summary-card strong {
  display: block;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1;
}

.executive-strip small,
.sales-summary-card small {
  display: block;
  margin-top: 8px;
  color: rgba(248, 251, 248, 0.72);
  font-weight: 700;
}

.sales-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sales-summary-card {
  background: var(--surface);
  color: var(--ink);
}

.sales-summary-card span,
.sales-summary-card small {
  color: var(--muted);
}

.segmented-filter {
  display: inline-flex;
  min-height: 42px;
  padding: 4px;
  gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segment {
  border: 0;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  border-radius: 5px;
  font-weight: 850;
}

.segment.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(17, 20, 17, 0.12);
}

canvas {
  height: 260px !important;
}

tbody tr {
  transition:
    background 140ms ease,
    box-shadow 140ms ease;
}

tbody tr:hover {
  background: #f8fbf8;
}

.cell-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.row-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: var(--green);
  background: var(--green-2);
  border: 1px solid #c3dfd3;
  border-radius: 6px;
  font-weight: 900;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(17, 20, 17, 0.38);
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 31;
  width: min(640px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: #fbfcfb;
  border-left: 1px solid var(--line);
  box-shadow: -28px 0 70px rgba(17, 20, 17, 0.18);
  overflow: auto;
}

.drawer-head,
.drawer-actions,
.receipt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.drawer-hero > div {
  min-width: 0;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.drawer-hero span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.drawer-hero strong {
  font-size: 18px;
}

.detail-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  gap: 4px;
}

.detail-tab {
  min-height: 38px;
  border: 0;
  background: transparent;
  border-radius: 5px;
  color: var(--muted);
  font-weight: 900;
}

.detail-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(17, 20, 17, 0.11);
}

.drawer-body,
.detail-section {
  display: grid;
  gap: 12px;
}

.detail-section {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.detail-section h4 {
  margin: 0;
  font-size: 15px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-pair {
  min-width: 0;
  padding: 11px;
  background: #f6f8f6;
  border: 1px solid #e2e8e3;
  border-radius: 6px;
}

.detail-pair span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-pair strong {
  display: block;
  overflow-wrap: anywhere;
}

.flag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flag-list span {
  padding: 7px 9px;
  background: var(--amber-2);
  color: var(--amber);
  border: 1px solid #efd79c;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.formula-card {
  padding: 12px;
  background: #111411;
  color: #e8f3ef;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow: auto;
}

.line-list,
.ledger-table,
.receipt-lines {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.line-list > div,
.ledger-head,
.ledger-row,
.receipt-lines > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px;
  background: var(--surface);
  font-weight: 800;
}

.ledger-head,
.ledger-row {
  grid-template-columns: minmax(0, 1fr) 120px 120px;
}

.ledger-head {
  color: var(--muted);
  background: #f4f6f5;
  font-size: 12px;
  text-transform: uppercase;
}

.ledger-row span:not(:first-child),
.ledger-head span:not(:first-child) {
  text-align: right;
}

.receipt-preview {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(17, 20, 17, 0.08);
}

.receipt-top {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px dashed #bfc9c1;
}

.receipt-top strong,
.receipt-top span,
.receipt-foot span {
  display: block;
}

.receipt-top span,
.receipt-foot {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.receipt-qr {
  width: 102px;
  min-height: 102px;
  display: grid;
  place-items: center;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.receipt-lines {
  margin: 14px 0;
}

.receipt-foot {
  display: grid;
  gap: 5px;
  padding-top: 12px;
  border-top: 1px dashed #bfc9c1;
}

.drawer-actions {
  margin-top: auto;
  padding-top: 6px;
}

@media (max-width: 900px) {
  .executive-strip,
  .sales-summary,
  .drawer-hero,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    width: 100vw;
  }
}

/* Rekclick sales-ready visual system */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f4f7;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe3ea;
  --green: #08735f;
  --green-2: #e4f6f1;
  --amber: #b7791f;
  --amber-2: #fff7e6;
  --red: #c2413a;
  --red-2: #fff0ef;
  --blue: #2563eb;
  --blue-2: #eaf1ff;
  --shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(8, 115, 95, 0.08), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, #f4f7fb 100%);
}

.login-shell {
  grid-template-columns: minmax(0, 1.08fr) minmax(460px, 0.72fr);
  background: #071018;
}

.login-visual {
  position: relative;
  overflow: hidden;
  justify-content: center;
  gap: 34px;
  background:
    linear-gradient(135deg, rgba(6, 17, 27, 0.96), rgba(8, 58, 54, 0.92)),
    #071018;
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 42px auto auto 54%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
  pointer-events: none;
}

.login-panel {
  background: #f8fafc;
}

.login-card {
  padding: 30px;
  border: 1px solid #d7e0ea;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
}

.login-card-head h2 {
  font-size: 30px;
}

.role-tabs {
  background: #edf2f7;
}

.role-tab.active {
  background: #111827;
  color: white;
}

.login-form input,
.login-form select,
.toolbar-field select,
.ticket-grid input,
.ticket-grid select {
  border-color: #cbd5e1;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.login-form input:disabled,
.ticket-grid input:disabled {
  color: #64748b;
  background: #eef2f6;
}

.market-board {
  position: relative;
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, #0f172a 0%, #101820 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark.compact {
  background: linear-gradient(135deg, #08735f, #2563eb);
}

.nav-item {
  min-height: 46px;
  color: rgba(241, 245, 249, 0.76);
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.095);
}

.workspace {
  padding: 24px;
  background: transparent;
}

.topbar {
  padding: 6px 0 18px;
  background: rgba(247, 248, 251, 0.9);
}

.role-banner {
  color: #0f3c4a;
  background: linear-gradient(90deg, #eaf5ff, #e9f8f2);
  border-color: #cce3ef;
}

.kpi-card,
.panel,
.branch-card,
.cash-row,
.alert-item,
.device-row,
.sales-summary-card,
.terminal-rates,
.terminal-ticket,
.terminal-calc {
  border: 1px solid #dce5ee;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.045);
}

.cashier-terminal {
  display: grid;
  grid-template-columns: 250px minmax(360px, 1fr) 260px;
  gap: 10px;
  margin-bottom: 14px;
}

.terminal-rates,
.terminal-ticket,
.terminal-calc {
  min-width: 0;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
}

.terminal-head,
.terminal-ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.terminal-head span,
.terminal-ticket-head span,
.terminal-calc span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.terminal-head strong,
.terminal-ticket-head strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.terminal-rate-list {
  display: grid;
  gap: 8px;
}

.terminal-rate {
  display: grid;
  grid-template-columns: 58px 1fr 1fr;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #dbe3ea;
  background: #fbfdff;
  border-radius: 7px;
  color: var(--ink);
  font-weight: 850;
}

.terminal-rate strong {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.terminal-rate.active {
  color: #063f35;
  background: var(--green-2);
  border-color: #9ad3c4;
  box-shadow: inset 3px 0 0 var(--green);
}

.terminal-ticket {
  display: grid;
  gap: 12px;
}

.ticket-status span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--green);
  background: var(--green-2);
  border: 1px solid #b8dfd3;
  border-radius: 999px;
}

.ticket-status span.needs-customer {
  color: var(--amber);
  background: var(--amber-2);
  border-color: #efcf88;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.customer-rule-panel {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 12px;
  color: #25524a;
  background: #f0faf6;
  border: 1px solid #cfece1;
  border-radius: 7px;
  font-weight: 800;
}

.terminal-shortcuts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.terminal-shortcuts span {
  padding: 6px 8px;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.terminal-calc {
  display: grid;
  gap: 10px;
}

.terminal-calc > div:not(.calc-actions) {
  padding: 12px;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 7px;
}

.terminal-calc strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(22px, 2.4vw, 34px);
}

.calc-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sales-summary {
  margin-top: 4px;
}

.sales-summary-card {
  border-color: #dce5ee;
}

th {
  color: #475569;
  background: #f8fafc;
  font-size: 11px;
}

td {
  color: #1f2937;
}

.drawer-hero > div,
.detail-section,
.receipt-preview {
  border-color: #dce5ee;
}

.primary-action {
  background: linear-gradient(135deg, #08735f, #0f8f76);
  box-shadow: 0 12px 26px rgba(8, 115, 95, 0.2);
}

.primary-action:hover {
  background: linear-gradient(135deg, #065c4d, #08735f);
}

.ghost-action,
.icon-button {
  border-color: #cbd5e1;
}

@media (max-width: 1220px) {
  .cashier-terminal {
    grid-template-columns: 1fr;
  }

  .terminal-rate-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .terminal-rate {
    grid-template-columns: 1fr;
  }

  .terminal-rate strong {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .ticket-grid,
  .terminal-rate-list {
    grid-template-columns: 1fr;
  }
}

/* v3 product-grade SaaS shell */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #0f766e;
  --green-2: #e6f7f4;
  --blue: #2563eb;
  --blue-2: #eff6ff;
  --amber: #b45309;
  --amber-2: #fff7ed;
  --red: #b91c1c;
  --red-2: #fef2f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.055);
  --radius: 8px;
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.94)),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  letter-spacing: 0;
}

.eyebrow {
  color: #64748b;
  opacity: 1;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.login-shell {
  grid-template-columns: minmax(0, 1fr) 480px;
  min-height: 100vh;
  background: #f8fafc;
}

.login-visual {
  position: relative;
  justify-content: center;
  gap: 28px;
  padding: 56px clamp(38px, 6vw, 88px);
  color: var(--ink);
  background:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #f8fafc 0%, #eef7f4 52%, #eff6ff 100%);
  background-size: 28px 28px, 28px 28px, auto;
}

.login-visual::after {
  display: none;
}

.brand-lockup {
  align-items: flex-start;
  gap: 18px;
  max-width: 680px;
}

.login-visual .brand-mark {
  width: 52px;
  height: 52px;
  color: #ffffff;
  border: 0;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  box-shadow: var(--shadow);
}

.login-visual h1 {
  max-width: 620px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.96;
}

.login-lead {
  max-width: 560px;
  margin: 14px 0 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 650;
}

.market-board {
  width: min(760px, 100%);
  border: 1px solid #d8e3ea;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.board-row {
  color: #0f766e;
  padding: 13px 16px;
  border-top-color: #e2e8f0;
  font-size: clamp(17px, 2vw, 25px);
}

.board-row.board-head {
  color: #475569;
  background: #f8fafc;
}

.board-row.gold {
  color: #b45309;
}

.login-insight-grid {
  width: min(760px, 100%);
  max-width: 760px;
}

.login-insight-grid > div {
  border-color: #dbe7ef;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.login-insight-grid strong {
  color: var(--ink);
}

.login-panel {
  padding: 32px;
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border-color: #e2e8f0;
  box-shadow: none;
}

.login-card-head h2 {
  font-size: 26px;
}

.status-pill {
  color: #0f766e;
  background: #e6f7f4;
}

.role-tabs {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.role-tab {
  color: #475569;
  font-size: 14px;
}

.role-tab.active {
  color: #ffffff;
  background: #0f172a;
}

input,
select {
  min-height: 42px;
  border-color: #d7dee8;
  color: #0f172a;
}

label {
  color: #334155;
  font-size: 12px;
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 14px;
  background: #0f172a;
}

.sidebar-brand {
  padding: 0 4px 12px;
}

.sidebar-brand strong {
  color: #ffffff;
}

.sidebar-brand span {
  color: #94a3b8;
}

.brand-mark.compact {
  background: linear-gradient(135deg, #0f766e, #2563eb);
}

.nav-list {
  gap: 4px;
}

.nav-item {
  min-height: 42px;
  color: #94a3b8;
  border-radius: 7px;
  font-size: 14px;
}

.nav-item:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #ffffff;
  background: #1e293b;
  box-shadow: inset 3px 0 0 #14b8a6;
}

.shortcut-strip span {
  color: #cbd5e1;
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

.workspace {
  padding: 18px 22px 28px;
  background: #f8fafc;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  padding: 4px 0 14px;
  margin-bottom: 8px;
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  backdrop-filter: blur(12px);
}

.topbar h2 {
  font-size: 26px;
}

.toolbar-field {
  color: #475569;
  font-size: 12px;
}

.toolbar-field select,
.ghost-action,
.icon-button {
  border-color: #d7dee8;
  background: #ffffff;
}

.role-banner {
  min-height: 40px;
  padding: 8px 12px;
  color: #0f3f38;
  background: #edfdf8;
  border-color: #c7eadf;
}

.executive-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.executive-strip > div {
  color: var(--ink);
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: var(--shadow);
}

.executive-strip span,
.executive-strip small {
  color: #64748b;
}

.executive-strip strong {
  color: #0f172a;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.kpi-card,
.panel,
.branch-card,
.cash-row,
.alert-item,
.device-row,
.sales-summary-card,
.terminal-rates,
.terminal-ticket,
.terminal-calc,
.detail-section,
.receipt-preview {
  border-color: #e2e8f0;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.kpi-card {
  padding: 15px;
}

.kpi-top {
  color: #64748b;
}

.kpi-card strong {
  font-size: clamp(22px, 1.6vw, 28px);
}

.panel {
  padding: 15px;
}

.panel-head span {
  color: #64748b;
}

.cashier-terminal {
  grid-template-columns: 250px minmax(370px, 1fr) 260px;
  gap: 12px;
}

.terminal-rates,
.terminal-ticket,
.terminal-calc {
  padding: 14px;
}

.terminal-head,
.terminal-ticket-head {
  margin-bottom: 12px;
}

.terminal-head strong,
.terminal-ticket-head strong {
  color: #0f172a;
  font-size: 17px;
}

.terminal-rate {
  min-height: 42px;
  border-color: #dbe3ea;
  background: #ffffff;
}

.terminal-rate:hover {
  border-color: #9bd8cd;
}

.terminal-rate.active {
  color: #0f3f38;
  background: #edfdf8;
  border-color: #a7e1d5;
  box-shadow: inset 3px 0 0 #0f766e;
}

.ticket-grid {
  gap: 10px;
}

.ticket-status span {
  background: #edfdf8;
}

.customer-rule-panel {
  color: #0f3f38;
  background: #f0fdfa;
  border-color: #bae6dc;
}

.terminal-shortcuts span {
  color: #475569;
  background: #f8fafc;
}

.terminal-calc > div:not(.calc-actions) {
  background: #0f172a;
}

.terminal-calc strong {
  font-size: 28px;
}

.sales-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.search-box {
  border-color: #d7dee8;
}

.segmented-filter {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.segment {
  color: #64748b;
}

.segment.active {
  background: #ffffff;
}

table {
  min-width: 980px;
}

th {
  color: #64748b;
  background: #f8fafc;
  font-size: 11px;
  letter-spacing: 0.02em;
}

td {
  color: #1e293b;
  font-size: 13px;
}

.row-action {
  color: #0f766e;
  background: #edfdf8;
  border-color: #b7e5dc;
}

.detail-drawer {
  background: #f8fafc;
}

.drawer-hero > div,
.detail-pair,
.receipt-preview {
  background: #ffffff;
}

.detail-pair {
  border-color: #e2e8f0;
}

.primary-action {
  background: #0f766e;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

.primary-action:hover {
  background: #0b5f59;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 244px minmax(0, 1fr);
  }

  .cashier-terminal {
    grid-template-columns: 1fr;
  }

  .terminal-calc {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .calc-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terminal-rate-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* v4 enterprise SaaS presentation layer */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f3f6f9;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e2ec;
  --green: #047a68;
  --green-2: #e7f8f4;
  --blue: #2459d6;
  --blue-2: #eef4ff;
  --amber: #a95e12;
  --amber-2: #fff5e6;
  --red: #b42318;
  --red-2: #fff0ee;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 18px 40px rgba(16, 24, 40, 0.07);
  --radius: 8px;
}

body {
  background:
    linear-gradient(180deg, #fbfcfe 0%, #f5f8fb 44%, #f6f8fb 100%),
    var(--bg);
  color: var(--ink);
  text-rendering: geometricprecision;
}

.login-shell {
  grid-template-columns: minmax(620px, 1fr) 484px;
  background: #f7f9fc;
}

.login-visual {
  min-height: 100vh;
  padding: clamp(36px, 5vw, 72px);
  justify-content: center;
  gap: 22px;
  color: var(--ink);
  background:
    linear-gradient(rgba(14, 27, 41, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 27, 41, 0.045) 1px, transparent 1px),
    linear-gradient(145deg, #f9fbfe 0%, #eef8f5 46%, #eef4ff 100%);
  background-size: 32px 32px, 32px 32px, auto;
}

.brand-lockup {
  max-width: 760px;
}

.login-visual h1 {
  max-width: 720px;
  margin-top: 4px;
  font-size: clamp(44px, 5.2vw, 68px);
  line-height: 0.98;
  font-weight: 900;
}

.login-lead {
  max-width: 660px;
  color: #4b5565;
  font-size: 16px;
  line-height: 1.6;
}

.login-visual .brand-mark,
.brand-mark.compact {
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: linear-gradient(145deg, #0f766e 0%, #2459d6 100%);
  box-shadow: 0 14px 34px rgba(36, 89, 214, 0.2);
}

.market-board {
  position: relative;
  width: min(780px, 100%);
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 226, 236, 0.92);
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.12);
  backdrop-filter: blur(14px);
}

.market-board::before {
  content: "Live rates";
  position: absolute;
  top: -11px;
  right: 16px;
  padding: 4px 9px;
  color: #0f513f;
  background: #ecfdf6;
  border: 1px solid #b8eadb;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.board-row {
  padding: 14px 18px;
  color: #0f766e;
  font-size: clamp(18px, 2vw, 27px);
}

.board-row.board-head {
  color: #475467;
  background: #f8fafc;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.login-insight-grid {
  width: min(780px, 100%);
  margin-top: 6px;
}

.login-insight-grid > div {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(217, 226, 236, 0.95);
  box-shadow: 0 14px 38px rgba(16, 24, 40, 0.08);
}

.login-panel {
  padding: 32px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border-left: 1px solid #dfe7ef;
}

.login-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid #dfe7ef;
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.1);
}

.login-card-head {
  padding-bottom: 18px;
  border-bottom: 1px solid #edf1f5;
}

.login-card-head h2 {
  font-size: 26px;
  letter-spacing: 0;
}

.status-pill,
.pill {
  min-height: 26px;
  border: 1px solid rgba(4, 122, 104, 0.18);
  font-size: 11px;
  letter-spacing: 0.01em;
}

.role-tabs,
.report-tabs,
.segmented-filter {
  background: #f3f6f9;
  border-color: #dfe7ef;
}

.role-tab.active,
.report-tab.active {
  background: #101828;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.13);
}

input,
select {
  min-height: 43px;
  border-color: #cfd8e3;
  background: #ffffff;
  color: #101828;
  font-weight: 720;
}

input:focus,
select:focus {
  border-color: #50b7a6;
}

label {
  color: #344054;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.primary-action {
  background: #047a68;
  border-color: #047a68;
  box-shadow: 0 12px 24px rgba(4, 122, 104, 0.18);
}

.primary-action:hover {
  background: #036657;
}

.ghost-action,
.icon-button {
  background: #ffffff;
  border-color: #cfd8e3;
  color: #101828;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 14px;
  background:
    linear-gradient(180deg, #111827 0%, #0b1220 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-brand {
  min-height: 60px;
  padding: 0 6px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand strong {
  color: #ffffff;
  font-size: 15px;
}

.sidebar-brand span {
  color: #98a2b3;
}

.nav-list {
  gap: 5px;
}

.nav-item {
  min-height: 43px;
  padding: 0 12px;
  color: #98a2b3;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 820;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #ffffff;
  background: #1d2939;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 #20c7ae;
}

.shortcut-strip {
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.shortcut-strip span {
  color: #d0d5dd;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.workspace {
  padding: 18px 24px 28px;
}

.topbar {
  min-height: 66px;
  padding: 4px 0 14px;
  border-bottom: 1px solid rgba(217, 226, 236, 0.9);
}

.topbar h2 {
  color: #101828;
  font-size: 25px;
  font-weight: 850;
}

.topbar-actions {
  padding: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(217, 226, 236, 0.8);
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(16, 24, 40, 0.045);
}

.toolbar-field {
  grid-template-columns: auto minmax(152px, 1fr);
  color: #475467;
}

.toolbar-field select {
  min-height: 38px;
  border-radius: 7px;
}

.role-banner {
  min-height: 42px;
  margin-bottom: 14px;
  color: #0d5146;
  background: linear-gradient(90deg, #e8faf6 0%, #f2f7ff 100%);
  border-color: #c5eadf;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}

.executive-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.executive-strip > div,
.kpi-card,
.panel,
.branch-card,
.cash-row,
.alert-item,
.device-row,
.sales-summary-card,
.terminal-rates,
.terminal-ticket,
.terminal-calc {
  border-color: #dfe7ef;
  box-shadow: var(--shadow);
}

.executive-strip > div {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.executive-strip span,
.sales-summary-card span,
.kpi-top,
.panel-head span,
.cell-sub,
.muted {
  color: #667085;
}

.executive-strip strong,
.sales-summary-card strong,
.kpi-card strong {
  color: #101828;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 96px;
  height: 96px;
  background: linear-gradient(135deg, rgba(4, 122, 104, 0.11), rgba(36, 89, 214, 0.08));
  clip-path: polygon(38% 0, 100% 0, 100% 100%);
  pointer-events: none;
}

.kpi-top svg {
  color: #047a68;
}

.dashboard-grid {
  gap: 14px;
}

.panel,
.kpi-card,
.sales-summary-card {
  background: #ffffff;
}

.panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f6;
}

canvas {
  border-color: #dfe7ef;
  background: #ffffff;
}

.cashier-terminal {
  grid-template-columns: 232px minmax(460px, 1fr) 252px;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}

.terminal-rates,
.terminal-ticket,
.terminal-calc {
  padding: 15px;
  border-radius: 8px;
  background: #ffffff;
}

.terminal-rates {
  display: flex;
  flex-direction: column;
}

.terminal-head,
.terminal-ticket-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f6;
}

.terminal-head span,
.terminal-ticket-head span,
.terminal-calc span {
  color: #667085;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.terminal-head strong,
.terminal-ticket-head strong {
  color: #101828;
  font-size: 17px;
}

.terminal-rate-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.terminal-rate {
  grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr);
  min-height: 46px;
  padding: 0 11px;
  border-color: #dfe7ef;
  background: #fbfcfe;
  border-radius: 7px;
}

.terminal-rate span {
  color: #101828;
}

.terminal-rate strong {
  color: #344054;
  font-size: 13px;
}

.terminal-rate.active {
  color: #0d5146;
  background: #e8faf6;
  border-color: #9bddcf;
  box-shadow: inset 3px 0 0 #047a68;
}

.terminal-rate.active strong,
.terminal-rate.active span {
  color: #0d5146;
}

.terminal-ticket {
  gap: 13px;
}

.ticket-grid {
  grid-template-columns: 0.95fr 1.35fr 0.95fr;
  gap: 11px;
}

.ticket-grid input,
.ticket-grid select {
  min-height: 43px;
}

.ticket-status span {
  min-height: 28px;
  color: #0d5146;
  background: #e8faf6;
  border-color: #b7e7dc;
}

.ticket-status span.needs-customer {
  color: #8a4b08;
  background: #fff5e6;
  border-color: #f2cf9b;
}

.customer-rule-panel {
  min-height: 45px;
  color: #0d5146;
  background: #f0fdfa;
  border-color: #c2eee5;
}

.terminal-shortcuts {
  padding-top: 2px;
}

.terminal-shortcuts span {
  color: #475467;
  background: #f8fafc;
  border-color: #dfe7ef;
}

.terminal-calc {
  align-content: start;
}

.terminal-calc > div:not(.calc-actions) {
  min-height: 88px;
  padding: 14px;
  background: #101828;
  border: 1px solid #1d2939;
}

.terminal-calc > div:nth-child(3) {
  background: linear-gradient(145deg, #047a68 0%, #0b5f59 100%);
  border-color: #047a68;
}

.terminal-calc strong {
  color: #ffffff;
  font-size: 27px;
  letter-spacing: 0;
}

.calc-actions {
  gap: 9px;
}

.sales-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sales-summary-card {
  padding: 15px;
}

.view-toolbar {
  padding: 12px;
  background: #ffffff;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-box {
  min-height: 42px;
  border-color: #dfe7ef;
  background: #fbfcfe;
}

.segment.active {
  color: #101828;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.09);
}

table {
  min-width: 1040px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #667085;
  background: #f8fafc;
  border-bottom-color: #dfe7ef;
}

td {
  color: #1d2939;
  border-bottom-color: #edf1f5;
}

tbody tr:hover {
  background: #f7fbfa;
}

.row-action {
  min-height: 32px;
  color: #047a68;
  background: #e8faf6;
  border-color: #b7e7dc;
}

.detail-drawer {
  background: #f6f8fb;
  border-left-color: #d9e2ec;
}

.drawer-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #dfe7ef;
}

.drawer-hero > div,
.detail-section,
.detail-pair,
.receipt-preview {
  border-color: #dfe7ef;
  background: #ffffff;
}

.formula-card {
  background: #101828;
}

.toast {
  background: #101828;
}

@media (min-width: 1121px) {
  .cashier-terminal {
    grid-template-columns: 232px minmax(460px, 1fr) 252px;
  }

  .terminal-rate-list {
    grid-template-columns: 1fr;
  }

  .terminal-calc {
    grid-template-columns: 1fr;
  }

  .calc-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .cashier-terminal {
    grid-template-columns: 1fr;
  }

  .terminal-rate-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .terminal-rate {
    grid-template-columns: 1fr;
  }

  .terminal-rate strong {
    text-align: left;
  }

  .terminal-calc {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .calc-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .login-panel {
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 14px;
  }

  .topbar-actions,
  .view-toolbar {
    width: 100%;
  }

  .cashier-terminal,
  .ticket-grid,
  .terminal-rate-list,
  .terminal-calc,
  .calc-actions,
  .sales-summary,
  .executive-strip {
    grid-template-columns: 1fr;
  }

  .terminal-rate {
    grid-template-columns: 56px 1fr 1fr;
  }

  .terminal-rate strong {
    text-align: right;
  }

  .sales-summary-card,
  .terminal-calc > div:not(.calc-actions) {
    min-height: auto;
  }
}

/* v5 Salesforce/Odoo inspired ERP shell */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f3f2f2;
  --ink: #181818;
  --muted: #5f6b7a;
  --line: #d8dde6;
  --green: #1b806a;
  --green-2: #e9f7f3;
  --blue: #0176d3;
  --blue-2: #eaf5fe;
  --amber: #b75d00;
  --amber-2: #fff4e5;
  --red: #ba0517;
  --red-2: #fff1f2;
  --odoo: #714b67;
  --odoo-dark: #57364f;
  --odoo-soft: #f7eff5;
  --shadow: 0 1px 2px rgba(24, 24, 24, 0.08), 0 8px 22px rgba(24, 24, 24, 0.06);
}

body {
  background: var(--bg);
  color: var(--ink);
}

.login-shell {
  grid-template-columns: minmax(0, 1fr) 456px;
  background: #f4f6f9;
}

.login-visual {
  color: var(--ink);
  background:
    linear-gradient(rgba(113, 75, 103, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1, 118, 211, 0.05) 1px, transparent 1px),
    linear-gradient(135deg, #f7f9fc 0%, #f8f0f6 48%, #eef6ff 100%);
  background-size: 30px 30px, 30px 30px, auto;
}

.login-visual .brand-mark,
.brand-mark.compact {
  background: linear-gradient(135deg, var(--odoo), var(--blue));
}

.login-card {
  border-color: #d8dde6;
  box-shadow: 0 24px 70px rgba(24, 24, 24, 0.12);
}

.role-tab.active,
.report-tab.active {
  background: var(--odoo);
}

.primary-action {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(1, 118, 211, 0.18);
}

.primary-action:hover {
  background: #0b5cab;
}

.app-shell {
  grid-template-columns: 238px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  padding: 12px 10px;
  color: #ffffff;
  background: var(--odoo);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-brand {
  min-height: 56px;
  padding: 0 8px 12px;
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

.sidebar-brand span {
  color: rgba(255, 255, 255, 0.72);
}

.nav-item {
  color: rgba(255, 255, 255, 0.78);
  border-radius: 4px;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.18);
}

.shortcut-strip {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.workspace {
  padding: 16px 18px 22px;
}

.topbar {
  min-height: 58px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 249, 0.92);
}

.topbar h2 {
  font-size: 24px;
  font-weight: 760;
}

.topbar-actions,
.view-toolbar {
  background: #ffffff;
  border-color: var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.role-banner {
  color: #3b3140;
  background: var(--odoo-soft);
  border-color: #e6d6e2;
  border-radius: 4px;
}

.panel,
.kpi-card,
.branch-card,
.cash-row,
.alert-item,
.device-row,
.sales-summary-card,
.terminal-rates,
.terminal-ticket,
.terminal-calc,
.detail-section,
.receipt-preview {
  border-color: var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.panel-head {
  border-bottom-color: #eef0f4;
}

th {
  color: #444b57;
  background: #f3f2f2;
}

tbody tr:hover {
  background: #f8fbff;
}

.row-action {
  color: #032d60;
  background: var(--blue-2);
  border-color: #b7d9f8;
}

.pill-green {
  color: #0b5f4f;
  background: #def3ed;
  border-color: #a8dcca;
}

.pill-amber {
  color: #8a4b08;
  background: var(--amber-2);
  border-color: #f0c98d;
}

.pill-red {
  color: var(--red);
  background: var(--red-2);
  border-color: #f4b8bf;
}

body[data-view="sales"] .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

body[data-view="sales"] .sidebar {
  padding: 10px 8px;
  background: var(--odoo);
}

body[data-view="sales"] .sidebar-brand {
  justify-content: center;
  padding: 0 0 12px;
}

body[data-view="sales"] .sidebar-brand > div:not(.brand-mark) {
  display: none;
}

body[data-view="sales"] .brand-mark.compact {
  width: 46px;
  height: 46px;
}

body[data-view="sales"] .nav-item {
  justify-content: center;
  min-height: 48px;
  padding: 0;
  font-size: 0;
}

body[data-view="sales"] .nav-item .lucide {
  width: 20px;
  height: 20px;
}

body[data-view="sales"] .shortcut-strip {
  display: none;
}

body[data-view="sales"] .workspace {
  height: 100vh;
  overflow: hidden;
  padding: 0;
  background: #f4f6f9;
}

body[data-view="sales"] .topbar {
  min-height: 64px;
  padding: 10px 18px;
  margin: 0;
  color: #ffffff;
  background: var(--odoo);
  border-bottom: 1px solid var(--odoo-dark);
  box-shadow: 0 2px 8px rgba(24, 24, 24, 0.16);
}

body[data-view="sales"] .topbar .eyebrow,
body[data-view="sales"] .topbar h2 {
  color: #ffffff;
}

body[data-view="sales"] .topbar .eyebrow {
  opacity: 0.76;
}

body[data-view="sales"] .topbar-actions {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

body[data-view="sales"] .toolbar-field {
  color: rgba(255, 255, 255, 0.78);
}

body[data-view="sales"] .toolbar-field select,
body[data-view="sales"] .topbar .ghost-action,
body[data-view="sales"] .topbar .icon-button {
  color: #181818;
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

body[data-view="sales"] .role-banner {
  display: none;
}

body[data-view="sales"] .sales-workbench {
  height: calc(100vh - 64px);
  display: grid;
  grid-template-rows: minmax(470px, 1fr) auto minmax(98px, 0.26fr);
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

body[data-view="sales"] .cashier-terminal {
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  gap: 12px;
}

body[data-view="sales"] .terminal-rates,
body[data-view="sales"] .terminal-ticket,
body[data-view="sales"] .terminal-calc {
  border-radius: 4px;
}

body[data-view="sales"] .terminal-rates {
  padding: 12px;
  overflow: hidden;
}

body[data-view="sales"] .terminal-ticket,
body[data-view="sales"] .terminal-calc {
  min-height: 0;
  overflow: auto;
}

body[data-view="sales"] .terminal-rate-list {
  min-height: 0;
  overflow: auto;
  grid-template-columns: 1fr;
}

body[data-view="sales"] .terminal-rate {
  min-height: 58px;
  grid-template-columns: 60px 1fr 1fr;
  border-radius: 4px;
  background: #ffffff;
}

body[data-view="sales"] .terminal-rate.active {
  color: #032d60;
  background: #f0f7ff;
  border-color: #9fcbed;
  box-shadow: inset 4px 0 0 var(--blue);
}

body[data-view="sales"] .terminal-ticket {
  padding: 16px;
  gap: 14px;
}

body[data-view="sales"] .terminal-ticket-head {
  min-height: 70px;
}

body[data-view="sales"] .terminal-ticket-head strong {
  font-size: clamp(24px, 2.4vw, 34px);
}

body[data-view="sales"] .ticket-status span {
  min-height: 34px;
  border-radius: 999px;
}

body[data-view="sales"] .ticket-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body[data-view="sales"] .ticket-grid input,
body[data-view="sales"] .ticket-grid select {
  min-height: 52px;
  border-radius: 4px;
  font-size: 16px;
}

body[data-view="sales"] .ticket-grid label {
  font-size: 13px;
}

body[data-view="sales"] .customer-rule-panel {
  min-height: 58px;
  border-radius: 4px;
  background: #f5fbf9;
}

body[data-view="sales"] .terminal-shortcuts {
  margin-top: auto;
  padding-top: 8px;
}

body[data-view="sales"] .terminal-shortcuts span {
  border-radius: 4px;
  background: #f3f2f2;
}

body[data-view="sales"] .terminal-calc {
  padding: 12px;
  grid-template-columns: 1fr;
  gap: 12px;
}

body[data-view="sales"] .terminal-calc > div:not(.calc-actions) {
  min-height: 96px;
  padding: 16px;
  color: #032d60;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

body[data-view="sales"] .terminal-calc > div:nth-child(3) {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #0b5cab);
  border-color: #0b5cab;
}

body[data-view="sales"] .terminal-calc span {
  color: currentColor;
  opacity: 0.68;
}

body[data-view="sales"] .terminal-calc strong {
  color: currentColor;
  font-size: clamp(34px, 3.3vw, 50px);
}

body[data-view="sales"] .calc-actions {
  grid-template-columns: 1fr;
  gap: 8px;
}

body[data-view="sales"] .calc-actions .primary-action,
body[data-view="sales"] .calc-actions .ghost-action {
  min-height: 48px;
  border-radius: 4px;
}

body[data-view="sales"] .sales-summary {
  display: none;
}

body[data-view="sales"] .sales-summary-card {
  min-height: 86px;
  padding: 14px 16px;
  border-radius: 4px;
}

body[data-view="sales"] .sales-summary-card strong {
  font-size: clamp(22px, 2vw, 34px);
}

body[data-view="sales"] .view-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border-radius: 4px 4px 0 0;
}

body[data-view="sales"] .search-box {
  min-width: 0;
  border-radius: 4px;
}

body[data-view="sales"] .segmented-filter {
  border-radius: 4px;
}

body[data-view="sales"] .segment {
  border-radius: 3px;
}

body[data-view="sales"] .table-wrap.panel.flat-panel {
  min-height: 0;
  overflow: auto;
  border-radius: 0 0 4px 4px;
}

body[data-view="sales"] table {
  min-width: 1100px;
}

body[data-view="sales"] th,
body[data-view="sales"] td {
  padding: 11px 12px;
}

@media (max-width: 1180px) {
  body[data-view="sales"] .cashier-terminal {
    grid-template-columns: 1fr;
  }

  body[data-view="sales"] .terminal-rate-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body[data-view="sales"] .terminal-rate {
    grid-template-columns: 1fr;
  }

  body[data-view="sales"] .terminal-calc {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-view="sales"] .calc-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body[data-view="sales"] .app-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  body[data-view="sales"] .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-view="sales"] .sales-workbench {
    height: auto;
    grid-template-rows: auto;
    overflow: visible;
  }

  body[data-view="sales"] .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  body[data-view="sales"] .ticket-grid,
  body[data-view="sales"] .terminal-rate-list,
  body[data-view="sales"] .terminal-calc,
  body[data-view="sales"] .sales-summary,
  body[data-view="sales"] .view-toolbar {
    grid-template-columns: 1fr;
  }

  body[data-view="sales"] .terminal-rate {
    grid-template-columns: 60px 1fr 1fr;
  }
}

/* v6 Framer-grade product redesign */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --ink: #111827;
  --muted: #667085;
  --line: #dfe4ec;
  --green: #08745f;
  --green-2: #e7f7f2;
  --blue: #155eef;
  --blue-2: #edf4ff;
  --amber: #b54708;
  --amber-2: #fff4e5;
  --red: #b42318;
  --red-2: #fff1f1;
  --violet: #6750a4;
  --violet-2: #f1edff;
  --dark: #0f172a;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 18px 54px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 10px 30px rgba(16, 24, 40, 0.055);
  --radius: 8px;
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(180deg, #fbfcff 0%, #f6f8fb 44%, #f7f8fb 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.eyebrow {
  color: #667085;
  opacity: 1;
  font-size: 11px;
  letter-spacing: 0.04em;
}

h1,
h2,
h3,
h4 {
  color: #111827;
}

.login-shell {
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.62fr);
  min-height: 100vh;
  background: #fbfcff;
}

.login-visual {
  position: relative;
  justify-content: center;
  gap: 26px;
  padding: clamp(34px, 5vw, 76px);
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(8, 116, 95, 0.08), transparent 36%),
    linear-gradient(240deg, rgba(21, 94, 239, 0.08), transparent 42%),
    linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    #f8fafc;
  background-size: auto, auto, 28px 28px, 28px 28px, auto;
}

.login-visual .brand-mark,
.brand-mark.compact {
  border: 0;
  background: linear-gradient(135deg, #0f172a 0%, #155eef 54%, #08745f 100%);
  box-shadow: 0 18px 42px rgba(21, 94, 239, 0.22);
}

.brand-lockup {
  max-width: 760px;
}

.login-visual h1 {
  max-width: 780px;
  font-size: clamp(46px, 6.4vw, 84px);
  line-height: 0.94;
  letter-spacing: -0.02em;
}

.login-lead {
  max-width: 680px;
  color: #475467;
  font-size: 17px;
  line-height: 1.64;
}

.market-board {
  width: min(820px, 100%);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(223, 228, 236, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.market-board::before {
  content: "Canlı oran";
  color: #084c3f;
  background: #ecfdf6;
}

.board-row {
  padding: 13px 18px;
  color: #08745f;
  font-size: clamp(18px, 2vw, 27px);
}

.board-row.board-head {
  color: #667085;
  background: #f8fafc;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.board-row.gold {
  color: #b54708;
}

.login-insight-grid {
  width: min(820px, 100%);
}

.login-insight-grid > div,
.login-card,
.panel,
.kpi-card,
.branch-card,
.cash-row,
.alert-item,
.device-row,
.sales-summary-card,
.terminal-rates,
.terminal-ticket,
.terminal-calc,
.detail-section,
.detail-pair,
.receipt-preview,
.view-toolbar {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.login-panel {
  padding: clamp(24px, 4vw, 44px);
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-left: 1px solid #edf1f6;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card-head {
  border-bottom-color: #eef2f6;
}

.role-tabs,
.report-tabs,
.segmented-filter {
  background: #f3f6fa;
  border-color: #e1e7ef;
}

.role-tab.active,
.report-tab.active {
  background: #111827;
  color: #ffffff;
}

input,
select {
  border-color: #d0d7e2;
  border-radius: 7px;
  background: #ffffff;
  color: #101828;
}

input:focus,
select:focus {
  border-color: #155eef;
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.12);
}

.primary-action {
  background: linear-gradient(135deg, #155eef, #0b5cab);
  border-color: #155eef;
  box-shadow: 0 12px 26px rgba(21, 94, 239, 0.2);
}

.primary-action:hover {
  background: linear-gradient(135deg, #0b5cab, #08427f);
}

.ghost-action,
.icon-button {
  border-color: #d0d7e2;
  background: #ffffff;
  color: #111827;
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  padding: 16px 12px;
  color: #e5e7eb;
  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  min-height: 58px;
  padding: 0 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-brand strong {
  color: #ffffff;
}

.sidebar-brand span {
  color: #98a2b3;
}

.nav-list {
  gap: 5px;
}

.nav-item {
  min-height: 42px;
  color: #aab2c0;
  border-radius: 8px;
  font-weight: 800;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 #38bdf8;
}

.shortcut-strip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.workspace {
  padding: 18px 22px 26px;
  background: transparent;
}

.topbar {
  min-height: 68px;
  padding: 6px 0 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(223, 228, 236, 0.9);
  background: rgba(247, 248, 251, 0.88);
  backdrop-filter: blur(14px);
}

.topbar h2 {
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.015em;
}

.topbar-actions {
  padding: 6px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.toolbar-field {
  color: #667085;
}

.role-banner {
  min-height: 44px;
  margin-bottom: 16px;
  color: #0b4a40;
  background: linear-gradient(90deg, #ecfdf6 0%, #eef4ff 100%);
  border-color: #c9eadf;
}

.executive-strip {
  gap: 14px;
}

.executive-strip > div {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  color: #111827;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.executive-strip span,
.executive-strip small,
.sales-summary-card span,
.sales-summary-card small,
.kpi-top,
.panel-head span,
.cell-sub,
.muted {
  color: #667085;
}

.executive-strip strong,
.sales-summary-card strong,
.kpi-card strong {
  color: #111827;
}

.kpi-grid {
  gap: 14px;
}

.kpi-card {
  min-height: 132px;
  padding: 16px;
  overflow: hidden;
}

.kpi-card::after {
  background: linear-gradient(135deg, rgba(21, 94, 239, 0.1), rgba(8, 116, 95, 0.08));
}

.kpi-top svg {
  color: #155eef;
}

.dashboard-grid,
.branch-grid,
.mix-list,
.bar-list,
.cash-list,
.alert-list,
.device-list,
.report-body {
  gap: 14px;
}

.panel {
  padding: 16px;
}

.panel-head {
  padding-bottom: 13px;
  border-bottom: 1px solid #eef2f6;
}

canvas {
  border-color: #e5eaf2;
  background: #ffffff;
}

.track {
  height: 9px;
  background: #eef2f6;
}

.fill {
  background: linear-gradient(90deg, #155eef, #08745f);
}

.fill.amber {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.fill.blue {
  background: linear-gradient(90deg, #155eef, #38bdf8);
}

.fill.red {
  background: linear-gradient(90deg, #b42318, #ef4444);
}

th {
  color: #667085;
  background: #f8fafc;
  letter-spacing: 0.035em;
}

td {
  color: #1f2937;
}

tbody tr:hover {
  background: #f8fbff;
}

.row-action {
  color: #0b4a75;
  background: #edf4ff;
  border-color: #bfd8ff;
}

.branch-card {
  position: relative;
  min-height: 210px;
  padding: 18px;
  overflow: hidden;
}

.branch-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, #155eef, #08745f, #d97706);
}

.branch-card h3 {
  align-items: center;
}

.branch-metrics {
  gap: 12px;
}

.branch-metrics div,
.rule-impact {
  padding: 9px 0;
  border-bottom: 1px solid #eef2f6;
}

.branch-metrics div:last-child,
.rule-impact:last-child {
  border-bottom: 0;
}

.branch-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  color: #0b4a40;
  background: #ecfdf6;
  border: 1px solid #c9eadf;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 850;
}

.branch-footer strong {
  color: #0b4a40;
  text-align: right;
}

.cash-row {
  grid-template-columns: minmax(160px, 1fr) repeat(4, minmax(130px, 0.8fr)) minmax(150px, 0.7fr);
  padding: 15px;
}

.cash-row > span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.cash-row b {
  display: inline-block;
  margin-top: 4px;
  color: #111827;
  font-size: 14px;
}

.cash-check {
  color: #344054;
}

.alert-item {
  grid-template-columns: 94px minmax(0, 1fr) auto;
  padding: 15px;
}

.severity {
  border-radius: 6px;
}

.severity.CRITICAL {
  background: #b42318;
}

.severity.WARNING {
  background: #b54708;
}

.severity.INFO {
  background: #155eef;
}

.rule-card {
  gap: 16px;
}

.led-preview {
  border: 1px solid #1e293b;
  background:
    linear-gradient(180deg, #111827, #020617);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.led-line {
  color: #86efac;
}

.device-row {
  padding: 15px;
}

.report-tabs {
  width: fit-content;
  margin-bottom: 14px;
}

.report-card {
  padding: 15px 0;
}

.detail-drawer {
  width: min(700px, 100vw);
  background: #f8fafc;
  border-left: 1px solid var(--line);
  box-shadow: -28px 0 80px rgba(15, 23, 42, 0.2);
}

.drawer-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #e5eaf2;
}

.drawer-hero {
  gap: 12px;
}

.drawer-hero > div {
  background: #ffffff;
  border: 1px solid var(--line);
}

.detail-tabs {
  background: #eef2f7;
  border-color: var(--line);
}

.detail-tab.active {
  color: #111827;
  background: #ffffff;
}

.detail-section {
  padding: 16px;
}

.detail-pair {
  background: #ffffff;
}

.flag-list span {
  color: #854a0e;
  background: #fff4e5;
}

.formula-card {
  background: #0f172a;
}

.receipt-preview {
  background: #ffffff;
}

body[data-view="sales"] .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

body[data-view="sales"] .sidebar {
  background: #0f172a;
}

body[data-view="sales"] .workspace {
  height: 100vh;
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

body[data-view="sales"] .topbar {
  min-height: 66px;
  padding: 10px 18px;
  color: #ffffff;
  background:
    linear-gradient(90deg, #0f172a 0%, #1e3a8a 52%, #0f766e 100%);
  border-bottom: 0;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

body[data-view="sales"] .topbar .eyebrow,
body[data-view="sales"] .topbar h2 {
  color: #ffffff;
}

body[data-view="sales"] .topbar-actions {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

body[data-view="sales"] .toolbar-field {
  color: rgba(255, 255, 255, 0.78);
}

body[data-view="sales"] .toolbar-field select,
body[data-view="sales"] .topbar .ghost-action,
body[data-view="sales"] .topbar .icon-button {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.38);
}

body[data-view="sales"] .role-banner {
  display: none;
}

body[data-view="sales"] .sales-workbench {
  height: calc(100vh - 66px);
  display: grid;
  grid-template-rows: minmax(492px, 1fr) auto minmax(102px, 0.24fr);
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

body[data-view="sales"] .cashier-terminal {
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr) 348px;
  gap: 12px;
}

body[data-view="sales"] .terminal-rates,
body[data-view="sales"] .terminal-ticket,
body[data-view="sales"] .terminal-calc {
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
}

body[data-view="sales"] .terminal-rates {
  padding: 13px;
}

body[data-view="sales"] .terminal-rate-list,
body[data-view="sales"] .terminal-ticket,
body[data-view="sales"] .terminal-calc {
  overflow: auto;
}

body[data-view="sales"] .terminal-head,
body[data-view="sales"] .terminal-ticket-head {
  border-bottom-color: #eef2f6;
}

body[data-view="sales"] .terminal-rate-list {
  grid-template-columns: 1fr;
  gap: 9px;
}

body[data-view="sales"] .terminal-rate {
  min-height: 60px;
  grid-template-columns: 62px 1fr 1fr;
  border-radius: 7px;
  background: #ffffff;
}

body[data-view="sales"] .terminal-rate.active {
  color: #0b4a75;
  background: #eef6ff;
  border-color: #b6d7ff;
  box-shadow: inset 4px 0 0 #155eef;
}

body[data-view="sales"] .terminal-ticket {
  padding: 17px;
  gap: 15px;
}

body[data-view="sales"] .terminal-ticket-head {
  min-height: 76px;
}

body[data-view="sales"] .terminal-ticket-head strong {
  max-width: 720px;
  font-size: clamp(28px, 2.8vw, 42px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

body[data-view="sales"] .ticket-status span {
  color: #854a0e;
  background: #fff4e5;
  border-color: #f2cc8f;
}

body[data-view="sales"] .ticket-status span:not(.needs-customer) {
  color: #075446;
  background: #e7f7f2;
  border-color: #b9e5d9;
}

body[data-view="sales"] .ticket-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body[data-view="sales"] .ticket-grid input,
body[data-view="sales"] .ticket-grid select {
  min-height: 54px;
  border-radius: 8px;
  font-size: 16px;
}

body[data-view="sales"] .customer-rule-panel {
  min-height: 58px;
  border-radius: 8px;
  background: #f2fbf8;
}

body[data-view="sales"] .terminal-shortcuts {
  gap: 8px;
}

body[data-view="sales"] .terminal-shortcuts span {
  border-radius: 7px;
  background: #f3f6fa;
}

body[data-view="sales"] .terminal-calc {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 13px;
}

body[data-view="sales"] .terminal-calc > div:not(.calc-actions) {
  min-height: 102px;
  color: #0f172a;
  background: #ffffff;
  border-color: var(--line);
  border-radius: 8px;
}

body[data-view="sales"] .terminal-calc > div:nth-child(3) {
  color: #ffffff;
  background: linear-gradient(135deg, #155eef 0%, #0b5cab 54%, #08745f 100%);
  border-color: transparent;
}

body[data-view="sales"] .terminal-calc strong {
  font-size: clamp(34px, 3.15vw, 52px);
  letter-spacing: -0.02em;
}

body[data-view="sales"] .calc-actions {
  gap: 9px;
}

body[data-view="sales"] .calc-actions .primary-action,
body[data-view="sales"] .calc-actions .ghost-action {
  min-height: 50px;
  border-radius: 8px;
}

body[data-view="sales"] .sales-summary {
  display: none;
}

body[data-view="sales"] .view-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
}

body[data-view="sales"] .search-box {
  min-width: 0;
  border-radius: 8px;
}

body[data-view="sales"] .segmented-filter {
  border-radius: 8px;
}

body[data-view="sales"] .segment {
  border-radius: 6px;
}

body[data-view="sales"] .table-wrap.panel.flat-panel {
  min-height: 0;
  overflow: auto;
  border-radius: 8px;
}

body[data-view="sales"] table {
  min-width: 1120px;
}

@media (max-width: 1180px) {
  body[data-view="sales"] .cashier-terminal {
    grid-template-columns: 1fr;
  }

  body[data-view="sales"] .terminal-rate-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body[data-view="sales"] .terminal-rate {
    grid-template-columns: 1fr;
  }

  body[data-view="sales"] .terminal-calc {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-view="sales"] .calc-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .app-shell,
  body[data-view="sales"] .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  body[data-view="sales"] .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-view="sales"] .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-view="sales"] .sales-workbench {
    height: auto;
    grid-template-rows: auto;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .workspace,
  .login-panel,
  .login-visual {
    padding: 14px;
  }

  body[data-view="sales"] .ticket-grid,
  body[data-view="sales"] .terminal-rate-list,
  body[data-view="sales"] .terminal-calc,
  body[data-view="sales"] .view-toolbar,
  .sales-summary,
  .executive-strip {
    grid-template-columns: 1fr;
  }

  body[data-view="sales"] .terminal-rate {
    grid-template-columns: 62px 1fr 1fr;
  }
}
