:root {
  --bg: #f3f6f1;
  --surface: #ffffff;
  --surface-soft: #eef5ef;
  --surface-muted: #f8faf7;
  --text: #17231c;
  --muted: #68756e;
  --border: #dce5dd;
  --primary: #1c7a4d;
  --primary-dark: #115b38;
  --primary-light: #dff2e7;
  --navy: #143c2b;
  --green-2: #47a56f;
  --blue: #2b70c9;
  --blue-soft: #eaf3ff;
  --amber: #c68516;
  --amber-soft: #fff4d9;
  --red: #c94f4f;
  --red-soft: #fff0ef;
  --purple: #7656c5;
  --purple-soft: #f1edff;
  --shadow-sm: 0 8px 24px rgba(24, 55, 36, .06);
  --shadow: 0 20px 50px rgba(24, 55, 36, .09);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --sidebar-width: 264px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 92% 0%, rgba(71, 165, 111, .11), transparent 28%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 20px;
  color: #fff;
  background:
    radial-gradient(circle at 30% 0%, rgba(255, 255, 255, .09), transparent 30%),
    linear-gradient(180deg, #153f2c 0%, #102e21 100%);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 22px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #113c28;
  background: linear-gradient(145deg, #f0c95b, #ffe399);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
  font-weight: 900;
  letter-spacing: -.05em;
}

.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: rgba(255, 255, 255, .62); font-size: 11px; }

.nav {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 13px;
  border-radius: 13px;
  color: rgba(255, 255, 255, .68);
  text-decoration: none;
  font-weight: 700;
  transition: .18s ease;
}

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

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, .13);
  box-shadow: inset 3px 0 0 #f0c95b;
}

.sidebar-card {
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
}

.sidebar-card-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sidebar-card p { margin: 9px 0 2px; color: #fff; font-weight: 750; }
.sidebar-card small { color: rgba(255, 255, 255, .55); font-size: 10px; overflow-wrap: anywhere; }

.sidebar-foot {
  display: grid;
  gap: 2px;
  padding: 14px 6px 0;
  color: rgba(255, 255, 255, .48);
  font-size: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #e0a92f;
  box-shadow: 0 0 0 4px rgba(224, 169, 47, .13);
}
.status-dot.status-online { background: #60d394; box-shadow: 0 0 0 4px rgba(96, 211, 148, .13); }
.status-dot.status-local { background: #f0bc4d; }

.main {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 32px;
  border-bottom: 1px solid rgba(214, 225, 216, .8);
  background: rgba(243, 246, 241, .88);
  backdrop-filter: blur(18px);
}

.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title h1 { margin: 0; font-size: clamp(21px, 3vw, 28px); line-height: 1.15; letter-spacing: -.04em; }
.topbar-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.today-pill,
.ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255, 255, 255, .76);
  font-size: 12px;
  font-weight: 700;
}
.ai-pill.status-online { color: #176540; border-color: #c8e6d4; background: #edf9f2; }
.ai-pill.status-local { color: #8c6508; border-color: #ecdcae; background: #fff9e8; }

.menu-button { display: none !important; }

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 32px 72px;
}

.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 13px;
  animation: slideDown .25s ease;
}
.alert > span:nth-child(2) { flex: 1; }
.alert button { border: 0; background: transparent; color: inherit; font-size: 20px; }
.alert-icon { display: grid; place-items: center; }
.alert-success { color: #155f3c; background: #eaf8f0; border-color: #c4e8d2; }
.alert-info { color: #245c78; background: #edf8fc; border-color: #cce6f1; }
.alert-warning { color: #7d5a09; background: #fff8e3; border-color: #ecdba7; }
.alert-danger { color: #8e3030; background: #fff1f0; border-color: #efc8c5; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } }

.card {
  overflow: hidden;
  border: 1px solid rgba(215, 225, 217, .92);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid #e8eee9;
}
.card-header h3, .card-header h2 { margin: 2px 0 2px; font-size: 19px; letter-spacing: -.025em; }
.card-header p { margin: 0; color: var(--muted); font-size: 12px; }
.card-body { padding: 22px; }
.section-gap { margin-top: 22px; }
.section-kicker {
  display: block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 10px 24px rgba(28, 122, 77, .2); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { color: var(--primary-dark); background: #fff; }
.btn-ghost-light { color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); }
.btn-soft { color: var(--primary-dark); background: var(--primary-light); }
.btn-outline { color: var(--text); border-color: var(--border); background: #fff; }
.btn-plain { color: var(--muted); background: transparent; }
.btn-danger { color: #fff; background: var(--red); }
.btn-whatsapp { color: #fff; background: #20a45b; }
.btn-lg { min-height: 50px; padding: 12px 18px; border-radius: 13px; }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--muted);
  background: #fff;
  text-decoration: none;
}
.icon-button:hover { color: var(--primary); border-color: #bcd7c6; }
.icon-button.danger:hover { color: var(--red); border-color: #efc6c6; background: var(--red-soft); }

.badge,
.feature-badge,
.confidence-badge,
.count-badge,
.source-pill,
.saving-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.badge-success { color: #17633f; background: #e7f7ed; }
.badge-danger { color: #9d3535; background: #ffeded; }
.badge-warning { color: #8a6107; background: #fff4d6; }
.badge-info { color: #245e83; background: #eaf4ff; }
.badge-neutral { color: #52615a; background: #edf1ee; }
.feature-badge { color: var(--primary-dark); background: var(--primary-light); }
.confidence-badge { color: #5a4597; background: var(--purple-soft); }
.count-badge { min-width: 28px; color: var(--red); background: var(--red-soft); }
.source-pill { color: #4a5e54; background: #eef3ef; }
.source-pill .icon { width: 14px; height: 14px; }

.hero-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: 18px;
}
.hero-copy {
  min-height: 270px;
  padding: 34px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(circle at 88% 25%, rgba(255, 224, 130, .2), transparent 25%),
    linear-gradient(135deg, #1b7349 0%, #123d2b 100%);
  box-shadow: var(--shadow);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 99px;
  color: inherit;
  background: rgba(255, 255, 255, .1);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.eyebrow .icon { width: 15px; height: 15px; }
.hero-copy h2 { max-width: 760px; margin: 18px 0 10px; font-size: clamp(31px, 4.8vw, 52px); line-height: 1.05; letter-spacing: -.055em; }
.hero-copy p { max-width: 720px; margin: 0; color: rgba(255, 255, 255, .75); font-size: 15px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.readiness-card {
  padding: 24px;
  border: 1px solid rgba(215, 225, 217, .95);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.readiness-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.readiness-head > div:first-child { display: grid; }
.readiness-head span { color: var(--muted); font-size: 12px; }
.readiness-head strong { font-size: 35px; letter-spacing: -.05em; }
.progress-ring {
  --progress: 0;
  width: 67px;
  height: 67px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--progress) * 1%), #e9eeea 0);
  position: relative;
}
.progress-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.progress-ring span { position: relative; z-index: 1; color: var(--text); font-weight: 850; font-size: 12px; }
.progress-track { height: 8px; margin: 18px 0; overflow: hidden; border-radius: 99px; background: #e9efea; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #62bd86); }
.check-list { display: grid; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 9px; color: var(--muted); text-decoration: none; font-size: 12px; }
.check-item > span { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: #fafcfa; }
.check-item > span .icon { width: 14px; height: 14px; }
.check-item.done { color: var(--text); font-weight: 700; }
.check-item.done > span { color: #fff; border-color: var(--primary); background: var(--primary); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.metric-card {
  min-height: 132px;
  display: flex;
  gap: 14px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.metric-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; }
.metric-content { display: grid; align-content: start; min-width: 0; }
.metric-content > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.metric-content strong { margin-top: 5px; font-size: clamp(22px, 2.3vw, 30px); line-height: 1.1; letter-spacing: -.045em; }
.metric-content small { margin-top: 8px; color: var(--muted); font-size: 10px; }
.metric-green .metric-icon { color: var(--primary); background: var(--primary-light); }
.metric-red .metric-icon { color: var(--red); background: var(--red-soft); }
.metric-blue .metric-icon { color: var(--blue); background: var(--blue-soft); }
.metric-amber .metric-icon { color: var(--amber); background: var(--amber-soft); }
.metric-purple .metric-icon { color: var(--purple); background: var(--purple-soft); }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.chart-card { min-height: 440px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: #f4f7f4; }
.segmented button { min-height: 31px; padding: 0 11px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; }
.segmented button.active { color: var(--primary-dark); background: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .07); }
.chart-legend { display: flex; gap: 18px; padding: 13px 22px 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 22px; height: 3px; border-radius: 99px; }
.legend-income { background: var(--primary); }
.legend-expense { background: #df826c; }
.chart-wrap { position: relative; min-height: 255px; padding: 8px 18px 0; }
.chart-wrap canvas { width: 100%; height: 255px; display: block; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.trend-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #e8eee9; }
.trend-strip > div { display: grid; padding: 14px 18px; border-right: 1px solid #e8eee9; }
.trend-strip > div:last-child { border: 0; }
.trend-strip span, .trend-strip small { color: var(--muted); font-size: 9px; }
.trend-strip strong { margin: 2px 0; font-size: 17px; }

.insight-card { background: linear-gradient(180deg, #fff, #f9fcfa); }
.mini-ai { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-light); }
.insight-body { min-height: 350px; display: flex; flex-direction: column; }
.insight-text { flex: 1; color: #33433a; font-size: 12px; line-height: 1.7; }
.insight-body > small { margin-top: 12px; color: var(--muted); font-size: 9px; }
.insight-action { margin-top: 18px; }

.text-link { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); text-decoration: none; font-size: 11px; font-weight: 800; }
.text-link .icon { width: 15px; height: 15px; }
.ranking-list { display: grid; gap: 16px; }
.ranking-item { display: flex; gap: 12px; }
.rank-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--primary-dark); background: var(--primary-light); font-size: 11px; font-weight: 900; }
.rank-main { flex: 1; min-width: 0; }
.rank-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rank-title strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-title span, .rank-main small { color: var(--muted); font-size: 9px; }
.rank-bar { height: 6px; margin: 7px 0 4px; overflow: hidden; border-radius: 99px; background: #edf1ee; }
.rank-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #6cc18d); }
.stock-alert-list { display: grid; gap: 10px; }
.stock-alert { display: flex; gap: 10px; padding: 11px; border: 1px solid #eee4c9; border-radius: 13px; color: inherit; background: #fffbef; text-decoration: none; }
.stock-alert-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--amber); background: var(--amber-soft); }
.stock-alert-copy { flex: 1; min-width: 0; display: grid; }
.stock-alert-copy strong { font-size: 11px; }
.stock-alert-copy small { color: var(--muted); font-size: 9px; }
.stock-mini-bar { height: 4px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: #eadfbe; }
.stock-mini-bar i { display: block; height: 100%; background: var(--amber); }

.transaction-list { display: grid; }
.transaction-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid #edf1ee; }
.transaction-row:last-child { border-bottom: 0; }
.transaction-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; }
.transaction-icon.type-success { color: var(--primary); background: var(--primary-light); }
.transaction-icon.type-danger { color: var(--red); background: var(--red-soft); }
.transaction-icon.type-warning { color: var(--amber); background: var(--amber-soft); }
.transaction-main { display: grid; min-width: 0; }
.transaction-main strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transaction-main span { color: var(--muted); font-size: 9px; }
.transaction-amount { display: grid; justify-items: end; font-size: 12px; font-weight: 900; }
.transaction-amount small { color: var(--muted); font-size: 8px; font-weight: 650; }
.positive { color: var(--primary) !important; }
.negative { color: var(--red) !important; }

.empty-state { min-height: 210px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 30px; text-align: center; color: var(--muted); }
.empty-state > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: var(--primary); background: var(--primary-light); }
.empty-state > span .icon { width: 25px; height: 25px; }
.empty-state strong { color: var(--text); font-size: 14px; }
.empty-state p { max-width: 360px; margin: 0; font-size: 11px; }
.empty-state.small { min-height: 200px; padding: 20px; }
.success-state > span { color: #fff; background: var(--primary); }

.transaction-workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .5fr); gap: 18px; }
.natural-input-wrap { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: #fbfdfb; }
.natural-input-wrap textarea { width: 100%; min-height: 160px; padding: 18px; border: 0; resize: vertical; background: transparent; outline: none; font-size: 15px; line-height: 1.65; }
.natural-input-wrap:focus-within { border-color: #75b68f; box-shadow: 0 0 0 4px rgba(28, 122, 77, .08); }
.input-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); background: #f4f8f4; }
.input-toolbar span { color: var(--muted); font-size: 9px; }
.example-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 17px; }
.example-chips button { padding: 6px 10px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); background: #fff; font-size: 9px; }
.example-chips button:hover { color: var(--primary); border-color: #b8d5c2; }
.guide-list { display: grid; gap: 14px; }
.guide-list > div { display: flex; gap: 11px; }
.guide-list > div > span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--primary-dark); background: var(--primary-light); font-size: 10px; font-weight: 900; }
.guide-list p { margin: 0; color: var(--muted); font-size: 11px; }
.guide-list strong { color: var(--text); }
.confirm-card { border-color: #c9dfd1; box-shadow: 0 18px 50px rgba(28, 122, 77, .09); }
.inline-warning { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 14px; padding: 12px; border-radius: 12px; color: #7a5708; background: #fff7df; font-size: 11px; }
.original-input { margin: 0 0 18px; padding: 14px 16px; border-left: 3px solid var(--primary); border-radius: 0 11px 11px 0; color: #4d5e54; background: #f4f8f5; font-size: 12px; font-style: italic; }
.split-actions { justify-content: flex-start; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field-span-2 { grid-column: span 2; }
.field label { color: #46544d; font-size: 10px; font-weight: 800; }
.field label span { color: var(--muted); font-weight: 500; }
.field input,
.field select,
.field textarea,
.filter-form input,
.filter-form select,
.compact-search input {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: .15s ease;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-form input:focus,
.filter-form select:focus,
.compact-search input:focus { border-color: #79b993; box-shadow: 0 0 0 4px rgba(28, 122, 77, .07); }
.money-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; border: 1px solid var(--border); border-radius: 11px; background: #fff; overflow: hidden; }
.money-field:focus-within { border-color: #79b993; box-shadow: 0 0 0 4px rgba(28, 122, 77, .07); }
.money-field span { padding-left: 12px; color: var(--muted); font-size: 11px; font-weight: 750; }
.money-field input { border: 0; box-shadow: none !important; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; }
.form-section + .form-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.form-section h4 { margin: 0 0 15px; font-size: 14px; }

.table-header { align-items: center; }
.header-actions { display: flex; gap: 8px; }
.filter-bar { padding: 13px 18px; border-bottom: 1px solid var(--border); background: #f9fbf9; }
.filter-form { display: grid; grid-template-columns: minmax(220px, 1.5fr) 180px 150px 150px auto auto; gap: 8px; align-items: center; }
.search-field { position: relative; }
.search-field .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search-field input { padding-left: 35px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.data-table th { padding: 11px 15px; color: var(--muted); background: #fbfcfb; font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
.data-table td { padding: 13px 15px; border-top: 1px solid #edf1ee; vertical-align: middle; font-size: 11px; }
.data-table td > strong { display: block; margin-top: 5px; font-size: 10px; }
.data-table td > small { display: block; color: var(--muted); font-size: 8px; }
.text-right { text-align: right !important; }
.amount-cell { font-weight: 900; white-space: nowrap; }
.table-action { width: 52px; }
.muted { color: var(--muted); }

.mini-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mini-metrics > div { display: grid; padding: 16px 18px; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.mini-metrics span, .mini-metrics small { color: var(--muted); font-size: 9px; }
.mini-metrics strong { margin: 3px 0; font-size: 19px; letter-spacing: -.03em; }
.product-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 18px; align-items: start; }
.product-form-card { position: sticky; top: 102px; }
.margin-preview { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin: 16px 0; padding: 12px; border-radius: 12px; background: var(--surface-soft); }
.margin-preview span, .margin-preview small { color: var(--muted); font-size: 9px; }
.margin-preview strong { grid-row: span 2; align-self: center; color: var(--primary); font-size: 20px; }
.content-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 14px; }
.content-toolbar h3 { margin: 2px 0 0; font-size: 20px; }
.compact-search { position: relative; width: min(320px, 100%); }
.compact-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--muted); }
.compact-search input { padding-left: 35px; }
.product-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.product-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.product-card.low-stock { border-color: #ead8a8; }
.product-card-top { display: flex; align-items: center; justify-content: space-between; }
.product-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--primary), #51aa77); font-weight: 900; }
.product-menu { display: flex; gap: 6px; }
.product-card-title { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-top: 14px; }
.product-card-title > div { display: grid; min-width: 0; }
.product-card-title strong { font-size: 13px; }
.product-card-title small { color: var(--muted); font-size: 9px; }
.product-card > p { min-height: 42px; margin: 11px 0; color: var(--muted); font-size: 10px; }
.product-price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; border-radius: 12px; background: #f7faf7; }
.product-price-row div { display: grid; }
.product-price-row span, .stock-display span, .stock-display small { color: var(--muted); font-size: 8px; }
.product-price-row strong { font-size: 13px; }
.stock-display { margin-top: 14px; }
.stock-display > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.stock-display strong { font-size: 11px; }
.stock-bar { height: 7px; margin: 8px 0 4px; overflow: hidden; border-radius: 99px; background: #e8eee9; }
.stock-bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.stock-bar span.danger { background: var(--red); }
.product-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }

.promo-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 18px; align-items: start; }
.promo-output-card { position: sticky; top: 102px; }
.upload-field { position: relative; }
.upload-field input[type=file] { position: absolute; z-index: 2; inset: 25px 0 0; opacity: 0; cursor: pointer; }
.upload-drop { min-height: 110px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px dashed #b9cdc0; border-radius: 13px; color: var(--muted); background: #f7faf7; }
.upload-drop .icon { width: 24px; height: 24px; color: var(--primary); }
.upload-drop span { font-size: 10px; }
.image-preview { width: 100%; max-height: 240px; margin-top: 10px; object-fit: contain; border-radius: 13px; border: 1px solid var(--border); background: #f5f6f5; }
.caption-output { width: 100%; min-height: 390px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; resize: vertical; outline: none; color: #26372e; background: #f9fcfa; line-height: 1.7; }
.caption-stats { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 9px; }
.promo-empty { min-height: 455px; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.section-title-row h3 { margin: 2px 0; font-size: 21px; }
.section-title-row p { margin: 0; color: var(--muted); font-size: 11px; }
.caption-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.caption-history-card { display: flex; flex-direction: column; min-height: 245px; padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.caption-history-head { display: flex; align-items: center; justify-content: space-between; }
.caption-history-head time { color: var(--muted); font-size: 8px; }
.caption-history-card h4 { margin: 12px 0 6px; font-size: 13px; }
.caption-history-card p { flex: 1; margin: 0; color: var(--muted); font-size: 10px; }
.caption-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.caption-meta span { padding: 4px 7px; border-radius: 99px; color: var(--muted); background: #f0f3f1; font-size: 8px; }

.impact-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 25px; padding: 30px; border-radius: var(--radius-lg); color: #fff; background: linear-gradient(135deg, #1b7349, #123d2b); box-shadow: var(--shadow); }
.impact-hero h2 { max-width: 760px; margin: 15px 0 8px; font-size: clamp(28px, 4vw, 45px); line-height: 1.08; letter-spacing: -.05em; }
.impact-hero p { max-width: 760px; margin: 0; color: rgba(255, 255, 255, .72); font-size: 13px; }
.partner-seal { min-width: 185px; display: grid; justify-items: center; padding: 20px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 20px; background: rgba(255, 255, 255, .08); text-align: center; }
.partner-seal > span { width: 55px; height: 55px; display: grid; place-items: center; margin-bottom: 9px; border-radius: 16px; color: var(--navy); background: #f0c95b; font-weight: 900; }
.partner-seal strong { font-size: 12px; }
.partner-seal small { color: rgba(255, 255, 255, .58); font-size: 8px; }
.impact-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 18px; }
.partner-details { display: grid; gap: 16px; }
.partner-details > div > span { color: var(--primary); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.partner-details p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.testimonial-box { padding: 15px; border-radius: 13px; background: var(--surface-soft); }
.testimonial-box blockquote { margin: 8px 0 0; color: #314139; font-size: 12px; font-style: italic; }
.comparison-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px; align-items: center; gap: 10px; margin-bottom: 17px; }
.comparison-row > span { color: var(--muted); font-size: 9px; }
.comparison-row > div { height: 11px; overflow: hidden; border-radius: 99px; background: #edf1ee; }
.comparison-row i { display: block; height: 100%; border-radius: inherit; }
.comparison-row.before i { background: #df8b76; }
.comparison-row.after i { background: var(--primary); }
.comparison-row strong { text-align: right; font-size: 11px; }
.metric-disclaimer { display: block; margin-top: 18px; color: var(--muted); font-size: 9px; }
.test-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.test-result-card { position: relative; padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.test-result-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.participant-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--primary); font-weight: 900; }
.test-result-head > div { display: grid; }
.test-result-head strong { font-size: 11px; }
.test-result-head small { color: var(--muted); font-size: 8px; }
.rating-stars { color: #e4ad2f; font-size: 10px; letter-spacing: 1px; }
.test-result-card > p { margin: 14px 0 10px; color: var(--muted); font-size: 10px; }
.test-times { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 9px; padding: 11px; border-radius: 12px; background: #f7faf7; }
.test-times > span { display: grid; }
.test-times > span:nth-child(2) .icon { width: 15px; color: var(--muted); }
.test-times small { color: var(--muted); font-size: 8px; }
.test-times strong { font-size: 11px; }
.saving-pill { color: var(--primary); background: var(--primary-light); }
.test-result-card blockquote { margin: 12px 0 0; color: #45564d; font-size: 10px; font-style: italic; }
.test-delete { position: absolute; right: 10px; bottom: 10px; }
.test-delete .icon-button { width: 31px; height: 31px; }
.solution-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.solution-flow > div { display: grid; justify-items: center; text-align: center; }
.solution-flow > div > span { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 7px; border-radius: 11px; color: #fff; background: var(--primary); font-size: 11px; font-weight: 900; }
.solution-flow strong { font-size: 11px; }
.solution-flow p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.solution-flow > i { color: #91a299; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(330px, .7fr); gap: 18px; align-items: start; }
.settings-side { display: grid; gap: 18px; }
.system-list { display: grid; }
.system-list > div { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 18px; border-bottom: 1px solid #edf1ee; }
.system-list > div:last-child { border-bottom: 0; }
.system-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; }
.system-icon.ok { color: var(--primary); background: var(--primary-light); }
.system-icon.warn { color: var(--amber); background: var(--amber-soft); }
.system-icon.error { color: var(--red); background: var(--red-soft); }
.system-list p { display: grid; margin: 0; }
.system-list strong { font-size: 10px; }
.system-list small { color: var(--muted); font-size: 8px; }
.model-label { max-width: 120px; color: var(--muted); font-size: 8px; overflow-wrap: anywhere; text-align: right; }
.security-list { display: grid; gap: 14px; }
.security-list > div { display: flex; gap: 10px; }
.security-list > div > .icon { color: var(--primary); }
.security-list > div > span { display: grid; }
.security-list strong { font-size: 10px; }
.security-list small { color: var(--muted); font-size: 8px; }
.deployment-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.deployment-steps > div { display: flex; gap: 10px; }
.deployment-steps > div > span { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--primary-dark); background: var(--primary-light); font-size: 10px; font-weight: 900; }
.deployment-steps p { margin: 0; color: var(--muted); font-size: 9px; }
.deployment-steps strong { display: block; color: var(--text); font-size: 10px; }
code { padding: 2px 5px; border-radius: 5px; background: #edf2ee; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

.mobile-nav { display: none; }
.sidebar-overlay { display: none; }
.toast { position: fixed; z-index: 200; right: 22px; bottom: 22px; max-width: 320px; padding: 12px 15px; border-radius: 12px; color: #fff; background: #173f2d; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; font-size: 11px; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-card { grid-column: span 2; }
  .insight-body { min-height: auto; }
  .product-card-grid { grid-template-columns: 1fr; }
  .filter-form { grid-template-columns: minmax(200px, 1fr) 160px 130px 130px; }
  .filter-form .btn { width: auto; }
  .deployment-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  :root { --sidebar-width: 250px; }
  .app-shell { grid-template-columns: 1fr; }
  .main { grid-column: 1; }
  .sidebar {
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 20px 0 50px rgba(0, 0, 0, .22);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 45; background: rgba(10, 24, 17, .5); backdrop-filter: blur(3px); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .menu-button { display: inline-grid !important; }
  .hero-dashboard { grid-template-columns: 1fr; }
  .readiness-card { display: grid; grid-template-columns: 220px 1fr; gap: 15px; }
  .readiness-head, .progress-track { grid-column: 1; }
  .check-list { grid-column: 2; grid-row: 1 / span 2; align-content: center; }
  .transaction-workspace,
  .product-layout,
  .promo-layout,
  .impact-grid,
  .settings-layout { grid-template-columns: 1fr; }
  .product-form-card,
  .promo-output-card { position: static; }
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .caption-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 68px; padding: 11px 15px; }
  .topbar-title p, .today-pill { display: none; }
  .topbar-title h1 { font-size: 20px; }
  .ai-pill { min-height: 32px; padding: 0 9px; font-size: 9px; }
  .content { padding: 18px 14px 35px; }
  .hero-copy { min-height: 300px; padding: 24px; border-radius: 20px; }
  .hero-copy h2 { font-size: 35px; }
  .hero-copy p { font-size: 13px; }
  .readiness-card { display: block; padding: 19px; }
  .check-list { margin-top: 15px; }
  .metrics-grid,
  .mini-metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 120px; display: block; padding: 15px; }
  .metric-icon { width: 36px; height: 36px; margin-bottom: 10px; }
  .metric-content strong { font-size: 21px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .span-2, .insight-card { grid-column: auto; }
  .card-header { padding: 17px; }
  .card-body { padding: 17px; }
  .trend-strip { grid-template-columns: 1fr; }
  .trend-strip > div { border-right: 0; border-bottom: 1px solid #e8eee9; }
  .chart-wrap { padding-inline: 6px; }
  .chart-wrap canvas { height: 230px; }
  .transaction-row { grid-template-columns: 36px minmax(0, 1fr); padding: 13px 16px; }
  .transaction-amount { grid-column: 2; justify-items: start; }
  .form-grid,
  .form-grid-4 { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .filter-form { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filter-form .btn-primary { grid-column: span 1; }
  .table-header { align-items: flex-start; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; font-size: 10px; }
  .content-toolbar { align-items: stretch; flex-direction: column; }
  .compact-search { width: 100%; }
  .product-card-grid,
  .caption-history-grid,
  .test-result-grid { grid-template-columns: 1fr; }
  .impact-hero { grid-template-columns: 1fr; padding: 24px; }
  .partner-seal { min-width: 0; }
  .solution-flow { grid-template-columns: 1fr; }
  .solution-flow > i { transform: rotate(90deg); justify-self: center; }
  .deployment-steps { grid-template-columns: 1fr; }
  .comparison-row { grid-template-columns: 90px minmax(0, 1fr) 62px; }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(18px);
    box-shadow: 0 -12px 30px rgba(24, 55, 36, .08);
  }
  .mobile-nav-item { display: grid; justify-items: center; gap: 3px; padding: 5px 2px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 8px; font-weight: 750; }
  .mobile-nav-item .icon { width: 19px; height: 19px; }
  .mobile-nav-item.active { color: var(--primary); background: var(--primary-light); }
  .toast { left: 14px; right: 14px; bottom: 84px; max-width: none; }
}

@media (max-width: 430px) {
  .metrics-grid, .mini-metrics { grid-template-columns: 1fr; }
  .metric-card { display: flex; min-height: 105px; }
  .metric-icon { margin: 0; }
  .hero-actions .btn { width: 100%; }
  .filter-form { grid-template-columns: 1fr; }
  .search-field, .filter-form .btn-primary { grid-column: auto; }
  .header-actions { flex-direction: column; }
  .test-times { grid-template-columns: 1fr auto 1fr; }
  .saving-pill { grid-column: 1 / -1; justify-self: start; }
}

@media print {
  .sidebar,
  .topbar,
  .mobile-nav,
  .flash-stack,
  .natural-input-card,
  .transaction-guide,
  .confirm-card,
  .filter-bar,
  .header-actions,
  .table-action { display: none !important; }
  .app-shell { display: block; }
  .main { display: block; }
  .content { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; }
  .card-header { padding-inline: 0; }
  .data-table { min-width: 0; font-size: 10px; }
  body { background: #fff; }
}

/* Authentication & role management — v3 */
.login-page {
  min-height: 100vh;
  padding: 0;
  background: #0f3323;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(430px, .85fr);
}
.login-showcase {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 5vw, 72px);
  color: #fff;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 221, 126, .18), transparent 25%),
    radial-gradient(circle at 90% 86%, rgba(95, 203, 139, .18), transparent 28%),
    linear-gradient(145deg, #174c34 0%, #0e2e20 100%);
}
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  color: #fff;
  text-decoration: none;
}
.login-brand > span:last-child { display: grid; line-height: 1.1; }
.login-brand strong { font-size: 18px; }
.login-brand small { margin-top: 5px; color: rgba(255,255,255,.6); font-size: 11px; }
.login-copy { max-width: 760px; margin: auto 0 52px; }
.login-eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #ffe39a;
  background: rgba(255,255,255,.07);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.login-copy h1 {
  max-width: 720px;
  margin: 20px 0 16px;
  font-size: clamp(40px, 5vw, 76px);
  line-height: .98;
  letter-spacing: -.06em;
}
.login-copy p { max-width: 650px; margin: 0; color: rgba(255,255,255,.72); font-size: 16px; }
.login-role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.login-role-grid article {
  min-height: 145px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(12px);
}
.login-role-grid article > span { color: #f5ce67; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.login-role-grid strong { display: block; margin-top: 13px; font-size: 13px; }
.login-role-grid p { margin: 7px 0 0; color: rgba(255,255,255,.62); font-size: 10px; }
.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
  background:
    radial-gradient(circle at 100% 0%, rgba(71,165,111,.13), transparent 35%),
    #f5f7f3;
}
.login-card { width: min(100%, 490px); padding: 34px; border: 1px solid var(--border); border-radius: 28px; background: #fff; box-shadow: 0 30px 90px rgba(10, 40, 25, .14); }
.login-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-card-head h2 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.login-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.login-lock { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; color: #17452f; background: linear-gradient(145deg, #f1c95b, #ffe7a3); font-weight: 950; }
.login-form { display: grid; gap: 15px; }
.login-form .field label { font-size: 11px; }
.login-form input { min-height: 50px; }
.login-flashes { margin: 0 0 18px; }
.demo-access { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 14px; border: 1px solid #dce9df; border-radius: 16px; background: #f2f8f3; }
.demo-access > div { display: grid; }
.demo-access strong { font-size: 11px; }
.demo-access small { color: var(--muted); font-size: 9px; }
.login-note { margin: 12px 0 0; color: var(--muted); font-size: 9px; text-align: center; overflow-wrap: anywhere; }

.sidebar-role { display: flex; align-items: center; gap: 9px; margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-role > span { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #19452f; background: #f4d374; font-size: 11px; font-weight: 900; }
.sidebar-role p { display: grid; min-width: 0; margin: 0; }
.sidebar-role p strong { color: #fff; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-role p small { margin-top: 1px; color: rgba(255,255,255,.55); font-size: 8px; }
.user-pill { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 10px 5px 6px; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.user-avatar { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #fff; background: var(--primary); font-size: 10px; font-weight: 900; }
.user-avatar.large { width: 40px; height: 40px; border-radius: 12px; font-size: 13px; }
.user-pill > span:last-child { display: grid; line-height: 1.1; }
.user-pill strong { max-width: 120px; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pill small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.logout-form { margin: 0; }
.read-only-pill { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; color: #fff; background: rgba(255,255,255,.08); font-size: 10px; font-weight: 800; }
.read-only-note, .read-only-explainer { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid #dce6de; border-radius: 13px; color: var(--muted); background: #f6f9f6; font-size: 10px; }
.read-only-note .icon, .read-only-explainer .icon { color: var(--primary); }
.read-only-explainer p { margin: 0; }
.read-only-banner { display: flex; align-items: center; gap: 13px; padding: 17px 20px; }
.read-only-banner > div { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: var(--blue); background: var(--blue-soft); }
.read-only-banner span { display: grid; }
.read-only-banner strong { font-size: 12px; }
.read-only-banner p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.read-only-label { padding: 7px 10px; border-radius: 9px; color: var(--muted); background: #eef2ef; font-size: 9px; font-weight: 800; }
.read-only-card { min-height: 220px; }

.user-management-layout { display: grid; grid-template-columns: minmax(330px, .65fr) minmax(0, 1.35fr); gap: 18px; align-items: start; }
.user-form-card { position: sticky; top: 92px; }
.user-list-content { min-width: 0; }
.section-gap-small { margin-top: 14px; }
.toggle-field { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: #f8faf8; cursor: pointer; }
.toggle-field > input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-field > span { position: relative; width: 40px; height: 23px; flex: 0 0 auto; border-radius: 999px; background: #cad4cd; transition: .2s; }
.toggle-field > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: .2s; }
.toggle-field > input:checked + span { background: var(--primary); }
.toggle-field > input:checked + span::after { transform: translateX(17px); }
.toggle-field p { display: grid; margin: 0; }
.toggle-field strong { font-size: 10px; }
.toggle-field small { color: var(--muted); font-size: 8px; }
.credential-card { overflow: hidden; }
.credential-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.credential-grid > div { min-width: 0; padding: 17px; border-right: 1px solid #edf1ee; }
.credential-grid > div:last-child { border-right: 0; }
.credential-grid span { display: block; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.credential-grid strong, .credential-grid code { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.credential-grid strong { font-size: 9px; }
.credential-grid code { padding: 5px 7px; color: #274335; background: #edf5ef; font-size: 8px; }
.user-list { display: grid; }
.user-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 36px; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #edf1ee; }
.user-row:last-child { border-bottom: 0; }
.user-row-main { display: grid; min-width: 0; }
.user-row-main strong { font-size: 11px; }
.user-row-main span, .user-row-main small { color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }
.user-row-status { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.role-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 850; }
.role-owner { color: #714f00; background: #fff2c8; }
.role-staff { color: #155a8a; background: #e4f3ff; }
.role-reviewer { color: #5b418f; background: #f0e9ff; }
.permission-table td:not(:first-child), .permission-table th:not(:first-child) { text-align: center; }
.audit-list { display: grid; }
.audit-list > div { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #edf1ee; }
.audit-list > div:last-child { border-bottom: 0; }
.audit-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.audit-list p { display: grid; margin: 0; }
.audit-list strong { font-size: 10px; }
.audit-list small, .audit-list time { color: var(--muted); font-size: 8px; }

@media (max-width: 1100px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-showcase { min-height: auto; }
  .login-copy { margin: 70px 0 38px; }
  .login-panel { min-height: auto; padding-block: 70px; }
  .user-management-layout { grid-template-columns: 1fr; }
  .user-form-card { position: static; }
}

@media (max-width: 720px) {
  .login-showcase { padding: 24px 18px 32px; }
  .login-copy { margin: 52px 0 28px; }
  .login-copy h1 { font-size: 42px; }
  .login-role-grid { grid-template-columns: 1fr; }
  .login-role-grid article { min-height: auto; }
  .login-panel { padding: 28px 14px 46px; }
  .login-card { padding: 23px 18px; border-radius: 22px; }
  .demo-access { align-items: stretch; flex-direction: column; }
  .demo-access .btn { width: 100%; }
  .user-pill { display: none; }
  .credential-grid { grid-template-columns: 1fr; }
  .credential-grid > div { border-right: 0; border-bottom: 1px solid #edf1ee; }
  .credential-grid > div:last-child { border-bottom: 0; }
  .user-row { grid-template-columns: 40px minmax(0, 1fr) 36px; }
  .user-row-status { grid-column: 2; justify-content: flex-start; }
  .audit-list > div { grid-template-columns: 12px minmax(0, 1fr); }
  .audit-list time { grid-column: 2; }
}

.brand-logo {
    width: 48px;
    height: 48px;
    display: block;
    object-fit: contain;
    flex: 0 0 48px;
}

/* Logo halaman login */
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-brand-logo {
    width: 54px !important;
    height: 54px !important;
    max-width: 54px !important;
    min-width: 54px;
    object-fit: contain;
    display: block;
    border-radius: 14px;
    background: transparent;
}

.login-brand > span {
    display: flex;
    flex-direction: column;
}

.login-brand > span strong {
    font-size: 18px;
    line-height: 1.2;
}

.login-brand > span small {
    font-size: 12px;
}

@media (max-width: 768px) {
    .login-brand-logo {
        width: 44px !important;
        height: 44px !important;
        max-width: 44px !important;
        min-width: 44px;
    }
}

/* Paksa ukuran logo login */
.login-showcase > img {
    display: none !important;
}

.login-brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.login-brand img.login-brand-logo {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 52px !important;
    background: transparent !important;
    border-radius: 12px !important;
}

/* Login publik sederhana */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, #edf8f0, transparent 40%),
        #f7faf7;
}

.login-shell {
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
}

.login-showcase {
    display: none !important;
}

.login-panel {
    width: 100% !important;
    min-height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    background: transparent !important;
}

.login-card {
    width: min(100%, 440px) !important;
    margin: 0 auto !important;
}

.login-card-head-clean {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 10px;
}

.login-card-logo {
    width: 58px !important;
    height: 58px !important;
    max-width: 58px !important;
    object-fit: contain !important;
    display: block;
}

.login-card-head-clean h2 {
    margin: 0;
}

.demo-login-button {
    margin-top: 14px;
}

@media (max-width: 600px) {
    .login-shell {
        padding: 16px !important;
    }

    .login-card {
        width: 100% !important;
    }
}
