:root {
    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-soft: #f9f9fc;
    --surface-alt: #f1f1f8;
    --ink: #171a2f;
    --text: #34384d;
    --muted: #71768d;
    --muted-2: #9ba0b2;
    --line: #e7e8f0;
    --line-strong: #d9dbe7;
    --sidebar: #11142d;
    --sidebar-soft: #191d3a;
    --primary: #5b5ce2;
    --primary-dark: #4849c7;
    --primary-soft: #eeedff;
    --secondary: #2f9f88;
    --secondary-soft: #e5f8f2;
    --green: #26a77d;
    --green-soft: #e6f8f2;
    --red: #dc5d67;
    --red-soft: #fff0f1;
    --orange: #e9913c;
    --orange-soft: #fff5e9;
    --blue: #3a82d8;
    --blue-soft: #eaf3ff;
    --shadow-xs: 0 1px 2px rgba(20, 24, 55, .04);
    --shadow-sm: 0 8px 24px rgba(21, 25, 55, .06);
    --shadow-md: 0 18px 45px rgba(21, 25, 55, .10);
    --shadow-lg: 0 28px 80px rgba(14, 18, 48, .18);
    --radius-sm: 10px;
    --radius: 15px;
    --radius-lg: 22px;
    --sidebar-width: 252px;
}

* { box-sizing: border-box; }

html { font-size: 16px; background: var(--bg); }

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
body.has-modal { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}
.rotated-right { transform: rotate(-90deg); }
.back-arrow { transform: rotate(180deg); }

.is-hidden { display: none !important; }

.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 18px;
    background: #f7f7fc;
    color: var(--muted);
    transition: opacity .35s ease, visibility .35s ease;
}

.boot-screen.is-leaving { opacity: 0; visibility: hidden; }
.boot-screen p { margin: 0; font-size: 13px; }
.boot-loader { display: flex; gap: 5px; }
.boot-loader i { width: 6px; height: 6px; border-radius: 99px; background: var(--primary); animation: boot-bounce 1s infinite ease-in-out; }
.boot-loader i:nth-child(2) { animation-delay: .12s; }
.boot-loader i:nth-child(3) { animation-delay: .24s; }

@keyframes boot-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }

.brand-mark {
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: linear-gradient(145deg, #7374f0, #5253dc);
    box-shadow: 0 8px 20px rgba(91, 92, 226, .28);
    overflow: hidden;
}

.brand-mark::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    width: 18px;
    height: 8px;
    border: 3px solid white;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    transform: rotate(-7deg);
}

.brand-mark::after {
    content: "";
    position: absolute;
    left: 10px;
    bottom: 9px;
    width: 11px;
    height: 8px;
    border: 3px solid white;
    border-top: 0;
    border-radius: 0 0 7px 7px;
    transform: rotate(-7deg);
}

.brand-mark span {
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #51ddb9;
    border: 2px solid #5b5ce2;
}

.brand-mark--large { width: 54px; height: 54px; border-radius: 17px; }
.brand-mark--large::before { left: 14px; top: 14px; width: 25px; height: 11px; border-width: 4px; }
.brand-mark--large::after { left: 14px; bottom: 13px; width: 15px; height: 10px; border-width: 4px; }
.brand-mark--large span { width: 11px; height: 11px; right: 9px; bottom: 9px; }

/* Authentication */
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(480px, 1.08fr) minmax(430px, .92fr); background: var(--surface); }

.auth-visual {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 50px clamp(42px, 6vw, 92px);
    display: flex;
    flex-direction: column;
    color: white;
    background:
        radial-gradient(circle at 75% 8%, rgba(111, 96, 255, .28), transparent 32%),
        linear-gradient(145deg, #0e122d 0%, #171941 52%, #161538 100%);
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .18;
    background-image: radial-gradient(rgba(255,255,255,.55) .8px, transparent .8px);
    background-size: 27px 27px;
    mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.auth-visual__glow { position: absolute; border-radius: 50%; filter: blur(1px); opacity: .32; }
.auth-visual__glow--one { width: 440px; height: 440px; left: -220px; bottom: 5%; background: radial-gradient(circle, #5b5ce2, transparent 67%); }
.auth-visual__glow--two { width: 320px; height: 320px; right: -150px; top: 28%; background: radial-gradient(circle, #36c9a8, transparent 68%); opacity: .16; }

.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-brand strong { display: block; font-size: 20px; line-height: 1.1; letter-spacing: -.5px; }
.auth-brand small { display: block; margin-top: 3px; color: rgba(255,255,255,.55); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.auth-copy { position: relative; z-index: 1; max-width: 650px; margin-top: auto; padding-top: 54px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow .icon { width: 15px; height: 15px; }
.eyebrow--light { color: #76ebd1; }
.auth-copy h1 { max-width: 630px; margin: 17px 0 20px; color: white; font-size: clamp(38px, 4.1vw, 62px); line-height: 1.04; letter-spacing: -.052em; }
.auth-copy p { max-width: 575px; margin: 0; color: rgba(242,244,255,.72); font-size: 17px; line-height: 1.7; }

.auth-preview {
    position: relative;
    z-index: 1;
    width: min(590px, 100%);
    margin: 44px 0 30px;
    padding: 22px 24px 18px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    background: rgba(255,255,255,.075);
    backdrop-filter: blur(12px);
    box-shadow: 0 30px 80px rgba(0,0,0,.16);
}
.auth-preview__top, .auth-preview__foot { display: flex; align-items: center; justify-content: space-between; }
.auth-preview__top span { font-weight: 700; }
.auth-preview__top b { padding: 6px 9px; border-radius: 8px; color: rgba(255,255,255,.64); background: rgba(255,255,255,.08); font-size: 10px; font-weight: 600; }
.auth-preview__value { display: flex; align-items: baseline; gap: 12px; margin-top: 26px; }
.auth-preview__value small { display: none; }
.auth-preview__value strong { font-size: 27px; letter-spacing: -.04em; }
.auth-preview__value em { color: #72e3c8; font-size: 12px; font-style: normal; font-weight: 700; }
.auth-preview svg { width: 100%; height: 100px; margin: 5px 0 0; }
.auth-preview__foot { justify-content: flex-start; gap: 22px; color: rgba(255,255,255,.62); font-size: 11px; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.dot--green { background: #4fe0bd; }
.dot--violet { background: #8d82ff; }
.auth-legal { position: relative; z-index: 1; margin: auto 0 0; color: rgba(255,255,255,.35); font-size: 10px; }

.auth-panel { display: grid; place-items: center; min-height: 100vh; padding: 48px; }
.auth-panel.is-signup { padding-top: 30px; padding-bottom: 30px; }
.auth-panel__inner { width: min(410px, 100%); }
.auth-mobile-brand { display: none; }
.auth-panel h2 { margin: 12px 0 7px; color: var(--ink); font-size: 32px; line-height: 1.2; letter-spacing: -.035em; }
.auth-subtitle { margin: 0 0 34px; color: var(--muted); font-size: 14px; }
.form-stack { display: grid; gap: 19px; }
.field { display: grid; gap: 8px; }
.field > span { color: #363a51; font-size: 12px; font-weight: 700; }
.field__control { position: relative; display: flex; align-items: center; }
.field__control > .icon { position: absolute; left: 14px; z-index: 1; width: 18px; height: 18px; color: #969bad; }
.field__control input, .field__control select { width: 100%; min-height: 47px; padding: 0 42px; border: 1px solid var(--line-strong); border-radius: 11px; outline: none; color: var(--ink); background: white; transition: border-color .2s, box-shadow .2s; }
.field__control input::placeholder, textarea::placeholder { color: #aaadba; }
.field__control input:focus, .field__control select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91,92,226,.10); }
.field__eye { position: absolute !important; right: 6px; top: 5px; }
.inline-error { padding: 10px 12px; border: 1px solid #ffd7da; border-radius: 9px; color: #b83d48; background: var(--red-soft); font-size: 12px; }
.auth-help { display: flex; gap: 9px; align-items: center; margin-top: 28px; color: var(--muted-2); font-size: 11px; }
.auth-help .icon { width: 17px; height: 17px; color: var(--green); }
.auth-view { animation: auth-view-in .24s ease both; }
@keyframes auth-view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.auth-separator { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--muted-2); font-size: 10px; }
.auth-separator::before, .auth-separator::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-back { display: flex; align-items: center; gap: 7px; width: max-content; margin: 0 0 15px; padding: 0; border: 0; color: var(--muted); cursor: pointer; background: transparent; font-size: 11px; font-weight: 700; }
.auth-back:hover { color: var(--primary); }
.auth-back .icon { width: 15px; height: 15px; transform: rotate(180deg); }
.form-stack--compact { gap: 13px; }
.form-stack--compact .field { gap: 6px; }
.form-stack--compact .field__control input { min-height: 43px; }
.field > span small { color: var(--muted-2); font-size: 10px; font-weight: 500; }
.signup-consent { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); cursor: pointer; font-size: 10px; line-height: 1.5; }
.signup-consent input { flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--primary); }
.signup-footnote { margin: 13px auto 0; max-width: 340px; color: var(--muted-2); text-align: center; font-size: 9.5px; line-height: 1.5; }

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 39px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 750;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .58; transform: none; }
.button .icon { width: 17px; height: 17px; }
.button--primary { color: white; background: var(--primary); box-shadow: 0 7px 16px rgba(91,92,226,.2); }
.button--primary:hover { background: var(--primary-dark); box-shadow: 0 9px 20px rgba(91,92,226,.26); }
.button--secondary { color: var(--primary); background: var(--primary-soft); }
.button--ghost { color: #555a70; border-color: var(--line); background: var(--surface); }
.button--ghost:hover { border-color: #cfd1df; background: #fbfbfd; }
.button--danger { color: #c54751; background: var(--red-soft); }
.button--success { color: #177c61; background: var(--green-soft); }
.button--large { min-height: 48px; padding: 0 20px; border-radius: 11px; font-size: 13px; }
.button--small { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 11px; }
.button--full { width: 100%; }
.button.is-loading span { opacity: .65; }
.button.is-loading::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; cursor: pointer; color: #6b7084; background: transparent; transition: background .18s, color .18s; }
.icon-button:hover { color: var(--ink); background: #f0f1f6; }

/* Application shell */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 800;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 20px 14px 13px;
    color: #daddec;
    background:
        radial-gradient(circle at 0 0, rgba(92,94,226,.20), transparent 34%),
        var(--sidebar);
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; height: 45px; padding: 0 9px; }
.sidebar__brand strong { display: block; color: white; font-size: 18px; line-height: 1.05; letter-spacing: -.03em; }
.sidebar__brand small { display: block; margin-top: 3px; color: #777c9c; font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.sidebar__close { display: none; margin-left: auto; color: white; }
.workspace-switcher { display: grid; grid-template-columns: 32px minmax(0,1fr) 16px; align-items: center; gap: 9px; width: 100%; margin: 20px 0 16px; padding: 10px; border: 1px solid rgba(255,255,255,.075); border-radius: 11px; color: white; cursor: pointer; text-align: left; background: rgba(255,255,255,.045); }
.workspace-switcher:hover { background: rgba(255,255,255,.07); }
.workspace-switcher__avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #1a2140; background: #63e2c3; font-size: 10px; font-weight: 900; }
.workspace-switcher small, .workspace-switcher strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-switcher small { color: #777d9f; font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.workspace-switcher strong { margin-top: 2px; color: #eef0fb; font-size: 11px; }
.workspace-switcher > .icon { width: 14px; height: 14px; color: #757b9a; }

.sidebar__nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.sidebar__nav::-webkit-scrollbar { display: none; }
.nav-label { display: block; padding: 17px 12px 7px; color: #626783; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.sidebar__nav a { position: relative; display: flex; align-items: center; gap: 11px; height: 42px; margin: 2px 0; padding: 0 11px; border-radius: 9px; color: #aeb3cc; font-size: 11.5px; font-weight: 600; transition: background .18s, color .18s; }
.sidebar__nav a:hover { color: #f3f4fb; background: rgba(255,255,255,.045); }
.sidebar__nav a.is-active { color: white; background: linear-gradient(90deg, rgba(91,92,226,.28), rgba(91,92,226,.14)); }
.sidebar__nav a.is-active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: #7778f0; box-shadow: 0 0 14px #5b5ce2; }
.sidebar__nav a.is-active .icon { color: #8d8eff; }
.sidebar__nav .icon { width: 17px; height: 17px; }
.nav-badge { display: grid; place-items: center; min-width: 21px; height: 18px; margin-left: auto; padding: 0 5px; border-radius: 6px; color: #ffb6ba; background: rgba(220,93,103,.18); font-size: 8px; }
.nav-badge--accent { color: #9fefdd; background: rgba(70,217,181,.14); }
.sidebar__bottom { border-top: 1px solid rgba(255,255,255,.06); padding-top: 10px; }
.sidebar-health { padding: 6px 10px 11px; }
.sidebar-health span { display: flex; align-items: center; gap: 6px; color: #9aa0bd; font-size: 9px; }
.sidebar-health i { width: 6px; height: 6px; border-radius: 50%; background: #45d6af; box-shadow: 0 0 0 4px rgba(69,214,175,.1); }
.sidebar-health small { display: block; margin: 3px 0 0 12px; color: #545a78; font-size: 8px; }
.sidebar-user { display: grid; grid-template-columns: 34px minmax(0,1fr) 16px; align-items: center; gap: 9px; width: 100%; padding: 9px; border: 0; border-radius: 10px; color: inherit; cursor: pointer; text-align: left; background: transparent; }
.sidebar-user:hover { background: rgba(255,255,255,.05); }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: #e6e8f3; font-size: 10.5px; }
.sidebar-user small { margin-top: 2px; color: #6f7594; font-size: 8.5px; }
.sidebar-user > .icon { width: 14px; height: 14px; color: #686e8d; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #4546bd; background: #e8e8ff; font-size: 10px; font-weight: 850; }

.app-main { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 500; display: flex; align-items: center; height: 65px; padding: 0 28px; border-bottom: 1px solid rgba(224,225,235,.82); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); }
.topbar__menu { display: none; margin-right: 8px; }
.global-search { position: relative; display: flex; align-items: center; width: min(410px, 40vw); }
.global-search > .icon { position: absolute; left: 12px; width: 17px; height: 17px; color: #9a9eae; }
.global-search input { width: 100%; height: 37px; padding: 0 54px 0 38px; border: 1px solid transparent; border-radius: 10px; outline: none; color: var(--ink); background: #f4f5f9; font-size: 11px; transition: border .18s, background .18s, box-shadow .18s; }
.global-search input:focus { border-color: #d9d9f5; background: white; box-shadow: 0 5px 18px rgba(20,23,54,.06); }
.global-search input::placeholder { color: #9296a8; }
.global-search kbd { position: absolute; right: 9px; padding: 3px 6px; border: 1px solid #dedfe7; border-radius: 5px; color: #989cab; background: white; font-family: inherit; font-size: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.search-results { position: absolute; top: 44px; left: 0; width: min(520px, 80vw); max-height: 430px; overflow: auto; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow-lg); }
.search-result { display: grid; grid-template-columns: 33px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 9px; border: 0; border-radius: 9px; cursor: pointer; text-align: left; background: transparent; }
.search-result:hover { background: #f6f6fb; }
.search-result__icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.search-result__icon .icon { width: 16px; height: 16px; }
.search-result strong, .search-result small { display: block; }
.search-result strong { color: var(--ink); font-size: 11px; }
.search-result small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.search-result > small { margin: 0; }
.topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.quick-create { height: 37px; }
.notification-button { position: relative; border: 1px solid var(--line); background: white; }
.notification-button i { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 1.5px solid white; border-radius: 50%; background: var(--red); }
.topbar-user { display: flex; align-items: center; gap: 4px; height: 40px; padding: 3px 5px 3px 3px; border: 0; border-radius: 11px; cursor: pointer; background: transparent; }
.topbar-user:hover { background: #f2f3f7; }
.topbar-user .icon { width: 13px; height: 13px; color: #8d91a2; }

.page-content { width: 100%; min-width: 0; min-height: calc(100vh - 65px); padding: 27px 28px 44px; overflow-x: hidden; outline: none; }
.page { width: 100%; min-width: 0; max-width: 1460px; margin: 0 auto; animation: page-in .27s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-header__title { min-width: 0; }
.page-header__title h1 { margin: 0; color: var(--ink); font-size: 24px; line-height: 1.25; letter-spacing: -.035em; }
.page-header__title p { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; }
.page-header__actions { display: flex; align-items: center; gap: 8px; }
.date-pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: #62667a; background: white; font-size: 10px; font-weight: 650; }
.date-pill .icon { width: 15px; height: 15px; color: #85899a; }

/* Dashboard */
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.welcome-row h1 { margin: 0; color: var(--ink); font-size: 24px; letter-spacing: -.035em; }
.welcome-row p { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; }
.welcome-row h1 span { color: var(--primary); }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.summary-card { position: relative; min-width: 0; padding: 17px 18px 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); }
.summary-card::after { content: ""; position: absolute; width: 85px; height: 85px; right: -38px; top: -40px; border-radius: 50%; opacity: .11; background: currentColor; }
.summary-card__top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 650; }
.summary-card__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; }
.summary-card__icon .icon { width: 15px; height: 15px; }
.summary-card__value { display: block; margin-top: 13px; color: var(--ink); font-size: clamp(19px, 2vw, 26px); line-height: 1; letter-spacing: -.045em; }
.summary-card__foot { display: flex; align-items: center; gap: 5px; min-height: 17px; margin-top: 10px; color: var(--muted-2); font-size: 9px; }
.summary-card__foot b { padding: 3px 5px; border-radius: 5px; color: var(--green); background: var(--green-soft); font-size: 8px; }
.summary-card--purple { color: var(--primary); }
.summary-card--purple .summary-card__icon { color: var(--primary); background: var(--primary-soft); }
.summary-card--red { color: var(--red); }
.summary-card--red .summary-card__icon { color: var(--red); background: var(--red-soft); }
.summary-card--green { color: var(--green); }
.summary-card--green .summary-card__icon { color: var(--green); background: var(--green-soft); }
.summary-card--blue { color: var(--blue); }
.summary-card--blue .summary-card__icon { color: var(--blue); background: var(--blue-soft); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(270px, .75fr); gap: 13px; margin-top: 13px; }
.dashboard-grid--lower { grid-template-columns: minmax(0, 1.45fr) minmax(285px, .75fr); }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); }
.panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 18px 0; }
.panel__header h2 { margin: 0; color: var(--ink); font-size: 13px; letter-spacing: -.015em; }
.panel__header p { margin: 3px 0 0; color: var(--muted); font-size: 9.5px; }
.panel__header-actions { display: flex; align-items: center; gap: 5px; }
.panel__body { padding: 17px 18px; }
.chart-legend { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 9px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 7px; height: 7px; border-radius: 2px; }
.chart-legend .billed { background: #d9daf7; }
.chart-legend .received { background: var(--primary); }
.chart-legend .recovered { background: #43c7a7; }
.cashflow-chart { width: 100%; height: 228px; overflow: visible; }
.cashflow-chart text { fill: #9498a8; font-family: inherit; font-size: 9px; }
.cashflow-chart .grid-line { stroke: #ececf2; stroke-width: 1; stroke-dasharray: 3 5; }
.cashflow-chart .bar-billed { fill: #e6e6f7; }
.cashflow-chart .bar-received { fill: url(#barGradient); }
.cashflow-chart .line-recovered { fill: none; stroke: #35b596; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cashflow-chart .line-dot { fill: white; stroke: #35b596; stroke-width: 2; }

.attention-list { display: grid; gap: 8px; padding: 14px 14px 15px; }
.attention-card { display: grid; grid-template-columns: 33px 1fr auto; align-items: center; gap: 9px; min-height: 61px; padding: 9px 10px; border: 1px solid #eeeef4; border-radius: 11px; background: #fbfbfd; }
.attention-card__icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; }
.attention-card__icon .icon { width: 15px; height: 15px; }
.attention-card__icon--red { color: var(--red); background: var(--red-soft); }
.attention-card__icon--orange { color: var(--orange); background: var(--orange-soft); }
.attention-card__icon--violet { color: var(--primary); background: var(--primary-soft); }
.attention-card strong { display: block; color: var(--ink); font-size: 10px; }
.attention-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.attention-card > .icon { width: 14px; height: 14px; color: #a3a6b3; }
.attention-card:hover { border-color: #ddddeb; background: white; }

.aging-wrap { display: grid; grid-template-columns: 120px minmax(0,1fr); align-items: center; gap: 17px; padding: 20px 18px 18px; }
.donut { position: relative; width: 115px; height: 115px; border-radius: 50%; background: conic-gradient(var(--red) 0 var(--p1), var(--orange) var(--p1) var(--p2), var(--primary) var(--p2) var(--p3), #aeb1c0 var(--p3) 100%); }
.donut::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: white; }
.donut__center { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; }
.donut__center strong { color: var(--ink); font-size: 14px; }
.donut__center small { color: var(--muted); font-size: 7px; }
.aging-legend { display: grid; gap: 10px; }
.aging-legend__row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; font-size: 9px; }
.aging-legend__row i { width: 7px; height: 7px; border-radius: 2px; }
.aging-legend__row span { color: var(--muted); }
.aging-legend__row strong { color: var(--ink); font-size: 9px; }

.activity-list { padding: 6px 18px 15px; }
.activity-item { position: relative; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; min-height: 54px; border-bottom: 1px solid #f0f0f5; }
.activity-item:last-child { border-bottom: 0; }
.activity-item__icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); }
.activity-item__icon .icon { width: 14px; height: 14px; }
.activity-item strong { display: block; color: #34384c; font-size: 9.5px; font-weight: 650; }
.activity-item small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.activity-item time { color: var(--muted-2); font-size: 8px; }

/* Toolbar and tables */
.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.toolbar__search { position: relative; width: min(315px, 100%); }
.toolbar__search .icon { position: absolute; left: 11px; top: 10px; width: 15px; height: 15px; color: #9498a9; }
.toolbar__search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: white; font-size: 10px; }
.toolbar__search input:focus { border-color: #c9c9ef; box-shadow: 0 0 0 3px rgba(91,92,226,.08); }
.toolbar__right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.segmented { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.segmented button { height: 29px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--muted); cursor: pointer; background: transparent; font-size: 9px; font-weight: 650; }
.segmented button.is-active { color: var(--primary); background: var(--primary-soft); }
.table-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-xs); }
.data-table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.data-table th { height: 39px; padding: 0 13px; border-bottom: 1px solid var(--line); color: #8b8fa1; background: #fafafd; text-align: left; white-space: nowrap; font-size: 8px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.data-table td { height: 55px; padding: 7px 13px; border-bottom: 1px solid #efeff4; color: #565a6d; white-space: nowrap; font-size: 9.5px; }
.data-table tbody tr { cursor: pointer; transition: background .15s; }
.data-table tbody tr:hover { background: #fbfbfe; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .cell-main { display: flex; align-items: center; gap: 9px; }
.cell-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--primary-dark); background: #eeeeff; font-size: 8px; font-weight: 800; }
.cell-avatar--green { color: #197c63; background: var(--green-soft); }
.cell-main strong, .cell-main small { display: block; }
.cell-main strong { max-width: 210px; overflow: hidden; color: #2f3347; text-overflow: ellipsis; font-size: 9.8px; }
.cell-main small { margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.cell-money { color: var(--ink) !important; font-variant-numeric: tabular-nums; font-weight: 720; }
.cell-danger { color: var(--red) !important; font-weight: 700; }
.cell-muted { color: var(--muted-2) !important; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.table-actions .icon-button { width: 30px; height: 30px; border-radius: 8px; }
.table-actions .icon { width: 14px; height: 14px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; min-height: 47px; padding: 8px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.pagination { display: flex; gap: 3px; }
.pagination button { width: 27px; height: 27px; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: #777b8e; cursor: pointer; background: white; font-size: 8px; }
.pagination button.is-active { border-color: var(--primary); color: white; background: var(--primary); }

.status { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 7px; border-radius: 7px; font-size: 8px; font-weight: 750; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status--pending { color: #8b641d; background: #fff6df; }
.status--overdue { color: #bb4651; background: #fff0f1; }
.status--paid, .status--accepted, .status--completed, .status--sent, .status--connected, .status--active { color: #167c5f; background: #e5f7f1; }
.status--negotiating, .status--processing { color: #5657c9; background: #eeedff; }
.status--cancelled, .status--rejected, .status--suppressed, .status--inactive, .status--disabled, .status--suspended { color: #73778a; background: #f0f1f5; }
.status--failed, .status--needs_credentials { color: #bb4651; background: #fff0f1; }
.status--not_configured { color: #73778a; background: #f0f1f5; }
.status--trialing { color: #5657c9; background: #eeedff; }
.status--pending_activation, .status--invited { color: #8b641d; background: #fff6df; }

/* Clients */
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 13px; }
.mini-stat { display: flex; align-items: center; gap: 11px; min-height: 66px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.mini-stat__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.mini-stat__icon .icon { width: 17px; height: 17px; }
.mini-stat strong, .mini-stat span { display: block; }
.mini-stat strong { color: var(--ink); font-size: 16px; letter-spacing: -.025em; }
.mini-stat span { color: var(--muted); font-size: 8.5px; }
.risk-score { display: inline-flex; align-items: center; gap: 6px; }
.risk-score__bar { width: 46px; height: 5px; overflow: hidden; border-radius: 9px; background: #ececf2; }
.risk-score__bar i { display: block; height: 100%; border-radius: inherit; }
.risk-high i { background: var(--green); }
.risk-medium i { background: var(--orange); }
.risk-low i { background: var(--red); }
.risk-score b { color: var(--text); font-size: 9px; }

/* Collection rule */
.rule-overview { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(260px,.5fr); gap: 13px; }
.rule-canvas { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.rule-canvas__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.rule-canvas__head h2 { margin: 0; color: var(--ink); font-size: 13px; }
.rule-canvas__head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.rule-stage-label { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 10px; }
.rule-stage-label span { padding: 7px 10px; border-radius: 8px; color: var(--muted); background: #f5f5f9; font-size: 8px; font-weight: 750; text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.rule-stage-label span:nth-child(1) { color: #397f6d; background: #eaf7f3; }
.rule-stage-label span:nth-child(2) { color: #735b1d; background: #fff7df; }
.rule-stage-label span:nth-child(3) { color: #aa4550; background: #fff0f1; }
.rule-timeline { position: relative; padding: 13px 0 3px; }
.rule-timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
.rule-item { position: relative; display: grid; grid-template-columns: 1fr 42px 1fr; align-items: center; min-height: 78px; }
.rule-item__day { justify-self: end; padding-right: 13px; color: var(--muted); text-align: right; font-size: 9px; }
.rule-item__day strong { display: block; color: var(--ink); font-size: 11px; }
.rule-item__dot { position: relative; z-index: 1; display: grid; place-items: center; justify-self: center; width: 27px; height: 27px; border: 4px solid white; border-radius: 50%; color: white; background: var(--primary); box-shadow: 0 0 0 1px #dcddea; }
.rule-item__dot .icon { width: 11px; height: 11px; }
.rule-item__card { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; min-height: 59px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfd; }
.rule-item__channel { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); }
.rule-item__channel--whatsapp { color: #138b69; background: #e4f8f1; }
.rule-item__channel--email { color: #3b79bd; background: #eaf3ff; }
.rule-item__channel--task { color: #bd722e; background: #fff2e5; }
.rule-item__channel .icon { width: 14px; height: 14px; }
.rule-item__card strong { display: block; color: var(--ink); font-size: 9.5px; }
.rule-item__card small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.switch { position: relative; width: 32px; height: 18px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; cursor: pointer; background: #d7d9e3; transition: background .2s; }
.switch span::after { content: ""; position: absolute; width: 13px; height: 13px; left: 2.5px; top: 2.5px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(14px); }
.rule-insights { display: grid; align-content: start; gap: 10px; }
.insight-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.insight-card__icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.insight-card__icon .icon { width: 16px; height: 16px; }
.insight-card strong { display: block; color: var(--ink); font-size: 11px; }
.insight-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.insight-card--highlight { color: white; border-color: transparent; background: linear-gradient(145deg, #5f60e4, #494ac5); box-shadow: 0 12px 26px rgba(91,92,226,.22); }
.insight-card--highlight strong { color: white; }
.insight-card--highlight p { color: rgba(255,255,255,.72); }
.insight-metric { display: flex; align-items: baseline; gap: 7px; margin-top: 15px; }
.insight-metric b { color: white; font-size: 24px; letter-spacing: -.04em; }
.insight-metric span { color: #93f0d8; font-size: 9px; font-weight: 700; }

/* Negotiations */
.negotiation-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 13px; }
.negotiation-stat { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.negotiation-stat span, .negotiation-stat strong, .negotiation-stat small { display: block; }
.negotiation-stat span { color: var(--muted); font-size: 8.5px; }
.negotiation-stat strong { margin-top: 6px; color: var(--ink); font-size: 17px; }
.negotiation-stat small { margin-top: 4px; color: var(--muted-2); font-size: 8px; }
.proposal-card { display: grid; grid-template-columns: minmax(160px,1fr) minmax(200px,1.15fr) auto; align-items: center; gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.proposal-card:last-child { border-bottom: 0; }
.proposal-card__client { display: flex; align-items: center; gap: 10px; }
.proposal-card__client strong, .proposal-card__client small { display: block; }
.proposal-card__client strong { color: var(--ink); font-size: 10px; }
.proposal-card__client small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.proposal-card__values { display: flex; align-items: center; gap: 18px; }
.proposal-value small, .proposal-value strong { display: block; }
.proposal-value small { color: var(--muted-2); font-size: 7.5px; text-transform: uppercase; }
.proposal-value strong { margin-top: 3px; color: var(--ink); font-size: 10px; }
.proposal-arrow { color: #b4b6c2; }
.proposal-actions { display: flex; gap: 6px; }

/* Messages */
.messages-shell { display: grid; grid-template-columns: 295px minmax(390px,1fr) 250px; min-height: calc(100vh - 145px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.conversation-list { border-right: 1px solid var(--line); }
.conversation-list__header { padding: 14px; border-bottom: 1px solid var(--line); }
.conversation-list__header h2 { margin: 0 0 10px; color: var(--ink); font-size: 12px; }
.conversation-item { display: grid; grid-template-columns: 37px 1fr auto; align-items: center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid #f0f0f4; cursor: pointer; }
.conversation-item:hover, .conversation-item.is-active { background: #f7f7fc; }
.conversation-item.is-active { box-shadow: inset 3px 0 var(--primary); }
.conversation-item strong, .conversation-item small, .conversation-item p { display: block; overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item strong { color: var(--ink); font-size: 9.5px; }
.conversation-item small { margin-top: 2px; color: var(--muted); font-size: 7.5px; }
.conversation-item p { max-width: 155px; margin-top: 5px; color: #888c9c; font-size: 8px; }
.conversation-item time { align-self: start; color: var(--muted-2); font-size: 7px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; background: #fafafd; }
.chat-pane__header { display: flex; align-items: center; gap: 10px; min-height: 59px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: white; }
.chat-pane__header strong, .chat-pane__header small { display: block; }
.chat-pane__header strong { color: var(--ink); font-size: 10px; }
.chat-pane__header small { color: var(--green); font-size: 7.5px; }
.chat-pane__header .button { margin-left: auto; }
.chat-history { flex: 1; min-height: 360px; overflow-y: auto; padding: 18px; }
.chat-day { margin: 7px auto 16px; color: var(--muted-2); font-size: 7.5px; text-align: center; }
.bubble { width: fit-content; max-width: 76%; margin-bottom: 9px; padding: 10px 12px; border-radius: 12px 12px 12px 3px; color: #505467; background: white; box-shadow: 0 2px 8px rgba(20,24,55,.06); font-size: 9px; line-height: 1.5; }
.bubble--out { margin-left: auto; border-radius: 12px 12px 3px 12px; color: #30354a; background: #e7f8f2; }
.bubble time { display: block; margin-top: 5px; color: #979aaa; font-size: 7px; text-align: right; }
.chat-composer { display: grid; grid-template-columns: 32px 1fr 36px; align-items: end; gap: 7px; padding: 11px 13px; border-top: 1px solid var(--line); background: white; }
.chat-composer textarea { min-height: 37px; max-height: 110px; resize: none; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; outline: none; font-size: 9px; }
.chat-composer .icon-button { width: 33px; height: 33px; }
.chat-composer .send-button { color: white; background: var(--primary); }
.contact-pane { padding: 16px; border-left: 1px solid var(--line); }
.contact-pane__hero { display: grid; justify-items: center; padding: 10px 0 18px; border-bottom: 1px solid var(--line); text-align: center; }
.contact-pane__hero .avatar { width: 52px; height: 52px; border-radius: 15px; font-size: 13px; }
.contact-pane__hero strong { margin-top: 9px; color: var(--ink); font-size: 11px; }
.contact-pane__hero small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.contact-detail { display: grid; gap: 11px; padding: 15px 0; }
.contact-detail span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 8.5px; }
.contact-detail .icon { width: 14px; height: 14px; color: #9296a7; }
.contact-debt { padding: 12px; border-radius: 10px; background: var(--red-soft); }
.contact-debt small, .contact-debt strong { display: block; }
.contact-debt small { color: #a55a61; font-size: 8px; }
.contact-debt strong { margin-top: 3px; color: #ae3e48; font-size: 15px; }
.messages-disclaimer { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 9px 11px; border: 1px solid #f0e2c8; border-radius: 9px; color: #876a37; background: #fffaf0; font-size: 8px; }
.messages-disclaimer .icon { width: 14px; height: 14px; }
.chat-readonly { padding: 12px 14px; border-top: 1px solid var(--line); color: var(--muted); background: #fafafd; text-align: center; font-size: 8.5px; }

/* Import */
.import-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(260px,.55fr); gap: 13px; }
.import-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.import-card h2 { margin: 0; color: var(--ink); font-size: 13px; }
.import-card > p { margin: 5px 0 17px; color: var(--muted); font-size: 9.5px; }
.import-readonly { display: grid; place-items: center; min-height: 210px; align-content: center; text-align: center; }
.import-readonly .empty-state__icon { margin-bottom: 10px; }
.import-readonly > p { max-width: 320px; margin-bottom: 0; }
.import-type { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }
.import-type label { position: relative; display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.import-type input { position: absolute; opacity: 0; }
.import-type label:has(input:checked) { border-color: #b9baf0; background: #f7f6ff; box-shadow: 0 0 0 2px rgba(91,92,226,.07); }
.import-type__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); }
.import-type__icon .icon { width: 15px; height: 15px; }
.import-type strong, .import-type small { display: block; }
.import-type strong { color: var(--ink); font-size: 9.5px; }
.import-type small { margin-top: 2px; color: var(--muted); font-size: 7.5px; }
.dropzone { position: relative; display: grid; place-items: center; min-height: 195px; padding: 25px; border: 1.5px dashed #cbccdd; border-radius: 13px; cursor: pointer; text-align: center; background: #fafafd; transition: border .18s, background .18s; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--primary); background: #f7f6ff; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone__icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 11px; border-radius: 15px; color: var(--primary); background: var(--primary-soft); }
.dropzone__icon .icon { width: 22px; height: 22px; }
.dropzone strong { display: block; color: var(--ink); font-size: 11px; }
.dropzone span { display: block; margin-top: 4px; color: var(--muted); font-size: 8.5px; }
.dropzone small { display: block; margin-top: 11px; color: var(--muted-2); font-size: 7.5px; }
.import-steps { display: grid; gap: 10px; counter-reset: steps; }
.import-step { display: grid; grid-template-columns: 28px 1fr; gap: 9px; }
.import-step::before { counter-increment: steps; content: counter(steps); display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
.import-step strong { display: block; color: var(--ink); font-size: 9px; }
.import-step p { margin: 3px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.import-template { display: flex; align-items: center; gap: 8px; margin-top: 15px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--primary); background: #fbfbfe; font-size: 8.5px; font-weight: 700; }
.import-template .icon { width: 15px; height: 15px; }
.import-preview { margin-top: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfd; }
.import-preview__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.import-preview__head strong { color: var(--ink); font-size: 10px; }
.import-preview__head span { color: var(--muted); font-size: 8px; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.mapping-field span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 7.5px; }
.mapping-field select { width: 100%; height: 33px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--text); background: white; font-size: 8.5px; }
.import-result { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 12px; }
.import-result div { padding: 10px; border-radius: 9px; background: #f6f6fa; text-align: center; }
.import-result strong, .import-result small { display: block; }
.import-result strong { color: var(--ink); font-size: 15px; }
.import-result small { color: var(--muted); font-size: 7.5px; }
.reconciliation-count { padding: 5px 8px; border-radius: 99px; color: var(--primary-dark); background: var(--primary-soft); font-size: 8px; font-weight: 750; white-space: nowrap; }
.reconciliation-table { min-width: 860px; }
.reconciliation-table td { height: 66px; }
.cell-stack strong, .cell-stack small { display: block; }
.cell-stack strong { color: var(--ink); font-size: 9px; }
.cell-stack small { max-width: 250px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 7.7px; text-overflow: ellipsis; }
.reconciliation-title { max-width: 220px; padding: 0; overflow: hidden; border: 0; color: var(--primary-dark); cursor: pointer; background: transparent; font: inherit; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.reconciliation-title:hover { text-decoration: underline; }
.reconciliation-actions { display: flex; gap: 6px; }

/* Integrations */
.integration-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 17px 18px; border: 1px solid #dcdcf7; border-radius: 14px; background: linear-gradient(120deg, #f7f6ff, #f0fbf8); }
.integration-hero h2 { margin: 0; color: var(--ink); font-size: 13px; }
.integration-hero p { max-width: 680px; margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.integration-card { position: relative; display: flex; flex-direction: column; min-height: 227px; padding: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.integration-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.integration-logo { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.integration-logo .icon { width: 21px; height: 21px; }
.integration-logo--whatsapp { color: #158966; background: #e4f8f1; }
.integration-logo--bank { color: #386fb0; background: #eaf3ff; }
.integration-logo--erp { color: #b06c2e; background: #fff2e6; }
.integration-card h3 { margin: 14px 0 5px; color: var(--ink); font-size: 12px; }
.integration-card p { margin: 0; color: var(--muted); font-size: 8.7px; line-height: 1.55; }
.integration-card__meta { display: grid; gap: 6px; margin: 12px 0 15px; }
.integration-card__meta span { display: flex; align-items: center; gap: 6px; color: #74798c; font-size: 8px; }
.integration-card__meta .icon { width: 12px; height: 12px; }
.integration-card .button { margin-top: auto; align-self: flex-start; }
.integration-readonly { margin-top: auto; color: var(--muted-2); font-size: 8px; font-weight: 650; }
.integration-notice { display: flex; gap: 9px; margin-top: 13px; padding: 11px 13px; border: 1px solid #eee2ca; border-radius: 10px; color: #7b633b; background: #fffaf1; font-size: 8.5px; line-height: 1.5; }
.integration-notice .icon { width: 15px; height: 15px; margin-top: 1px; }

/* SaaS workspace, team and subscription */
.subscription-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 150px; padding: 24px 25px; overflow: hidden; border: 1px solid #dcdcf7; border-radius: var(--radius-lg); background: linear-gradient(120deg, #f4f3ff 0%, #fff 58%, #edf9f6 100%); }
.subscription-hero::after { content: ""; position: absolute; right: -55px; top: -80px; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, rgba(79,211,178,.18), transparent 68%); }
.subscription-hero__copy { position: relative; z-index: 1; min-width: 0; }
.plan-kicker { color: var(--primary); font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.subscription-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.subscription-title h2 { margin: 0; color: var(--ink); font-size: 25px; letter-spacing: -.04em; }
.subscription-hero__copy > p { max-width: 650px; margin: 8px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.subscription-date { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: #5e6377; font-size: 9px; font-weight: 700; }
.subscription-date .icon { width: 14px; height: 14px; color: var(--primary); }
.subscription-hero__seal { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; min-width: 205px; padding: 13px 15px; border: 1px solid rgba(46,159,136,.16); border-radius: 12px; background: rgba(255,255,255,.75); box-shadow: var(--shadow-xs); }
.subscription-hero__seal > .icon { width: 24px; height: 24px; color: var(--green); }
.subscription-hero__seal strong, .subscription-hero__seal small { display: block; }
.subscription-hero__seal strong { color: var(--ink); font-size: 9.5px; }
.subscription-hero__seal small { margin-top: 3px; max-width: 155px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.usage-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-top: 13px; }
.usage-card { padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow-xs); }
.usage-card__top { display: flex; align-items: center; gap: 7px; }
.usage-card__top > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); }
.usage-card__top .icon { width: 13px; height: 13px; }
.usage-card__top small { color: var(--muted); font-size: 9px; font-weight: 700; }
.usage-card__value { display: flex; align-items: baseline; gap: 5px; margin-top: 11px; }
.usage-card__value strong { color: var(--ink); font-size: 20px; letter-spacing: -.03em; }
.usage-card__value span { color: var(--muted-2); font-size: 8px; }
.usage-meter { height: 5px; margin-top: 9px; overflow: hidden; border-radius: 20px; background: #eeeeF5; }
.usage-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #8384ef); }
.usage-meter.is-near-limit i { background: linear-gradient(90deg, var(--orange), var(--red)); }
.account-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 25px 1px 11px; }
.account-section-head h2 { margin: 0; color: var(--ink); font-size: 14px; }
.account-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.account-section-head--members { margin-top: 27px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.plan-card { position: relative; display: flex; flex-direction: column; min-height: 305px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow-xs); }
.plan-card--featured { border-color: #c9c9f7; box-shadow: 0 9px 30px rgba(91,92,226,.08); }
.plan-card.is-current { border-color: #9e9fea; box-shadow: 0 0 0 2px rgba(91,92,226,.07); }
.plan-card.is-pending { border-color: #edd7aa; box-shadow: 0 0 0 2px rgba(233,145,60,.07); }
.plan-card__top { display: flex; align-items: center; justify-content: space-between; }
.plan-card__icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.plan-card__icon .icon { width: 18px; height: 18px; }
.plan-current { padding: 5px 7px; border-radius: 6px; color: #167c5f; background: var(--green-soft); font-size: 7.5px; font-weight: 800; text-transform: uppercase; }
.plan-pending { padding: 5px 7px; border-radius: 6px; color: #8b641d; background: #fff6df; font-size: 7.5px; font-weight: 800; text-transform: uppercase; }
.plan-card h3 { margin: 13px 0 3px; color: var(--ink); font-size: 15px; }
.plan-card > p { margin: 0; color: var(--muted); font-size: 9px; }
.plan-price { display: block; margin-top: 15px; color: var(--ink); font-size: 19px; letter-spacing: -.03em; }
.plan-price small { color: var(--muted); font-size: 7.5px; font-weight: 600; letter-spacing: 0; }
.plan-card ul { display: grid; gap: 8px; margin: 15px 0 18px; padding: 0; list-style: none; }
.plan-card li { display: flex; align-items: center; gap: 7px; color: #5c6073; font-size: 8.5px; }
.plan-card li .icon { width: 13px; height: 13px; color: var(--green); }
.plan-card > .button { margin-top: auto; }
.members-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-xs); }
.members-table tbody tr { cursor: default; }
.members-table td { height: 62px; }
.cell-avatar--muted { color: #797d8d; background: #eff0f4; }
.role-select { height: 31px; min-width: 125px; padding: 0 26px 0 9px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: #555a6d; background: white; font-size: 9px; }
.role-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,92,226,.08); }
.role-label { color: #555a6d; font-size: 9px; font-weight: 650; }
.account-security-note { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 12px 14px; border: 1px solid #dcebe7; border-radius: 11px; color: #246f5d; background: #f3fbf8; }
.account-security-note > .icon { width: 18px; height: 18px; }
.account-security-note strong, .account-security-note small { display: block; }
.account-security-note strong { font-size: 9px; }
.account-security-note small { margin-top: 2px; color: #5d8077; font-size: 8px; }
.workspace-list { display: grid; gap: 7px; }
.workspace-invitations { display: grid; gap: 7px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.workspace-invitations h3 { margin: 0 0 3px; color: var(--ink); font-size: 10px; }
.workspace-invitation { display: grid; grid-template-columns: 39px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid #d7eade; border-radius: 11px; background: #f7fcf9; }
.workspace-invitation strong, .workspace-invitation small { display: block; }
.workspace-invitation strong { color: var(--ink); font-size: 10px; }
.workspace-invitation small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.workspace-invitation > div { display: flex; gap: 6px; }
.workspace-option { display: grid; grid-template-columns: 39px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 61px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; color: inherit; cursor: pointer; text-align: left; background: white; transition: border .18s, background .18s, transform .18s; }
.workspace-option:not(:disabled):hover { transform: translateY(-1px); border-color: #c9c9ef; background: #fbfbff; }
.workspace-option.is-current { border-color: #c5e9df; background: #f5fcfa; }
.workspace-option:disabled { cursor: default; }
.workspace-option__avatar { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: var(--primary-dark); background: var(--primary-soft); font-size: 10px; font-weight: 850; }
.workspace-option strong, .workspace-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-option strong { color: var(--ink); font-size: 10.5px; }
.workspace-option small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.workspace-option > .icon { width: 15px; height: 15px; color: var(--muted-2); }
.workspace-option em { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: 8px; font-style: normal; font-weight: 750; }
.workspace-option em .icon { width: 14px; height: 14px; }
.workspace-isolation { display: flex; align-items: flex-start; gap: 7px; margin-top: 13px; color: var(--muted); font-size: 8px; }
.workspace-isolation .icon { width: 13px; height: 13px; color: var(--green); }
.member-invite-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; border: 1px solid #dfdff3; border-radius: 9px; color: #5c6076; background: #f7f7fe; font-size: 8.5px; line-height: 1.5; }
.member-invite-note .icon { width: 14px; height: 14px; color: var(--primary); }
.member-invite-note--warning { margin-top: 12px; border-color: #eee2ca; color: #7b633b; background: #fffaf1; }
.member-invite-note--warning .icon { color: var(--orange); }
.temporary-password { padding: 15px; border: 1px solid #dcdcf0; border-radius: 12px; background: #f8f8fd; }
.temporary-password > span { display: block; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.temporary-password code { display: block; margin: 8px 0 13px; overflow-wrap: anywhere; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 18px; font-weight: 750; letter-spacing: .03em; }
.modal-root.is-locked .modal-backdrop { cursor: not-allowed; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* Reports */
.report-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.65fr); gap: 13px; }
.report-grid + .report-grid { margin-top: 13px; }
.report-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 13px; }
.report-kpi { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.report-kpi span { color: var(--muted); font-size: 8px; }
.report-kpi strong { display: block; margin-top: 6px; color: var(--ink); font-size: 16px; }
.report-kpi small { color: var(--green); font-size: 7.5px; font-weight: 700; }
.horizontal-bars { display: grid; gap: 12px; }
.horizontal-bar__labels { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; color: var(--muted); font-size: 8.5px; }
.horizontal-bar__labels strong { color: var(--ink); font-size: 8.5px; }
.horizontal-bar__track { height: 7px; overflow: hidden; border-radius: 99px; background: #efeff4; }
.horizontal-bar__track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #8989f2); }

/* Modals and drawers */
.modal-root, .drawer-root { position: fixed; inset: 0; z-index: 1500; pointer-events: none; }
.modal-root.is-open, .drawer-root.is-open { pointer-events: auto; }
.modal-backdrop, .drawer-backdrop { position: absolute; inset: 0; opacity: 0; background: rgba(11,14,33,.48); backdrop-filter: blur(3px); transition: opacity .22s; }
.modal-root.is-open .modal-backdrop, .drawer-root.is-open .drawer-backdrop { opacity: 1; }
.modal { position: absolute; left: 50%; top: 50%; width: min(520px, calc(100vw - 30px)); max-height: calc(100vh - 32px); overflow-y: auto; opacity: 0; transform: translate(-50%,-48%) scale(.985); border-radius: 17px; background: white; box-shadow: var(--shadow-lg); transition: opacity .22s, transform .22s; }
.modal--wide { width: min(780px, calc(100vw - 30px)); }
.modal-root.is-open .modal { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 18px 19px 14px; border-bottom: 1px solid var(--line); }
.modal__header h2 { margin: 0; color: var(--ink); font-size: 15px; }
.modal__header p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.modal__header .icon-button { width: 32px; height: 32px; }
.modal__body { padding: 18px 19px; }
.modal__footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 19px; border-top: 1px solid var(--line); background: #fafafd; }
.modal__footer--stack { flex-direction: column; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .field--full { grid-column: 1 / -1; }
.form-grid .field input, .form-grid .field select, .form-grid .field textarea, .modal .field input, .modal .field select, .modal .field textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; color: var(--ink); background: white; font-size: 10px; }
.form-grid .field textarea, .modal .field textarea { min-height: 88px; resize: vertical; }
.field-help { color: var(--muted-2); font-size: 7.5px; line-height: 1.45; }
.check-row { display: flex; align-items: flex-start; gap: 8px; }
.check-row input { margin-top: 2px; accent-color: var(--primary); }
.check-row span { color: var(--muted); font-size: 9px; }
.drawer { position: absolute; top: 0; right: 0; width: min(470px, 100vw); height: 100%; overflow-y: auto; transform: translateX(102%); background: white; box-shadow: -20px 0 55px rgba(15,18,44,.16); transition: transform .26s ease; }
.drawer-root.is-open .drawer { transform: none; }
.drawer__header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(8px); }
.drawer__header h2 { margin: 0; color: var(--ink); font-size: 14px; }
.drawer__body { padding: 18px; }
.detail-hero { padding: 15px; border-radius: 13px; color: white; background: linear-gradient(135deg, #5657d9, #6b6ce7); }
.detail-hero__top { display: flex; justify-content: space-between; gap: 12px; }
.detail-hero small { color: rgba(255,255,255,.67); font-size: 8px; }
.detail-hero h3 { margin: 5px 0 0; font-size: 14px; }
.detail-hero__amount { margin-top: 20px; }
.detail-hero__amount strong { display: block; font-size: 27px; letter-spacing: -.045em; }
.detail-hero__amount span { display: block; margin-top: 4px; color: rgba(255,255,255,.72); font-size: 8px; }
.detail-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section h4 { margin: 0 0 11px; color: var(--ink); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.detail-field small, .detail-field strong { display: block; }
.detail-field small { color: var(--muted-2); font-size: 7.5px; text-transform: uppercase; }
.detail-field strong { margin-top: 3px; color: var(--text); font-size: 9px; font-weight: 650; overflow-wrap: anywhere; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.profile-menu { position: fixed; z-index: 1300; width: 205px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow-md); }
.profile-menu button { display: flex; align-items: center; gap: 9px; width: 100%; height: 36px; padding: 0 9px; border: 0; border-radius: 8px; cursor: pointer; color: #555a6e; background: transparent; font-size: 9px; text-align: left; }
.profile-menu button:hover { background: #f5f5f9; }
.profile-menu .icon { width: 15px; height: 15px; }
.profile-menu hr { height: 1px; margin: 5px 2px; border: 0; background: var(--line); }
.profile-menu .danger { color: var(--red); }

/* Toast and states */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 2500; display: grid; gap: 8px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 28px minmax(0,1fr) 18px; align-items: center; gap: 9px; width: min(350px, calc(100vw - 30px)); padding: 11px 12px; opacity: 0; transform: translateY(12px); border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow-md); pointer-events: auto; animation: toast-in .28s forwards; }
@keyframes toast-in { to { opacity: 1; transform: none; } }
.toast__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--green); background: var(--green-soft); }
.toast--error .toast__icon { color: var(--red); background: var(--red-soft); }
.toast__icon .icon { width: 14px; height: 14px; }
.toast strong, .toast small { display: block; }
.toast strong { color: var(--ink); font-size: 9.5px; }
.toast small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.toast button { padding: 0; border: 0; color: #a0a3b1; cursor: pointer; background: transparent; }
.empty-state { display: grid; place-items: center; min-height: 260px; padding: 30px; text-align: center; }
.empty-state__icon { display: grid; place-items: center; width: 49px; height: 49px; margin-bottom: 12px; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.empty-state__icon .icon { width: 21px; height: 21px; }
.empty-state h3 { margin: 0; color: var(--ink); font-size: 12px; }
.empty-state p { max-width: 320px; margin: 5px 0 14px; color: var(--muted); font-size: 9px; }
.page-loading { max-width: 1460px; margin: 0 auto; }
.skeleton { overflow: hidden; border-radius: 9px; background: #e8e9f0; }
.skeleton::after, .skeleton-grid i::after { content: ""; display: block; width: 100%; height: 100%; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shimmer 1.35s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton--heading { width: 240px; height: 31px; margin-bottom: 24px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; }
.skeleton-grid i { height: 112px; overflow: hidden; border-radius: 13px; background: #e8e9f0; }
.skeleton--panel { width: 100%; height: 335px; margin-top: 13px; }
.noscript { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 30px; background: white; color: var(--ink); }
.sidebar-overlay { display: none; }

@media (max-width: 1180px) {
    :root { --sidebar-width: 225px; }
    .summary-grid { grid-template-columns: repeat(2,1fr); }
    .integration-grid { grid-template-columns: repeat(2,1fr); }
    .messages-shell { grid-template-columns: 270px 1fr; }
    .contact-pane { display: none; }
    .report-kpis { grid-template-columns: repeat(2,1fr); }
    .usage-grid { grid-template-columns: repeat(2,1fr); }
    .members-table { min-width: 690px; }
}

@media (max-width: 900px) {
    :root { --sidebar-width: 252px; }
    .sidebar { transform: translateX(-102%); box-shadow: 18px 0 45px rgba(10,13,35,.25); transition: transform .25s ease; }
    .sidebar.is-open { transform: none; }
    .sidebar__close { display: grid; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 790; display: block; visibility: hidden; opacity: 0; background: rgba(10,12,30,.42); transition: opacity .22s, visibility .22s; }
    .sidebar-overlay.is-open { visibility: visible; opacity: 1; }
    .app-main { margin-left: 0; }
    .topbar__menu { display: grid; }
    .dashboard-grid, .dashboard-grid--lower, .rule-overview, .import-layout, .report-grid { grid-template-columns: 1fr; }
    .rule-insights { grid-template-columns: repeat(2,1fr); }
    .auth-screen { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-panel { padding: 30px; background: linear-gradient(160deg, #f4f4ff, #fff 40%); }
    .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 55px; color: var(--ink); font-size: 18px; }
    .auth-panel.is-signup .auth-mobile-brand { margin-bottom: 25px; }
    .subscription-hero { align-items: flex-start; }
}

@media (max-width: 680px) {
    .topbar { height: 59px; padding: 0 13px; }
    .global-search { width: auto; flex: 1; }
    .global-search input { padding-right: 10px; }
    .global-search kbd, .quick-create span, .topbar-user { display: none; }
    .quick-create { width: 38px; padding: 0; }
    .page-content { min-height: calc(100vh - 59px); padding: 19px 13px 35px; }
    .page-header, .welcome-row { align-items: flex-start; flex-direction: column; gap: 12px; }
    .page-header__actions, .welcome-row > div:last-child { width: 100%; }
    .page-header__actions .button { flex: 1; }
    .summary-grid, .mini-stats, .negotiation-stats { grid-template-columns: 1fr 1fr; }
    .summary-card { padding: 14px; }
    .summary-card__value { font-size: 19px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar__search { width: 100%; }
    .toolbar__right { width: 100%; margin-left: 0; overflow-x: auto; }
    .toolbar__right .segmented { flex: 0 0 auto; }
    .rule-stage-label { display: none; }
    .rule-timeline::before { left: 13px; }
    .rule-item { grid-template-columns: 27px 1fr; gap: 10px; padding: 7px 0; }
    .rule-item__day { grid-column: 2; justify-self: start; padding: 0; text-align: left; }
    .rule-item__dot { grid-row: 1 / span 2; }
    .rule-item__card { grid-column: 2; }
    .rule-insights { grid-template-columns: 1fr; }
    .messages-shell { grid-template-columns: 1fr; min-height: auto; }
    .conversation-list { border-right: 0; }
    .chat-pane { display: none; }
    .messages-shell.has-chat .conversation-list { display: none; }
    .messages-shell.has-chat .chat-pane { display: flex; min-height: 620px; }
    .proposal-card { grid-template-columns: 1fr; gap: 11px; }
    .proposal-card__values { justify-content: space-between; }
    .proposal-actions .button { flex: 1; }
    .integration-grid { grid-template-columns: 1fr; }
    .integration-hero { align-items: flex-start; flex-direction: column; }
    .subscription-hero { flex-direction: column; }
    .subscription-hero__seal { width: 100%; }
    .plan-grid { grid-template-columns: 1fr; }
    .plan-card { min-height: 0; }
    .account-section-head { align-items: flex-start; flex-direction: column; }
    .account-section-head .button { width: 100%; }
    .workspace-invitation { grid-template-columns: 39px minmax(0,1fr); }
    .workspace-invitation > div { grid-column: 1 / -1; }
    .workspace-invitation > div .button { flex: 1; }
    .form-grid, .mapping-grid { grid-template-columns: 1fr; }
    .import-type { grid-template-columns: 1fr; }
    .report-kpis { grid-template-columns: 1fr 1fr; }
    .skeleton-grid { grid-template-columns: 1fr 1fr; }
    .aging-wrap { grid-template-columns: 110px 1fr; }
    .data-table th, .data-table td { padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 420px) {
    .mini-stats, .negotiation-stats, .report-kpis { grid-template-columns: 1fr; }
    .usage-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .summary-card { min-height: 108px; padding: 12px; }
    .summary-card__value { font-size: 17px; }
    .summary-card__foot { font-size: 7.5px; }
    .auth-panel { padding: 24px 20px; }
    .auth-panel.is-signup { padding-top: 20px; padding-bottom: 20px; }
    .auth-panel h2 { font-size: 28px; }
    .date-pill { width: 100%; justify-content: center; }
    .aging-wrap { grid-template-columns: 1fr; justify-items: center; }
    .aging-legend { width: 100%; }
    .modal__body, .modal__header, .modal__footer { padding-left: 15px; padding-right: 15px; }
}

@media (max-width: 350px) {
    .summary-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Módulos operacionais unificados */
.suite-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}.suite-metrics article{display:flex;align-items:center;gap:14px;padding:18px 20px;border-radius:18px;background:var(--surface);box-shadow:var(--shadow-sm)}.suite-metrics article>span{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:var(--primary-soft);color:var(--primary)}.suite-metrics small{display:block;color:var(--muted);font-size:11px;margin-bottom:4px}.suite-metrics strong{font-size:20px;letter-spacing:-.03em;font-variant-numeric:tabular-nums}.suite-low-stock{background:rgba(239,108,90,.045)}.suite-low-stock td:nth-child(3) strong{color:var(--danger)}.reconciliation-page{height:calc(100dvh - 78px);display:flex;flex-direction:column}.reconciliation-frame{flex:1;min-height:580px;overflow:hidden;border-radius:18px;background:var(--surface);box-shadow:var(--shadow-sm);display:flex;flex-direction:column}.reconciliation-frame__bar{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:1px solid var(--line);color:var(--muted);font-size:11px}.reconciliation-frame__bar span{display:flex;align-items:center;gap:8px;color:var(--ink);font-weight:600}.reconciliation-frame__bar i{width:7px;height:7px;border-radius:50%;background:var(--success);box-shadow:0 0 0 4px rgba(33,171,133,.12)}.reconciliation-frame iframe{width:100%;height:100%;min-height:540px;border:0;background:#f6f8fb}.numeric{font-variant-numeric:tabular-nums}@media(max-width:800px){.suite-metrics{grid-template-columns:1fr}.reconciliation-page{height:auto}.reconciliation-frame{min-height:720px}.reconciliation-frame__bar small{display:none}}
