:root{
    --bg:#f3f7fb;
    --bg2:#edf3f9;
    --panel:#ffffff;
    --panel-2:#f8fbff;
    --panel-muted:#f8fafc;
    --line:#dbe4ee;
    --line-strong:#c7d2e3;
    --text:#0f172a;
    --muted:#64748b;
    --muted-2:#94a3b8;
    --primary:#2563eb;
    --primary2:#4f46e5;
    --success:#16a34a;
    --danger:#dc2626;
    --warning:#d97706;
    --info:#0891b2;
    --shadow:0 18px 48px rgba(15,23,42,.08);
    --shadow-soft:0 10px 26px rgba(15,23,42,.05);
    --radius:22px;
    --radius-sm:16px;
}
*{box-sizing:border-box}
html,body{
    margin:0;
    padding:0;
    min-height:100%;
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.08), transparent 28%),
        radial-gradient(circle at top right, rgba(79,70,229,.06), transparent 24%),
        linear-gradient(180deg,var(--bg),var(--bg2));
    color:var(--text);
    font-family:Inter,Segoe UI,Arial,sans-serif;
}
body{overflow-x:hidden}
body.body-lock{overflow:hidden}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button,input,select,textarea{font:inherit}
.container{width:min(1260px,94%);margin:0 auto}
.public-top{
    position:sticky;top:0;z-index:20;
    background:rgba(255,255,255,.92);
    backdrop-filter:blur(14px);
    border-bottom:1px solid var(--line);
}
.topbar,.public-nav,.hero-actions,.actions-row,.card-head,.user-menu,.filters,.table-toolbar,.topbar-left,.quick-links,.hero-stats,.stats-inline,.metrics-inline,.topbar-actions{
    display:flex;gap:12px;align-items:center;
}
.topbar{justify-content:space-between;padding:16px 0}
.brand{font-weight:800;letter-spacing:.2px;color:var(--text)}
.primary-btn,.ghost-btn,.danger-btn,.icon-btn,.subtle-btn,button{
    border:0;border-radius:16px;padding:12px 18px;font-weight:700;cursor:pointer;
    transition:.22s transform,.22s opacity,.22s box-shadow,.22s background,.22s border-color,.22s color;
}
.primary-btn{background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;box-shadow:0 12px 28px rgba(37,99,235,.22)}
.ghost-btn{background:#fff;color:var(--text);border:1px solid var(--line);box-shadow:var(--shadow-soft)}
.ghost-btn:disabled{cursor:not-allowed;opacity:.6;transform:none;background:#f8fafc}
.subtle-btn{background:rgba(8,145,178,.08);color:#0f4c5c;border:1px solid rgba(8,145,178,.18)}
.danger-btn{background:rgba(220,38,38,.08);color:var(--danger);border:1px solid rgba(220,38,38,.16)}
.icon-btn{background:#fff;color:var(--text);padding:10px 14px;border:1px solid var(--line);box-shadow:var(--shadow-soft)}
.tiny-btn{padding:8px 12px;font-size:12px}
.primary-btn:hover,.ghost-btn:hover,.danger-btn:hover,.icon-btn:hover,.subtle-btn:hover,button:hover{transform:translateY(-1px)}
.big{padding:14px 24px}.full{width:100%}
.hero{padding:56px 0 24px}
.hero-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:28px;align-items:center}
.badge{display:inline-block;padding:10px 14px;border:1px solid var(--line);background:rgba(255,255,255,.85);border-radius:999px;color:var(--primary2);margin-bottom:18px;font-weight:600}
h1{font-size:clamp(34px,5vw,64px);line-height:1.02;margin:0 0 16px}
h2{font-size:clamp(28px,4vw,42px);margin:0 0 12px}
h3,h4{margin:0;color:var(--text)}
p{margin:0;color:var(--muted)}
.lead{font-size:18px;max-width:760px}
.grid-3,.kpi-grid,.grid-two,.helper-grid,.grid-4{display:grid;gap:18px}
.hero-stats{display:grid;grid-template-columns:repeat(3,1fr);margin-top:26px}
.stat-card,.glass-card,.auth-card,.sidebar,.app-topbar,.info-card{
    background:var(--panel);
    border:1px solid var(--line);
    box-shadow:var(--shadow);
}
.stat-card,.glass-card,.info-card{border-radius:var(--radius);padding:20px}
.hero-panel{min-height:420px;display:flex;flex-direction:column;justify-content:center;gap:16px;background:linear-gradient(180deg,var(--panel),var(--panel-2))}
.mini-kpi{display:flex;justify-content:space-between;align-items:center;padding:18px;border-radius:18px;background:var(--panel-muted);border:1px solid var(--line)}
.mini-kpi span,.muted,small,.page-subtitle,.hint-list li,.table-note{color:var(--muted)}
.mini-chart{display:flex;align-items:flex-end;gap:12px;height:180px;padding-top:20px}
.mini-chart .bar{flex:1;background:linear-gradient(180deg,var(--primary),var(--primary2));border-radius:16px 16px 6px 6px;opacity:.92}
.section{padding:28px 0 44px}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-4{grid-template-columns:repeat(4,1fr)}
.feature{min-height:180px}
.center{text-align:center}
.narrow{max-width:900px}
.final-cta{padding-bottom:80px}
.auth-wrap{min-height:calc(100vh - 80px);display:grid;place-items:center;padding:44px 0}
.auth-card{width:min(560px,92%);padding:28px;border-radius:28px}
.form-grid{display:grid;gap:14px}
.form-grid.cols-2{grid-template-columns:repeat(2,1fr)}
.form-grid.cols-3{grid-template-columns:repeat(3,1fr)}
.form-grid.cols-4{grid-template-columns:repeat(4,1fr)}
.form-grid label{min-width:0;display:flex;flex-direction:column;justify-content:flex-start}
.form-grid label span{display:block;font-size:13px;color:#475569;margin-bottom:8px;font-weight:600}
label.full,.full-col{grid-column:1/-1}
input,select,textarea{
    width:100%;padding:14px 15px;border-radius:16px;border:1px solid var(--line);
    background:#fff;color:var(--text);outline:none;transition:border-color .2s ease, box-shadow .2s ease, background .2s ease
}
textarea{min-height:110px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:rgba(37,99,235,.55);box-shadow:0 0 0 4px rgba(37,99,235,.12)}
input::placeholder,textarea::placeholder{color:var(--muted-2)}
input:disabled,select:disabled,textarea:disabled{background:#f8fafc;color:#94a3b8;cursor:not-allowed}
.search-box{display:grid;gap:8px;min-width:290px;max-width:440px;flex:0 1 420px}
.search-box input,.search-field input,input.search-field{min-width:0}
.field-hint,.search-status{
    font-size:12px;
    line-height:1.45;
    color:var(--muted);
}
.search-status{margin-top:2px}
input.is-searching{border-color:rgba(37,99,235,.45);background:#f8fbff}
select.select-search-active{border-color:rgba(37,99,235,.34);background:#f8fbff}
.flash{padding:14px 16px;border-radius:16px;margin:0 0 16px;border:1px solid transparent;box-shadow:var(--shadow-soft)}
.flash.success{background:rgba(22,163,74,.08);border-color:rgba(22,163,74,.16);color:#166534}
.flash.error{background:rgba(220,38,38,.08);border-color:rgba(220,38,38,.16);color:#991b1b}
.app-shell{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:100vh}
.sidebar{
    padding:20px;position:sticky;top:0;height:100vh;border-radius:0;display:flex;flex-direction:column;gap:18px;
    background:linear-gradient(180deg,#ffffff,#f8fbff);min-width:0
}
.sidebar-top{display:flex;justify-content:space-between;align-items:center}
.sidebar-nav{display:grid;gap:8px}
.sidebar-nav a{padding:14px 16px;border-radius:16px;color:#334155;border:1px solid transparent;font-weight:600}
.sidebar-nav a:hover,.sidebar-nav a.active{background:rgba(37,99,235,.08);border-color:rgba(37,99,235,.16);color:#1d4ed8}
.sidebar-footer{margin-top:auto;display:grid;gap:12px;padding-top:18px;border-top:1px solid var(--line)}
.mini-user{display:grid;gap:6px;padding:14px;border-radius:18px;background:var(--panel-muted);border:1px solid var(--line)}
.mini-user span{color:var(--muted)}
.mini-user-avatar{margin-bottom:8px}
.mini-user-avatar img{width:56px;height:56px;border-radius:50%;object-fit:cover;border:1px solid var(--line)}
.main-area{display:flex;flex-direction:column;min-width:0}
.app-topbar{
    margin:18px 18px 0;padding:16px 18px;border-radius:22px;display:flex;justify-content:space-between;align-items:center;gap:18px;
    min-width:0;background:rgba(255,255,255,.92);backdrop-filter:blur(10px);position:relative
}
.page-title{font-size:26px;font-weight:800;color:var(--text)}
.content{padding:18px;display:grid;gap:18px;min-width:0}
.user-badge{display:grid;gap:4px;text-align:right;padding:10px 14px;border-radius:16px;background:var(--panel-muted);border:1px solid var(--line)}
.kpi-grid{grid-template-columns:repeat(5,1fr)}
.kpi-grid.compact{grid-template-columns:repeat(4,1fr)}
.kpi{display:flex;flex-direction:column;gap:8px;min-height:120px;justify-content:center;background:linear-gradient(180deg,#fff,#f9fbff)}
.kpi span{color:#64748b;font-size:13px;font-weight:600}
.kpi strong{font-size:28px;color:var(--text)}
.kpi.positive strong{color:#15803d}
.kpi.negative strong{color:#b91c1c}
.grid-two{grid-template-columns:1fr 1fr}
.inline-grid{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end}
.inline-grid label{min-width:150px;flex:1 1 160px}
.card-head{justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:14px}
.card-subtitle{color:var(--muted);font-size:14px;margin-top:6px}
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:18px;max-width:100%;background:#fff}
table{width:100%;border-collapse:collapse;min-width:760px;background:#fff}
th,td{padding:14px 12px;border-bottom:1px solid #e9eef5;text-align:left;white-space:nowrap;vertical-align:top;color:var(--text)}
thead th{position:sticky;top:0;z-index:1;background:#f8fafc;color:#475569;font-size:13px;font-weight:800}
tbody tr:hover{background:#f8fbff}
tbody tr:last-child td{border-bottom:0}
.stack{display:grid;gap:14px}
.list-card{display:flex;justify-content:space-between;gap:18px;padding:18px;border-radius:18px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow-soft)}
.list-card.compact{padding:14px}
.list-body{display:grid;gap:8px;min-width:0}
.list-actions{display:flex;gap:10px;align-items:flex-start;flex-wrap:wrap}
.plan-fact,.forecast-box,.attention-list,.hint-list,.role-permissions,.notifications-list,.support-messages,.support-threads{display:grid;gap:12px}
.info-card p{margin-top:8px}
.hint-box{padding:16px;border-radius:18px;background:var(--panel-muted);border:1px solid var(--line)}
.quick-links{flex-wrap:wrap}
.quick-link{padding:10px 14px;border-radius:999px;border:1px solid var(--line);color:#334155;background:#fff;box-shadow:var(--shadow-soft);font-weight:600}
.quick-link:hover,.quick-link.active{background:rgba(37,99,235,.08);border-color:rgba(37,99,235,.18);color:#1d4ed8}
.table-toolbar{justify-content:space-between;flex-wrap:wrap;margin-bottom:14px}
.table-meta,.stats-inline{display:flex;gap:10px;flex-wrap:wrap}
.pill{display:inline-flex;align-items:center;gap:6px;padding:9px 12px;border-radius:999px;background:#fff;border:1px solid var(--line);color:#334155;font-size:13px;box-shadow:var(--shadow-soft);font-weight:600}
.status-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:999px;font-size:12px;font-weight:800;border:1px solid transparent}
.status-success{background:rgba(22,163,74,.08);color:#166534;border-color:rgba(22,163,74,.16)}
.status-danger{background:rgba(220,38,38,.08);color:#991b1b;border-color:rgba(220,38,38,.16)}
.status-warning{background:rgba(217,119,6,.08);color:#9a3412;border-color:rgba(217,119,6,.16)}
.status-info{background:rgba(8,145,178,.08);color:#155e75;border-color:rgba(8,145,178,.16)}
.status-muted{background:rgba(148,163,184,.12);color:#475569;border-color:rgba(148,163,184,.18)}
.status-primary{background:rgba(37,99,235,.08);color:#1d4ed8;border-color:rgba(37,99,235,.16)}
.attention-item{display:grid;gap:8px;padding:16px;border-radius:18px;background:#fff;border:1px solid var(--line)}
.attention-item.danger{border-color:rgba(220,38,38,.22);background:linear-gradient(180deg,#fff,#fff7f7)}
.attention-item.warning{border-color:rgba(217,119,6,.2);background:linear-gradient(180deg,#fff,#fffaf3)}
.attention-item.success{border-color:rgba(22,163,74,.18);background:linear-gradient(180deg,#fff,#f6fff8)}
.attention-item .title{font-weight:800}
.attention-item .desc{color:#334155;line-height:1.5}
.sort-link{display:inline-flex;align-items:center;gap:6px;color:#334155;font-weight:800}
.sort-link span{color:var(--muted)}
.sort-link.active{color:#1d4ed8}
.empty-state{padding:26px;text-align:center;color:var(--muted);border:1px dashed var(--line-strong);border-radius:18px;background:#fcfdff}
.empty-state.small{padding:14px;font-size:14px}
.search-field{min-width:220px}
.checkbox-cell{width:42px}
.amount-income{color:#15803d;font-weight:800}
.amount-expense{color:#b91c1c;font-weight:800}
.amount-neutral{font-weight:800}
.danger-note{margin-top:12px;padding:12px 14px;border-radius:14px;background:rgba(220,38,38,.08);border:1px solid rgba(220,38,38,.16);color:#991b1b;font-size:14px}
.import-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.helper-grid{grid-template-columns:repeat(2,1fr)}
.top-space{margin-top:14px}
.mobile-only{display:none}
canvas{width:100%!important;height:320px!important}
.modal{
    position:fixed;inset:0;background:rgba(15,23,42,.38);backdrop-filter:blur(6px);display:none;align-items:center;justify-content:center;z-index:90;padding:20px
}
.modal.open{display:flex}
.modal-dialog{
    width:min(860px,100%);max-height:90vh;overflow:auto;background:linear-gradient(180deg,var(--panel),var(--panel-2));
    border:1px solid var(--line);border-radius:28px;box-shadow:0 30px 70px rgba(15,23,42,.18)
}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px;border-bottom:1px solid var(--line);position:sticky;top:0;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);z-index:1}
.modal-body{padding:20px}
.modal-title{font-size:20px;font-weight:800}
.modal-actions{display:flex;gap:12px;justify-content:flex-end;flex-wrap:wrap;margin-top:16px}
.field-hidden{display:none!important}
.hero-note{color:#334155;font-weight:600}
.role-permissions{grid-template-columns:repeat(3,1fr)}
.check-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.check-item{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fff}
.notifications-popover{
    position:absolute;right:18px;top:76px;width:min(430px,calc(100vw - 36px));background:#fff;border:1px solid var(--line);
    box-shadow:0 24px 60px rgba(15,23,42,.16);border-radius:20px;padding:14px;display:none;z-index:40
}
.notifications-popover.open{display:block}
.notifications-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px}
.notifications-subtitle{font-size:12px;color:var(--muted);margin-top:4px}
.notification-item{padding:12px;border:1px solid var(--line);border-radius:14px;background:#fff;cursor:pointer;transition:.2s ease background,.2s ease border-color,.2s ease transform,.2s ease box-shadow}
.notification-item:hover{transform:translateY(-1px);box-shadow:var(--shadow-soft)}
.notification-item.unread{background:#f5f9ff;border-color:#cfe0ff}
.notification-item.read{background:#fff;border-color:#e7edf5;opacity:.92}
.notification-item.recently-updated{box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.notification-topline{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.notification-title{font-weight:800;margin-bottom:6px}
.notification-body{color:#334155;font-size:14px;line-height:1.45}
.notification-meta{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:8px;font-size:12px;color:var(--muted)}
.notification-link{color:#1d4ed8;font-weight:700}
.notification-state{
    display:inline-flex;align-items:center;white-space:nowrap;
    padding:5px 8px;border-radius:999px;font-size:11px;font-weight:800;border:1px solid transparent
}
.notification-state.unread{background:rgba(37,99,235,.08);color:#1d4ed8;border-color:rgba(37,99,235,.16)}
.notification-state.read{background:rgba(148,163,184,.12);color:#475569;border-color:rgba(148,163,184,.18)}
.bell-btn{position:relative}
.bell-counter{
    position:absolute;top:-6px;right:-6px;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:#dc2626;color:#fff;
    display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800
}
.bell-counter.hidden{display:none}
.support-layout{display:grid;grid-template-columns:320px minmax(0,1fr);gap:18px}
.support-threads{max-height:560px;overflow:auto}
.support-thread{
    width:100%;text-align:left;background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px;display:grid;gap:6px
}
.support-thread.active{border-color:#2563eb;background:#f5f9ff}
.support-thread span,.support-thread small{color:var(--muted)}
.support-chat{display:grid;grid-template-rows:1fr auto;min-height:560px}
.support-messages{
    border:1px solid var(--line);border-radius:18px;padding:16px;background:#fff;overflow:auto;max-height:560px
}
.support-message{max-width:80%;padding:12px 14px;border-radius:16px;background:#f8fafc;border:1px solid var(--line)}
.support-message.user{justify-self:end;background:#eef4ff;border-color:#cfe0ff}
.support-message.admin{justify-self:start;background:#fff7f7;border-color:#ffd2d2}
.support-meta{font-size:12px;color:var(--muted);margin-bottom:6px}
.support-text{white-space:pre-wrap;line-height:1.5}
.onboarding-overlay{
    position:fixed;inset:0;background:rgba(15,23,42,.45);backdrop-filter:blur(4px);display:none;align-items:center;justify-content:center;z-index:120;padding:16px
}
.onboarding-overlay.open{display:flex}
.onboarding-card{width:min(620px,100%);background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:0 24px 60px rgba(15,23,42,.18);padding:20px}
.onboarding-top,.onboarding-actions{display:flex;justify-content:space-between;align-items:center;gap:12px}
.onboarding-body{padding:16px 0;display:grid;gap:12px}
.onboarding-step{font-size:16px;line-height:1.7;color:#334155}
.onboarding-progress{font-size:13px;color:var(--muted)}
.tabs-row{display:flex;flex-wrap:wrap;gap:10px}
.anchor-pill{padding:10px 14px;border-radius:999px;border:1px solid var(--line);background:#fff;box-shadow:var(--shadow-soft);font-weight:700}
.anchor-pill:hover{background:#f5f9ff;border-color:#cfe0ff}
.checkbox-list{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-height:220px;overflow:auto;padding:10px;border:1px solid var(--line);border-radius:16px;background:#fff}
.checkbox-list label{display:flex;align-items:flex-start;gap:10px;padding:8px 10px;border:1px solid #eef2f7;border-radius:12px;background:#fcfdff}
.price-box{font-size:28px;font-weight:800;color:#1d4ed8;margin:8px 0}
.seo-section p{line-height:1.8}
.inline-status{
    margin-top:10px;padding:10px 12px;border-radius:14px;border:1px solid var(--line);font-size:13px
}
.inline-status.neutral{background:#f8fafc;color:#475569}
.inline-status.success{background:rgba(22,163,74,.08);border-color:rgba(22,163,74,.16);color:#166534}
.inline-status.error{background:rgba(220,38,38,.08);border-color:rgba(220,38,38,.16);color:#991b1b}
@media (max-width:1180px){
    .kpi-grid{grid-template-columns:repeat(3,1fr)}
    .form-grid.cols-4,.check-grid,.role-permissions,.checkbox-list{grid-template-columns:repeat(2,1fr)}
    .import-grid,.helper-grid,.support-layout{grid-template-columns:1fr}
}
@media (max-width:900px){
    .hero-grid,.grid-3,.grid-two,.hero-stats,.kpi-grid,.kpi-grid.compact,.grid-4,.form-grid.cols-2,.form-grid.cols-3,.form-grid.cols-4,.check-grid,.role-permissions,.checkbox-list{
        grid-template-columns:1fr
    }
    .app-shell{grid-template-columns:1fr}
    .sidebar{position:fixed;left:-100%;top:0;width:min(88vw,320px);z-index:95;transition:.24s left;border-right:1px solid var(--line)}
    .sidebar.open{left:0}
    .app-topbar{margin:12px;flex-wrap:wrap;align-items:flex-start}
    .content{padding:12px}
    .mobile-only{display:inline-flex}
    .user-menu{width:100%;justify-content:space-between;flex-wrap:wrap}
    .user-badge{text-align:left}
    .table-toolbar,.filters,.actions-row,.quick-links,.card-head,.topbar-left,.stats-inline,.topbar-actions{flex-wrap:wrap}
    .search-box{min-width:100%;max-width:none;flex:1 1 100%}
    .search-field{min-width:100%}
    table{min-width:680px}
    canvas{height:260px!important}
    .notifications-popover{right:12px;top:120px}
    .kpi{min-height:100px}
    .list-card{flex-direction:column;align-items:stretch}
    .list-actions{justify-content:flex-start}
}
@media (max-width:640px){
    .container{width:min(100%,calc(100% - 24px))}
    .topbar{padding:12px 0;flex-wrap:wrap}
    .public-nav{width:100%;justify-content:flex-start;flex-wrap:wrap}
    .hero{padding:32px 0 20px}
    .auth-card{padding:22px}
    .glass-card,.info-card,.stat-card{padding:16px}
    .page-title{font-size:22px}
    .modal{padding:10px}
    .modal-dialog{border-radius:22px}
    .form-grid,.inline-grid{gap:12px}
    th,td{padding:12px 10px}
    .primary-btn,.ghost-btn,.danger-btn,.icon-btn,.subtle-btn,button{padding:11px 14px}
    .kpi strong{font-size:24px}
    .notification-topline,.notification-meta{flex-direction:column;align-items:flex-start}
}

.main-area,.content,.glass-card,.list-card,.list-body,.list-actions,.app-topbar,.topbar-left,.topbar-actions,.form-grid,.table-wrap,.support-layout,.support-chat,.support-messages,.support-threads{min-width:0}
.table-wrap{width:100%}
.project-sites-list{display:grid;gap:6px;margin-top:8px}
.project-sites-list a{word-break:break-all;color:#1d4ed8}
.project-title-line{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.payment-badge{
    display:inline-flex;align-items:center;justify-content:center;
    padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;border:1px solid transparent
}
.payment-badge.prepayment{background:rgba(22,163,74,.08);color:#166534;border-color:rgba(22,163,74,.16)}
.payment-badge.postpayment{background:rgba(217,119,6,.08);color:#9a3412;border-color:rgba(217,119,6,.16)}
.benchmark-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.benchmark-card{
    border:1px solid var(--line);border-radius:18px;background:#fff;padding:16px;
    display:grid;gap:8px;box-shadow:var(--shadow-soft)
}
.benchmark-card.better{border-color:rgba(22,163,74,.24);background:linear-gradient(180deg,#fff,#f6fff8)}
.benchmark-card.worse{border-color:rgba(220,38,38,.22);background:linear-gradient(180deg,#fff,#fff7f7)}
.benchmark-card.equal{border-color:rgba(148,163,184,.22);background:#fff}
.benchmark-label{font-weight:800}
.benchmark-values{display:grid;gap:4px}
.benchmark-state{font-size:12px;font-weight:800}
.benchmark-card.better .benchmark-state{color:#166534}
.benchmark-card.worse .benchmark-state{color:#991b1b}
.benchmark-card.equal .benchmark-state{color:#475569}

@media (max-width:1180px){
    .benchmark-grid{grid-template-columns:repeat(2,1fr)}
}

@media (max-width:900px){
    .notifications-popover{
        position:fixed;
        left:12px;
        right:12px;
        top:72px;
        width:auto;
        max-height:calc(100vh - 84px);
        overflow:auto;
        z-index:120;
    }
    .app-topbar,.glass-card,.list-card,.form-grid,.table-wrap{max-width:100%}
    .content{overflow-x:hidden}
}

@media (max-width:640px){
    .benchmark-grid{grid-template-columns:1fr}
    .project-title-line{align-items:flex-start}
    .notifications-popover{
        left:10px;
        right:10px;
        top:66px;
        max-height:calc(100vh - 76px);
        border-radius:18px;
    }
}

.page-title,
.page-subtitle,
.user-badge span,
.user-badge small,
.mini-user strong,
.mini-user span,
.sidebar-nav a,
.quick-link,
.pill,
.notification-title,
.notification-body,
.project-title-line strong,
.card-subtitle,
.list-body,
.list-actions,
.brand {
    overflow-wrap:anywhere;
    word-break:break-word;
}

.topbar-left{
    flex:1 1 420px;
    min-width:0;
}

.topbar-actions{
    flex:0 1 auto;
    justify-content:flex-end;
    flex-wrap:wrap;
    min-width:0;
    max-width:100%;
}

.user-menu{
    min-width:0;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.user-badge{
    min-width:0;
    max-width:100%;
}

.content > *{
    min-width:0;
}

.glass-card,
.app-topbar,
.modal-dialog{
    max-width:100%;
}

@media (max-width:1366px){
    .app-shell{
        grid-template-columns:272px minmax(0,1fr);
    }

    .kpi-grid{
        grid-template-columns:repeat(4,1fr);
    }

    .kpi-grid.compact{
        grid-template-columns:repeat(3,1fr);
    }

    .app-topbar{
        flex-wrap:wrap;
        align-items:flex-start;
    }
}

@media (max-width:1180px){
    .kpi-grid.compact{
        grid-template-columns:repeat(2,1fr);
    }
}

/* =========================
   ДОБАВЛЕНО: onboarding / modals / support / filters / bank
   ========================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.56);
    overflow-y: auto;
}

.modal.is-open {
    display: flex;
}

.modal-dialog {
    width: min(980px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.modal-body {
    padding: 20px 22px 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.full-col {
    grid-column: 1 / -1;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.14);
    color: #0f172a;
    cursor: pointer;
    transition: .2s ease;
}

.icon-btn:hover {
    background: rgba(148, 163, 184, 0.24);
}

.top-space {
    margin-top: 18px;
}

.inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.search-field {
    min-width: 240px;
}

.filters label,
.form-grid label,
.switch-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.filters span,
.form-grid span,
.switch-form span {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid input[type="text"],
.form-grid input[type="email"],
.form-grid input[type="password"],
.form-grid input[type="url"],
.form-grid input[type="date"],
.form-grid input[type="month"],
.form-grid input[type="number"],
.form-grid textarea,
.form-grid select,
.filters input[type="text"],
.filters input[type="date"],
.filters input[type="month"],
.filters select,
.search-box input[type="text"],
.switch-form input[type="password"],
.switch-form select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #fff;
    color: #0f172a;
    outline: none;
    transition: .2s ease;
    box-sizing: border-box;
}

.form-grid textarea {
    min-height: 110px;
    resize: vertical;
    padding-top: 12px;
}

.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus,
.filters input:focus,
.filters select:focus,
.search-box input:focus,
.switch-form input:focus,
.switch-form select:focus {
    border-color: rgba(124, 58, 237, 0.48);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.10);
}

.primary-btn,
.ghost-btn,
.danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: .2s ease;
    border: 0;
}

.primary-btn {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
}

.primary-btn:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.ghost-btn {
    background: rgba(148, 163, 184, 0.12);
    color: #0f172a;
}

.ghost-btn:hover {
    background: rgba(148, 163, 184, 0.20);
}

.danger-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.danger-btn:hover {
    filter: brightness(1.03);
}

.full {
    width: 100%;
}

.big {
    min-height: 50px;
    padding: 0 20px;
    border-radius: 14px;
}

.tiny-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0;
}

.kpi-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi span {
    font-size: 13px;
    color: #64748b;
}

.kpi strong {
    font-size: 28px;
    line-height: 1.1;
    color: #0f172a;
}

.kpi.positive strong {
    color: #15803d;
}

.kpi.negative strong {
    color: #dc2626;
}

.glass-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    padding: 18px;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.card-head h3,
.card-head h2 {
    margin: 0;
    color: #0f172a;
}

.card-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.table-wrap th,
.table-wrap td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    text-align: left;
    vertical-align: top;
    color: #0f172a;
}

.table-wrap th {
    font-size: 13px;
    color: #475569;
    font-weight: 700;
    background: rgba(248, 250, 252, 0.82);
    position: sticky;
    top: 0;
}

.checkbox-cell {
    width: 42px;
}

.table-toolbar,
.table-meta,
.actions-row,
.plan-fact,
.forecast-box,
.stack,
.tabs-row,
.quick-links,
.benchmark-grid,
.check-grid,
.checkbox-list,
.project-sites-list,
.support-layout {
    display: flex;
    gap: 12px;
}

.table-toolbar,
.table-meta,
.actions-row,
.plan-fact,
.forecast-box,
.stack,
.tabs-row,
.quick-links,
.benchmark-grid,
.check-grid,
.checkbox-list,
.project-sites-list {
    flex-wrap: wrap;
}

.stack {
    flex-direction: column;
}

.plan-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.85);
}

.plan-line span {
    color: #64748b;
}

.plan-line strong {
    color: #0f172a;
}

.forecast-box > div,
.mini-kpi,
.stat-card,
.info-card,
.feature,
.benchmark-card {
    border-radius: 16px;
    padding: 14px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.info-card p,
.feature p {
    margin: 8px 0 0;
    color: #475569;
    line-height: 1.5;
}

.list-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.96);
}

.list-card.compact {
    padding: 12px 14px;
}

.list-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.list-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge,
.pill,
.anchor-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.status-success {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.status-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.status-warning {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.status-primary,
.status-info {
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
}

.pill,
.anchor-pill {
    background: rgba(148, 163, 184, 0.14);
    color: #334155;
}

.anchor-pill:hover {
    background: rgba(124, 58, 237, 0.10);
    color: #6d28d9;
}

.amount-income {
    color: #15803d;
    font-weight: 700;
}

.amount-expense {
    color: #b91c1c;
    font-weight: 700;
}

.payment-badge.prepayment {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
    font-size: 12px;
    font-weight: 700;
}

.payment-badge.postpayment {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
    font-size: 12px;
    font-weight: 700;
}

.project-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.project-sites-list a {
    color: #4f46e5;
    text-decoration: none;
    word-break: break-all;
}

.project-sites-list a:hover {
    text-decoration: underline;
}

.muted {
    color: #64748b;
    line-height: 1.45;
}

.empty-state {
    padding: 18px;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.85);
    color: #64748b;
    text-align: center;
}

.empty-state.small {
    padding: 12px;
    font-size: 14px;
}

.flash {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
}

.flash.success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.18);
}

.flash.error {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.danger-note {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.10);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.16);
}

.search-box {
    min-width: 280px;
}

.field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.check-item,
.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.support-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.support-threads,
.support-chat {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(248, 250, 252, 0.72);
    padding: 14px;
}

.support-threads {
    max-height: 680px;
    overflow-y: auto;
}

.support-chat {
    display: flex;
    flex-direction: column;
    min-height: 520px;
}

.support-messages {
    flex: 1;
    min-height: 280px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.support-thread-item {
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #fff;
    transition: .2s ease;
}

.support-thread-item:hover {
    border-color: rgba(124, 58, 237, 0.34);
}

.support-thread-item.active {
    border-color: rgba(124, 58, 237, 0.70);
    background: rgba(124, 58, 237, 0.08);
}

.support-message-item {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 12px;
    max-width: 85%;
    word-break: break-word;
}

.support-message-item.user {
    background: rgba(124, 58, 237, 0.12);
    margin-left: auto;
}

.support-message-item.admin {
    background: rgba(59, 130, 246, 0.12);
    margin-right: auto;
}

.support-message-meta {
    font-size: 12px;
    opacity: .72;
    margin-bottom: 6px;
}

.support-attachments {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.support-attachments a {
    color: #4f46e5;
    text-decoration: none;
    word-break: break-all;
}

.support-attachments a:hover {
    text-decoration: underline;
}

.bell-btn {
    position: relative;
}

.bell-counter {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.32);
}

.bell-counter.hidden {
    display: none;
}

.notifications-popover {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: min(420px, calc(100vw - 24px));
    max-height: 520px;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.16);
    z-index: 3200;
}

.notifications-popover.is-open {
    display: block;
}

.notifications-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.notifications-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
}

.notification-item.unread {
    border-color: rgba(99, 102, 241, 0.34);
    background: rgba(99, 102, 241, 0.05);
}

.onboarding-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    z-index: 5000;
}

.onboarding-overlay.is-open {
    display: block;
}

.onboarding-card {
    position: fixed;
    z-index: 5003;
    width: min(420px, calc(100vw - 24px));
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.onboarding-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.onboarding-body {
    padding: 18px;
}

.onboarding-step {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.55;
}

.onboarding-progress {
    margin-top: 12px;
    font-size: 13px;
    color: #64748b;
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 18px;
}

.tour-highlight {
    position: relative !important;
    z-index: 5002 !important;
    box-shadow:
        0 0 0 4px rgba(124, 58, 237, 0.95),
        0 0 0 9999px rgba(15, 23, 42, 0.18);
    border-radius: 14px;
    transition: box-shadow .2s ease;
}

.tour-hidden {
    display: none !important;
}

.live-filter-counter {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

.benchmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.benchmark-card.better {
    border-color: rgba(34, 197, 94, 0.25);
}

.benchmark-card.worse {
    border-color: rgba(239, 68, 68, 0.25);
}

.benchmark-card.equal {
    border-color: rgba(148, 163, 184, 0.22);
}

.benchmark-label {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.benchmark-values {
    display: grid;
    gap: 6px;
    color: #475569;
}

.benchmark-state {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
}

.attention-list {
    display: grid;
    gap: 12px;
}

.attention-item {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(248, 250, 252, 0.92);
}

.attention-item .title {
    font-weight: 700;
    margin-bottom: 6px;
}

.attention-item .desc {
    color: #475569;
    line-height: 1.45;
}

.attention-item.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.16);
}

.attention-item.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.16);
}

.attention-item.success {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.16);
}

.mobile-only {
    display: none;
}

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .kpi-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid.cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .support-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .grid-two,
    .grid-3,
    .form-grid.cols-3,
    .form-grid.cols-2 {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mobile-only {
        display: inline-flex;
    }

    .modal {
        padding: 12px;
    }

    .modal-dialog {
        max-height: calc(100vh - 24px);
    }
}

@media (max-width: 640px) {
    .kpi-grid,
    .kpi-grid.compact,
    .form-grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .glass-card {
        padding: 14px;
        border-radius: 18px;
    }

    .modal-head,
    .modal-body,
    .onboarding-top,
    .onboarding-body,
    .onboarding-actions {
        padding-left: 14px;
        padding-right: 14px;
    }

    .notifications-popover {
        right: -8px;
    }
}
