:root {
    --navy: #101d35;
    --navy-2: #172641;
    --ink: #1d2939;
    --muted: #667085;
    --line: #e4e9f0;
    --surface: #ffffff;
    --bg: #f4f7fb;
    --green: #12a67a;
    --green-dark: #08795a;
    --green-soft: #e9f8f3;
    --orange: #ef8d32;
    --orange-soft: #fff4e8;
    --red: #d74646;
    --red-soft: #fff0f0;
    --shadow: 0 10px 30px rgba(16, 29, 53, .07);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
a { color: var(--green-dark); text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--navy); color: #fff; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 22px 20px; color: #fff; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #19c395, #0a8763); color: #fff; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 8px 20px rgba(18, 166, 122, .3); flex: 0 0 auto; }
.brand-mark.large { width: 50px; height: 50px; border-radius: 15px; font-size: 17px; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font-size: 19px; letter-spacing: -.02em; }
.brand-copy small { color: #99a8bd; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-label { display: block; color: #7789a4; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin: 18px 10px 8px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 11px; border-radius: 10px; color: #c9d3e1; padding: 0 12px; margin-bottom: 3px; transition: .18s ease; }
.nav-item span { width: 20px; color: #8ca0bb; font-size: 17px; text-align: center; }
.nav-item b { font-size: 13px; font-weight: 600; flex: 1; }
.nav-item em { font-size: 9px; font-style: normal; color: #76879f; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active span { color: #2bd0a0; }
.nav-item.disabled { opacity: .55; cursor: default; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding: 15px 17px; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip > span { width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,.1); display: grid; place-items: center; color: #2bd0a0; font-weight: 800; }
.user-chip div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-chip strong, .user-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: 12px; }.user-chip small { color: #8293ab; font-size: 10px; margin-top: 2px; }
.link-button { background: none; border: 0; color: #91a1b6; padding: 8px 0 0 42px; font-size: 11px; }
.link-button:hover { color: #fff; }

.main { margin-left: 250px; min-height: 100vh; width: calc(100% - 250px); }
.topbar { min-height: 88px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 15px; padding: 18px 30px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.03em; }.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.sidebar-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.page-content { padding: 26px 30px 50px; max-width: 1700px; margin: 0 auto; }
.page-description { color: var(--muted); margin: 0 0 20px; }

.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.filter-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }.filter-form.grow { flex: 1; }.filter-form .search-field { min-width: 280px; flex: 1; }
label { display: flex; flex-direction: column; gap: 7px; color: #344054; font-size: 12px; font-weight: 650; }
input, select { min-height: 42px; border: 1px solid #d5dce6; border-radius: 9px; background: #fff; color: var(--ink); padding: 9px 12px; outline: none; transition: .15s ease; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,166,122,.12); }
label small { color: var(--muted); font-weight: 400; line-height: 1.4; }
.button { min-height: 42px; border-radius: 9px; border: 1px solid transparent; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; font-weight: 750; font-size: 12px; white-space: nowrap; }
.button.primary { background: var(--green); color: #fff; box-shadow: 0 7px 18px rgba(18,166,122,.18); }.button.primary:hover { background: var(--green-dark); }
.button.secondary { background: #fff; border-color: #d5dce6; color: #344054; }.button.secondary:hover { background: #f8fafc; }
.button.danger { background: var(--red-soft); color: var(--red); border-color: #ffd1d1; }.button.small { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.button.full { width: 100%; }.large-button { width: 100%; min-height: 50px; margin: 8px 0 30px; font-size: 14px; }

.alert { padding: 13px 15px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; line-height: 1.45; }
.alert.success { background: var(--green-soft); border-color: #bcebdc; color: #087153; }.alert.danger { background: var(--red-soft); border-color: #ffcaca; color: #a32929; }.alert.warning { background: var(--orange-soft); border-color: #ffd7b1; color: #94551b; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.card-head h2 { font-size: 16px; margin: 3px 0 0; letter-spacing: -.02em; }.card-head p { color: var(--muted); margin: 6px 0 0; font-size: 12px; }.card-head > div > div { display: flex; align-items: center; gap: 10px; }
.eyebrow { font-size: 9px; font-weight: 850; letter-spacing: .14em; color: var(--green-dark); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-grid.compact { margin-top: 18px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-width: 0; box-shadow: 0 5px 20px rgba(16,29,53,.04); }
.metric-card > span { display: block; color: var(--muted); font-size: 11px; font-weight: 650; margin-bottom: 10px; }.metric-card strong { display: block; font-size: 24px; letter-spacing: -.04em; color: var(--navy); overflow-wrap: anywhere; }.metric-card small { display: block; color: #8792a2; font-size: 10px; margin-top: 7px; }
.metric-card.accent { background: linear-gradient(135deg, #0d8766, #12ad7f); border-color: transparent; }.metric-card.accent span, .metric-card.accent strong, .metric-card.accent small { color: #fff; }.metric-card.accent small { opacity: .72; }
.warning-card strong { color: var(--orange); }

.funnel-card { overflow: hidden; }.funnel-flow { display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow-x: auto; padding: 8px 4px 14px; }.funnel-flow > i { color: #bdc6d3; font-style: normal; }
.funnel-stage { min-width: 115px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfd; position: relative; }.funnel-stage > span { position: absolute; right: 9px; top: 7px; color: #c5cdd8; font-size: 9px; }.funnel-stage b { display: block; font-size: 20px; color: var(--navy); }.funnel-stage small { color: var(--muted); font-size: 10px; }.funnel-stage.active { background: var(--green-soft); border-color: #bcebdc; }.funnel-stage.active b { color: var(--green-dark); }
.hint { color: var(--muted); font-size: 11px; margin: 2px 0 0; }
.status-pill { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-pill.ok, .status-pill.configured { color: #087153; background: var(--green-soft); }.status-pill.warning { color: #9a5718; background: var(--orange-soft); }.status-pill.muted-pill { color: #657183; background: #edf1f5; }

.content-grid { display: grid; gap: 20px; align-items: start; }.content-grid.two-thirds { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }.users-grid { grid-template-columns: minmax(0, 2fr) minmax(300px, .8fr); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 750px; } th { text-align: left; color: #748096; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; } td { padding: 13px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; font-size: 12px; } tbody tr:last-child td { border-bottom: 0; } tbody tr:hover { background: #fbfcfe; } td strong { color: #243247; }
.table-sub { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; max-width: 420px; }.result-count { color: var(--muted); font-size: 11px; }.role-pill { background: #eef2ff; color: #4859a6; padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 700; }
code { color: #36506c; background: #eff3f7; padding: 3px 6px; border-radius: 5px; font-size: 10px; }
.activity-list { display: flex; flex-direction: column; }.activity-list a { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf0f4; color: var(--ink); }.activity-list a:last-child { border: 0; }.activity-list div { flex: 1; min-width: 0; display: flex; flex-direction: column; }.activity-list strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.activity-list small { color: var(--muted); font-size: 9px; margin-top: 3px; }.activity-list > a > b { font-size: 10px; white-space: nowrap; }.activity-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--green-soft); color: var(--green-dark); font-size: 8px; font-weight: 850; }
.empty-state { text-align: center; padding: 50px 20px; }.empty-state b { font-size: 15px; }.empty-state p { color: var(--muted); margin: 7px 0 18px; }.muted { color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 18px; color: var(--muted); font-size: 11px; }

.narrow-content { max-width: 680px; margin: 0 auto; }.narrow-content.wide { max-width: 920px; }.upload-card { padding: 26px; }
.dropzone { border: 2px dashed #cad4df; background: #f9fbfc; border-radius: 14px; min-height: 240px; align-items: center; justify-content: center; text-align: center; margin: 4px 0 18px; padding: 25px; cursor: pointer; }.dropzone:hover { border-color: var(--green); background: #f5fcf9; }.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }.dropzone strong { font-size: 14px; color: var(--navy); }.dropzone small { color: var(--muted); }.upload-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--green-soft); color: var(--green-dark); font-size: 25px; margin-bottom: 8px; }
.info-card { background: #eef4fa; border: 1px solid #dce6f0; border-radius: 13px; padding: 18px 20px; color: #3c4f66; margin-bottom: 20px; }.info-card b { color: var(--navy); }.info-card p { margin: 7px 0 0; line-height: 1.55; }.info-card ul { margin: 10px 0 0; padding-left: 18px; line-height: 1.8; font-size: 12px; }
.preview-period { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }.preview-period span { color: var(--muted); font-size: 11px; }.preview-period strong { font-size: 15px; color: var(--navy); }
.validation-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }.validation-list > div { background: #f7fbf9; border: 1px solid #dbefe8; border-radius: 11px; display: flex; gap: 9px; padding: 12px; }.validation-list > div > span { color: var(--green); font-weight: 900; }.validation-list p { display: flex; flex-direction: column; margin: 0; }.validation-list b { font-size: 11px; }.validation-list small { color: var(--muted); font-size: 9px; margin-top: 3px; line-height: 1.4; }.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 20px; }.form-actions form { margin: 0; }

.stack-form { display: flex; flex-direction: column; gap: 14px; }.sticky-card { position: sticky; top: 110px; }.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }.integration-card { padding: 24px; }.integration-brand { display: flex; gap: 13px; align-items: center; }.integration-brand > span { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-size: 18px; font-weight: 850; }.integration-brand.wetalkie > span { background: linear-gradient(135deg,#7059e8,#4638a6); }.integration-brand.cnn > span { background: linear-gradient(135deg,#1688d7,#0c5e9b); }.integration-brand h2 { margin: 0; font-size: 16px; }.integration-brand p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }.integration-status { display: flex; justify-content: space-between; align-items: center; margin: 17px 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.integration-status small { color: var(--muted); font-size: 9px; }

.auth-page { display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr); background: #fff; }
.auth-visual { background: radial-gradient(circle at 15% 10%, rgba(31,194,148,.24), transparent 32%), linear-gradient(145deg, #101d35 0%, #162b4a 100%); padding: 46px 7vw; color: #fff; display: flex; flex-direction: column; min-height: 100vh; }.auth-brand { display: flex; align-items: center; gap: 13px; }.auth-brand > div { display: flex; flex-direction: column; }.auth-brand strong { font-size: 22px; }.auth-brand small { color: #8fa3bc; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.auth-message { margin: auto 0 45px; max-width: 580px; }.auth-message .eyebrow { color: #4addb1; }.auth-message h1 { font-size: clamp(36px, 4vw, 58px); line-height: 1.04; letter-spacing: -.055em; margin: 18px 0; }.auth-message p { color: #afbed1; font-size: 16px; line-height: 1.55; }.mini-flow { display: flex; align-items: center; gap: 12px; color: #9cb0c7; font-size: 10px; }.mini-flow span { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); border-radius: 8px; padding: 8px 10px; }.mini-flow i { font-style: normal; color: #32cfa0; }
.auth-panel { display: grid; place-items: center; min-height: 100vh; padding: 35px; }.auth-card { width: min(420px, 100%); }.auth-card h2 { font-size: 27px; letter-spacing: -.04em; margin: 0; }.auth-card > p { color: var(--muted); margin: 8px 0 26px; }.auth-card label { margin-bottom: 15px; }.auth-card input { min-height: 48px; }.auth-card .button { min-height: 49px; margin-top: 4px; }.secure-note { display: block; color: #98a2b3; text-align: center; font-size: 10px; margin-top: 14px; }.mobile-brand { display: none; }

.install-page { background: #eef3f8; padding: 35px 18px; }.install-wrap { max-width: 900px; margin: 0 auto; }.install-header { display: flex; align-items: center; gap: 15px; margin-bottom: 22px; }.install-header h1 { margin: 0; font-size: 26px; letter-spacing: -.04em; }.install-header p { color: var(--muted); margin: 4px 0 0; }.requirements { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }.requirement { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; color: var(--muted); }.requirement b { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; }.requirement.ok b { color: #fff; background: var(--green); }.requirement.warning b { color: #fff; background: var(--orange); }.step { width: 28px; height: 28px; border-radius: 9px; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-size: 11px; font-weight: 850; }.form-grid { display: grid; gap: 15px; }.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }.form-grid .span-two { grid-column: span 2; }

.error-page { display: grid; place-items: center; text-align: center; background: var(--navy); color: #fff; }.error-page main { max-width: 560px; padding: 30px; }.error-page main > strong { display: block; font-size: 70px; letter-spacing: -.06em; margin-top: 18px; color: #30d0a0; }.error-page h1 { font-size: 20px; font-weight: 500; color: #c7d2df; line-height: 1.5; margin: 5px 0 25px; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .content-grid.two-thirds, .users-grid { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
    .validation-list { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 40px rgba(0,0,0,.2); }.sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; width: 100%; }.sidebar-toggle { display: block; }.topbar { min-height: 72px; padding: 14px 17px; }.topbar h1 { font-size: 18px; }.page-content { padding: 18px 14px 40px; }
    .auth-page { display: block; }.auth-visual { display: none; }.auth-panel { padding: 25px; }.mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; font-size: 19px; }
    .integration-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.metric-card { padding: 14px; }.metric-card strong { font-size: 19px; }
    .toolbar { align-items: stretch; flex-direction: column; }.filter-form { align-items: stretch; }.filter-form label, .filter-form .search-field { min-width: 0; flex: 1 1 100%; }.toolbar > .button { width: 100%; }
    .funnel-flow { justify-content: flex-start; }.card { padding: 15px; border-radius: 13px; }.form-grid.two { grid-template-columns: 1fr; }.form-grid .span-two { grid-column: auto; }.preview-period { align-items: flex-start; flex-direction: column; gap: 5px; }.form-actions { flex-direction: column-reverse; }.form-actions > *, .form-actions form, .form-actions .button { width: 100%; }.install-page { padding: 20px 10px; }
}

