@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700&display=swap');

:root {
  --bg: #f7f6f3; --surface: #fff; --surface-soft: #fbfaf7; --ink: #302e2a;
  --muted: #777168; --gold: #c4a15d; --gold-deep: #8d7549; --gold-soft: #eee0c2;
  --dark: #191b22; --dark-soft: #242731; --line: #e7e0d5; --danger: #a33a3a;
  --success: #327154; --warning: #9a6d26; --sidebar: 264px; --sidebar-mini: 78px;
  --shadow: 0 14px 40px rgba(49, 42, 31, .07); --radius: 16px;
  font-family: "DM Sans", system-ui, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
body { --gold: var(--brand-primary, #c4a15d); --gold-deep: var(--brand-primary, #8d7549); --gold-soft: color-mix(in srgb, var(--brand-primary, #c4a15d) 20%, white); }
a { color: var(--gold-deep); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, .button, input[type="submit"] { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(196, 161, 93, .38); outline-offset: 2px; }
h1, h2, h3 { font-family: Manrope, "DM Sans", sans-serif; letter-spacing: -.025em; color: var(--ink); }
h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); margin: 0 0 .35rem; }
h2 { font-size: 1.15rem; margin-top: 0; }
p { line-height: 1.6; }

.app-shell { min-height: 100vh; padding-left: var(--sidebar); transition: padding-left .25s ease; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); display: flex; flex-direction: column; color: #f8f4ea; background: linear-gradient(180deg, #1b1d24 0%, #15171c 100%); border-right: 1px solid #2f3036; transition: width .25s ease, transform .25s ease; }
.sidebar-brand { height: 92px; display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand > a { min-width: 0; flex: 1; display: flex; align-items: center; gap: 11px; color: white; text-decoration: none; overflow: hidden; }
.sidebar-brand img { width: 52px; height: 52px; flex: 0 0 auto; object-fit: cover; border-radius: 10px; }
.sidebar-brand span { display: grid; white-space: nowrap; letter-spacing: .12em; }
.sidebar-brand strong { font-size: .95rem; }
.sidebar-brand small { color: #c7a967; font-size: .55rem; letter-spacing: .28em; }
.sidebar-toggle { width: 28px; height: 28px; padding: 0; flex: 0 0 auto; color: #e7d3a6; background: #292b32; border: 1px solid #3a3c44; border-radius: 50%; font-size: 1.25rem; line-height: 1; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 24px; scrollbar-width: thin; }
.nav-section { margin: 20px 12px 7px; color: #8f9096; font-size: .62rem; font-weight: 700; letter-spacing: .16em; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.sidebar-nav a { position: relative; display: flex; align-items: center; min-height: 43px; margin: 2px 0; padding: 8px 12px; gap: 12px; color: #c9c9cc; border-radius: 10px; text-decoration: none; font-size: .88rem; font-weight: 500; white-space: nowrap; transition: .16s ease; }
.sidebar-nav a:hover { color: white; background: rgba(255,255,255,.06); }
.sidebar-nav a.active { color: #fff6df; background: linear-gradient(90deg, rgba(196,161,93,.25), rgba(196,161,93,.08)); }
.sidebar-nav a.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 22px; background: var(--gold); border-radius: 0 4px 4px 0; }
.nav-icon { width: 24px; flex: 0 0 24px; text-align: center; color: #d1b776; font-size: 1.25rem; line-height: 1; }
.sidebar-account { min-height: 78px; display: flex; align-items: center; gap: 10px; padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: #28231b; background: var(--gold-soft); border-radius: 50%; font-weight: 700; }
.account-copy { min-width: 0; flex: 1; display: grid; }
.account-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.account-copy small { color: #9fa0a5; font-size: .68rem; }
.account-settings { color: #c9c9cc; text-decoration: none; }
.sidebar-collapsed { padding-left: var(--sidebar-mini); }
.sidebar-collapsed .sidebar { width: var(--sidebar-mini); }
.sidebar-collapsed .sidebar-brand { padding-inline: 13px; }
.sidebar-collapsed .sidebar-brand span, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-section, .sidebar-collapsed .account-copy, .sidebar-collapsed .account-settings { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
.sidebar-collapsed .sidebar-brand img { width: 44px; height: 44px; }
.sidebar-collapsed .sidebar-toggle { position: absolute; left: 64px; top: 34px; }
.sidebar-collapsed .sidebar-nav a { justify-content: center; padding-inline: 8px; }
.sidebar-collapsed .sidebar-account { justify-content: center; padding-inline: 8px; }

.app-frame { min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 20; min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 12px clamp(18px, 3vw, 42px); background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.app-header > div:first-of-type { display: grid; }
.app-header strong { font-size: .9rem; }
.eyebrow { color: var(--gold-deep); font-size: .6rem; font-weight: 700; letter-spacing: .2em; }
.header-actions, .header-actions form { display: flex; align-items: center; gap: 12px; margin: 0; }
.header-user { color: var(--muted); font-size: .82rem; }
.quiet-button { padding: 8px 13px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 9px; }
.quiet-button:hover { border-color: var(--gold); }
.mobile-menu, .sidebar-overlay { display: none; }
.app-content { width: min(1440px, 100%); margin: 0 auto; padding: clamp(24px, 4vw, 48px); }

.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.page-heading p { margin: 4px 0 0; color: var(--muted); }
.page-kicker { display: block; margin-bottom: 7px; color: var(--gold-deep); font-size: .65rem; font-weight: 700; letter-spacing: .16em; }
.button.secondary { color: var(--gold-deep); background: white; border-color: var(--gold-soft); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 4px 0 0; font-size: 1.25rem; }
.section-heading a { font-size: .8rem; font-weight: 600; text-decoration: none; }
.overview-card { margin-bottom: 30px; }
.quick-section { margin-top: 30px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 13px; }
.quick-grid > a { min-height: 88px; display: flex; align-items: center; gap: 14px; padding: 17px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; transition: .16s ease; }
.quick-grid > a:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.quick-grid > a > span { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; color: var(--gold-deep); background: #f5ecda; border-radius: 12px; font-size: 1.3rem; }
.quick-grid > a > div { min-width: 0; flex: 1; display: grid; gap: 3px; }
.quick-grid small { color: var(--muted); }
.quick-grid b { color: var(--gold); }
.empty-home { display: flex; align-items: center; gap: 16px; }
.empty-home > span { font-size: 2rem; color: var(--gold); }
.empty-home h2, .empty-home p { margin: 0; }
.card, .table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(255,255,255,.8); }
.card { padding: clamp(18px, 2.5vw, 28px); }
.card + .card { margin-top: 18px; }
.card.compact { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.button, button, input[type="submit"] { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 16px; color: white; background: var(--dark); border: 1px solid var(--dark); border-radius: 10px; font-weight: 600; text-decoration: none; transition: transform .15s ease, background .15s ease; }
.button:hover, button:hover, input[type="submit"]:hover { background: var(--dark-soft); transform: translateY(-1px); }
input, select, textarea { width: 100%; min-height: 42px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #d8cdbc; border-radius: 10px; }
textarea { min-height: 110px; resize: vertical; }
label { display: grid; gap: 7px; margin: 14px 0; color: #504b44; font-size: .83rem; font-weight: 600; }
fieldset { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 8px; font-weight: 700; }
.check { display: flex; align-items: center; gap: 8px; }
.check input, input[type="checkbox"], input[type="radio"] { width: 17px; min-height: 17px; accent-color: var(--gold-deep); }
.form-grid, .module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.search, .inline-form, .sales-actions, .metrics, .actions, .actions form, .category-list .card span, .category-list form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { margin: 0 0 22px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.search > label { flex: 1; min-width: 180px; margin: 0; }
.search input, .search select { width: auto; min-width: 180px; flex: 1; }
.search .check { min-height: 42px; margin: 0; padding: 0 8px; white-space: nowrap; }
.inline-form { align-items: end; }
.inline-form label { flex: 1; min-width: 180px; }
.inline-form .product-picker-search { flex-basis: 100%; }
.sales-item-grid { display:grid; grid-template-columns:minmax(260px,2fr) repeat(2,minmax(160px,1fr)); gap:16px; align-items:start; }
.sales-item-grid .product-picker-search { grid-column:1/-1; }
.sales-item-grid input, .sales-item-grid select { min-height:52px; }
.sales-item-grid input[type="submit"] { grid-column:1/-1; width:100%; }
.card-price-pill { display:none; align-items:center; justify-content:space-between; gap:8px; width:100%; margin-top:6px; padding:8px 12px; background:#1e293b; color:#f8fafc !important; border:1px solid #334155; border-radius:9px; font-size:.8rem; font-weight:500; text-align:left; cursor:pointer; transition:all .18s ease; box-shadow:0 2px 6px rgba(0,0,0,.08); }
.card-price-pill:hover { background:#0f172a; border-color:#475569; transform:translateY(-1px); box-shadow:0 4px 12px rgba(0,0,0,.15); }
.card-price-pill .pill-icon { font-size:1rem; line-height:1; }
.card-price-pill .pill-text { flex:1; color:#cbd5e1; }
.card-price-pill .pill-text strong { color:#ffffff !important; font-weight:700; margin-left:3px; }
.card-price-pill .pill-action { display:inline-block; padding:3px 8px; background:rgba(255,255,255,0.16); border:1px solid rgba(255,255,255,0.28); border-radius:6px; color:#ffffff !important; font-size:.7rem; font-weight:700; letter-spacing:.02em; text-transform:uppercase; }
.card-price-pill:hover .pill-action { background:rgba(255,255,255,0.28); }
.payment-comparison { display:grid; grid-template-columns:minmax(220px,1fr) minmax(300px,2fr); gap:14px; margin:18px 0; }
.payment-comparison > div { border:1px solid var(--border); border-radius:14px; padding:16px; background:var(--surface-soft); }
.payment-comparison small, .payment-comparison span { display:block; }
.payment-comparison strong { display:block; font-size:1.5rem; margin:5px 0; }
.card-quotes div { display:grid; gap:5px; margin-top:6px; }
.settings-payment-form { grid-template-columns:minmax(180px,2fr) minmax(260px,2fr) auto; }
.settings-interest-form { padding:18px; margin:0 0 26px; border:1px solid var(--line); border-radius:14px; background:var(--surface-soft); }
.settings-card-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.settings-option-card { min-width:0; min-height:142px; display:flex; flex-direction:column; justify-content:center; gap:12px; margin:0; padding:18px; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.settings-option-card.check { display:grid; grid-template-columns:auto 1fr; align-items:start; }
.settings-option-card.check input { margin-top:3px; }
.settings-option-card span,.settings-option-card strong,.settings-option-card small { display:block; }
.settings-option-card strong { margin-bottom:6px; font-size:.95rem; line-height:1.35; }
.settings-option-card small { color:var(--muted); font-weight:500; line-height:1.45; }
.settings-option-card select { width:100%; margin-top:auto; }
.settings-form-footer { display:flex; justify-content:flex-end; margin-top:14px; }
.settings-form-footer input[type="submit"] { width:auto; min-width:260px; }
.settings-rule-heading { display:flex; justify-content:space-between; gap:16px; margin:4px 0 12px; }
.settings-rule-heading h3 { margin:0 0 4px; }
.settings-rule-heading p { margin:0; color:var(--muted); }
.settings-rule-form { display:grid; grid-template-columns:minmax(210px,1.4fr) minmax(170px,1fr) minmax(210px,1fr) auto; gap:12px; align-items:end; margin-bottom:22px; }
.settings-rule-form label { min-width:0; margin:0; }
.settings-rule-form input { min-width:0; }
.settings-rule-form input[type="submit"] { width:auto; }
@media (max-width:800px) { .sales-item-grid, .payment-comparison,.settings-card-options,.settings-rule-form { grid-template-columns:1fr; } .sales-item-grid .product-picker-search { grid-column:auto; } .settings-payment-form { grid-template-columns:1fr; } .settings-form-footer input[type="submit"],.settings-rule-form input[type="submit"] { width:100%; } }
.product-picker-search input { width: 100%; }
.product-search-status { display: block; min-height: 1.2em; margin-top: 5px; color: var(--muted); }
.actions a { font-weight: 600; font-size: .82rem; }
.actions input, .actions select { width: auto; min-width: 130px; }
.actions button { min-height: 36px; padding: 7px 11px; font-size: .78rem; }
.sales-actions { align-items: end; }
.sales-actions form { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.sales-actions > a, .sales-actions > form > button, .sales-actions > form > input { min-height: 42px; }
.order-actions-section { display:grid; gap:18px; margin-top:28px; }
.order-quick-actions { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.order-quick-actions h2, .order-action-card h3 { margin:0 0 6px; }
.order-quick-actions p, .order-action-card p { margin:0; }
.order-action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:stretch; }
.order-action-grid.single { grid-template-columns:minmax(0,1fr); }
.order-action-card { display:flex; flex-direction:column; justify-content:space-between; gap:18px; margin:0; padding:22px; }
.order-action-card form { display:grid; gap:10px; }
.order-action-card button { width:100%; min-height:46px; }
.order-action-card .confirmation-check { align-items:flex-start; padding:14px; background:var(--surface-soft); border-radius:10px; line-height:1.45; }
.order-action-card .confirmation-check input { flex:0 0 auto; margin-top:3px; }
.action-eyebrow { display:block; margin-bottom:8px; color:var(--brand-primary); font-size:.72rem; font-weight:800; letter-spacing:.12em; }
.action-eyebrow.danger { color:#a33b3b; }
.cancel-sale label { display:grid; gap:7px; font-weight:700; }
.danger-button { color:#fff; background:#9d3434; border-color:#9d3434; }
.danger-button:hover { background:#832929; border-color:#832929; }
.danger-button:disabled { cursor:not-allowed; color:var(--muted); background:var(--surface-soft); border-color:var(--line); opacity:1; }
.catalog-conversion { flex: 1; }
.catalog-conversion label { min-width: 280px; margin: 0; }
.catalog-pending { margin-bottom: 28px; border-color: var(--gold-soft); }
.catalog-pending .table-wrap { margin-bottom: 0; }
.receivable-actions > form { padding: 16px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }

.table-wrap { overflow-x: auto; margin: 14px 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #eee9e1; vertical-align: middle; }
th { color: #70695f; background: var(--surface-soft); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
tbody tr:hover { background: #fdfbf7; }
tbody tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge.active { color: #245b43; background: #e1f2e8; }
.badge.inactive { color: #8b3030; background: #f7dfdf; }
.message { margin-bottom: 18px; padding: 13px 16px; border: 1px solid; border-radius: 11px; }
.message.error { color: #8f3030; background: #fff1f1; border-color: #efcaca; }
.message.success { color: #225e43; background: #edf8f1; border-color: #cbe8d6; }
small { color: var(--muted); }
label small, .form-grid small { color: var(--danger); }
.hint { color: #665c4d; background: #f3eee4; padding: 12px 14px; border-radius: 10px; }
.category-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

.metrics { align-items: stretch; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.metrics > div { position: relative; display: grid; gap: 7px; min-height: 102px; padding: 18px; background: var(--surface-soft); border: 1px solid #eee7dc; border-radius: 13px; }
.metrics > div::before { content: ""; position: absolute; top: 0; left: 18px; width: 34px; height: 3px; background: var(--gold); border-radius: 0 0 4px 4px; }
.metrics small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.metrics strong { align-self: end; font: 700 1.18rem Manrope, sans-serif; }
.report-kpis, .report-rankings { margin: 18px 0; }
.purchase-totals { margin: 18px 0; }
.bar-list > div { display: grid; grid-template-columns: minmax(140px, 1fr) 3fr auto; gap: 12px; align-items: center; margin: 11px 0; }
.bar-track { height: 9px; background: #ebe5da; border-radius: 99px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--gold); }
.mini-bars { min-width: 130px; display: grid; gap: 4px; }
.mini-bars span { display: block; height: 7px; border-radius: 99px; }
.mini-bars .revenue { background: var(--success); }
.mini-bars .expense { background: var(--danger); }
.dre-table th, .dre-table td { white-space: nowrap; }
.dre-table .indent { padding-left: 32px; }
.dre-total { font-weight: 700; background: #f5f0e7; }
.dre-table .dre-revenue { background:#e7f6ec; color:#185f36; }
.dre-table .dre-expense { background:#fdeaea; color:#8b2f2f; }
.dre-summary { font-weight:800; border-top:2px solid currentColor; border-bottom:2px solid currentColor; }
.dre-result { font-weight: 700; background: var(--dark); color: white; }
.audit-change-list { display:grid; gap:5px; min-width:260px; }
.audit-change-list span { line-height:1.35; }
.data-pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px;margin:18px 0;padding:14px 16px;background:var(--surface);border:1px solid var(--line);border-radius:12px}.data-pagination>div{display:flex;align-items:center;gap:10px}.data-pagination label{display:flex;align-items:center;gap:8px;font-size:.78rem;font-weight:700}.data-pagination select{min-height:38px;padding:6px 28px 6px 10px}
.cash-comparison, .sales-checkout, .sales-actions { margin-top: 18px; }

@media (max-width: 800px) {
  .order-quick-actions { align-items:flex-start; flex-direction:column; }
  .order-action-grid { grid-template-columns:1fr; }
}

.guest-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(520px, 1.12fr) minmax(440px, .88fr); background: #f6f7f5; }
.guest-brand { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(34px, 5vw, 72px); color: white; background: #080a09; isolation: isolate; }
.guest-brand::before { content: ""; position: absolute; z-index: -2; inset: 0; background: radial-gradient(circle at 82% 18%, rgba(57,255,20,.16), transparent 28%), radial-gradient(circle at 15% 90%, rgba(57,255,20,.08), transparent 32%); }
.guest-brand::after { content: ""; position: absolute; z-index: -1; right: -16%; bottom: -20%; width: 72%; aspect-ratio: 1; opacity: .22; background: repeating-linear-gradient(135deg, transparent 0 23px, rgba(57,255,20,.18) 24px 25px); transform: skewX(-10deg); mask-image: linear-gradient(to top left, black, transparent 72%); }
.guest-brand-content { width: min(670px, 100%); margin: auto 0; }
.guest-logo { display: block; width: min(390px, 72%); height: auto; margin: 0 0 clamp(52px, 8vh, 92px); mix-blend-mode: screen; }
.guest-kicker, .login-kicker { display: block; color: #39ff14; font-size: .68rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.guest-brand h1 { max-width: 650px; margin: 18px 0 24px; color: white; font-size: clamp(2.5rem, 4.6vw, 5.4rem); font-weight: 600; line-height: .98; letter-spacing: -.055em; }
.guest-brand h1 em { color: #39ff14; font-style: normal; font-weight: 750; }
.guest-brand-content > p { max-width: 590px; margin: 0; color: #aeb5b0; font-size: clamp(1rem, 1.35vw, 1.2rem); line-height: 1.65; }
.guest-benefits { display: flex; flex-wrap: wrap; gap: 9px; margin: 34px 0 0; padding: 0; list-style: none; }
.guest-benefits li { padding: 9px 13px; color: #dfe4df; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .02em; }
.guest-benefits li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; background: #39ff14; border-radius: 50%; box-shadow: 0 0 12px rgba(57,255,20,.65); vertical-align: 1px; }
.guest-brand-footer { color: #6e7771; font-size: .67rem; letter-spacing: .03em; }
.guest-brand-footer span { margin: 0 7px; color: #39ff14; }
.guest-content { width: min(500px, calc(100% - 64px)); align-self: center; justify-self: center; padding: 54px 0; }
.login-card { padding: clamp(28px, 4vw, 50px); background: white; border-color: #e4e8e4; border-radius: 22px; box-shadow: 0 24px 70px rgba(20,29,23,.09); }
.login-card h1 { margin: 12px 0 10px; color: #101411; font-size: clamp(2rem, 3.2vw, 2.8rem); }
.login-intro { margin: 0 0 30px; color: #68716b; font-size: .94rem; line-height: 1.6; }
.login-card label { margin: 18px 0 0; color: #303732; font-size: .76rem; letter-spacing: .02em; }
.login-card input:not([type="submit"]) { min-height: 52px; padding: 13px 15px; color: #171c18; background: #fafbfa; border-color: #dbe0dc; border-radius: 9px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.login-card input:not([type="submit"]):hover { border-color: #aab3ac; }
.login-card input:not([type="submit"]):focus { background: white; border-color: #20c900; box-shadow: 0 0 0 4px rgba(57,255,20,.13); outline: 0; }
.login-card input::placeholder { color: #a2aaa4; }
.login-card input[type="submit"] { width: 100%; min-height: 52px; margin-top: 24px; color: #061006; background: #39ff14; border-color: #39ff14; border-radius: 9px; font-weight: 750; box-shadow: 0 10px 25px rgba(39,210,7,.18); }
.login-card input[type="submit"]:hover { background: #31e611; border-color: #31e611; box-shadow: 0 12px 30px rgba(39,210,7,.24); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 78px !important; }
.password-field button { position: absolute; top: 50%; right: 6px; width: auto; min-height: 38px; padding: 7px 9px; color: #4d5750; background: transparent; border: 0; transform: translateY(-50%); font-size: .7rem; font-weight: 700; }
.password-field button:hover { color: #0c8d00; background: #edffea; transform: translateY(-50%); }
.login-security { display: flex; align-items: center; gap: 8px; margin: 24px 0 0; padding-top: 20px; color: #637068; border-top: 1px solid #edf0ed; font-size: .74rem; }
.login-security span { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: 0 0 auto; color: #097900; background: #e9ffe5; border-radius: 50%; font-size: .68rem; font-weight: 800; }
.login-help { margin: 10px 0 0; color: #89918c; font-size: .7rem; line-height: 1.5; }
.login-developer-credit { margin: 22px 0 0; color: #747d77; font-size: .68rem; text-align: center; }
.login-developer-credit a { color: #148606; font-weight: 700; }

@media (max-width: 980px) {
  .guest-shell { grid-template-columns: minmax(380px, .9fr) minmax(400px, 1.1fr); }
  .guest-brand { padding: 38px; }
  .guest-logo { width: min(320px, 85%); margin-bottom: 55px; }
  .guest-brand h1 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); }
  .guest-benefits { display: none; }
  .app-shell, .sidebar-collapsed { padding-left: 0; }
  .sidebar, .sidebar-collapsed .sidebar { width: min(292px, 88vw); transform: translateX(-105%); box-shadow: 18px 0 50px rgba(0,0,0,.22); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-toggle { display: none; }
  .sidebar-collapsed .sidebar-brand span, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-section, .sidebar-collapsed .account-copy, .sidebar-collapsed .account-settings { opacity: 1; width: auto; pointer-events: auto; }
  .sidebar-collapsed .sidebar-nav a { justify-content: flex-start; padding-inline: 12px; }
  .sidebar-collapsed .sidebar-account { justify-content: flex-start; padding-inline: 14px; }
  .mobile-menu { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; color: var(--ink); background: white; border-color: var(--line); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 25; padding: 0; opacity: 0; visibility: hidden; background: rgba(10,10,12,.48); border: 0; border-radius: 0; transition: .2s; }
  .sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
  .app-header { justify-content: flex-start; gap: 14px; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 720px) {
  .app-content { padding: 24px 16px 40px; }
  .app-header { min-height: 64px; padding-inline: 14px; }
  .app-header > div:first-of-type, .header-user { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading .button { align-self: flex-start; }
  .form-grid, .module-grid, .metrics { grid-template-columns: 1fr; }
  .search { align-items: stretch; flex-direction: column; }
  .search input, .search select { width: 100%; }
  .bar-list > div { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; }
  .guest-shell { display: block; min-height: 100vh; background: #f6f7f5; }
  .guest-brand { min-height: auto; padding: 25px 22px 58px; }
  .guest-brand::after { right: -35%; bottom: -65%; width: 100%; }
  .guest-brand-content { margin: 0; }
  .guest-logo { width: 230px; max-width: 70%; margin: 0 0 38px; }
  .guest-brand h1 { margin-block: 12px 16px; font-size: clamp(2.15rem, 11vw, 3.2rem); }
  .guest-brand-content > p { font-size: .9rem; line-height: 1.55; }
  .guest-brand-footer { display: none; }
  .guest-content { width: min(100% - 28px, 500px); margin: -28px auto 0; padding: 0 0 34px; position: relative; z-index: 2; }
  .login-card { padding: 28px 22px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Identidade e preferências configuráveis */
.brand-gradient-text { color: var(--brand-primary, var(--gold)); background: var(--brand-name-gradient); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-icon, .page-kicker, .eyebrow { color: var(--brand-primary, var(--gold-deep)); }
.sidebar-nav a.active::before, .metrics > div::before, .bar-track i { background: var(--brand-primary, var(--gold)); }
.settings-form h3 { margin: 28px 0 4px; }
.color-input { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.color-input input[type="color"], .settings-inline-form input[type="color"] { width: 48px; min-width: 48px; height: 42px; padding: 3px; border-radius: 9px; }
.color-input output { color: var(--muted); font-size: .78rem; }
.optional-color { opacity: .7; }
.optional-color.active { opacity: 1; }
.optional-color-toggle { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.optional-color-toggle input { width: auto; min-height: 0; margin: 0; }
.optional-color:not(.active) .color-input { display: none; }
.compact-color { display: flex; min-width: 88px; min-height: 72px; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; margin: 0; color: var(--muted); font-size: .72rem; }
.compact-color input[type="color"] { width: 52px; min-width: 52px; height: 44px; padding: 3px; }
.compact-color.optional-color:not(.active)>input[type="color"] { visibility: hidden; }
.compact-color .optional-color-toggle,.color-control-heading { min-height:17px; display:flex; align-items:center; justify-content:center; margin:0; white-space:nowrap; color:var(--muted); font-size:.78rem; font-weight:700; }
.settings-logo-preview { width: 150px; max-height: 90px; margin: 8px 0 18px; padding: 8px; object-fit: contain; background: #111; border-radius: 10px; }
.settings-switches { display: flex; flex-wrap: wrap; gap: 18px; margin: 22px 0; }
.settings-inline-form { display: grid; grid-template-columns: minmax(180px,2fr) repeat(3,minmax(72px,auto)) auto; align-items: center; gap: 10px; margin-bottom: 22px; }
.settings-inline-form input { min-width: 0; }
.color-combination-form { grid-template-columns:minmax(240px,1fr) repeat(3,100px) auto; align-items:end; gap:14px; }
.color-combination-form>input[type="text"],.color-combination-form>input[type="submit"] { min-height:44px; margin:0; }
.settings-size-form { grid-template-columns: minmax(180px, 1fr) auto; }
.settings-list { display: grid; gap: 8px; }
.settings-list > div { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.settings-list form { margin-left: auto; }
.product-color-dot { display: inline-block; width: 25px; height: 25px; flex: 0 0 auto; background: linear-gradient(135deg, var(--piece-colors)); border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.18); vertical-align: middle; }
.theme-escuro { --bg:#111411; --surface:#1b1f1c; --surface-soft:#222723; --ink:#edf2ee; --muted:#9da8a0; --line:#343b36; background:var(--bg); color:var(--ink); }
.theme-escuro .app-header, .theme-escuro input, .theme-escuro select, .theme-escuro textarea, .theme-escuro .quick-grid > a, .theme-escuro .button.secondary { color:var(--ink); background:#1b1f1c; border-color:var(--line); }
.theme-escuro .card, .theme-escuro .table-wrap, .theme-escuro .search { background:var(--surface); border-color:var(--line); }
.theme-escuro th { color:#b7c0b9; background:#222723; }
.theme-escuro td { border-color:#303631; }
.theme-escuro tbody tr:hover { background:#242925; }
.theme-escuro h1, .theme-escuro h2, .theme-escuro h3 { color:var(--ink); }
/* Aplicação global da identidade escolhida */
body :focus-visible { outline-color: color-mix(in srgb, var(--brand-primary) 42%, transparent); }
.sidebar-brand small, .sidebar-toggle, .nav-icon, .quick-grid b { color: var(--brand-primary); }
.sidebar-nav a.active { color: white; background: linear-gradient(90deg, color-mix(in srgb, var(--brand-primary) 28%, transparent), color-mix(in srgb, var(--brand-primary) 8%, transparent)); }
.quick-grid > a > span, .user-avatar { color: color-mix(in srgb, var(--brand-primary) 55%, #111); background: color-mix(in srgb, var(--brand-primary) 14%, var(--surface)); }
.quick-grid > a:hover, .quiet-button:hover, input:focus, select:focus, textarea:focus { border-color: var(--brand-primary); }
.button.secondary { color: var(--ink); background: color-mix(in srgb, var(--brand-primary) 10%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--brand-primary) 62%, var(--line)); }
.button.secondary:hover { color: var(--ink); background: color-mix(in srgb, var(--brand-primary) 18%, var(--surface)); border-color: var(--brand-primary); }
.page-heading>div:last-child:not(:first-child) { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.page-heading>a:not(.button),.page-heading .actions>a:not(.button),.page-heading>div:last-child>a:not(.button),.section-heading>a:not(.button),.card>form>a:not(.button),form.card>a:not(.button) { display:inline-flex; align-items:center; justify-content:center; min-height:42px; padding:10px 16px; color:var(--ink); background:color-mix(in srgb,var(--brand-primary) 10%,var(--surface)); border:1.5px solid color-mix(in srgb,var(--brand-primary) 62%,var(--line)); border-radius:10px; font-weight:600; text-decoration:none; }
.page-heading>a:not(.button):hover,.page-heading .actions>a:not(.button):hover,.page-heading>div:last-child>a:not(.button):hover,.section-heading>a:not(.button):hover,.card>form>a:not(.button):hover,form.card>a:not(.button):hover { background:color-mix(in srgb,var(--brand-primary) 18%,var(--surface)); border-color:var(--brand-primary); }
.table-wrap td:last-child>a:not(.button),.table-wrap td .actions>a:not(.button),.category-list a:not(.button) { display:inline-flex; align-items:center; justify-content:center; min-height:36px; padding:7px 12px; color:var(--ink); background:color-mix(in srgb,var(--brand-primary) 10%,var(--surface)); border:1.5px solid color-mix(in srgb,var(--brand-primary) 55%,var(--line)); border-radius:9px; font-size:.78rem; font-weight:700; text-decoration:none; }
.table-wrap td:last-child>a:not(.button):hover,.table-wrap td .actions>a:not(.button):hover,.category-list a:not(.button):hover { background:color-mix(in srgb,var(--brand-primary) 19%,var(--surface)); border-color:var(--brand-primary); }
.purchase-item-builder .form-grid { align-items:start; }
.purchase-item-builder .form-grid input,.purchase-item-builder .form-grid select { height:52px; min-height:52px; }
.purchase-item-builder .form-grid label { align-content:start; }
.check input, input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-primary); }
.touch-choice-group { grid-column: 1/-1; }
.touch-choice-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:10px; }
.touch-choice-grid label { position:relative; display:block; min-height:52px; margin:0; cursor:pointer; }
.touch-choice-grid input { position:absolute; width:1px; height:1px; min-height:0; opacity:0; }
.touch-choice-grid span { min-height:52px; display:grid; place-items:center; padding:10px 14px; color:var(--ink); background:var(--surface-soft); border:1px solid var(--line); border-radius:11px; text-align:center; transition:.15s ease; }
.touch-choice-grid input:checked + span { color:color-mix(in srgb,var(--brand-primary) 60%,#111); background:color-mix(in srgb,var(--brand-primary) 15%,var(--surface)); border:2px solid var(--brand-primary); box-shadow:0 0 0 2px color-mix(in srgb,var(--brand-primary) 15%,transparent); }
.touch-choice-grid input:focus-visible + span { outline:3px solid color-mix(in srgb,var(--brand-primary) 35%,transparent); }
.product-color-choice-grid span { display:flex; align-items:center; justify-content:flex-start; gap:11px; text-align:left; }
.product-color-choice-grid .product-color-dot { width:28px; height:28px; flex:0 0 28px; }
.dre-setup-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:stretch; }
.dre-setup-form { display:flex; flex-direction:column; margin:0!important; }
.dre-setup-form>div p { min-height:3.2em; margin:4px 0 8px; color:var(--muted); }
.dre-setup-form input[type="submit"] { width:100%; margin-top:auto; }
.dre-structure-heading { margin-top:34px; }
.dre-category-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:18px; }
.dre-category-card { display:flex; flex-direction:column; padding:0; overflow:hidden; }
.dre-category-card>header { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:20px 22px; background:var(--surface-soft); border-bottom:1px solid var(--line); }
.dre-category-card h3 { margin:3px 0 0; }
.dre-type-list { display:grid; gap:0; padding:8px 22px; }
.dre-type-list>div { min-height:64px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line); }
.dre-type-list>div:last-child { border:0; }
.dre-type-list span { display:grid; gap:2px; }
.dre-category-card>footer { margin-top:auto; padding:14px 22px 20px; }
.dre-category-card>footer form,.dre-category-card>footer button { width:100%; }
@media (max-width:900px) { .color-combination-form { grid-template-columns:repeat(3,minmax(88px,1fr)); }.color-combination-form>input[type="text"],.color-combination-form>input[type="submit"] { grid-column:1/-1; width:100%; } }
@media (max-width:720px) { .settings-inline-form { grid-template-columns:repeat(3,52px) 1fr; }.settings-inline-form input:first-of-type { grid-column:1/-1; }.settings-inline-form input[type="submit"] { grid-column:1/-1; }.color-combination-form { grid-template-columns:repeat(3,minmax(76px,1fr)); }.color-combination-form .compact-color { min-width:0; } }
@media (max-width:720px) { .dre-setup-grid { grid-template-columns:1fr; }.dre-category-grid { grid-template-columns:1fr; }.touch-choice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.badge.warning { color: #b45309; background: #fef3c7; border: 1px solid #fde68a; }
.theme-escuro .badge.warning { color: #fde047; background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.35); }

.session-warning-banner {
    margin: 0 0 20px;
    padding: 14px 18px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 5px solid #f59e0b;
    border-radius: 12px;
    color: #92400e;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
    animation: fadeInSlide .25s ease-out;
}
.theme-escuro .session-warning-banner {
    background: #1c1917;
    border-color: #44403c;
    border-left: 5px solid #f59e0b;
    color: #fef08a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.session-warning-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.session-warning-icon {
    font-size: 1.35rem;
    line-height: 1.2;
    flex-shrink: 0;
}
.session-warning-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.session-warning-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #78350f;
}
.theme-escuro .session-warning-title {
    color: #fde047;
}
.session-warning-desc {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
}
.session-warning-tip {
    margin-top: 4px;
    font-size: 0.78rem;
    color: #b45309;
    opacity: 0.95;
    line-height: 1.35;
}
.theme-escuro .session-warning-tip {
    color: #cbd5e1;
}

.session-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #f59e0b;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: pulseGlow 2s infinite;
}
@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
