:root {
    --cabinet-bg: #f2f5fa;
    --card: #ffffff;
    --text: #11131a;
    --muted: #6d7891;
    --line: #e8ecf3;
    --soft: #f4f6f9;
    --blue: #4b8df8;
    --violet: #9852ed;
    --orange: #ff9a5b;
    --green: #36bd87;
    --danger: #d34b69;
    --shadow: 0 16px 42px rgba(37, 48, 76, .07);
    --radius-xl: 38px;
    --radius-lg: 28px;
    --radius-md: 20px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--cabinet-bg); }

body {
    margin: 0;
    color: var(--text);
    font-family: Inter, Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.cabinet-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #0e1118;
}

.cabinet-logo__mark {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 15px 18px 16px 20px;
    background: conic-gradient(from 220deg, #38c6ff, #355df6, #9e3fee, #fb59c4, #38c6ff);
    box-shadow: 0 8px 18px rgba(95, 65, 238, .23);
    transform: rotate(-6deg);
}

.cabinet-logo__mark::before {
    content: "";
    width: 21px;
    height: 21px;
    border: 5px solid #fff;
    border-radius: 50%;
}

.cabinet-logo__mark i {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #42baf8;
}

.cabinet-logo > span:last-child { display: flex; flex-direction: column; }
.cabinet-logo strong { font-size: 27px; line-height: .9; letter-spacing: -.8px; }
.cabinet-logo small { margin-top: 5px; font-size: 11px; font-weight: 700; line-height: 1; }
.cabinet-logo--large .cabinet-logo__mark { width: 50px; height: 50px; }
.cabinet-logo--large strong { font-size: 34px; }
.cabinet-logo--large small { font-size: 12px; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 13px;
    color: #6b60e9;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    border: 0;
    border-radius: 15px;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button:hover { transform: translateY(-1px); }
.button svg { width: 20px; height: 20px; }
.button--primary { color: #fff; background: linear-gradient(110deg, #7277f4, #9947e8); box-shadow: 0 12px 24px rgba(120, 79, 228, .22); }
.button--primary:hover { box-shadow: 0 15px 29px rgba(120, 79, 228, .3); }
.button--soft { color: #191b20; background: #f2f3f6; }
.button--soft:hover { background: #ebeef3; }
.button--wide { width: 100%; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.flash svg { flex: 0 0 auto; width: 20px; height: 20px; }
.flash--success { color: #16734e; background: #eafaf3; }
.flash--error { color: #a62f4e; background: #fff0f3; }

/* Авторизация */

.cabinet-auth-page { min-height: 100vh; background: #f2f5fa; }

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(420px, 1.05fr) minmax(500px, .95fr);
    padding: 16px;
}

.auth-visual {
    position: relative;
    display: flex;
    min-height: calc(100vh - 32px);
    flex-direction: column;
    overflow: hidden;
    padding: 42px 48px;
    border-radius: 38px;
    color: #fff;
    background:
        radial-gradient(circle at 82% 14%, rgba(255,255,255,.2), transparent 26%),
        linear-gradient(145deg, #303ff0 0%, #6d4ae9 49%, #a147df 100%);
}

.auth-visual .cabinet-logo { position: relative; z-index: 2; color: #fff; }
.auth-visual__content { position: relative; z-index: 2; max-width: 610px; margin: auto 0; padding: 70px 2vw 70px; }
.auth-visual__content .eyebrow { color: rgba(255,255,255,.72); }
.auth-visual__content h1 { max-width: 590px; margin: 0; font-size: clamp(42px, 4.2vw, 72px); line-height: .99; letter-spacing: -.055em; }
.auth-visual__content > p { max-width: 550px; margin: 28px 0 35px; color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.6; }
.auth-feature-list { display: flex; flex-wrap: wrap; gap: 12px; }
.auth-feature-list span { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.1); backdrop-filter: blur(10px); font-size: 13px; font-weight: 650; }
.auth-feature-list svg { width: 17px; height: 17px; }
.auth-orb { position: absolute; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.auth-orb::after { content: ""; position: absolute; inset: 14%; border: 1px solid rgba(255,255,255,.09); border-radius: inherit; }
.auth-orb--one { right: -120px; bottom: -150px; width: 440px; height: 440px; }
.auth-orb--two { top: 18%; right: 10%; width: 150px; height: 150px; background: rgba(255,255,255,.05); }

.auth-panel { display: grid; place-items: center; padding: 45px clamp(25px, 5vw, 95px); }
.auth-card { width: min(100%, 530px); padding: 16px 0; }
.auth-card__intro { margin-bottom: 28px; }
.auth-card__intro h2 { margin: 0 0 10px; font-size: clamp(30px, 3vw, 44px); letter-spacing: -.045em; }
.auth-card__intro p { margin: 0; color: var(--muted); font-size: 16px; }
.mobile-logo { display: none; }
.auth-card .flash { margin: 0 0 20px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 24px; padding: 5px; border-radius: 16px; background: #e9edf3; }
.auth-tabs button { min-height: 45px; border: 0; border-radius: 12px; color: #6d7588; background: transparent; font-weight: 700; cursor: pointer; }
.auth-card[data-auth-mode="login"] [data-auth-tab="login"],
.auth-card[data-auth-mode="register"] [data-auth-tab="register"] { color: #171921; background: #fff; box-shadow: 0 5px 15px rgba(30,40,65,.08); }
.auth-form { display: grid; gap: 18px; }
.auth-card[data-auth-mode="login"] [data-auth-form="register"],
.auth-card[data-auth-mode="register"] [data-auth-form="login"] { display: none; }
.auth-form label, .stack-form label { display: grid; gap: 8px; }
.auth-form label > span, .stack-form label > span { color: #414858; font-size: 13px; font-weight: 700; }
.auth-form input, .stack-form input, .stack-form select, .center-form input, .inline-create-form input {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    border: 1px solid #dfe4ec;
    outline: none;
    border-radius: 14px;
    color: #151820;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.auth-form input:focus, .stack-form input:focus, .stack-form select:focus, .center-form input:focus, .inline-create-form input:focus { border-color: #8171ea; box-shadow: 0 0 0 4px rgba(123,103,234,.11); }
.auth-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.auth-legal { margin: 23px auto 0; color: #9299a8; font-size: 12px; line-height: 1.5; text-align: center; }

/* Основной кабинет */

.cabinet-page { min-height: 100vh; background: var(--cabinet-bg); }
.dashboard-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    z-index: 30;
    top: 16px;
    bottom: 16px;
    left: 14px;
    display: flex;
    width: 282px;
    flex-direction: column;
    padding: 25px 16px 18px;
    border-radius: 36px;
    background: #fff;
    box-shadow: 0 10px 34px rgba(40,50,73,.045);
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 28px; }
.sidebar__close { display: none; border: 0; color: #596176; background: transparent; font-size: 31px; cursor: pointer; }
.sidebar-nav { display: grid; flex-shrink: 0; gap: 6px; }
.sidebar-nav a, .sidebar__bottom a, .sidebar__bottom button {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 51px;
    align-items: center;
    gap: 15px;
    padding: 11px 15px;
    border: 0;
    border-radius: 15px;
    color: #1d2029;
    background: transparent;
    font-size: 14px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.sidebar-nav a:hover, .sidebar__bottom a:hover, .sidebar__bottom button:hover { background: #f4f5f8; }
.sidebar-nav a.is-active { color: #15171d; background: #f0f1f4; }
.sidebar-nav a.is-active::before { content: ""; position: absolute; top: 13px; bottom: 13px; left: -1px; width: 3px; border-radius: 5px; background: linear-gradient(#4c8cff, #9a43e7); }
.sidebar-nav svg, .sidebar__bottom svg { width: 22px; height: 22px; }
.sidebar-nav .is-active svg { color: #6357e9; }
.sidebar-nav em { min-width: 23px; margin-left: auto; padding: 3px 6px; border-radius: 8px; color: #7361e9; background: #ece9ff; font-size: 11px; font-style: normal; text-align: center; }
.nav-status { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: #31bd83; box-shadow: 0 0 0 4px #e8f8f1; }
.company-switcher { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: end; gap: 7px; margin: 0 4px 15px; padding: 10px; border: 1px solid #e6e7ef; border-radius: 17px; background: linear-gradient(145deg, #fafbfd, #f5f4fb); }
.company-switcher form { position: relative; min-width: 0; margin: 0; }
.company-switcher label { display: block; margin: 0 0 5px 3px; color: #858c9c; font-size: 10px; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.company-switcher form::before { content: ''; position: absolute; z-index: 1; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 8px; background: #efedff; pointer-events: none; transition: background .2s ease, box-shadow .2s ease; }
.company-switcher form::after { content: ''; position: absolute; z-index: 2; right: 16px; bottom: 16px; width: 6px; height: 6px; border-right: 1.8px solid #7162dc; border-bottom: 1.8px solid #7162dc; pointer-events: none; transform: rotate(45deg); transition: border-color .2s ease; }
.company-switcher select { display: block; width: 100%; min-height: 38px; padding: 7px 39px 7px 11px; overflow: hidden; border: 1px solid #e3e4eb; outline: 0; border-radius: 11px; color: #171a23; background: linear-gradient(#fff, #fdfdff); box-shadow: 0 3px 10px rgba(41, 48, 71, .055); font-size: 12px; font-weight: 750; text-overflow: ellipsis; cursor: pointer; appearance: none; -webkit-appearance: none; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.company-switcher select:hover { border-color: #ccc8eb; background: #fff; }
.company-switcher select:focus-visible { border-color: #8171ea; box-shadow: 0 0 0 3px rgba(123, 103, 234, .12), 0 4px 12px rgba(41, 48, 71, .06); }
.company-switcher form:hover::before, .company-switcher form:focus-within::before { background: linear-gradient(135deg, #7779f2, #9551e8); box-shadow: 0 4px 10px rgba(119, 91, 225, .22); }
.company-switcher form:hover::after, .company-switcher form:focus-within::after { border-color: #fff; }
.company-switcher > span { align-self: center; color: var(--muted); font-size: 11px; line-height: 1.3; }
.company-switcher > a { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(110deg, #7277f4, #9947e8); }
.company-switcher > a svg { width: 18px; height: 18px; }
.sidebar__bottom { display: grid; flex-shrink: 0; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid #edf0f4; }
.sidebar__bottom form { min-width: 0; margin: 0; }
.sidebar__actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .72fr); gap: 6px; }
.sidebar__actions a, .sidebar__actions button { min-height: 42px; justify-content: center; gap: 7px; padding: 8px 9px; border-radius: 12px; font-size: 12px; }
.sidebar__actions svg { width: 18px; height: 18px; flex: 0 0 18px; }
.sidebar-backdrop { display: none; }

.dashboard-main { min-height: 100vh; margin-left: 310px; padding: 30px clamp(28px, 4vw, 74px) 70px; }
.dashboard-topbar { display: none; min-height: 58px; align-items: center; gap: 18px; }
.dashboard-topbar__title { display: none; font-size: 17px; font-weight: 750; }
.mobile-company-name { display: none; overflow: hidden; max-width: 42vw; padding: 7px 10px; border-radius: 10px; color: #6357d9; background: #eceaff; font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu-button { display: none; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 13px; background: #fff; cursor: pointer; }
.account-pill { display: flex; min-width: 0; max-width: 340px; align-items: center; gap: 11px; padding: 8px 15px 8px 9px; border-radius: 999px; background: #fff; box-shadow: 0 8px 22px rgba(44,54,80,.07); }
.account-pill--sidebar { max-width: none; padding: 7px 9px; border-radius: 14px; background: #f4f5f8; box-shadow: none; }
.account-pill--sidebar .account-pill__avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 11px; }
.account-pill--sidebar .account-pill__copy small { font-size: 10px; }
.account-pill--sidebar .account-pill__copy strong { font-size: 12px; }
.account-pill__avatar { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(140deg, #536ef6, #9e4be4); font-size: 12px; font-weight: 800; }
.account-pill__copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.account-pill__copy small { color: #7c8497; font-size: 11px; }
.account-pill__copy strong { overflow: hidden; margin-top: 2px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-pill > svg { width: 18px; height: 18px; padding: 4px; border-radius: 50%; background: #f3f4f6; transform: rotate(90deg); }
.dashboard-flash { max-width: 1180px; margin: 0 auto 20px; box-shadow: 0 10px 24px rgba(35,44,65,.05); }
.dashboard-content { width: min(100%, 1180px); margin: 10px auto 0; }
.page-heading { margin: 0 6px 38px; }
.page-heading h1 { margin: 0; font-size: clamp(31px, 3vw, 46px); line-height: 1.08; letter-spacing: -.047em; }
.page-heading p { margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.page-heading--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.connection-badge, .counter-badge { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 5px; padding: 11px 15px; border-radius: 999px; color: #795b2c; background: #fff4df; font-size: 13px; font-weight: 750; white-space: nowrap; }
.connection-badge i { width: 8px; height: 8px; border-radius: 50%; background: #f0a53c; }
.connection-badge.is-connected { color: #1c7754; background: #e8f8f1; }
.connection-badge.is-connected i { background: #35b77f; }
.counter-badge { color: #6655da; background: #ebe9ff; }

.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.overview-card {
    display: flex;
    min-height: 305px;
    flex-direction: column;
    padding: 35px 38px 31px;
    border-radius: var(--radius-xl);
    background: #fff;
    box-shadow: var(--shadow);
}
.overview-card:nth-child(4) { grid-column: 1 / 2; }
.feature-icon { --feature-accent: #6d62e8; position: relative; display: grid; width: 63px; height: 63px; place-items: center; border: 2px solid currentColor; border-radius: 21px; }
.feature-icon::after { content: ""; position: absolute; inset: 5px; border-radius: 15px; background: currentColor; opacity: .1; }
.feature-icon svg { position: relative; z-index: 1; width: 32px; height: 32px; }
.feature-icon i { position: absolute; z-index: 2; right: -6px; bottom: -5px; display: grid; min-width: 23px; height: 23px; place-items: center; padding: 0 5px; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--feature-accent); font-size: 10px; font-style: normal; font-weight: 800; }
.feature-icon i.is-ok { background: var(--green); }
.overview-card--blue .feature-icon, .connect-card .feature-icon { --feature-accent: var(--blue); color: var(--blue); }
.overview-card--violet .feature-icon { --feature-accent: var(--violet); color: var(--violet); }
.overview-card--orange .feature-icon { --feature-accent: var(--orange); color: var(--orange); }
.overview-card--green .feature-icon { --feature-accent: var(--green); color: var(--green); }
.overview-card h2 { margin: 25px 0 11px; font-size: 20px; letter-spacing: -.025em; }
.overview-card > p { margin: 0 0 25px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card-action { display: flex; min-height: 45px; align-items: center; justify-content: center; margin-top: auto; border: 0; border-radius: 13px; color: #191b20; background: #f2f3f5; font-weight: 750; cursor: pointer; transition: transform .2s ease, filter .2s ease; }
.card-action:hover { transform: translateY(-1px); filter: brightness(.98); }
.overview-card--violet .card-action { color: #fff; background: linear-gradient(110deg, #be80f4, #9343e7); }
.overview-card--orange .card-action { color: #e97737; background: #fff0e8; }
.overview-card--green .card-action { color: #23875f; background: #eaf8f2; }
.card-action.is-disabled { color: #9a9fa9; cursor: default; }
.overview-card--violet .card-action.is-disabled { color: #fff; }
.inline-create-form { display: grid; gap: 8px; margin-top: auto; }
.inline-create-form input { min-height: 43px; }
.inline-create-form .card-action { margin: 0; }

.wide-card { border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
.quick-status { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 24px; padding: 23px 27px; }
.quick-status > div { display: flex; align-items: center; gap: 15px; }
.quick-status strong, .quick-status small { display: block; }
.quick-status small { margin-top: 5px; color: var(--muted); line-height: 1.35; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: #eeaa3e; box-shadow: 0 0 0 8px #fff4e1; }
.status-dot.is-online { background: #36bc83; box-shadow: 0 0 0 8px #e9f8f2; }

.connection-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 24px; }
.connect-card, .connected-card { min-width: 0; padding: 38px; }
.connect-card__hero { display: flex; align-items: center; gap: 22px; }
.connect-card__hero h2 { margin: 0 0 7px; font-size: 25px; letter-spacing: -.03em; }
.connect-card__hero p { margin: 0; color: var(--muted); line-height: 1.5; }
.connect-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 34px 0; padding: 0; list-style: none; }
.connect-steps li { display: flex; align-items: center; gap: 11px; padding: 15px; border-radius: 17px; background: #f6f7f9; }
.connect-steps li > span { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 10px; color: #6857e4; background: #e9e7ff; font-size: 12px; font-weight: 800; }
.connect-steps p { margin: 0; }
.connect-steps strong, .connect-steps small { display: block; }
.connect-steps strong { font-size: 13px; }
.connect-steps small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.connection-link-box { display: grid; min-width: 0; gap: 14px; }
.connection-link-box > div { position: relative; min-width: 0; padding: 13px 48px 13px 15px; border-radius: 14px; background: #f5f6f8; }
.connection-link-box small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.connection-link-box code { display: block; overflow: hidden; color: #5140c3; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.connection-link-box button, .form-item__summary > button { position: absolute; top: 50%; right: 12px; display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 10px; color: #6257d9; background: #e9e7ff; cursor: pointer; transform: translateY(-50%); }
.connection-link-box button svg, .form-item__summary > button svg { width: 17px; height: 17px; }
.field-hint { margin: 0; color: #8b7180; font-size: 12px; line-height: 1.5; }
.connection-request-message { margin-top: 14px; }
.info-card { padding: 28px; border: 1px solid #e7e9f5; border-radius: 27px; background: rgba(255,255,255,.58); }
.info-card__icon { display: grid; width: 41px; height: 41px; place-items: center; border-radius: 14px; color: #6659df; background: #eae8ff; font-weight: 900; }
.info-card__icon svg { width: 20px; height: 20px; }
.info-card h3 { margin: 19px 0 9px; font-size: 17px; }
.info-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.info-card--success { border-color: #dcefe7; }
.info-card--success .info-card__icon { color: #25865f; background: #e5f7ef; }
.connected-profile { display: flex; align-items: center; gap: 16px; }
.connected-profile__avatar { display: grid; width: 67px; height: 67px; flex: 0 0 67px; place-items: center; border-radius: 22px; color: #fff; background: linear-gradient(140deg, #548bf8, #9b4ce7); font-weight: 800; }
.connected-profile small { color: var(--muted); font-size: 12px; }
.connected-profile h2 { margin: 3px 0; font-size: 22px; }
.connected-profile p { margin: 0; color: #6f62dc; font-size: 13px; }
.verified-mark { display: grid; width: 28px; height: 28px; place-items: center; margin-left: auto; border-radius: 50%; color: #fff; background: #39bd86; }
.verified-mark svg { width: 16px; height: 16px; }
.connected-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 31px 0; overflow: hidden; border-radius: 17px; background: #e7eaf0; }
.connected-details div { padding: 18px; background: #f7f8fa; }
.connected-details small, .connected-details strong { display: block; }
.connected-details small { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.connected-details strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { padding: 55px 30px; text-align: center; }
.empty-state .feature-icon { margin: 0 auto; color: #7d68e8; }
.empty-state h2 { margin: 22px 0 8px; }
.empty-state > p { max-width: 500px; margin: 0 auto 22px; color: var(--muted); line-height: 1.5; }
.center-form { display: flex; width: min(100%, 520px); gap: 10px; margin: 23px auto 0; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.setup-card { padding: 29px; }
.setup-card.is-muted { opacity: .65; }
.setup-card__heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.setup-card__heading h2 { margin: 0 0 4px; font-size: 19px; }
.setup-card__heading p { margin: 0; color: var(--muted); font-size: 12px; }
.mini-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 15px; }
.mini-icon svg { width: 22px; height: 22px; }
.mini-icon--blue { color: #367cdd; background: #e9f3ff; }
.mini-icon--violet { color: #7a4cde; background: #f0e9ff; }
.stack-form { display: grid; gap: 14px; }
.stack-form .button { justify-self: start; }
.form-row { display: grid; grid-template-columns: .8fr 1.2fr; gap: 12px; }
.list-card { overflow: hidden; padding: 29px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.section-title h2 { margin: 0 0 4px; font-size: 20px; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.section-title > a { display: flex; align-items: center; gap: 5px; color: #6c5add; font-size: 13px; font-weight: 700; }
.section-title > a svg { width: 16px; height: 16px; }
.empty-list { display: flex; min-height: 115px; align-items: center; justify-content: center; gap: 13px; border: 1px dashed #dce0e8; border-radius: 18px; color: var(--muted); }
.empty-list > span { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 13px; color: #7969e4; background: #eeecff; }
.empty-list svg { width: 19px; height: 19px; }
.forms-list { display: grid; gap: 9px; }
.forms-list > article { overflow: hidden; border-radius: 17px; background: #f7f8fa; }
.form-item__summary { position: relative; display: grid; grid-template-columns: 46px minmax(150px, .8fr) minmax(240px, 1.2fr) 40px; align-items: center; gap: 14px; padding: 14px 13px; }
.forms-list__name strong, .forms-list__name small, .forms-list__key small, .forms-list__key code { display: block; }
.forms-list__name small, .forms-list__key small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.forms-list__key { min-width: 0; }
.forms-list__key code { overflow: hidden; margin-top: 4px; color: #5e4dc8; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.form-item__summary > button { position: relative; top: auto; right: auto; transform: none; }
.form-editor { border-top: 1px solid #e8eaf0; }
.form-editor summary { padding: 12px 16px; color: #6554d8; font-size: 12px; font-weight: 750; cursor: pointer; list-style-position: inside; }
.form-editor[open] summary { background: #f2f0ff; }
.form-editor__form { padding: 16px; background: #fff; }

.muted-copy { color: var(--muted); font-size: 13px; }
.companies-list { display: grid; gap: 9px; }
.companies-list article { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px; border: 1px solid transparent; border-radius: 17px; background: #f7f8fa; }
.companies-list article.is-current { border-color: #dcd7ff; background: #f7f5ff; }
.companies-list article > div strong, .companies-list article > div small { display: block; }
.companies-list article > div small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.companies-list .button { min-height: 38px; padding: 9px 15px; font-size: 12px; }
.companies-list__actions { display: flex; align-items: center; gap: 8px; }
.companies-list__actions form { margin: 0; }

.team-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 16px; padding: 25px 29px; }
.team-toolbar > div { display: flex; align-items: center; gap: 15px; }
.team-toolbar h2 { margin: 0 0 5px; font-size: 19px; }
.team-toolbar p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.team-toolbar form { margin: 0; }
.invite-list { display: grid; gap: 9px; margin-bottom: 16px; }
.invite-list article { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; }
.invite-list small, .invite-list code, .invite-list span { display: block; }
.invite-list small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.invite-list code { margin: 5px 0; color: #5e4dc8; font-size: 13px; font-weight: 750; word-break: break-all; }
.invite-list span { color: var(--muted); font-size: 11px; }
.invite-list button { flex: 0 0 auto; border: 0; color: #6257d9; background: #e9e7ff; }
.team-card { overflow: visible; }
.members-list { display: grid; gap: 9px; }
.members-list > article { border-radius: 18px; background: #f7f8fa; }
.member-summary { display: grid; grid-template-columns: 42px minmax(150px, 1fr) auto auto; align-items: center; gap: 13px; padding: 14px; }
.member-summary__name strong, .member-summary__name small { display: block; }
.member-summary__name small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.member-owner-note { color: var(--muted); font-size: 11px; }
.lead-status--inactive { color: #7d8290; background: #e9ebef; }
.member-editor { position: relative; }
.member-editor > summary { padding: 9px 12px; border-radius: 11px; color: #6257d9; background: #e9e7ff; font-size: 12px; font-weight: 750; cursor: pointer; list-style: none; }
.member-editor > summary::-webkit-details-marker { display: none; }
.member-editor[open] { grid-column: 1 / -1; width: 100%; }
.member-editor[open] > summary { width: max-content; margin: 3px 0 12px auto; }
.member-editor form { padding: 18px; border: 1px solid #e5e2fa; border-radius: 16px; background: #fff; }
.assignment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.assignment-grid fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid #e3e6ed; border-radius: 14px; }
.assignment-grid legend { padding: 0 5px; font-size: 12px; font-weight: 750; }
.assignment-grid fieldset > small { display: block; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
.assignment-grid label { display: flex; align-items: center; grid-template-columns: none; gap: 8px; padding: 5px 0; color: #353945; font-size: 12px; }
.assignment-grid input { width: 16px; height: 16px; margin: 0; accent-color: #7464e5; }

.leads-card { padding: 8px; }
.empty-state--compact { box-shadow: none; }
.leads-table { display: grid; }
.leads-table__head, .leads-table > article { display: grid; grid-template-columns: 1.3fr 1fr .9fr .7fr .8fr; align-items: center; gap: 16px; padding: 17px 21px; }
.leads-table__head { color: #8a91a0; font-size: 11px; font-weight: 750; text-transform: uppercase; }
.leads-table > article { border-top: 1px solid #edf0f4; }
.leads-table > article:hover { border-radius: 14px; background: #fafbfc; }
.leads-table strong, .leads-table small { display: block; }
.leads-table strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.leads-table small { overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.lead-status { display: inline-flex; padding: 7px 10px; border-radius: 999px; color: #4d6fd0; background: #eaf0ff; font-size: 11px; font-weight: 750; white-space: nowrap; }
.lead-status--in_work { color: #9b6a20; background: #fff3dd; }
.lead-status--done, .lead-status--paid { color: #247b58; background: #e7f8f0; }
.lead-status--pending { color: #9b6a20; background: #fff3dd; }

.billing-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 24px; }
.plan-card, .payment-card { padding: 35px; }
.plan-card__label { display: inline-flex; padding: 7px 10px; border-radius: 9px; color: #654ed0; background: #ece9ff; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.plan-card h2 { display: flex; align-items: baseline; gap: 7px; margin: 24px 0 8px; }
.plan-card h2 strong { font-size: 42px; letter-spacing: -.05em; }
.plan-card h2 small { color: var(--muted); font-size: 14px; }
.plan-card > p { margin: 0; color: var(--muted); }
.plan-card ul { display: grid; gap: 13px; margin: 27px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); list-style: none; }
.plan-card li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.plan-card li svg { width: 18px; height: 18px; color: #2cae78; }
.subscription-status { display: flex; align-items: center; gap: 15px; padding: 18px; border-radius: 19px; background: #f7f8fa; }
.subscription-status > span { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 15px; color: #a3722d; background: #fff0d8; }
.subscription-status.is-active > span { color: #22815b; background: #e4f7ee; }
.subscription-status svg { width: 23px; height: 23px; }
.subscription-status small, .subscription-status strong { display: block; }
.subscription-status small { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.subscription-status p { margin: 3px 0 0; color: #398461; font-size: 11px; }
.payment-card h3 { margin: 29px 0 14px; font-size: 16px; }
.payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-options form { margin: 0; }
.payment-options button { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 15px 16px; border: 1px solid #e3e5ec; border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.payment-options button:hover { border-color: #8b77e9; background: #faf9ff; }
.payment-options strong { font-size: 13px; }
.payment-options small { color: #6c5bdc; font-weight: 750; }
.payment-card__hint { margin: 27px 0 18px; color: var(--muted); line-height: 1.55; }
.billing-grid + .list-card { margin-top: 24px; }
.payments-list { display: grid; gap: 1px; background: var(--line); }
.payments-list article { display: grid; grid-template-columns: 1fr auto 120px; align-items: center; gap: 20px; padding: 15px 0; background: #fff; }
.payments-list article > div strong, .payments-list article > div small { display: block; }
.payments-list article > div small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.payments-list article > strong { text-align: right; }

.copy-toast { position: fixed; z-index: 80; right: 28px; bottom: 28px; padding: 12px 18px; border-radius: 13px; color: #fff; background: #222630; box-shadow: 0 12px 28px rgba(20,24,34,.25); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transform: translateY(15px); transition: opacity .2s ease, transform .2s ease; }
.copy-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
    .overview-grid { grid-template-columns: 1fr 1fr; }
    .overview-card:nth-child(4) { grid-column: auto; }
    .setup-card .form-row { grid-template-columns: 1fr; }
    .connection-layout { grid-template-columns: 1fr; }
    .info-card { display: flex; align-items: center; gap: 15px; }
    .info-card h3 { margin: 0 0 4px; }
    .info-card__icon { flex: 0 0 41px; }
    .auth-shell { grid-template-columns: 1fr 1fr; }
    .auth-visual { padding: 35px; }
    .auth-feature-list { display: grid; justify-items: start; }
}

@media (max-width: 980px) {
    .sidebar { transform: translateX(calc(-100% - 30px)); transition: transform .25s ease; }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar__close { display: block; }
    .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; display: block; background: rgba(21,26,40,.3); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    .sidebar.is-open + .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .dashboard-main { margin-left: 0; padding: 20px 26px 55px; }
    .dashboard-topbar { display: flex; justify-content: space-between; }
    .dashboard-topbar__title { display: block; margin-right: auto; }
    .mobile-company-name { display: block; }
    .mobile-menu-button { display: grid; }
    .dashboard-content { margin-top: 24px; }
    .auth-shell { display: block; padding: 0; }
    .auth-visual { display: none; }
    .auth-panel { min-height: 100vh; padding: 40px 24px; }
    .mobile-logo { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 38px; font-size: 18px; font-weight: 850; }
    .mobile-logo .cabinet-logo__mark { width: 38px; height: 38px; }
}

@media (max-width: 760px) {
    .dashboard-main { padding: 15px 16px 45px; }
    .dashboard-topbar__title { font-size: 15px; }
    .dashboard-content { margin-top: 22px; }
    .page-heading { margin: 0 2px 27px; }
    .page-heading--row { align-items: flex-start; flex-direction: column; gap: 14px; }
    .page-heading h1 { font-size: 32px; }
    .page-heading p { font-size: 14px; }
    .overview-grid, .setup-grid, .billing-grid { grid-template-columns: 1fr; gap: 15px; }
    .overview-card { min-height: 265px; padding: 29px; border-radius: 29px; }
    .quick-status { align-items: stretch; flex-direction: column; }
    .quick-status .button { width: 100%; }
    .connect-card, .connected-card, .plan-card, .payment-card { padding: 25px; }
    .connect-card__hero { align-items: flex-start; }
    .connect-steps { grid-template-columns: 1fr; }
    .connected-details { grid-template-columns: 1fr; }
    .connected-details div { padding: 14px 17px; }
    .center-form { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    .list-card { padding: 21px; }
    .section-title { align-items: flex-start; flex-direction: column; }
    .form-item__summary { grid-template-columns: 42px minmax(0, 1fr) 38px; }
    .forms-list__key { grid-column: 2 / 4; }
    .form-item__summary > button { grid-column: 3; grid-row: 1; }
    .team-toolbar { align-items: stretch; flex-direction: column; }
    .team-toolbar .button { width: 100%; }
    .invite-list article { align-items: stretch; flex-direction: column; }
    .invite-list button { width: 100%; }
    .member-summary { grid-template-columns: 42px minmax(0, 1fr) auto; }
    .member-owner-note, .member-editor { grid-column: 2 / 4; }
    .member-editor[open] { grid-column: 1 / -1; }
    .assignment-grid { grid-template-columns: 1fr; }
    .leads-card { padding: 7px; overflow: visible; background: transparent; box-shadow: none; }
    .leads-table__head { display: none; }
    .leads-table { gap: 10px; }
    .leads-table > article { grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px; border: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
    .leads-table > article > div:first-child { grid-column: 1 / 3; }
    .payments-list article { grid-template-columns: 1fr auto; }
    .payments-list article > strong { grid-column: 2; grid-row: 1; }
    .payments-list article > .lead-status { grid-column: 1 / 3; justify-self: start; }
}

@media (max-width: 520px) {
    .auth-panel { align-items: start; padding: 27px 18px; }
    .auth-card__intro h2 { font-size: 31px; }
    .auth-form__row { grid-template-columns: 1fr; }
    .sidebar { top: 8px; bottom: 8px; left: 8px; width: calc(100% - 16px); }
    .overview-card { min-height: 250px; }
    .connect-card__hero { flex-direction: column; }
    .connected-profile { align-items: flex-start; }
    .verified-mark { margin-left: 0; }
    .info-card { display: grid; grid-template-columns: 41px minmax(0, 1fr); align-items: center; }
    .info-card h3 { grid-column: 2; margin: 0; }
    .info-card p { grid-column: 1 / -1; margin-top: 12px; }
    .payment-options { grid-template-columns: 1fr; }
    .companies-list article { grid-template-columns: 42px minmax(0, 1fr); }
    .companies-list article > form, .companies-list article > .lead-status, .companies-list article > .companies-list__actions { grid-column: 2; justify-self: start; }
    .companies-list article > form .button { width: 100%; }
    .companies-list__actions { flex-wrap: wrap; }
    .copy-toast { right: 16px; bottom: 16px; }
}

@media (max-height: 720px) {
    .sidebar { padding-top: 18px; padding-bottom: 14px; }
    .sidebar__top { padding-bottom: 17px; }
    .company-switcher { margin-bottom: 10px; padding: 8px; }
    .sidebar-nav { gap: 3px; }
    .sidebar-nav a { min-height: 39px; gap: 12px; padding: 7px 13px; }
    .sidebar-nav a.is-active::before { top: 9px; bottom: 9px; }
    .sidebar-nav svg { width: 20px; height: 20px; }
    .sidebar__bottom { gap: 6px; padding-top: 9px; }
    .sidebar__actions a, .sidebar__actions button { min-height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
