:root {
    --bg: #f5f7fb;
    --panel: rgba(255,255,255,.92);
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e7eaf1;
    --primary: #6778db;
    --primary-dark: #4f5eb3;
    --soft-primary: #eef1ff;
    --green: #12b981;
    --amber: #f59e0b;
    --red: #ef4444;
    --blue: #3b82f6;
    --gray: #94a3b8;
    --shadow: 0 22px 60px rgba(31,41,55,.10);
    --radius: 24px;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(102,126,234,.22), transparent 38rem),
        radial-gradient(circle at bottom right, rgba(18,185,129,.13), transparent 34rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 290px;
    padding: 28px 22px;
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(18px);
    border-right: 1px solid rgba(255,255,255,.7);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand.large { margin-bottom: 26px; }
.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 900;
    letter-spacing: -.04em;
    background: linear-gradient(135deg, var(--primary), #9f7aea);
    box-shadow: 0 14px 28px rgba(102,126,234,.28);
}
.brand strong { display: block; line-height: 1.1; }
.brand span, .muted, .hint { color: var(--muted); font-size: .92rem; }
.menu { display: grid; gap: 8px; margin: 36px 0; }
.menu a {
    padding: 13px 14px;
    border-radius: 16px;
    color: #4b5563;
    transition: .18s ease;
}
.menu a:hover { background: var(--soft-primary); color: var(--primary-dark); transform: translateX(2px); }
.user-box {
    margin-top: 22px;
    position: relative;
    padding: 14px;
    border-radius: 20px;
    background: rgba(245,247,251,.9);
    display: flex;
    gap: 12px;
    align-items: center;
}
.avatar {
    width: 42px; height: 42px; border-radius: 14px;
    display: grid; place-items: center;
    background: #e8ecff;
    color: var(--primary-dark);
    font-weight: 800;
}
.user-box strong, .user-box span { display: block; }
.main { flex: 1; padding: 30px; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--primary-dark); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.03em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
h2 { font-size: 1.35rem; }
.grid { display: grid; gap: 22px; margin-bottom: 22px; }
.grid.two { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.grid.two.uneven { grid-template-columns: minmax(280px,.8fr) minmax(0,1.2fr); }
.grid.cards.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card {
    background: var(--panel);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.card-head.wrap { flex-wrap: wrap; }
.stat span { color: var(--muted); font-weight: 700; }
.stat strong { display: block; font-size: clamp(2rem, 4vw, 3.2rem); margin: 10px 0 4px; letter-spacing: -.06em; }
.stat small { color: var(--muted); }
.btn {
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 15px;
    background: #eef1f7;
    color: #364152;
    font-weight: 800;
    cursor: pointer;
    transition: .18s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(31,41,55,.10); }
.btn.primary { color: white; background: linear-gradient(135deg, var(--primary), #8b5cf6); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.small { padding: 8px 11px; font-size: .88rem; border-radius: 12px; }
.btn.full { width: 100%; }
.alert { padding: 14px 16px; border-radius: 16px; margin-bottom: 18px; font-weight: 750; transition: opacity .3s ease; }
.alert.green { background: #e8fff6; color: #047857; }
.alert.red { background: #fff0f0; color: #b91c1c; }
.alert.fade-out { opacity: .35; }
.form label { display: grid; gap: 8px; color: #374151; font-weight: 760; }
.form input, .form select, .form textarea, .filters input, .filters select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 12px 14px;
    background: #fbfcff;
    color: var(--text);
    outline: none;
    transition: .18s ease;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus {
    border-color: rgba(102,126,234,.55);
    box-shadow: 0 0 0 4px rgba(102,126,234,.12);
}
.form.stack { display: grid; gap: 15px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-form.compact { gap: 13px; }
.full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.filters { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(170px,.55fr)) auto auto; gap: 10px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 0 12px 12px; }
td { border-top: 1px solid var(--line); padding: 15px 12px; vertical-align: middle; }
.table-actions { display: flex; gap: 8px; justify-content: flex-end; }
.badge, .chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 850;
}
.badge.green { background: #dcfce7; color: #047857; }
.badge.amber { background: #fffbeb; color: #b45309; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.gray { background: #f1f5f9; color: #475569; }
.chip { background: #f4f6fb; color: #4b5563; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.company-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 10px; }
.details { display: grid; gap: 14px; margin: 0; }
.details div { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-weight: 850; }
dd { margin: 0; }
.note-box { margin-top: 18px; padding: 16px; border-radius: 18px; background: #f7f8fc; }
.note-box p { margin-bottom: 0; color: var(--muted); }
.soft-list { display: grid; gap: 10px; }
.soft-item, .sub-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: #f8faff;
    border: 1px solid var(--line);
}
.soft-item:hover { background: #eef2ff; }
.soft-item span, .sub-card span, .sub-card small { display: block; color: var(--muted); margin-top: 3px; }
.soft-item time { color: var(--primary-dark); font-weight: 900; }
.empty { color: var(--muted); background: #f8faff; border: 1px dashed #d9deea; border-radius: 18px; padding: 18px; }
.timeline { display: grid; gap: 16px; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; }
.timeline-item p { margin: 6px 0; }
.timeline-item small { color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: linear-gradient(135deg,var(--primary),#8b5cf6); box-shadow: 0 0 0 6px rgba(102,126,234,.12); }
.subscription-list { display: grid; gap: 10px; margin-top: 18px; }
.sub-actions { display: grid; justify-items: end; gap: 8px; }
.link-danger { border: 0; background: transparent; color: #b91c1c; font-weight: 800; cursor: pointer; }
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: min(460px, 100%); background: var(--panel); border-radius: 30px; padding: 34px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9); }
.login-card h1 { margin-top: 10px; }
.login-card .hint { text-align: center; margin-top: 18px; }
@media (max-width: 1120px) {
    .grid.cards.four { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .grid.two, .grid.two.uneven { grid-template-columns: 1fr; }
    .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { position: relative; width: auto; height: auto; padding: 18px; }
    .user-box { position: static; margin-top: 18px; }
    .menu { grid-template-columns: repeat(2, minmax(0,1fr)); margin: 20px 0; }
    .main { padding: 18px; }
    .topbar, .company-hero { align-items: flex-start; flex-direction: column; }
    .grid-form, .filters, .grid.cards.four { grid-template-columns: 1fr; }
    .details div { grid-template-columns: 1fr; gap: 3px; }
    .soft-item, .sub-card { align-items: flex-start; flex-direction: column; }
    .sub-actions { justify-items: start; }
}

/* N.G.SYSTEMS BUSINESS v2 - soft business visual language */
.brand-mark{width:56px;height:56px;font-size:.95rem;letter-spacing:.02em;background:linear-gradient(140deg,#3c58b3,#8199f1 58%,#a78bfa)}
.brand strong{font-size:1.03rem;max-width:180px;line-height:1.18}
.brand span{font-size:.82rem;margin-top:5px}
.menu{margin:24px 0 4px;gap:3px}
.menu a{padding:10px 12px;font-size:.91rem;font-weight:680}
.menu a[href]:focus-visible,.btn:focus-visible{outline:3px solid #8398fa;outline-offset:2px}
.quick-nav,.inline-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.quick-nav{margin-bottom:22px}
.soft-notice{background:#eaf1ff;border:1px solid #d4e3fc;border-radius:18px;padding:17px 20px;margin-bottom:20px;color:#2e4363;line-height:1.6}
.code-sample{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;background:#f4f6fc;padding:16px;border-radius:12px;font-size:.85rem}
.card h2{margin-bottom:15px}
.form{display:grid;gap:14px}
.form.grid-form{display:grid}
.form .grid{margin-bottom:0}
.metric{font-size:2rem;letter-spacing:-.05em}
.stat-row{display:grid;grid-template-columns:115px 1fr 30px;gap:12px;align-items:center;padding:13px 0;border-bottom:1px solid var(--line)}
.stat-track{height:11px;border-radius:999px;background:#eef1fc;overflow:hidden}
.stat-track span{display:block;height:100%;border-radius:999px;background:linear-gradient(135deg,#6477de,#a78bfa)}
.bar-chart{display:flex;gap:8px;justify-content:space-around;align-items:flex-end;height:220px;padding-top:20px}
.bar-wrap{height:100%;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:5px;font-size:.7rem;min-width:0}
.bar-wrap .bar{min-height:3px;width:min(30px,85%);border-radius:10px 10px 4px 4px;background:linear-gradient(#8da0f4,#6579d7)}
.activity-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 0;border-bottom:1px solid var(--line)}
.activity-item small{color:var(--muted)}
.calendar-head{display:flex;justify-content:space-between;gap:15px;align-items:center;flex-wrap:wrap;margin-bottom:20px}
.calendar-head small{color:var(--muted);font-weight:450;font-size:.75em}
.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}
.cal-weekday{padding:8px;color:#66758d;font-weight:800;text-align:center}
.cal-day{border:1px solid #e6eaf5;background:#fbfcff;border-radius:12px;padding:10px;min-height:105px;overflow:hidden}
.cal-day.today{background:#f0f3ff;border-color:#9aacfb}
.cal-day b{display:block;margin-bottom:7px}
.cal-day.empty-day{background:transparent;border-style:dashed;opacity:.35}
.cal-event{display:block;margin:4px 0;font-size:.74rem;background:#e9efff;border-radius:6px;padding:5px;overflow-wrap:anywhere;color:#4257a4}
.cal-event.follow{background:#e5fbf2;color:#157c5d}
.cal-event.muted-event{opacity:.55;text-decoration:line-through}
@media(max-width:820px){.sidebar{overflow:visible}.menu{grid-template-columns:repeat(2,minmax(0,1fr))}.brand strong{max-width:none}.calendar-grid{gap:3px}.cal-day{padding:4px;min-height:64px}.cal-day b{font-size:.8rem}.cal-event{font-size:.66rem;padding:3px}.activity-item{align-items:start;flex-direction:column}.quick-nav{gap:8px}.quick-nav .btn{font-size:.79rem}}
@media(max-width:500px){.card{padding:17px}.menu a{font-size:.78rem;padding:9px 8px}.calendar-grid{grid-template-columns:repeat(7,minmax(0,1fr))}.cal-day{min-height:49px;border-radius:7px}.cal-event{font-size:.62rem;line-height:1.1;max-height:3.8em;overflow:hidden}.calendar-head .inline-actions .btn{font-size:.7rem}}

/* N.G.SYSTEMS BUSINESS v2.1 — offerte, fornitori e catalogo */
.catalog-filters{display:grid;grid-template-columns:minmax(180px,1.3fr) repeat(3,minmax(125px,.75fr)) auto auto;gap:10px;margin-bottom:20px;align-items:center}
.catalog-filters input,.catalog-filters select,.search-input{min-width:0;border:1px solid var(--line);background:#fbfcff;border-radius:15px;padding:12px 14px;color:var(--text);font:inherit}
.catalog-filters input:focus,.catalog-filters select:focus,.search-input:focus{outline:3px solid rgba(103,120,219,.19);border-color:var(--primary)}
.proposal-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:22px}
.proposal-stats .card{padding:21px}.proposal-stats strong{display:block;font-size:clamp(1.45rem,2vw,2.15rem);letter-spacing:-.045em;margin-top:8px;overflow-wrap:anywhere}.proposal-stats small{color:var(--muted)}
.proposal-editor{display:grid;gap:21px}.proposal-editor>.card{margin:0}
.proposal-lines{display:grid;gap:16px}
.proposal-line{background:linear-gradient(145deg,#f8faff,#fcfcff);border:1px solid #dfe5f7;border-radius:20px;padding:20px}
.proposal-line-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}
.proposal-line-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.proposal-line-grid label{display:grid;gap:7px;font-size:.83rem;font-weight:760;color:#41516b;min-width:0}
.proposal-line-grid input,.proposal-line-grid select{min-width:0;width:100%;border:1px solid var(--line);border-radius:12px;padding:10px;background:#fff;color:#1f2937;font:inherit}
.proposal-line-grid .wide{grid-column:span 2}
.line-total{display:flex;align-items:end;gap:7px;flex-direction:column;justify-content:center;font-size:.75rem;color:var(--muted)}
.line-total strong{font-size:1.2rem;color:var(--primary-dark)}
.proposal-totals{margin-top:20px;margin-left:auto;max-width:410px;display:grid;gap:10px;padding:18px;border:1px solid #dfe6f6;border-radius:17px;background:#f7f9ff}
.proposal-totals div{display:flex;justify-content:space-between;align-items:center;gap:15px}
.proposal-totals span{color:#64748b;font-weight:650}.proposal-totals strong{font-size:1.08rem;white-space:nowrap}
.proposal-totals .grand{padding-top:11px;border-top:1px solid #dce3f7}.proposal-totals .grand strong{color:var(--primary-dark);font-size:1.35rem}
.proposal-hero{display:flex;gap:20px;align-items:center;justify-content:space-between;margin-bottom:20px}
.proposal-hero-total{text-align:right;display:grid;gap:7px;flex-shrink:0}.proposal-hero-total span{color:var(--muted);font-weight:700}.proposal-hero-total strong{font-size:clamp(1.7rem,3vw,2.4rem);color:var(--primary-dark)}
.action-stack{display:flex;gap:9px;flex-wrap:wrap;margin-top:16px}.pre-wrap{white-space:pre-wrap;line-height:1.6;overflow-wrap:anywhere}
@media(max-width:1120px){.catalog-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.proposal-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.proposal-line-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){.proposal-hero{flex-direction:column;align-items:stretch}.proposal-hero-total{text-align:left}}
@media(max-width:580px){.catalog-filters{grid-template-columns:1fr}.proposal-stats{gap:9px}.proposal-stats .card{padding:14px}.proposal-stats strong{font-size:1.3rem}.proposal-line{padding:13px}.proposal-line-grid{grid-template-columns:1fr}.proposal-line-grid .wide{grid-column:auto}.proposal-totals{max-width:100%;width:100%}}


/* N.G.SYSTEMS BUSINESS v2.3.0 — Comfort Dark: global, responsive and accessible.
   Design only: no database or commercial processing changes. */
:root {
    --bg: #0e1724;
    --panel: #192637;
    --panel-2: #213248;
    --field: #111e2d;
    --text: #edf3fa;
    --muted: #b9c9db;
    --line: #35495f;
    --primary: #a5bbff;
    --primary-dark: #c0d0ff;
    --soft-primary: #263b56;
    --green: #85deba;
    --amber: #ffd18a;
    --red: #ffa9ad;
    --blue: #9dc8ff;
    --gray: #bbc8d8;
    --shadow: 0 16px 38px rgba(0, 5, 14, .24);
    --radius: 20px;
}
html { color-scheme: dark; font-size: 18px; }
html[data-font-size="large"] { font-size: 20px; }
html[data-font-size="extra"] { font-size: 22px; }
body {
    font-size: 1rem;
    line-height: 1.56;
    color: var(--text);
    background:
        radial-gradient(ellipse at 5% 0%, rgba(82, 115, 178, .10), transparent 37rem),
        radial-gradient(ellipse at 96% 90%, rgba(58, 114, 115, .08), transparent 34rem),
        var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
::selection { color: #fff; background: #47679f; }
:focus-visible { outline: 3px solid #a7c4ff; outline-offset: 3px; }
a:focus-visible, button:focus-visible { border-radius: 8px; }
small, .muted, .hint { color: var(--muted); }
small { font-size: .87rem; }
p { line-height: 1.64; }
h1, h2, h3, h4 { color: #f1f6ff; line-height: 1.3; letter-spacing: -.025em; }
h1 { font-size: clamp(1.8rem, 2.35vw, 2.35rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.16rem; }
.eyebrow { color: #b4c8ff; font-size: .84rem; letter-spacing: .095em; }
.app-shell { min-width: 0; }
.sidebar {
    background: rgba(17, 28, 44, .98);
    border-right: 1px solid var(--line);
    backdrop-filter: none;
    width: 304px;
    padding: 26px 19px;
    scrollbar-width: thin;
    scrollbar-color: #3e5570 #172337;
}
.brand-mark {
    background: linear-gradient(135deg, #3b5c96, #5f71b5);
    box-shadow: none;
    color: #fff;
    border: 1px solid #788dc0;
    flex-shrink: 0;
    font-size: 1.0rem;
}
.brand strong { color: #f0f5ff; font-size: 1.05rem; line-height: 1.3; }
.brand span { color: var(--muted); font-size: .88rem; }
.menu { gap: 4px; margin: 25px 0 8px; }
.menu a {
    padding: 11px 13px;
    color: #d6e3f4;
    border: 1px solid transparent;
    font-size: .94rem;
    font-weight: 600;
    line-height: 1.36;
    white-space: normal;
    min-height: 46px;
    display: flex;
    align-items: center;
    transform: none;
}
.menu a:hover, .menu a:focus-visible {
    background: var(--soft-primary);
    border-color: #4a6483;
    color: #f4f8ff;
    transform: none;
}
.menu a[aria-current="page"] { background: #2b4367; border-color: #6488bc; color: #fff; font-weight: 740; }
.user-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; }
.user-box span { color: var(--muted); }
.avatar { background: #385171; color: #edf4ff; }
.main { min-width: 0; padding: 32px; }
.topbar { padding-bottom: 20px; border-bottom: 1px solid #293c52; margin-bottom: 25px; }
.topbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.text-size-control { display:flex; align-items:center; gap:5px; padding:4px; border:1px solid var(--line); background: #1c2c40; border-radius: 14px; }
.text-size-label { padding: 0 7px 0 9px; font-size: .83rem; color: var(--muted); font-weight: 700; }
.text-size-btn { min-width: 40px; min-height: 38px; padding: 5px 9px; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 10px; font-size: .85rem; line-height: 1; font-weight: 800; cursor:pointer; }
.text-size-btn:hover { background: #30445f; color: #fff; }
.text-size-btn[aria-pressed="true"] { color: #fff; background: #405d8d; border-color: #6385bd; }
.mobile-menu-toggle { display:none; }
.card, .login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    color: var(--text);
    min-width: 0;
}
.card { padding: 26px; }
.card h2 { margin-bottom: 16px; }
.card-head { gap: 18px; }
.stat span, .stat small, .proposal-stats small { color: var(--muted); }
.stat strong, .proposal-stats strong { color: #f2f7ff; letter-spacing: -.035em; }
.stat strong { font-size: clamp(2rem, 3vw, 2.7rem); }
.btn {
    min-height: 46px;
    padding: 11px 17px;
    border: 1px solid #3b5270;
    border-radius: 13px;
    background: #293c55;
    color: #f0f5ff;
    font-weight: 730;
    font-size: .94rem;
    line-height: 1.35;
    box-shadow: none;
}
.btn:hover { background: #334b69; box-shadow: none; transform: none; }
.btn.primary { background: #4266a3; border-color: #7094d5; color: #fff; }
.btn.primary:hover { background: #537bb9; }
.btn.ghost { background: #1a2a3e; color: #e4edfc; border-color: #465c79; }
.btn.ghost:hover { background: #2a405d; color: #fff; }
.btn.small { min-height: 40px; padding: 8px 13px; border-radius: 11px; font-size: .87rem; }
.btn:disabled, button:disabled, input:disabled, select:disabled { opacity: .56; cursor: not-allowed; }
button, select, input, textarea { accent-color: #9db8ff; }
.form label, .proposal-line-grid label { color: #dce7f6; font-size: .96rem; font-weight: 670; line-height:1.45; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
select, textarea,
.form input:not([type="checkbox"]), .form select, .form textarea,
.filters input, .filters select,
.catalog-filters input, .catalog-filters select, .search-input,
.proposal-line-grid input, .proposal-line-grid select {
    background: var(--field);
    border: 1px solid #49627c;
    color: var(--text);
    border-radius: 12px;
    font: inherit;
    font-size: .98rem;
    min-height: 48px;
    padding: 11px 14px;
    outline: none;
}
textarea, .form textarea { min-height: 108px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a4b5c9; opacity: 1; }
input:focus, select:focus, textarea:focus,
.form input:focus, .form select:focus, .form textarea:focus,
.filters input:focus, .filters select:focus,
.catalog-filters input:focus, .catalog-filters select:focus, .search-input:focus,
.proposal-line-grid input:focus, .proposal-line-grid select:focus {
    border-color: #9cb7fa;
    box-shadow: 0 0 0 3px rgba(119, 165, 232, .24);
    outline: none;
}
input[type="checkbox"], input[type="radio"], .form input[type="checkbox"], .form input[type="radio"] {
    width: 20px;
    height: 20px;
    min-height: 0;
    padding: 0;
    flex-shrink: 0;
}
select option { background: #162435; color: #f0f5ff; }
input[type="file"]::file-selector-button { background: #344d6f; border: 1px solid #6183af; padding: 8px 12px; border-radius: 9px; color: #f2f6ff; margin-right: 12px; }
.table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:14px; background:#182638; scrollbar-color:#4c627d #182638; }
table { font-size: .94rem; min-width: 760px; }
th { background: #20334a; color: #c4d6ed; font-size: .83rem; font-weight: 780; padding: 15px 13px; letter-spacing:.055em; }
td { padding: 16px 13px; border-top: 1px solid #35475e; }
tbody tr:nth-child(even) { background: rgba(255,255,255,.018); }
tbody tr:hover { background: #263951; }
td small { font-size:.85rem; color:var(--muted); }
.badge, .chip { font-size: .87rem; font-weight: 770; padding: 7px 12px; line-height:1.4; }
.badge.green { background: #163d36; color: #9ae9c5; }
.badge.amber { background: #4c391e; color: #ffdfa6; }
.badge.red { background: #4b2832; color: #ffb9c0; }
.badge.blue { background: #213c62; color: #b5d7ff; }
.badge.gray { background: #313d4e; color: #d0dae6; }
.chip { background: #27394e; color: #d8e5f4; }
.alert { border: 1px solid var(--line); line-height:1.55; }
.alert.green { background: #163b34; border-color:#2e6b59; color:#a9f2d3; }
.alert.red { background: #472a34; border-color:#795162; color:#ffd0d5; }
.alert.fade-out { opacity: .72; }
.details div { border-bottom: 1px solid var(--line); }
dt { color:#b8cbe2; }
dd { color:var(--text); }
.note-box, .soft-item, .sub-card, .empty, .soft-notice, .code-sample { background: var(--panel-2); border: 1px solid var(--line); color: #dde8f6; }
.note-box p, .soft-item span, .sub-card span, .sub-card small, .empty { color: var(--muted); }
.soft-item, .sub-card { padding:16px; }
.soft-item:hover { background:#2a4059; }
.soft-item time { color: #bed3ff; }
.soft-notice { padding: 19px 21px; line-height:1.65; }
.empty { border-style: dashed; border-color:#50647d; }
.link-danger { color:#ffb0b6; }
.timeline-item small, .activity-item small { color:var(--muted); }
.dot { background: #9ebaff; box-shadow: 0 0 0 5px rgba(157,186,255,.12); }
.stat-row { grid-template-columns: minmax(120px, 1fr) minmax(70px, 2fr) auto; }
.stat-track { background: #2c4159; }
.stat-track span, .bar-wrap .bar { background: #7f9cdd; }
.bar-wrap { font-size: .84rem; }
.calendar-head small { color:var(--muted); }
.cal-weekday { color:#c2d3e7; font-size:.88rem; }
.cal-day { background:#1d2d42; border-color:#384f69; min-height:120px; }
.cal-day.today { background:#2c4262; border-color:#99b7ee; }
.cal-day b { color:#ecf2fb; }
.cal-day.empty-day { background: transparent; opacity:.65; }
.cal-event { background:#344b6e; color:#f0f5ff; font-size:.78rem; padding:6px; line-height:1.35; }
.cal-event.follow { background:#215143; color:#b9f0d6; }
.cal-event.muted-event { opacity:.7; }
.calendar-viewport { max-width:100%; overflow-x:auto; scrollbar-color:#4c627d #192637; }
.calendar-hint { display:none; color:var(--muted); font-size:.83rem; margin:0 0 10px; }
.proposal-line { background: #1d2c40; border: 1px solid #415671; border-radius: 17px; padding: 22px; }
.proposal-line-grid label { color:#d9e6f8; font-size:.9rem; }
.proposal-line-grid input, .proposal-line-grid select { padding:11px 13px; }
.line-total { color:var(--muted); font-size:.88rem; }
.line-total strong, .proposal-totals .grand strong, .proposal-hero-total strong { color:#d2dfff; }
.proposal-totals { background:#203148; border-color:#405976; padding:21px; }
.proposal-totals span { color:var(--muted); }
.proposal-totals .grand { border-color:#506781; }
.proposal-totals strong { color:#eff5ff; }
.proposal-stats strong { font-size:clamp(1.7rem,2.2vw,2.2rem); overflow-wrap:anywhere; }
.login-page { background: radial-gradient(circle at 20% 12%, rgba(89, 119, 179, .11), transparent 32rem), var(--bg); }
.login-card { width:min(520px,100%); padding:38px; }
.login-card h1 { margin-top:12px; }
.login-card .hint { color:var(--muted); }
@media (max-width:1120px) {
    .sidebar { width:280px; }
    .stat-row { grid-template-columns: minmax(115px,1fr) minmax(65px,2fr) auto; }
}
@media (max-width:820px) {
    .sidebar { width:100%; height:auto; position:relative; padding:18px; border-right:0; border-bottom:1px solid var(--line); }
    .main { padding:20px; }
    .menu { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:7px; margin-top:15px; }
    .menu a { padding:12px; font-size:.94rem; }
    .js-ready .mobile-menu-toggle { display:inline-flex; margin-top:17px; min-height:44px; }
    .js-ready .sidebar:not(.menu-open) .menu { display:none; }
    .topbar-actions { width:100%; justify-content:space-between; }
    .grid.two, .grid.two.uneven, .grid.cards.four { grid-template-columns:1fr; }
    .calendar-hint { display:block; }
    .calendar-grid { min-width:770px; gap:7px; }
    .cal-day { min-height:108px; padding:9px; }
    .cal-day b { font-size:.95rem; }
    .cal-event { font-size:.8rem; padding:5px; max-height:none; }
}
@media (max-width:580px) {
    html { font-size:17px; }
    html[data-font-size="large"] { font-size:19px; }
    html[data-font-size="extra"] { font-size:21px; }
    .main { padding:14px; }
    .sidebar { padding:15px; }
    .card { padding:19px; }
    .topbar { gap:14px; }
    .menu { grid-template-columns:1fr; }
    .menu a { min-height:49px; font-size:1rem; }
    .quick-nav .btn, .calendar-head .inline-actions .btn { font-size:.91rem; }
    .proposal-stats { grid-template-columns:1fr; gap:12px; }
    .proposal-stats .card { padding:20px; }
    .proposal-stats strong { font-size:1.85rem; }
    .proposal-line { padding:17px; }
    .proposal-line-grid { grid-template-columns:1fr; }
    .proposal-line-grid .wide { grid-column:auto; }
    .proposal-totals { max-width:100%; width:100%; }
    .calendar-grid { min-width:770px; }
    .cal-event { font-size:.88rem; line-height:1.35; max-height:none; }
    .text-size-control { flex-wrap:nowrap; }
    .text-size-label { display:none; }
    .stat-row { grid-template-columns:minmax(85px,1fr) minmax(50px,2fr) auto; gap:8px; }
    .login-page { padding:14px; }
    .login-card { padding:25px; }
}
@media (prefers-reduced-motion:reduce) {
    *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}
