/* Impulse Eggs ERP — design system */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-latin-700-normal.woff2') format('woff2'); }

:root {
  --yellow: #FFC928;
  --yellow-soft: #FFF6D6;
  --black: #222222;
  --navy: #0B1F3A;
  --navy-2: #13294B;
  --white: #FFFFFF;
  --bg: #F7F8FA;
  --border: #E6E8EC;
  --muted: #64748B;
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --warning: #D97706;
  --warning-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11,31,58,.05), 0 4px 16px rgba(11,31,58,.06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 260px;
  --topbar-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--black); background: var(--bg); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
a { color: inherit; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-btn.only-mobile { display: none; }

/* Brand */
.brand-logo { display: block; max-width: 150px; height: auto; }
.brand-wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 24px; letter-spacing: -.02em; }
.brand-wordmark-light { color: #fff; }
.brand-wordmark-dark { color: var(--black); }
.brand-oval { width: 30px; height: 38px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--black); display: inline-block; }
.brand-wordmark-light .brand-oval { border-color: #fff; }

/* App shell */
.app { min-height: 100vh; display: flex; }
.sidebar { width: var(--sidebar-w); background: var(--navy); color: #cbd5e1; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40; padding: 20px 14px; transition: transform .22s ease; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 6px; }
.sidebar .brand-logo { background: #fff; padding: 6px 10px; border-radius: 10px; }
.sidebar-sub { padding: 2px 10px 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #8aa0bf; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: #cbd5e1; text-decoration: none; font-weight: 500; border: 0; background: none; font-family: inherit; font-size: 15px; width: 100%; cursor: pointer; }
.nav-link:hover { background: var(--navy-2); color: #fff; }
.nav-link.is-active { background: var(--yellow); color: var(--black); font-weight: 600; }
.nav-link.is-disabled { opacity: .5; cursor: not-allowed; }
.nav-link.is-disabled:hover { background: none; color: #cbd5e1; }
.soon { margin-left: auto; font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; background: var(--navy-2); padding: 2px 7px; border-radius: 99px; }
.sidebar-foot { border-top: 1px solid var(--navy-2); padding-top: 12px; margin-top: 12px; }
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; transition: margin .22s ease; }
.app.collapsed .sidebar { transform: translateX(-100%); }
.app.collapsed .main { margin-left: 0; }
.topbar { height: var(--topbar-h); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 0 24px; }
.topbar-title { font-size: 18px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--yellow); color: var(--black); font-weight: 700; display: grid; place-items: center; }
.who { display: flex; flex-direction: column; line-height: 1.2; }
.who small { color: var(--muted); font-size: 12px; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: inherit; }
.icon-btn:hover { background: rgba(100,116,139,.12); }
.sidebar .icon-btn { color: #fff; }
.content { padding: 24px; max-width: 1360px; width: 100%; margin: 0 auto; }
.scrim { position: fixed; inset: 0; background: rgba(11,31,58,.5); z-index: 35; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 16px; font-weight: 600; }
.card-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h2 { font-size: 22px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; overflow: hidden; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi-accent { background: var(--yellow); border-color: var(--yellow); }
.kpi-accent .kpi-label, .kpi-accent .kpi-sub { color: rgba(34,34,34,.75); }
.kpi-warn .kpi-value { color: var(--warning); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.chart-box { position: relative; height: 260px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .08s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--black); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-accent { background: var(--yellow); color: var(--black); }
.btn-accent:hover { background: #f5be14; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--black); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; }
.input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 16px; background: #fff; color: var(--black); }
.input:focus { outline: 3px solid rgba(255,201,40,.45); border-color: var(--yellow); }
.help { font-size: 12px; color: var(--muted); }

/* Alerts & badges */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: #991B1B; border-color: #FECACA; }
.alert-success { background: var(--success-soft); color: #166534; border-color: #BBF7D0; }
.alert-warning { background: var(--warning-soft); color: #92400E; border-color: #FDE68A; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--success-soft); color: #166534; }
.badge-warning { background: var(--warning-soft); color: #92400E; }
.badge-danger { background: var(--danger-soft); color: #991B1B; }
.badge-neutral { background: #EEF1F5; color: #475569; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid #F1F3F6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--danger); } .neg { color: var(--success); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 14px; }
.empty .icon { width: 28px; height: 28px; opacity: .5; display: block; margin: 0 auto 8px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F1F3F6; }
.list li:last-child { border-bottom: 0; }
.list small { color: var(--muted); display: block; }

/* Store dashboard */
.hero { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 16px; }
.hero h2 { font-size: 20px; }
.hero p { margin: 4px 0 0; color: #a9bbd4; font-size: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.stat strong { display: block; font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-hi { background: var(--yellow-soft); border-color: var(--yellow); }
.report-cards { display: none; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side .brand-logo { background: #fff; padding: 8px 14px; border-radius: 12px; }
.login-side h2 { font-size: 34px; letter-spacing: -.02em; max-width: 18ch; }
.login-side p { color: #a9bbd4; max-width: 38ch; }
.login-main { display: grid; place-items: center; padding: 28px 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .mobile-brand { display: none; margin-bottom: 24px; }
.login-card h1 { font-size: 26px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 24px; }

/* Responsive */
@media (max-width: 1199px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  .app.drawer-open .sidebar { transform: translateX(0); }
  .main, .app.collapsed .main { margin-left: 0; }
  .icon-btn.only-mobile { display: grid; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .topbar { padding: 0 12px; }
  .who { display: none; }
  .content { padding: 16px 14px 96px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kpi-value { font-size: 22px; }
  .page-head h2 { font-size: 19px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .login-card .mobile-brand { display: block; }
  .report-table { display: none; }
  .report-cards { display: block; }
  .rcard { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .rcard small { color: var(--muted); }
  .sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(247,248,250,.96); border-top: 1px solid var(--border); z-index: 25; }
  .hero .btn { width: 100%; }
}
@media (min-width: 768px) { .sticky-cta { position: static; } .hero { flex-direction: row; align-items: center; justify-content: space-between; } }
@media (max-width: 380px) { .kpi-grid, .stat-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
:focus-visible { outline: 3px solid rgba(255,201,40,.7); outline-offset: 2px; }

/* ---- v1.1 additions ---- */
.req { color: var(--danger); }
textarea.input { padding: 12px 14px; min-height: 84px; resize: vertical; }
select.input { appearance: auto; }
.err-list { margin: 0; padding-left: 18px; }
.form-card { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.inline-form { display: inline; margin: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar .field { margin: 0; min-width: 150px; flex: 1 1 150px; }
.toolbar .field.grow { flex: 2 1 220px; }
.toolbar .input { min-height: 44px; }
.toolbar-btns { display: flex; gap: 8px; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.pager-info { color: var(--muted); font-size: 13px; margin-top: 12px; }
.pager .pager-info { margin: 0; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pg { min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; font-size: 14px; background: #fff; }
.pg.is-active { background: var(--black); color: #fff; border-color: var(--black); }
.pg.is-disabled { opacity: .4; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #F1F3F6; font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv strong { text-align: right; font-weight: 600; }
.tfoot-total td { font-weight: 700; background: #FAFBFC; border-top: 2px solid var(--border); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.tab { white-space: nowrap; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border); background: #fff; text-decoration: none; font-size: 14px; font-weight: 500; }
.tab.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.row-link { text-decoration: none; font-weight: 600; }
.row-link:hover { text-decoration: underline; }
.calc { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px; margin: 4px 0 18px; }
.calc .line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.1); }
.calc .line:last-child { border-bottom: 0; }
.calc .line span { color: #b8c7dc; }
.calc .line strong { font-variant-numeric: tabular-nums; font-size: 17px; }
.calc .big { font-size: 22px !important; }
.calc .hi strong { color: var(--yellow); }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 18px 0 10px; }
.readonly { background: #F3F5F8; color: var(--black); }
.money-in { font-size: 20px; font-weight: 600; }
.diff-box { border-radius: var(--radius); padding: 16px 18px; margin: 12px 0 18px; display: flex; justify-content: space-between; align-items: center; background: var(--yellow-soft); border: 1px solid var(--yellow); }
.diff-box strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.diff-box.is-clear { background: var(--success-soft); border-color: #86EFAC; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0 0 16px 22px; position: relative; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.timeline small { color: var(--muted); display: block; }
.demo-box { margin-top: 22px; border: 1px dashed #D5B84A; background: var(--yellow-soft); border-radius: var(--radius-sm); padding: 14px; font-size: 13px; }
.demo-box h3 { font-size: 13px; margin-bottom: 8px; }
.demo-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-pick button { border: 1px solid var(--border); background: #fff; border-radius: 99px; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 36px; }
.demo-pick button:hover { border-color: var(--black); }
.steps { display: flex; gap: 8px; margin-bottom: 18px; font-size: 13px; }
.steps span { flex: 1; text-align: center; padding: 8px; border-radius: 99px; background: #EEF1F5; color: var(--muted); font-weight: 600; }
.steps span.on { background: var(--black); color: #fff; }
.success-hero { text-align: center; padding: 28px 16px; }
.success-hero .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; margin: 0 auto 12px; }
.success-hero .tick .icon { width: 34px; height: 34px; }
@media (max-width: 767px) {
  .form-grid { grid-template-columns: 1fr; }
  .toolbar .field, .toolbar .field.grow { flex: 1 1 100%; }
  .toolbar-btns { width: 100%; } .toolbar-btns .btn { flex: 1; }
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 10px; background: #fff; }
  .stack-table td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .stack-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  .stack-table td.actions { justify-content: flex-end; }
  .stack-table td.actions::before { content: none; }
  .kpi-grid.kpi-2 { grid-template-columns: 1fr 1fr; }
  .calc .line { font-size: 14px; }
}
