:root {
    --bg: #0b0d12;
    --bg-soft: #10131a;
    --surface: #151922;
    --surface-2: #1b202b;
    --surface-3: #222836;
    --text: #f6f7f9;
    --muted: #9da6b5;
    --muted-2: #747e8e;
    --accent: #f5bd26;
    --accent-strong: #d99c00;
    --accent-soft: rgba(245, 189, 38, .12);
    --success: #34d17b;
    --danger: #ff6262;
    --info: #65a8ff;
    --border: rgba(255,255,255,.09);
    --border-strong: rgba(255,255,255,.15);
    --shadow: 0 24px 70px rgba(0,0,0,.34);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --sidebar-width: 282px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(245,189,38,.06), transparent 28%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffd666; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 4vw, 3.45rem); line-height: 1.05; }
h2 { font-size: clamp(1.45rem, 2.4vw, 2.15rem); line-height: 1.15; }
h3 { font-size: 1.12rem; }
code, pre { font-family: "SFMono-Regular", Consolas, monospace; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.muted { color: var(--muted); }

/* Brand */
.brand { display:flex; align-items:center; gap:12px; min-width:0; }
.logo {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display:grid;
    place-items:center;
    overflow:hidden;
    background: linear-gradient(145deg, #ffd25a, var(--accent));
    color:#11141a;
    font-weight:900;
    letter-spacing:-.04em;
    box-shadow: 0 10px 28px rgba(245,189,38,.2);
}
.logo.logo-custom { background: #fff; padding: 5px; }
.logo img { width:100%; height:100%; object-fit:contain; border-radius:9px; }
.brand-copy { min-width:0; display:flex; flex-direction:column; }
.brand-copy strong { color:var(--text); font-size:.98rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brand-copy small { color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Buttons and controls */
.button {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:44px;
    padding:10px 16px;
    border:1px solid var(--border-strong);
    border-radius:12px;
    background:var(--surface-2);
    color:var(--text);
    font-weight:750;
    cursor:pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, filter .18s ease;
}
.button:hover { transform:translateY(-1px); border-color:rgba(255,255,255,.25); color:var(--text); }
.button.primary { background:linear-gradient(180deg,#ffd04e,var(--accent)); border-color:#efb31a; color:#12151b; box-shadow:0 12px 30px rgba(245,189,38,.14); }
.button.primary:hover { filter:brightness(1.05); color:#12151b; }
.button.secondary { background:transparent; border-color:var(--border-strong); }
.button.ghost { background:rgba(255,255,255,.035); }
.button.large { min-height:50px; padding:13px 20px; border-radius:14px; }
.button:disabled { opacity:.45; cursor:not-allowed; transform:none; }
.actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.actions.centered { justify-content:center; }
.actions.vertical { flex-direction:column; align-items:stretch; }

label { color:#c3c9d3; font-weight:650; font-size:.86rem; }
input, select, textarea {
    width:100%;
    min-height:44px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:11px;
    background:#0d1016;
    color:var(--text);
    outline:none;
    transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { min-height:100px; resize:vertical; }
input::placeholder, textarea::placeholder { color:#626c7b; }
input:focus, select:focus, textarea:focus { border-color:rgba(245,189,38,.8); box-shadow:0 0 0 3px rgba(245,189,38,.1); background:#10141b; }
input[type="file"] { padding:8px; }
input[type="checkbox"] { width:18px; min-height:18px; accent-color:var(--accent); }
.form { display:flex; flex-direction:column; gap:12px; }
.form.wide { max-width:780px; }
.form.compact { margin-top:16px; }
.form-grid { display:grid; gap:14px; }
.form-grid.two-columns { grid-template-columns:repeat(2,minmax(0,1fr)); }
.form-grid > div { display:flex; flex-direction:column; gap:7px; }
.inline { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:12px; }
.field-help, .hint { display:block; color:var(--muted); font-size:.8rem; line-height:1.45; }
.checkbox-row { display:flex; align-items:flex-start; gap:10px; padding:12px; border:1px solid var(--border); border-radius:12px; background:rgba(255,255,255,.025); }

/* App shell */
.app-body { display:block; }
.sidebar {
    position:fixed;
    inset:0 auto 0 0;
    width:var(--sidebar-width);
    padding:24px 20px;
    display:flex;
    flex-direction:column;
    background:rgba(9,11,16,.96);
    border-right:1px solid var(--border);
    backdrop-filter:blur(18px);
    z-index:30;
    overflow-y:auto;
}
.sidebar > .brand { padding:0 8px; margin-bottom:24px; }
.tenant-switch, .tenant-box { margin:0 4px 20px; }
.tenant-switch label { display:block; margin:0 0 7px 4px; color:var(--muted); }
.tenant-switch select { font-size:.8rem; }
.tenant-box { padding:13px 14px; border:1px solid var(--border); border-radius:13px; background:var(--surface); }
.tenant-box span, .tenant-box small { display:block; color:var(--muted); font-size:.76rem; }
.tenant-box strong { display:block; margin:3px 0; }
.sidebar-nav { display:flex; flex-direction:column; gap:4px; }
.sidebar-nav a { display:flex; align-items:center; gap:11px; min-height:42px; padding:10px 12px; border-radius:11px; color:#d6dae1; font-weight:620; transition:.18s ease; }
.sidebar-nav a:hover { background:var(--surface); color:#fff; }
.nav-icon { width:20px; text-align:center; color:var(--muted); font-size:1rem; }
.nav-section { margin:16px 12px 5px; color:#667181; font-size:.69rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.nav-logout { margin-top:10px; color:#c9ced6!important; }
.sidebar-status { margin-top:auto; display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--border); border-radius:13px; background:var(--surface); }
.sidebar-status div { display:flex; flex-direction:column; }
.sidebar-status small { color:var(--muted); }
.sidebar-status strong { font-size:.8rem; }
.status-dot { width:9px; height:9px; border-radius:50%; background:var(--muted); box-shadow:0 0 0 5px rgba(255,255,255,.03); }
.status-dot.online { background:var(--success); box-shadow:0 0 0 5px rgba(52,209,123,.1); }
.status-dot.attention { background:var(--accent); box-shadow:0 0 0 5px rgba(245,189,38,.1); }
.content { margin-left:var(--sidebar-width); width:calc(100% - var(--sidebar-width)); min-height:100vh; padding:34px clamp(22px,4vw,56px) 70px; }
.page-header { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:26px; }
.page-header h1 { margin:3px 0 0; font-size:clamp(1.9rem,3vw,2.7rem); }
.page-header p { margin:7px 0 0; color:var(--muted); }

/* Panels, cards, tables */
.panel, .card {
    background:linear-gradient(180deg,rgba(25,29,39,.96),rgba(18,21,29,.96));
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:0 18px 48px rgba(0,0,0,.2);
}
.panel { padding:22px; }
.card { padding:19px; }
.panel h2 { margin-bottom:8px; }
.panel > p { color:var(--muted); }
.panel-heading { display:flex; justify-content:space-between; gap:16px; margin-bottom:5px; }
.cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:24px; }
.card span { display:block; color:var(--muted); font-size:.83rem; }
.card strong { display:block; margin-top:7px; font-size:1.55rem; }
.card small { display:block; margin-top:5px; color:var(--muted); }
.grid-2 { display:grid; grid-template-columns:minmax(320px,420px) minmax(0,1fr); gap:20px; margin-bottom:24px; }
.grid-2.process-layout { grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr); }
.compact-panel { margin-bottom:24px; }
.badge { display:inline-flex; align-items:center; padding:5px 9px; border-radius:999px; background:var(--accent-soft); color:#ffd15a; border:1px solid rgba(245,189,38,.22); font-size:.72rem; font-weight:800; }
.notice, .warning { padding:13px 15px; border-radius:12px; margin:0 0 18px; }
.notice { color:#c9f8da; background:rgba(52,209,123,.1); border:1px solid rgba(52,209,123,.3); }
.warning { color:#ffe29a; background:rgba(245,189,38,.09); border:1px solid rgba(245,189,38,.28); }
.link-danger, .link-success { border:0; background:transparent; cursor:pointer; padding:0; font-weight:700; }
.link-danger { color:var(--danger); }
.link-success { color:var(--success); }
.inline-form { display:inline-block; margin:3px; }
.mini-form { margin-top:12px; }
details summary { cursor:pointer; color:var(--accent); }
table { width:100%; border-collapse:separate; border-spacing:0; overflow:hidden; }
th, td { padding:13px 12px; text-align:left; vertical-align:top; border-bottom:1px solid var(--border); }
th { color:var(--muted); font-size:.74rem; text-transform:uppercase; letter-spacing:.06em; font-weight:760; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover td { background:rgba(255,255,255,.018); }
pre { padding:14px; overflow:auto; border:1px solid var(--border); border-radius:12px; background:#0d1016; color:#dde2ea; }
.list { color:var(--muted); line-height:1.8; padding-left:18px; }

/* Uploads and previews */
.upload-box { display:block; padding:20px; border:1px dashed rgba(245,189,38,.45); border-radius:14px; background:rgba(245,189,38,.035); cursor:pointer; }
.upload-box:hover { background:rgba(245,189,38,.06); }
.upload-box input[type="file"] { display:none; }
.upload-title { display:block; color:var(--text); font-weight:750; margin-bottom:5px; }
.upload-subtitle { display:block; color:var(--muted); font-size:.84rem; }
.header-preview, .scope-preview { border:1px solid var(--border); border-radius:14px; background:#10141b; padding:18px; }
.header-preview h3 { margin:0 0 10px; }
.header-preview p { margin:5px 0; color:#dfe3e9; }
.scope-preview { white-space:pre-wrap; color:var(--muted); line-height:1.62; max-height:420px; overflow:auto; }
.profile-photo { width:88px; height:88px; border-radius:18px; object-fit:cover; border:1px solid var(--border-strong); }
.company-logo-preview { width:120px; max-height:82px; padding:8px; object-fit:contain; border:1px solid var(--border-strong); border-radius:14px; background:#fff; }
.optional-label { color:var(--muted); font-size:.72rem; font-weight:500; }
.checkbox-row { display:flex; align-items:center; gap:9px; color:var(--muted); }
.checkbox-row input { width:auto; }

/* Public navigation and pages */
.landing-body { display:block; background:var(--bg); }
.landing-nav { min-height:88px; padding:18px max(24px,6vw); display:flex; align-items:center; justify-content:space-between; gap:24px; border-bottom:1px solid var(--border); background:rgba(10,12,17,.86); backdrop-filter:blur(18px); position:sticky; top:0; z-index:20; }
.landing-links { display:flex; flex-direction:row; align-items:center; gap:6px; }
.landing-links > a:not(.button) { padding:10px 12px; color:#d4d8df; font-weight:620; }
.landing-main { max-width:1260px; margin:0 auto; padding:0 28px 72px; }
.hero { min-height:650px; display:grid; grid-template-columns:minmax(0,1.05fr) minmax(430px,.95fr); gap:64px; align-items:center; padding:70px 0 54px; }
.hero-copy h1 { max-width:760px; margin:8px 0 22px; }
.hero-lead { max-width:700px; color:#b8bfca; font-size:1.13rem; line-height:1.72; }
.eyebrow { display:inline-flex; align-items:center; gap:8px; color:var(--accent); font-size:.72rem; font-weight:900; letter-spacing:.14em; text-transform:uppercase; }
.hero-actions { margin-top:28px; }
.hero-notes { display:flex; flex-wrap:wrap; gap:16px 24px; margin-top:24px; color:#aeb6c2; font-size:.83rem; }
.product-preview { padding:12px; border:1px solid var(--border-strong); border-radius:26px; background:linear-gradient(145deg,#1a1f29,#11141b); box-shadow:0 34px 90px rgba(0,0,0,.42),0 0 0 1px rgba(245,189,38,.05) inset; transform:perspective(1200px) rotateY(-2deg) rotateX(1deg); overflow:hidden; }
.preview-app-shell { display:grid; grid-template-columns:145px minmax(0,1fr); min-height:390px; overflow:hidden; border:1px solid rgba(255,255,255,.07); border-radius:18px; background:#171b23; }
.preview-sidebar { padding:15px 12px; border-right:1px solid rgba(255,255,255,.065); background:#101319; }
.preview-brand { display:flex; align-items:center; gap:8px; }
.preview-brand > span { display:grid; place-items:center; width:30px; height:30px; border-radius:9px; background:var(--accent); color:#101218; font-size:.7rem; font-weight:950; }
.preview-brand div { min-width:0; }
.preview-brand strong { display:block; font-size:.59rem; white-space:nowrap; }
.preview-brand small { display:block; margin-top:2px; color:var(--muted); font-size:.47rem; white-space:nowrap; }
.preview-company { margin:17px 0 14px; padding:10px; display:grid; gap:3px; border:1px solid var(--border); border-radius:10px; background:#171b23; }
.preview-company small,.preview-company span { color:var(--muted); font-size:.49rem; }
.preview-company strong { font-size:.58rem; }
.preview-sidebar nav { display:grid; grid-template-columns:18px 1fr; gap:10px 5px; align-items:center; color:#c6ccd5; font-size:.55rem; }
.preview-sidebar nav b { color:#8e98a7; text-align:center; }
.preview-dashboard { min-width:0; padding:18px; }
.preview-page-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.preview-page-heading strong { display:block; font-size:.95rem; }
.preview-page-heading small { display:block; margin-top:3px; color:var(--muted); font-size:.54rem; }
.preview-page-heading > span { padding:7px 9px; border-radius:8px; background:var(--accent); color:#111; font-size:.55rem; font-weight:900; }
.preview-plan-line { margin:14px 0; padding:8px 10px; display:flex; justify-content:space-between; gap:10px; border:1px solid var(--border); border-radius:9px; color:#cbd1da; font-size:.53rem; }
.preview-plan-line span { color:#8bd4a8; }
.preview-dashboard-cards { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.preview-dashboard-cards article { min-width:0; padding:10px; border:1px solid var(--border); border-radius:10px; background:#11151c; }
.preview-dashboard-cards small { display:block; min-height:22px; color:var(--muted); font-size:.48rem; }
.preview-dashboard-cards strong { display:block; margin-top:7px; font-size:.82rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.preview-budget-list { margin-top:10px; border:1px solid var(--border); border-radius:11px; overflow:hidden; background:#101319; }
.preview-budget-list header { padding:9px 10px; font-size:.59rem; border-bottom:1px solid var(--border); }
.preview-budget-list > div { display:grid; grid-template-columns:1.35fr .8fr .7fr 22px; gap:8px; align-items:center; padding:9px 10px; border-bottom:1px solid var(--border); font-size:.52rem; }
.preview-budget-list > div:last-child { border-bottom:0; }
.preview-budget-list b { color:#aab3c0; font-weight:600; }
.preview-budget-list em { color:#f2f4f7; font-style:normal; text-align:right; }
.preview-budget-list i { display:grid; place-items:center; width:18px; height:18px; border-radius:6px; color:#ff4d55; background:rgba(239,68,68,.1); font-style:normal; font-weight:900; }
.trust-strip { display:grid; grid-template-columns:repeat(5,1fr); border:1px solid var(--border); border-radius:16px; background:rgba(255,255,255,.018); overflow:hidden; }
.trust-strip span { padding:17px 13px; text-align:center; color:#aeb5c0; border-right:1px solid var(--border); font-size:.8rem; font-weight:650; }
.trust-strip span:last-child { border-right:0; }
.landing-section { margin:100px 0; }
.section-heading { max-width:820px; margin-bottom:34px; }
.section-heading h2 { margin:11px 0 14px; }
.section-heading p { color:var(--muted); font-size:1.02rem; line-height:1.65; }
.compact-heading { max-width:700px; }
.feature-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.feature-card { min-height:230px; padding:24px; border:1px solid var(--border); border-radius:18px; background:linear-gradient(180deg,var(--surface),rgba(18,21,29,.9)); transition:transform .2s ease,border-color .2s ease; }
.feature-card:hover { transform:translateY(-3px); border-color:rgba(245,189,38,.26); }
.feature-icon { display:grid; place-items:center; width:38px; height:38px; margin-bottom:34px; border-radius:11px; background:var(--accent-soft); color:var(--accent); font-weight:900; font-size:.75rem; }
.feature-card h3 { margin-bottom:10px; }
.feature-card p { color:var(--muted); line-height:1.65; }
.workflow-section { padding:42px; border:1px solid var(--border); border-radius:24px; background:linear-gradient(145deg,rgba(27,32,43,.85),rgba(15,18,24,.9)); }
.workflow-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.workflow-grid article { display:flex; gap:15px; padding:18px; border-radius:16px; background:rgba(0,0,0,.15); border:1px solid rgba(255,255,255,.055); }
.workflow-grid article > span { flex:0 0 auto; display:grid; place-items:center; width:36px; height:36px; border-radius:50%; background:var(--accent); color:#111; font-weight:900; }
.workflow-grid h3 { margin:2px 0 6px; }
.workflow-grid p { margin:0; color:var(--muted); }
.cta-section { margin:80px 0 20px; padding:42px; display:flex; justify-content:space-between; align-items:center; gap:30px; border:1px solid rgba(245,189,38,.28); border-radius:24px; background:linear-gradient(135deg,rgba(245,189,38,.12),rgba(21,25,34,.9)); }
.cta-section h2 { max-width:760px; margin:10px 0; }
.cta-section p { max-width:760px; color:var(--muted); margin-bottom:0; }
.public-footer { min-height:88px; display:flex; justify-content:center; align-items:center; gap:28px; flex-wrap:wrap; padding:22px; color:var(--muted); border-top:1px solid var(--border); font-size:.82rem; }

/* Plans */
.plans-page { padding-top:64px; }
.plans-hero { max-width:820px; margin:0 auto 48px; text-align:center; }
.plans-hero h1 { margin:12px 0 17px; }
.plans-hero p { color:var(--muted); font-size:1.04rem; line-height:1.65; }
.plan-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.plan-grid.compact { grid-template-columns:repeat(3,minmax(220px,1fr)); }
.plan-card { position:relative; min-height:100%; padding:25px; display:flex; flex-direction:column; gap:18px; border:1px solid var(--border); border-radius:20px; background:linear-gradient(180deg,#191d26,#12151c); }
.plan-card.featured { border-color:rgba(245,189,38,.8); box-shadow:0 24px 70px rgba(245,189,38,.1); transform:translateY(-8px); }
.recommended { position:absolute; top:-13px; right:18px; padding:6px 10px; border-radius:999px; background:var(--accent); color:#111; font-size:.66rem; font-weight:900; letter-spacing:.08em; }
.plan-header { min-height:128px; }
.plan-header h2 { margin-bottom:10px; font-size:1.55rem; }
.plan-header p { margin:0; color:var(--muted); line-height:1.55; }
.plan-price { display:flex; align-items:baseline; gap:5px; padding:17px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.plan-price strong { font-size:2rem; letter-spacing:-.04em; }
.plan-price span { color:var(--muted); }
.plan-features { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:13px; flex:1; }
.plan-features li { display:flex; align-items:flex-start; gap:10px; color:#d9dde3; }
.plan-features li span { color:var(--accent); font-weight:900; }
.plan-button { width:100%; margin-top:7px; }
.plan-footnote { max-width:850px; margin:44px auto 0; padding:22px; text-align:center; border:1px solid var(--border); border-radius:16px; background:rgba(255,255,255,.02); }
.plan-footnote p { color:var(--muted); margin:8px 0 0; }

/* Authentication */
.auth-body { display:grid; place-items:center; min-height:100vh; padding:28px; background:radial-gradient(circle at 18% 8%,rgba(245,189,38,.09),transparent 35%),var(--bg); }
.auth-shell { width:min(1080px,100%); display:grid; grid-template-columns:minmax(0,.9fr) minmax(400px,.62fr); gap:40px; align-items:center; }
.registration-shell { grid-template-columns:minmax(300px,.72fr) minmax(520px,1fr); }
.auth-intro { min-height:560px; padding:38px; display:flex; flex-direction:column; justify-content:space-between; border:1px solid var(--border); border-radius:26px; background:linear-gradient(145deg,rgba(27,32,43,.88),rgba(13,16,22,.94)); box-shadow:var(--shadow); }
.auth-copy h1 { margin:10px 0 18px; font-size:clamp(2rem,4vw,3.35rem); }
.auth-copy p { max-width:560px; color:var(--muted); font-size:1.03rem; line-height:1.7; }
.auth-intro > a { color:#c8ced8; }
.auth-card { padding:34px; border:1px solid var(--border); border-radius:24px; background:rgba(20,24,32,.97); box-shadow:var(--shadow); }
.auth-card h2 { margin:8px 0; font-size:2rem; }
.auth-card > div:first-child > p { color:var(--muted); }
.auth-card .form { margin-top:24px; }
.auth-footer { display:flex; justify-content:center; gap:7px; margin-top:22px; color:var(--muted); }
.registration-benefits { display:flex; flex-direction:column; gap:10px; color:#cdd2da; }
.registration-card { padding:30px; }
.message-shell { width:min(560px,100%); }
.message-card { padding:38px; text-align:center; border:1px solid var(--border); border-radius:24px; background:linear-gradient(180deg,var(--surface),#11151c); box-shadow:var(--shadow); }
.message-card h1 { margin:9px 0 16px; font-size:2.15rem; }
.message-card p { color:var(--muted); line-height:1.65; }
.message-icon { width:58px; height:58px; margin:0 auto 20px; display:grid; place-items:center; border-radius:17px; background:var(--accent-soft); color:var(--accent); font-size:1.45rem; font-weight:900; }
.warning-icon { color:#ffcb54; }
.success-icon { color:var(--success); background:rgba(52,209,123,.11); }
.company-id-box { margin:20px 0; padding:16px; border:1px solid var(--border); border-radius:14px; background:#0d1117; }
.company-id-box small { display:block; color:var(--muted); }
.company-id-box strong { display:block; margin-top:3px; font-size:1.4rem; letter-spacing:.08em; }

/* Branding config */
.branding-layout { grid-template-columns:minmax(0,1fr) minmax(320px,.8fr); }
.brand-preview-panel { display:flex; flex-direction:column; gap:20px; }
.brand-preview-card { margin:auto 0; padding:30px; border:1px solid var(--border); border-radius:20px; background:linear-gradient(145deg,#0f131a,#1a1f29); }
.brand-preview-card .brand { margin-bottom:24px; }
.brand-preview-card > strong { display:block; font-size:1.5rem; }
.brand-preview-card > p { margin-top:10px; }
.preview-divider { height:1px; margin:0 0 24px; background:var(--border); }

/* Chatbot */
.chatbot { position:fixed; right:22px; bottom:22px; z-index:1000; }
.chatbot-toggle { width:54px; height:54px; border:0; border-radius:18px; display:grid; place-items:center; background:linear-gradient(145deg,#ffd25b,var(--accent)); color:#111; font-size:1.2rem; font-weight:900; cursor:pointer; box-shadow:0 16px 40px rgba(0,0,0,.4),0 0 0 1px rgba(255,255,255,.15) inset; }
.chatbot-toggle:hover { transform:translateY(-2px); }
.chatbot-panel { position:absolute; right:0; bottom:66px; width:min(410px,calc(100vw - 28px)); overflow:hidden; border:1px solid var(--border-strong); border-radius:20px; background:#151922; box-shadow:0 28px 80px rgba(0,0,0,.55); }
.chatbot-panel > header { min-height:72px; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:13px 15px; border-bottom:1px solid var(--border); background:#12161e; }
.chatbot-title { display:flex; align-items:center; gap:10px; }
.chatbot-title > div { display:flex; flex-direction:column; }
.chatbot-title small { color:var(--muted); }
.chatbot-avatar { width:38px; height:38px; display:grid; place-items:center; border-radius:12px; background:var(--accent); color:#111; font-weight:900; font-size:.75rem; }
.chatbot-panel > header > button { border:0; background:transparent; color:var(--muted); font-size:1.6rem; cursor:pointer; }
.chatbot-messages { height:350px; overflow-y:auto; padding:15px; display:flex; flex-direction:column; gap:10px; }
.chatbot-messages p { max-width:89%; margin:0; padding:11px 13px; border-radius:14px; white-space:pre-wrap; line-height:1.48; }
.bot-message { align-self:flex-start; background:#252b36; color:#edf0f4; border-bottom-left-radius:5px!important; }
.user-message { align-self:flex-end; background:var(--accent); color:#101318; border-bottom-right-radius:5px!important; }
.loading-message { color:var(--muted); font-style:italic; }
.chatbot-suggestions { display:flex; flex-wrap:wrap; gap:7px; }
.chatbot-suggestions button { padding:8px 10px; border:1px solid rgba(245,189,38,.28); border-radius:999px; background:rgba(245,189,38,.06); color:#f3c95e; cursor:pointer; font-size:.75rem; }
.chatbot-suggestions button:hover { background:rgba(245,189,38,.12); }
.chatbot-panel form { display:grid; grid-template-columns:1fr auto; gap:8px; padding:12px; border-top:1px solid var(--border); background:#11151c; }
.chatbot-panel form input { min-width:0; }

/* Cutting plan */
.cut-input-grid { align-items:start; }
.field-label-with-help { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:4px; }
.field-label-with-help label { margin:0; }
.input-help-button { flex:0 0 auto; display:grid; place-items:center; width:27px; height:27px; padding:0; border:1px solid rgba(245,189,38,.48); border-radius:50%; background:rgba(245,189,38,.08); color:var(--accent); font-weight:900; cursor:pointer; }
.input-help-button:hover { background:var(--accent); color:#111; }
.feature-list { display:grid; gap:12px; margin:16px 0 24px; }
.feature-list > div { display:grid; grid-template-columns:36px 1fr; gap:12px; align-items:center; padding:12px; border:1px solid var(--border); border-radius:12px; background:#141820; }
.feature-list strong { display:grid; place-items:center; width:32px; height:32px; border-radius:10px; background:var(--accent); color:#111; }
.cut-history { display:grid; gap:8px; }
.cut-history-row { display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--border); }
.cut-result-header, .cut-group-header { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.cut-kpis { margin:20px 0; }
.cut-group { margin-top:20px; }
.sheet-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(500px,1fr)); gap:18px; margin-top:18px; }
.sheet-card { padding:14px; border:1px solid var(--border); border-radius:14px; background:#141820; }
.sheet-card > header { display:flex; justify-content:space-between; gap:12px; margin-bottom:12px; }
.sheet-card > header span { color:var(--muted); font-size:.8rem; }
.sheet-canvas-wrap { width:100%; overflow:auto; padding:10px; border-radius:10px; background:#0b0e13; }
.sheet-canvas { display:block; width:100%; min-height:280px; max-height:520px; }
.sheet-background { fill:#f7f2e5; stroke:#eab308; stroke-width:8; vector-effect:non-scaling-stroke; }
.piece { stroke:#fff; stroke-width:3; vector-effect:non-scaling-stroke; opacity:.9; }
.piece-color-0 { fill:#f4b400; }.piece-color-1 { fill:#4f86f7; }.piece-color-2 { fill:#58a65c; }.piece-color-3 { fill:#e76f51; }.piece-color-4 { fill:#9b5de5; }.piece-color-5 { fill:#00a8e8; }.piece-color-6 { fill:#ff7f50; }
.piece-label { fill:#0b0d10; font-size:42px; font-family:Arial,sans-serif; font-weight:700; pointer-events:none; }
.sheet-card details { margin-top:12px; }

@media (max-width: 1120px) {
    .cards { grid-template-columns:repeat(2,1fr); }
    .hero { grid-template-columns:1fr; gap:30px; padding-top:55px; }
    .product-preview { max-width:760px; transform:none; }
    .feature-grid { grid-template-columns:repeat(2,1fr); }
    .trust-strip { grid-template-columns:repeat(3,1fr); }
    .trust-strip span { border-bottom:1px solid var(--border); }
    .grid-2, .branding-layout { grid-template-columns:1fr; }
}

@media (max-width: 900px) {
    :root { --sidebar-width: 0px; }
    .sidebar { position:static; width:100%; max-height:none; border-right:0; border-bottom:1px solid var(--border); }
    .sidebar-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .nav-section, .sidebar-status { grid-column:1/-1; }
    .content { margin-left:0; width:100%; padding:26px 20px 60px; }
    .landing-nav { position:static; padding:16px 20px; }
    .landing-links > a:not(.button) { display:none; }
    .workflow-grid, .plan-grid, .plan-grid.compact { grid-template-columns:1fr; }
    .plan-card.featured { transform:none; }
    .auth-shell, .registration-shell { grid-template-columns:1fr; width:min(680px,100%); }
    .auth-intro { min-height:auto; gap:60px; }
    .registration-benefits { margin-top:30px; }
    .sheet-grid { grid-template-columns:1fr; }
}

@media (max-width: 700px) {
    body { font-size:14px; }
    .landing-main { padding-inline:18px; }
    .landing-nav .brand-copy small { display:none; }
    .hero { min-height:auto; padding:48px 0 35px; }
    .hero h1 { font-size:2.55rem; }
    .hero-actions .button { width:100%; }
    .preview-app-shell { grid-template-columns:1fr; min-height:auto; }
    .preview-sidebar { display:none; }
    .preview-dashboard { padding:13px; }
    .preview-dashboard-cards { grid-template-columns:repeat(2,1fr); }
    .preview-budget-list > div { grid-template-columns:1.2fr .7fr 22px; }
    .preview-budget-list b { display:none; }
    .trust-strip, .feature-grid, .workflow-grid, .cards, .form-grid.two-columns { grid-template-columns:1fr; }
    .trust-strip span { border-right:0; }
    .workflow-section, .cta-section { padding:25px; }
    .cta-section { flex-direction:column; align-items:flex-start; }
    .cta-section .button { width:100%; }
    .page-header { align-items:flex-start; flex-direction:column; }
    .auth-body { padding:14px; }
    .auth-intro, .auth-card, .message-card { padding:24px; border-radius:20px; }
    .auth-intro { display:none; }
    .registration-shell .auth-intro { display:flex; }
    .sidebar-nav { grid-template-columns:1fr; }
    .chatbot { right:12px; bottom:12px; }
    .chatbot-panel { width:calc(100vw - 24px); }
    .chatbot-messages { height:330px; }
    .cut-result-header, .cut-group-header, .sheet-card > header { flex-direction:column; align-items:flex-start; }
}

/* Conferência de peças detectadas */
.review-heading { margin:24px 0 14px; }
.review-heading h2 { margin:9px 0 6px; }
.review-form { margin-top:14px; }
.review-card { padding:16px; border:1px solid rgba(245,189,38,.28); border-radius:14px; background:rgba(245,189,38,.035); }
.review-card-title { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:14px; }
.review-card-title span { display:block; margin-top:3px; color:#ffe09a; font-size:.78rem; text-align:right; }
.review-card-actions { display:flex; align-items:flex-start; gap:12px; }
.review-remove-button { padding:7px 10px; border-color:rgba(239,68,68,.42); color:#ff747a; background:rgba(239,68,68,.07); font-size:.74rem; white-space:nowrap; }
.review-remove-button:hover { background:#b4232c; color:#fff; border-color:#d33; }
.review-confirmed-list { display:grid; gap:9px; margin-bottom:18px; }
.review-card-confirmed { display:flex; align-items:center; justify-content:space-between; gap:16px; border-color:rgba(52,209,123,.22); background:rgba(52,209,123,.035); }
.review-card-confirmed span { display:block; margin-top:4px; color:var(--muted); font-size:.78rem; }
.full-row { grid-column:1 / -1; }
@media (max-width:720px) {
  .review-card-title { flex-direction:column; }
  .review-card-title span { text-align:left; }
  .review-card-actions, .review-card-confirmed { width:100%; flex-direction:column; align-items:flex-start; }
  .form-grid.two-columns { grid-template-columns:1fr; }
  .full-row { grid-column:auto; }
}

/* Clientes e materiais */
.table-scroll { width:100%; overflow-x:auto; }
.table-primary-link { color:#f7f9fc; font-weight:800; text-decoration:none; }
.table-primary-link:hover { color:var(--accent); text-decoration:underline; }
.back-link { display:inline-flex; margin-bottom:8px; color:var(--muted); text-decoration:none; font-size:.86rem; }
.back-link:hover { color:var(--accent); }
.client-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
.client-profile-layout { align-items:start; }
.client-summary-panel { min-height:100%; }
.detail-list { display:grid; gap:0; margin:10px 0 20px; }
.detail-list > div { display:grid; grid-template-columns:minmax(130px,.7fr) 1.3fr; gap:14px; padding:13px 0; border-bottom:1px solid var(--border); }
.detail-list dt { color:var(--muted); }
.detail-list dd { margin:0; color:#f3f5f8; text-align:right; }
.edit-material-panel { max-width:760px; }

.icon-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.icon-actions form { margin:0; }
.icon-action { width:36px; height:36px; display:grid; place-items:center; border:1px solid var(--border); border-radius:10px; background:#11151c; cursor:pointer; transition:.18s ease; }
.icon-action span { display:block; width:20px; height:20px; background:currentColor; -webkit-mask-position:center; mask-position:center; -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat; -webkit-mask-size:contain; mask-size:contain; }
.edit-action { color:#34d17b; }
.edit-action span { -webkit-mask-image:url('/static/icons/lapis.png'); mask-image:url('/static/icons/lapis.png'); }
.delete-action { color:#ef4444; }
.delete-action span { -webkit-mask-image:url('/static/icons/lixeira.png'); mask-image:url('/static/icons/lixeira.png'); }
.icon-action:hover { transform:translateY(-1px); border-color:currentColor; background:rgba(255,255,255,.04); }

.autocomplete-field { position:relative; }
.autocomplete-menu { position:absolute; z-index:80; top:calc(100% + 7px); left:0; right:0; max-height:300px; overflow-y:auto; padding:7px; border:1px solid var(--border-strong); border-radius:14px; background:#141922; box-shadow:0 22px 58px rgba(0,0,0,.48); }
.autocomplete-option { width:100%; display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:11px 12px; border:0; border-radius:10px; background:transparent; color:#f5f7fa; text-align:left; cursor:pointer; }
.autocomplete-option:hover, .autocomplete-option:focus { background:rgba(245,189,38,.1); outline:none; }
.autocomplete-option strong { font-size:.9rem; }
.autocomplete-option small { color:var(--muted); font-size:.74rem; }

.result-panel { min-width:0; }

@media (max-width:900px) {
  .client-kpis { grid-template-columns:1fr; }
}
@media (max-width:700px) {
  .detail-list > div { grid-template-columns:1fr; gap:5px; }
  .detail-list dd { text-align:left; }
  .icon-actions { justify-content:flex-start; }
}

.file-feedback{display:block;margin-top:8px;color:#94a3b8}
.file-feedback.success{color:#22c55e}
.entity-link{font-weight:700;color:inherit;text-decoration:none}
.entity-link:hover{color:#f0b91f;text-decoration:underline}
.download-action{display:inline-grid;place-items:center;width:34px;height:34px;border:1px solid rgba(239,68,68,.58);border-radius:9px;text-decoration:none;color:#ff4d55;background:rgba(239,68,68,.08);transition:.18s ease}
.download-action svg{width:18px;height:18px;display:block}
.download-action:hover{color:#fff;border-color:#ff4d55;background:#d92d38;transform:translateY(-1px);box-shadow:0 8px 22px rgba(217,45,56,.24)}
.download-action:focus-visible{outline:3px solid rgba(255,77,85,.32);outline-offset:2px}
.danger-zone{margin-top:18px;padding-top:18px;border-top:1px solid #3a2630}
.button.danger{background:#b4232c;color:white;border-color:#d33}
.subscription-cancel{margin-top:20px}
