* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #182230;
}

body.menu-open {
    overflow: hidden;
}

.shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
}

.side {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: #111827;
    color: #cbd5e1;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.brand {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0 8px 18px;
    border-bottom: 1px solid #263244;
}

.brand-logo-wrap {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 11px;
    overflow: hidden;
    background: #fff;
    display: grid;
    place-items: center;
}

.brand-logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-logo-fallback {
    width: 100%;
    height: 100%;
    display: none;
    place-items: center;
    background: #fff;
    color: #111827;
    font-weight: 800;
}

.brand-copy {
    min-width: 0;
}

.brand b,
.brand small {
    display: block;
}

.brand small {
    font-size: 11px;
    color: #7f8ba0;
}

.demo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7px;
    border-radius: 999px;
    background: #edf1f5;
    color: #586577;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .08em;
}

.sidebar-demo-badge {
    margin-left: auto;
    background: #243044;
    color: #aeb9c9;
}

.side nav {
    flex: 1;
    padding-top: 14px;
}

.side section {
    margin-bottom: 18px;
}

.side label {
    display: block;
    padding: 0 10px 7px;
    color: #6f7c90;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.side a {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
}

.side a:hover {
    background: #1f2937;
    color: #fff;
}

.side a.active {
    background: #fff;
    color: #111827;
    font-weight: 750;
}

.side a.active:hover {
    background: #fff;
    color: #111827;
}

.side a.locked {
    opacity: .42;
    pointer-events: none;
}

.sidebar-user {
    padding: 12px 8px;
    border-top: 1px solid #263244;
}

.sidebar-user b,
.sidebar-user small {
    display: block;
}

.sidebar-user small {
    margin-top: 3px;
    color: #7f8ba0;
    font-size: 10px;
}

.side footer {
    padding: 12px 8px 0;
    border-top: 1px solid #263244;
    color: #6f7c90;
    font-size: 11px;
}

main {
    min-width: 0;
}

.top {
    min-height: 72px;
    background: #fff;
    border-bottom: 1px solid #e5e9ef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 12px 28px;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.top b,
.top small {
    display: block;
}

.top small {
    color: #7c8798;
    font-size: 11px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.top-actions form,
.package-control {
    display: flex;
    align-items: center;
    gap: 7px;
}

.top-actions span,
.package-control > span {
    color: #7c8798;
    font-size: 11px;
    white-space: nowrap;
}

.top select,
.filter-bar select,
.login-language select {
    height: 36px;
    border: 1px solid #dce2e9;
    border-radius: 8px;
    background: #fff;
    padding: 0 10px;
    color: #182230;
}

.top select:disabled {
    background: #f7f8fa;
    color: #5d6878;
    opacity: 1;
}

.user-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid #e6eaf0;
}

.user-name {
    color: #182230 !important;
    font-weight: 700;
}

.logout-button,
.filter-bar button,
.login-form button,
.button-link {
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: #182230;
    color: #fff;
    padding: 0 14px;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
}

.logout-button {
    background: transparent;
    color: #687588;
    padding: 0 6px;
    font-size: 11px;
}

.menu-toggle,
.mobile-close {
    display: none;
}

.mobile-overlay {
    display: none;
}

.content {
    width: 100%;
    max-width: 1460px;
    margin: auto;
    padding: 28px;
}

.head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.head em,
.card em {
    color: #6c7789;
    font-style: normal;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.head h1 {
    margin: 4px 0;
    font-size: 28px;
}

.head p,
.card p {
    margin: 0;
    color: #728095;
    font-size: 13px;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.kpi,
.card {
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 13px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.kpi {
    min-width: 0;
    padding: 18px;
}

.kpi small,
.kpi span {
    display: block;
    color: #778396;
}

.kpi small {
    font-size: 12px;
    font-weight: 650;
}

.kpi strong {
    display: block;
    margin: 8px 0 3px;
    font-size: clamp(22px, 2vw, 28px);
    overflow-wrap: anywhere;
}

.kpi span {
    font-size: 11px;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.grid.wide {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, .8fr);
}

.card {
    min-width: 0;
    padding: 18px;
    margin-bottom: 16px;
}

.card h3 {
    margin: 0 0 14px;
    font-size: 15px;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.card-title-row h3 {
    margin: 0;
}

.card-title-row a,
.card a {
    color: #4b5a70;
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
}

.bars {
    height: 180px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    overflow: hidden;
}

.bars i {
    display: block;
    flex: 1;
    max-width: 26px;
    min-width: 4px;
    background: #263346;
    border-radius: 5px 5px 2px 2px;
}

.enterprise-bars i:nth-child(3n + 2) {
    opacity: .78;
}

.flow {
    min-height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #8290a3;
}

.flow span {
    border: 1px solid #e0e5eb;
    border-radius: 8px;
    padding: 10px 11px;
    color: #253044;
    font-size: 12px;
    font-weight: 650;
}

.flow.vertical {
    flex-direction: column;
}

.line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #eef1f4;
}

.line:last-child {
    border-bottom: 0;
}

.big {
    font-size: 28px;
    font-weight: 800;
}

.progress,
.metric-bar,
.heatmap-track {
    height: 8px;
    background: #edf0f4;
    border-radius: 99px;
    overflow: hidden;
}

.progress {
    margin: 14px 0;
}

.progress i,
.metric-bar i,
.heatmap-track i {
    display: block;
    height: 100%;
    background: #243246;
}

.tag,
.status,
.priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
}

.tag {
    padding: 5px 8px;
    background: #edf1f5;
    font-size: 10px;
}

.tag.new {
    background: #edf5ff;
    color: #245ea8;
}

.tag.active,
.status.active,
.status.redeemed,
.status.online,
.status.resolved {
    background: #edf9f1;
    color: #237044;
}

.tag.at_risk,
.status.warning,
.status.degraded,
.status.paused,
.priority.medium {
    background: #fff5dc;
    color: #8a5d00;
}

.tag.lost,
.status.offline,
.status.critical,
.priority.high {
    background: #fff0f0;
    color: #a33d3d;
}

.tag.loyal {
    background: #f2edff;
    color: #6941c6;
}

.tag.large,
.status.large {
    padding: 7px 12px;
    font-size: 11px;
}

.status {
    padding: 4px 7px;
    background: #edf1f5;
    color: #586577;
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.status.info {
    background: #edf5ff;
    color: #245ea8;
}

.priority {
    padding: 5px 8px;
    font-size: 10px;
}

.priority.low {
    background: #edf9f1;
    color: #237044;
}

.dark {
    background: #182230;
    border-color: #182230;
    color: #fff;
}

.dark p {
    color: #b4becb;
}

.dark a {
    color: #fff;
}

.alert,
.attention-row {
    border-radius: 9px;
    margin: 8px 0;
    font-size: 12px;
}

.alert {
    padding: 11px;
}

.alert.bad {
    background: #fff1f1;
    color: #9f3030;
}

.alert.warn {
    background: #fff7e7;
    color: #8a5d00;
}

.attention-row {
    padding: 11px 12px;
    border: 1px solid #edf0f4;
}

.attention-row.critical {
    border-left: 3px solid #a33d3d;
}

.attention-row.warning {
    border-left: 3px solid #b17a0c;
}

.attention-row b,
.attention-row small {
    display: block;
    margin-top: 5px;
}

.attention-row small {
    color: #7d8999;
}

.search,
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 14px;
}

.search input,
.login-form input {
    width: 380px;
    max-width: 100%;
    height: 38px;
    border: 1px solid #dce2e9;
    border-radius: 8px;
    padding: 0 12px;
}

.search button {
    border: 0;
    background: #182230;
    color: #fff;
    border-radius: 8px;
    padding: 0 16px;
}

.filter-bar label,
.login-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-bar label span,
.login-form label span {
    color: #687588;
    font-size: 11px;
    font-weight: 650;
}

.back {
    display: inline-block;
    margin-bottom: 12px;
    color: #697688;
    font-size: 12px;
    text-decoration: none;
}

.table-card {
    overflow: hidden;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th {
    text-align: left;
    padding: 10px;
    color: #788496;
    font-size: 10px;
    text-transform: uppercase;
    border-bottom: 1px solid #e8ecf1;
    white-space: nowrap;
}

td {
    padding: 11px 10px;
    border-bottom: 1px solid #eef1f4;
    vertical-align: middle;
}

td small {
    display: block;
    color: #8b95a4;
    margin-top: 3px;
}

.click {
    cursor: pointer;
}

.click:hover {
    background: #fafbfd;
}

.metric-positive {
    color: #237044;
    font-weight: 700;
}

.metric-negative {
    color: #a33d3d;
    font-weight: 700;
}

.event {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) 125px;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    border-bottom: 1px solid #eef1f4;
}

.event i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #506176;
}

.event b,
.event span {
    display: block;
    font-size: 12px;
}

.event span {
    color: #7b8798;
    font-size: 11px;
}

.event time {
    color: #8994a4;
    font-size: 10px;
    text-align: right;
}

.voucher {
    margin-top: 10px;
    padding: 12px;
    border-radius: 9px;
    background: #f8fafc;
}

.voucher b,
.voucher span,
.voucher small {
    display: block;
}

.voucher span {
    margin: 3px 0;
    color: #697688;
    font-size: 9px;
    font-weight: 800;
}

.voucher small {
    color: #7e8999;
}

.empty {
    text-align: center;
    padding: 60px 20px;
}

.upgrade-card {
    max-width: 620px;
    margin: 80px auto;
}

.button-link {
    display: inline-flex;
    align-items: center;
    margin-top: 18px;
}

.metric-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 55px;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 12px;
}

.metric-row b {
    text-align: right;
}

.segment-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.segment-card {
    margin: 0;
}

.segment-card strong {
    display: block;
    margin: 13px 0 2px;
    font-size: 28px;
}

.segment-card small {
    color: #7c8798;
}

.large-progress {
    height: 12px;
}

.automation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.automation-card {
    margin: 0;
}

.automation-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.automation-head h3 {
    margin-top: 10px;
}

.automation-card dl {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    margin: 12px 0 0;
}

.automation-card dt,
.automation-card dd {
    padding: 8px 0;
    border-top: 1px solid #eef1f4;
    font-size: 11px;
}

.automation-card dt {
    color: #7c8798;
}

.automation-card dd {
    margin: 0;
    font-weight: 650;
    text-transform: capitalize;
}

.toggle {
    width: 38px;
    height: 22px;
    border-radius: 99px;
    background: #d8dee7;
    padding: 3px;
}

.toggle i {
    display: block;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px #999;
}

.toggle.on {
    background: #263346;
}

.toggle.on i {
    margin-left: 16px;
}

.recommendation {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #eef1f4;
}

.recommendation:last-child {
    border-bottom: 0;
}

.recommendation h4 {
    margin: 0 0 6px;
}

.recommendation p {
    font-size: 12px;
}

.cohort-table td,
.cohort-table th {
    text-align: right;
}

.cohort-table td:first-child,
.cohort-table th:first-child {
    text-align: left;
}

.region-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.region-card {
    padding: 14px;
    border: 1px solid #e6eaf0;
    border-radius: 10px;
    background: #fafbfd;
}

.region-card span,
.region-card strong,
.region-card small {
    display: block;
}

.region-card span {
    color: #687588;
    font-size: 11px;
}

.region-card strong {
    margin: 7px 0 4px;
    font-size: 24px;
}

.region-card small {
    color: #8a95a4;
}

.hour-bars {
    max-height: 230px;
    overflow-y: auto;
}

.hour-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 10px;
}

.hour-row b {
    text-align: right;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.heatmap-card {
    display: block;
    padding: 16px;
    border: 1px solid #e3e8ef;
    border-radius: 13px;
    background: #fff;
    color: #182230;
    text-decoration: none;
}

.heatmap-card:hover {
    border-color: #c9d1dc;
    box-shadow: 0 3px 10px rgba(16, 24, 40, .05);
}

.heatmap-card-head,
.heatmap-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.heatmap-card-head b,
.heatmap-card-head small {
    display: block;
}

.heatmap-card-head small,
.heatmap-meta {
    color: #7e8999;
    font-size: 10px;
}

.heatmap-track {
    height: 12px;
    margin: 18px 0 10px;
}

.heatmap-track i {
    background: #243246;
}

.context-card {
    margin-top: 0;
}

.login-page {
    min-height: 100vh;
    background: #f3f6fa;
}

.login-language {
    position: fixed;
    top: 20px;
    right: 24px;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px 16px;
}

.login-card {
    width: min(420px, 100%);
    padding: 34px;
    border: 1px solid #e0e6ed;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 50px rgba(29, 41, 57, .08);
}

.login-brand {
    text-align: center;
    margin-bottom: 26px;
}

.brand-logo-login {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 18px;
}

.login-brand h1 {
    margin: 0;
    font-size: 26px;
}

.login-brand p {
    margin: 4px 0 12px;
    color: #768396;
    font-size: 12px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-form input {
    width: 100%;
    height: 42px;
}

.login-form button {
    height: 42px;
    margin-top: 4px;
}

.login-error {
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 8px;
    background: #fff0f0;
    color: #a33d3d;
    font-size: 12px;
}

.login-note {
    margin: 16px 0 0;
    color: #8b95a4;
    font-size: 10px;
    text-align: center;
}

@media (max-width: 1100px) {
    .shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid,
    .grid.wide {
        grid-template-columns: 1fr;
    }

    .segment-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .heatmap-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .shell {
        display: block;
    }

    .side {
        position: fixed;
        left: 0;
        top: 0;
        width: min(320px, 86vw);
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 14px 0 36px rgba(16, 24, 40, .24);
    }

    .side.mobile-open {
        transform: translateX(0);
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: block;
        background: rgba(13, 22, 35, .52);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .mobile-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    .mobile-close {
        display: block;
        margin-left: 4px;
        border: 0;
        background: transparent;
        color: #a9b4c5;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
    }

    .menu-toggle {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        border: 1px solid #dce2e9;
        border-radius: 9px;
        background: #fff;
        display: grid;
        align-content: center;
        gap: 4px;
        padding: 0 10px;
        cursor: pointer;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        border-radius: 99px;
        background: #283649;
    }

    .top {
        align-items: center;
        padding: 10px 14px;
    }

    .top-actions {
        gap: 8px;
    }

    .top-actions > form > span,
    .package-control > span,
    .user-name {
        display: none;
    }

    .user-control {
        padding-left: 4px;
        border-left: 0;
    }

    .content {
        padding: 18px;
    }

    .automation-grid {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 760px;
    }

    .table-scroll table {
        min-width: 760px;
    }

    .card {
        overflow-x: auto;
    }
}

@media (max-width: 640px) {
    .top {
        flex-wrap: wrap;
    }

    .top-left {
        width: 100%;
    }

    .top-actions {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .top select {
        height: 34px;
        max-width: 130px;
    }

    .content {
        padding: 14px;
    }

    .head h1 {
        font-size: 24px;
    }

    .kpis {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .kpi {
        padding: 14px;
    }

    .kpi strong {
        font-size: 22px;
    }

    .segment-grid,
    .region-grid,
    .heatmap-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .filter-bar label {
        flex: 1 1 130px;
    }

    .filter-bar button {
        align-self: flex-end;
    }

    .event {
        grid-template-columns: 14px minmax(0, 1fr);
    }

    .event time {
        grid-column: 2;
        text-align: left;
        padding-bottom: 8px;
    }

    .recommendation {
        grid-template-columns: 1fr;
    }

    .login-language {
        top: 12px;
        right: 12px;
    }

    .login-card {
        padding: 26px 20px;
    }
}

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

    .top-actions {
        gap: 5px;
    }

    .logout-button {
        font-size: 10px;
    }
}

/* v0.5 Enterprise completion */
.report-grid,
.integration-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.report-card,
.integration-card {
    height: 100%;
}

.report-card h3,
.integration-card h3 {
    margin-top: 10px;
    margin-bottom: 8px;
}

.report-card p,
.integration-card p {
    min-height: 44px;
}

.report-metric {
    margin: 18px 0;
    font-size: 24px;
    font-weight: 800;
}

.report-metric span {
    color: #778396;
    font-size: 11px;
    font-weight: 600;
}

.button-link.compact {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 11px;
    font-size: 11px;
}

.integration-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.integration-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #eef2f7;
    color: #27364b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
}

.integration-meta,
.table-sub,
.muted {
    display: block;
    color: #7c8798;
    font-size: 10px;
}

.integration-meta {
    margin-top: 14px;
}

.inline-form {
    margin: 0;
}

.mini-button {
    min-height: 30px;
    border: 1px solid #d9e0e8;
    border-radius: 7px;
    background: #fff;
    color: #344054;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.mini-button:hover {
    background: #f5f7fa;
}

.status.neutral {
    background: #eef1f5;
    color: #667085;
}

.permission-cell {
    text-align: center;
    font-size: 15px;
    font-weight: 800;
}

.settings-form {
    margin: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.settings-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.settings-grid label > span {
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.settings-grid input,
.settings-grid select {
    width: 100%;
    height: 40px;
    border: 1px solid #dce2e9;
    border-radius: 8px;
    background: #fff;
    color: #182230;
    padding: 0 11px;
}

.notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 650;
}

.notice.success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}

code {
    color: #475467;
    background: #f2f4f7;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 11px;
}

@media (max-width: 1180px) {
    .report-grid,
    .integration-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .report-grid,
    .integration-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .report-card p,
    .integration-card p {
        min-height: 0;
    }
}


/* v0.6.0 - Starter analytics refresh */
.kpi {
    position: relative;
    overflow: hidden;
}

.kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #dfe6ee;
}

.kpi-blue::before {
    background: #3b82f6;
}

.kpi-cyan::before {
    background: #06b6d4;
}

.kpi-green::before {
    background: #22a06b;
}

.kpi-purple::before {
    background: #8b5cf6;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 10px;
}

.kpi-trend b {
    font-size: 10px;
}

.kpi-trend span {
    font-size: 10px;
    color: #8a95a6;
}

.kpi-trend.up b {
    color: #237a52;
}

.kpi-trend.down b {
    color: #b54747;
}

.chart-card {
    overflow: hidden;
}

.chart-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
}

.chart-wrap-lg {
    height: 300px;
}

.chart-wrap-donut {
    height: 245px;
}

.chart-wrap-pattern {
    height: 310px;
    min-width: 720px;
}

.chart-legend-note {
    color: #8a95a6;
    font-size: 11px;
    white-space: nowrap;
}

.customer-mix-card {
    display: flex;
    flex-direction: column;
}

.customer-mix-summary {
    display: grid;
    gap: 9px;
    margin-top: 6px;
}

.customer-mix-summary span {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #687588;
    font-size: 11px;
}

.customer-mix-summary b {
    margin-left: auto;
    color: #263346;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-cyan {
    background: #06b6d4;
}

.dot-green {
    background: #22a06b;
}

.traffic-pattern-title {
    flex-wrap: wrap;
}

.chart-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid #e2e8ef;
    border-radius: 9px;
    background: #f7f9fb;
}

.chart-tab {
    border: 0;
    border-radius: 7px;
    padding: 7px 12px;
    background: transparent;
    color: #6d798b;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.chart-tab.active {
    background: #ffffff;
    color: #223249;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .10);
}

.chart-scroll-mobile {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.insight-list {
    display: grid;
    gap: 10px;
}

.insight-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 12px;
    padding: 11px 12px;
    border: 1px solid #edf1f5;
    border-radius: 10px;
    background: #fafcfe;
}

.insight-row span {
    color: #728095;
    font-size: 11px;
}

.insight-row b {
    color: #223249;
    font-size: 14px;
}

.insight-row small {
    grid-column: 1 / -1;
    color: #8a95a6;
    font-size: 10px;
}

.starter-journey {
    min-height: 115px;
}

.campaign-filter-card {
    padding-bottom: 14px;
}

.campaign-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.campaign-filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.campaign-filter-bar label span {
    color: #687588;
    font-size: 11px;
    font-weight: 650;
}

.campaign-filter-bar input,
.campaign-filter-bar select {
    height: 38px;
    border: 1px solid #dce2e9;
    border-radius: 8px;
    background: #fff;
    padding: 0 11px;
    color: #263346;
}

.campaign-search-field {
    flex: 1 1 240px;
}

.campaign-search-field input {
    width: 100%;
}

.campaign-filter-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.button-primary,
.button-secondary,
.button-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 8px;
    padding: 0 12px;
    border: 1px solid #dbe2ea;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.button-primary {
    border-color: #263346;
    background: #263346;
    color: #fff;
}

.button-secondary {
    background: #fff;
    color: #46566d;
}

.button-mini {
    min-height: 30px;
    padding: 0 9px;
    background: #f5f8fb;
    color: #31506f;
    white-space: nowrap;
}

.button-mini.disabled {
    opacity: .45;
    cursor: default;
}

.empty-row {
    padding: 30px;
    text-align: center;
    color: #8994a4;
}

.status.ended {
    background: #eef1f4;
    color: #687588;
}

.traffic-chart {
    width: 100%;
}

.traffic-axis-x {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
}

.traffic-axis-item {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 11px;
    color: #7b879b;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .chart-wrap-lg {
        height: 260px;
    }

    .chart-wrap-pattern {
        height: 280px;
    }

    .campaign-filter-bar {
        align-items: stretch;
    }

    .campaign-filter-bar label {
        flex: 1 1 160px;
    }

    .campaign-filter-actions {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .starter-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .chart-wrap-donut {
        height: 220px;
    }

    .chart-tabs {
        width: 100%;
    }

    .chart-tab {
        flex: 1;
    }

    .campaign-filter-actions > * {
        flex: 1 1 auto;
    }
}
