@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@400;600;700;800&family=Vazirmatn:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   KABUL PRO — DASHBOARD UI
   Refined light theme. A single indigo/violet accent carries interaction;
   platform and metric colour appears only as small marks, never as slabs.
   Layout mechanics (sidebar shell, sticky bar, RTL mirroring, breakpoints)
   are preserved exactly — this file changes the design language, not the
   structure the markup and JS depend on.
   ========================================================================== */

:root {
    /* Surfaces */
    --kp-canvas:        #F5F7FA;
    --kp-surface:       #FFFFFF;
    --kp-surface-sunk:  #F7F9FC;
    --kp-surface-hover: #F1F4F9;

    /* Text */
    --kp-text:          #141B2D;
    --kp-text-soft:     #5A6678;
    --kp-text-muted:    #8C97A8;

    /* Lines */
    --kp-border:        #E4E8EF;
    --kp-border-strong: #D3D9E3;

    /* Accent — indigo / violet */
    --kp-accent:        #5B5BD6;
    --kp-accent-hover:  #4B4BC4;
    --kp-accent-press:  #3E3EAF;
    --kp-accent-soft:   #F0F0FE;
    --kp-accent-line:   #DCDCFA;

    /* Semantic — each role has soft (fill), line (border) and hover variants
       so markup utilities can map onto tokens instead of raw palette hues. */
    --kp-success:       #0E9F6E;
    --kp-success-soft:  #E9F9F1;
    --kp-success-line:  #A7F3D0;
    --kp-success-hover: #0B7F58;
    --kp-warn:          #B45309;
    --kp-warn-soft:     #FFF7ED;
    --kp-warn-line:     #FDE68A;
    --kp-warn-hover:    #92400E;
    --kp-danger:        #DC2626;
    --kp-danger-soft:   #FEF2F2;
    --kp-danger-line:   #FBD5D5;
    --kp-danger-hover:  #B91C1C;

    /* Platform marks — dots and icons only */
    --kp-ig:            #D6336C;
    --kp-fb:            #1877F2;
    --kp-yt:            #E5322D;
    --kp-th:            #141B2D;
    --kp-ai:            #7C3AED;

    /* Elevation — layered and soft */
    --kp-shadow-xs: 0 1px 2px rgba(20, 27, 45, .04);
    --kp-shadow-sm: 0 1px 2px rgba(20, 27, 45, .04), 0 1px 3px rgba(20, 27, 45, .05);
    --kp-shadow-md: 0 2px 4px rgba(20, 27, 45, .03), 0 6px 16px rgba(20, 27, 45, .06);
    --kp-shadow-lg: 0 4px 8px rgba(20, 27, 45, .04), 0 16px 40px rgba(20, 27, 45, .10);
    --kp-ring: 0 0 0 3px rgba(91, 91, 214, .16);

    /* Geometry — three radii only (plus 9999px for true pills) */
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 14px;
}

/* --- Base ---------------------------------------------------------------- */

body {
    font-family: 'Inter', 'Vazirmatn', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--kp-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
}

/* Dari/Farsi shapes correctly in Vazirmatn.
   Deliberately NOT using :lang(fa) here — applyDashboardLanguage() sets
   documentElement.lang="fa-AF", so :lang(fa) matches *every* element,
   including <i class="fa-solid">, and overrides Font Awesome's own
   font-family (same specificity, but this file loads later). That blanked
   out every icon in Dari. Scope it to text containers instead. */
.lang-dari,
.lang-dari input,
.lang-dari textarea,
.lang-dari button,
.lang-dari select,
.lang-dari option {
    font-family: 'Vazirmatn', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* Re-assert the icon fonts so no language rule can strip them. Higher
   specificity than the .lang-dari selectors above, and it must repeat the
   weights Font Awesome relies on to pick the right glyph face. */
.lang-dari .fa,
.lang-dari .fas,
.lang-dari .fa-solid,
.lang-dari .far,
.lang-dari .fa-regular,
.lang-dari .fab,
.lang-dari .fa-brands,
.lang-dari [class*=" fa-"],
.lang-dari [class^="fa-"] {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands';
}

.lang-dari .fas,
.lang-dari .fa-solid { font-family: 'Font Awesome 6 Free'; font-weight: 900; }

.lang-dari .far,
.lang-dari .fa-regular { font-family: 'Font Awesome 6 Free'; font-weight: 400; }

.lang-dari .fab,
.lang-dari .fa-brands { font-family: 'Font Awesome 6 Brands'; font-weight: 400; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #C7CEDA;
    border-radius: 9999px;
    border: 3px solid var(--kp-canvas);
}
::-webkit-scrollbar-thumb:hover { background: #AEB7C6; }

::selection { background: var(--kp-accent-soft); color: var(--kp-accent-press); }

:focus-visible { outline: none; box-shadow: var(--kp-ring); border-radius: var(--r-sm); }

@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
.animate-ticker { white-space: nowrap; animation: ticker 28s linear infinite; }
.ticker-wrap { overflow: hidden; width: 100%; }

/* --- Z-index hierarchy (order preserved) --------------------------------- */

#newsBar             { z-index: 40; }
#settingsModal       { z-index: 60; }
#pickerModal         { z-index: 70; }
#accountModal        { z-index: 80; }
#helpModal           { z-index: 85; }
#metaPrepModal       { z-index: 90; }
#metaPagePickerModal { z-index: 95; }
#login-screen, #signup-screen { z-index: 100; }
#recoveryModal       { z-index: 110; }
#termsModal          { z-index: 120; }

/* --- Help center --------------------------------------------------------- */

body.help-center-open { overflow: hidden; }

.help-center-shell {
    width: min(1180px, 100%);
    height: min(820px, calc(100vh - 2rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--kp-surface);
    border: 1px solid var(--kp-border);
    border-radius: var(--r-lg);
    box-shadow: var(--kp-shadow-lg);
}

.help-center-header {
    min-height: 84px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(240px, 360px) 40px;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--kp-border);
    background: var(--kp-surface);
}

.help-center-heading,
.help-guide-intro {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.help-center-mark,
.help-guide-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    color: var(--kp-accent);
    background: var(--kp-accent-soft);
    border: 1px solid var(--kp-accent-line);
    border-radius: var(--r-sm);
}

.help-center-heading h2 {
    margin: 0;
    color: var(--kp-text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
}

.help-center-heading p {
    margin: 3px 0 0;
    color: var(--kp-text-soft);
    font-size: 12px;
    line-height: 1.45;
}

.help-search {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-inline: 13px;
    color: var(--kp-text-muted);
    background: var(--kp-surface-sunk);
    border: 1px solid var(--kp-border);
    border-radius: var(--r-sm);
}

.help-search:focus-within {
    border-color: var(--kp-accent);
    box-shadow: var(--kp-ring);
}

.help-search input {
    width: 100%;
    min-width: 0;
    color: var(--kp-text);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 13px;
}

.help-search input::placeholder { color: var(--kp-text-muted); }

.help-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--kp-text-soft);
    border: 1px solid var(--kp-border);
    border-radius: var(--r-sm);
    background: var(--kp-surface);
    transition: background-color .15s ease, color .15s ease;
}

.help-close:hover { color: var(--kp-text); background: var(--kp-surface-hover); }

.help-center-layout {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
}

.help-topic-nav {
    min-height: 0;
    overflow-y: auto;
    padding: 16px 12px 24px;
    background: var(--kp-surface-sunk);
    border-inline-end: 1px solid var(--kp-border);
}

.help-nav-group + .help-nav-group { margin-top: 20px; }

.help-nav-group h3 {
    margin: 0 10px 7px;
    color: var(--kp-text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.help-topic-button {
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    color: var(--kp-text-soft);
    text-align: start;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.help-topic-button:hover { color: var(--kp-text); background: var(--kp-surface-hover); }
.help-topic-button.is-active {
    color: var(--kp-accent-press);
    background: var(--kp-accent-soft);
    border-color: var(--kp-accent-line);
    font-weight: 700;
}

.help-topic-button i { text-align: center; }
.help-topic-button span { min-width: 0; font-size: 12px; line-height: 1.35; }
.help-topic-button small {
    padding: 2px 5px;
    color: var(--kp-accent-press);
    background: var(--kp-surface);
    border: 1px solid var(--kp-accent-line);
    border-radius: 9999px;
    font-size: 9px;
    font-weight: 800;
}

.help-topic-content {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 30px clamp(24px, 4vw, 54px) 44px;
    background: var(--kp-surface);
}

.help-guide { width: min(820px, 100%); margin-inline: auto; }
.help-guide-intro { margin-bottom: 22px; }
.help-guide-label {
    margin-bottom: 3px;
    color: var(--kp-accent);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.help-guide-intro h3 {
    margin: 0;
    color: var(--kp-text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
}

.help-guide-intro p {
    margin: 7px 0 0;
    color: var(--kp-text-soft);
    font-size: 14px;
    line-height: 1.65;
}

.help-guide-figure {
    margin: 0 0 28px;
    overflow: hidden;
    background: var(--kp-surface-sunk);
    border: 1px solid var(--kp-border);
    border-radius: var(--r-sm);
}

.help-guide-figure img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 8.6;
    object-fit: cover;
    object-position: top center;
}

.help-guide-figure figcaption {
    padding: 8px 12px;
    color: var(--kp-text-muted);
    font-size: 10px;
    border-top: 1px solid var(--kp-border);
}

.help-step-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--kp-text);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.help-step-heading i { color: var(--kp-accent); }
.help-steps { margin: 0; padding: 0; list-style: none; }
.help-steps li {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--kp-border);
}

.help-step-number {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--kp-accent-press);
    background: var(--kp-accent-soft);
    border: 1px solid var(--kp-accent-line);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 800;
}

.help-steps h4 { margin: 0; color: var(--kp-text); font-size: 13px; font-weight: 700; line-height: 1.45; }
.help-steps p { margin: 3px 0 0; color: var(--kp-text-soft); font-size: 12px; line-height: 1.65; }

.help-tip {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    margin-top: 12px;
    padding: 13px 14px;
    color: var(--kp-warn);
    background: var(--kp-warn-soft);
    border: 1px solid var(--kp-warn-line);
    border-radius: var(--r-sm);
}

.help-tip i { margin-top: 2px; text-align: center; }
.help-tip p { margin: 0; color: var(--kp-text-soft); font-size: 12px; line-height: 1.6; }

.help-open-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 20px;
    padding: 10px 16px;
    color: #fff;
    background: var(--kp-accent);
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 800;
    transition: background-color .15s ease;
}

.help-open-action:hover { background: var(--kp-accent-hover); }
.help-no-results { margin: 10px; color: var(--kp-text-soft); font-size: 12px; line-height: 1.6; }
.help-empty-state {
    min-height: 320px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    color: var(--kp-text-muted);
    text-align: center;
}
.help-empty-state i { font-size: 28px; }
.help-empty-state p { margin: 0; font-size: 13px; }

@media (max-width: 760px) {
    .help-center-shell { height: 100%; border: 0; border-radius: 0; }
    .help-center-header {
        min-height: 0;
        grid-template-columns: minmax(0, 1fr) 40px;
        gap: 12px;
        padding: 13px 14px;
    }
    .help-center-heading p { display: none; }
    .help-center-mark { width: 36px; height: 36px; flex-basis: 36px; }
    .help-search { grid-column: 1 / -1; grid-row: 2; }
    .help-close { grid-column: 2; grid-row: 1; }
    .help-center-layout { display: flex; flex-direction: column; }
    .help-topic-nav {
        flex: 0 0 auto;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px 12px;
        border-inline-end: 0;
        border-bottom: 1px solid var(--kp-border);
    }
    .help-nav-group { display: flex; gap: 7px; }
    .help-nav-group + .help-nav-group { margin: 0; }
    .help-nav-group h3 { display: none; }
    .help-topic-button {
        width: auto;
        min-width: max-content;
        min-height: 38px;
        grid-template-columns: 18px auto auto;
        padding: 7px 10px;
    }
    .help-topic-content { flex: 1; padding: 22px 17px 36px; }
    .help-guide-intro h3 { font-size: 20px; }
    .help-guide-intro p { font-size: 13px; }
    .help-guide-figure img { aspect-ratio: 16 / 10; }
    .help-open-action { width: 100%; }
}

.lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, .74);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* --- Automations: table -------------------------------------------------- */

.automation-table {
    table-layout: fixed;
    min-width: 760px;
}

.automation-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.automation-target-meta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--kp-text-muted);
}

/* --- Automations: builder ------------------------------------------------ */

.automation-builder-section {
    border: 1px solid var(--kp-border);
    border-radius: var(--r-lg);
    padding: 1.125rem;
    background: var(--kp-surface);
}

.automation-section-heading {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.875rem;
}

.automation-step {
    display: inline-flex;
    height: 1.5rem;
    width: 1.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--kp-accent-soft);
    color: var(--kp-accent);
    font-size: 0.75rem;
    font-weight: 700;
}

.automation-label {
    display: block;
    margin-left: 0.125rem;
    margin-bottom: 0.375rem;
    color: var(--kp-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.automation-input {
    width: 100%;
    border: 1px solid var(--kp-border-strong);
    border-radius: var(--r-md);
    background: var(--kp-surface);
    padding: 0.625rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--kp-text);
    outline: none;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.automation-input::placeholder { color: #A6B0BF; }

.automation-input:focus {
    background: var(--kp-surface);
    border-color: var(--kp-accent);
    box-shadow: var(--kp-ring);
}

.automation-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border: 1px solid var(--kp-border-strong);
    border-radius: var(--r-md);
    background: var(--kp-surface);
    padding: 0.75rem 0.875rem;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.automation-toggle:hover {
    border-color: var(--kp-accent-line);
    background: var(--kp-accent-soft);
}

.automation-toggle input[type="checkbox"] {
    accent-color: var(--kp-accent);
    cursor: pointer;
}

/* --- Tabs (used in-sidebar; grid form kept for narrow layouts) ------------ */

.dashboard-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .dashboard-tabs { width: auto; }
}

.dashboard-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid var(--kp-border);
    border-radius: var(--r-md);
    background: var(--kp-surface);
    color: var(--kp-text-soft);
    padding: 0.65rem 0.8rem;
    font-size: 0.8125rem;
    font-weight: 600;
    min-height: 2.75rem;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.dashboard-tab:hover {
    border-color: var(--kp-accent-line);
    background: var(--kp-accent-soft);
    color: var(--kp-accent);
}

.dashboard-tab.is-active {
    border-color: var(--kp-accent);
    background: var(--kp-accent);
    color: #ffffff;
}

@media (max-width: 480px) {
    .dashboard-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-tab {
        gap: 0.3rem;
        padding: 0.55rem 0.35rem;
        font-size: 0.75rem;
    }
}

.dashboard-view { scroll-margin-top: 5rem; }

/* --- Brand / header shells ----------------------------------------------- */

.app-brand-bar,
.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--kp-border);
    border-radius: var(--r-lg);
    background: var(--kp-surface);
    padding: 1rem 1.25rem;
    box-shadow: var(--kp-shadow-xs);
}

.app-brand-bar {
    margin-bottom: 0.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.dashboard-header { margin-bottom: 1.5rem; }

@media (min-width: 1280px) {
    .app-brand-bar,
    .dashboard-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.kabul-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    flex: 0 0 auto;
    min-width: 0;
}

.kabul-brand-mark {
    height: 2.5rem;
    width: 2.5rem;
    flex: 0 0 auto;
    border-radius: var(--r-md);
}

/* --- Status pills in the header rail ------------------------------------- */

.dashboard-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    font-size: 0.6875rem;
    font-weight: 600;
}

.dashboard-status-row span {
    border-color: var(--kp-border);
    background: var(--kp-surface-sunk);
    color: var(--kp-text-muted);
}

/* --- Header actions ------------------------------------------------------ */

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
}

@media (min-width: 640px) {
    .dashboard-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        width: auto;
    }
}

.dashboard-action,
.dashboard-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    border: 1px solid var(--kp-border-strong);
    border-radius: var(--r-sm);
    background: var(--kp-surface);
    color: var(--kp-text-soft);
    padding: 0.625rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.dashboard-icon-action { width: 2.5rem; padding: 0; }

.dashboard-icon-action.is-refreshing i {
    animation: dashboard-refresh-spin 0.7s linear infinite;
}

@keyframes dashboard-refresh-spin { to { transform: rotate(360deg); } }

.dashboard-action:hover,
.dashboard-icon-action:hover {
    border-color: var(--kp-border-strong);
    background: var(--kp-surface-hover);
    color: var(--kp-text);
}

/* One accent, not four: header actions share the neutral treatment and only
   the primary Configure action carries the accent. */
#languageToggleBtn,
.account-action,
.support-action {
    border-color: var(--kp-border-strong);
    background: var(--kp-surface);
    color: var(--kp-text-soft);
}

#languageToggleBtn:hover,
.account-action:hover,
.support-action:hover {
    background: var(--kp-surface-hover);
    color: var(--kp-text);
}

#clientConfigureBtn {
    border-color: var(--kp-accent);
    background: var(--kp-accent);
    color: #ffffff;
}

#clientConfigureBtn:hover {
    border-color: var(--kp-accent-hover);
    background: var(--kp-accent-hover);
    color: #ffffff;
}

/* --- RTL (Dari) ---------------------------------------------------------- */

.lang-dari { direction: rtl; text-align: right; }

.lang-dari input,
.lang-dari textarea { direction: rtl; text-align: right; }

.lang-dari .ai-text-field {
    unicode-bidi: plaintext;
}

.lang-dari table,
.lang-dari canvas { direction: ltr; text-align: left; }

.lang-dari [dir="auto"] {
    unicode-bidi: plaintext;
    text-align: start;
}

.lang-dari .dashboard-tab,
.lang-dari .automation-section-heading,
.lang-dari .automation-toggle,
.lang-dari .flex { direction: rtl; }

/* --- Badges -------------------------------------------------------------- */

.pro-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--kp-accent-line);
    border-radius: 9999px;
    background: var(--kp-accent-soft);
    color: var(--kp-accent);
    padding: 0.15rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.soon-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--kp-border-strong);
    border-radius: 9999px;
    background: var(--kp-surface-hover);
    color: var(--kp-text-muted);
    padding: 0.15rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

/* --- Config cards -------------------------------------------------------- */

.settings-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-radius: var(--r-lg);
    border: 1px solid var(--kp-border);
    background: var(--kp-surface-hover);
    padding: 0.375rem;
}

.settings-tab {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--r-md);
    color: var(--kp-text-soft);
    font-size: 0.875rem;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.settings-tab:hover {
    color: var(--kp-text);
    background: rgba(255, 255, 255, 0.65);
}

.settings-tab.is-active {
    background: var(--kp-surface);
    color: var(--kp-accent);
    box-shadow: var(--shadow-sm);
}

.settings-workspace-form {
    display: block;
}

.settings-panel {
    display: block;
}

.settings-panel.hidden {
    display: none;
}

.settings-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.settings-panel-heading h3 {
    color: var(--kp-text);
    font-size: 1rem;
    font-weight: 800;
}

.settings-panel-heading p {
    margin-top: 0.25rem;
    color: var(--kp-text-muted);
    font-size: 0.75rem;
}

.config-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--kp-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.config-card {
    border: 1px solid var(--kp-border);
    border-radius: var(--r-lg);
    background: var(--kp-surface);
    padding: 1.125rem;
}

.automation-template-btn,
.sales-tool-chip {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid var(--kp-border);
    border-radius: var(--r-md);
    background: var(--kp-surface);
    color: var(--kp-text-soft);
    font-size: 0.75rem;
    font-weight: 750;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.automation-template-btn:hover,
.sales-tool-chip:hover {
    border-color: var(--kp-accent-line);
    background: var(--kp-accent-soft);
    color: var(--kp-accent);
}

.sales-tool-chip input {
    height: 1rem;
    width: 1rem;
    accent-color: var(--kp-accent);
}

.ai-limit-counter {
    margin-top: 0.25rem;
    color: var(--kp-text-muted);
    font-size: 0.6875rem;
    font-weight: 650;
    text-align: right;
}

.lang-dari .ai-limit-counter {
    text-align: left;
}

.ai-limit-counter.is-near-limit {
    color: var(--kp-warn);
}

@media (max-width: 520px) {
    .settings-tabs {
        grid-template-columns: 1fr;
    }

    .settings-tab {
        justify-content: flex-start;
        padding: 0 0.875rem;
    }
}

/* --- Dashboard shell ----------------------------------------------------- */

#dashboard {
    background: var(--kp-canvas);
    color: var(--kp-text);
}

.dashboard-shell { min-height: 100vh; }

.dashboard-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: 248px;
    flex-direction: column;
    border-right: 1px solid var(--kp-border);
    background: var(--kp-surface);
    padding: 1.25rem 1rem;
}

.sidebar-brand {
    display: flex;
    min-height: 3rem;
    align-items: center;
    gap: 0.7rem;
    padding: 0 0.45rem 1.25rem;
    border-bottom: 1px solid var(--kp-border);
}

.sidebar-close,
.mobile-menu-button {
    display: none;
    height: 2.5rem;
    width: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--kp-border-strong);
    border-radius: var(--r-sm);
    background: var(--kp-surface);
    color: var(--kp-text-soft);
    transition: background-color .15s ease, color .15s ease;
}

.sidebar-close:hover,
.mobile-menu-button:hover { background: var(--kp-surface-hover); color: var(--kp-text); }

.sidebar-close { margin-left: auto; border: 0; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0;
}

.sidebar-label {
    margin: 0 0.7rem 0.55rem;
    color: var(--kp-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.sidebar-label-spaced { margin-top: 1.25rem; }

.dashboard-sidebar .dashboard-tab,
.sidebar-action {
    display: flex;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--kp-text-soft);
    padding: 0.7rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 550;
    text-align: left;
    transition: background-color .15s ease, color .15s ease;
}

.dashboard-sidebar .dashboard-tab i,
.sidebar-action i,
.sidebar-group-title i {
    width: 1.1rem;
    color: var(--kp-text-muted);
    text-align: center;
    transition: color .15s ease;
}

.dashboard-sidebar .dashboard-tab:hover,
.sidebar-action:hover {
    background: var(--kp-surface-hover);
    color: var(--kp-text);
}

.dashboard-sidebar .dashboard-tab:hover i,
.sidebar-action:hover i { color: var(--kp-text-soft); }

.dashboard-sidebar .dashboard-tab.is-active {
    background: var(--kp-accent-soft);
    color: var(--kp-accent);
    font-weight: 650;
    box-shadow: inset 3px 0 0 var(--kp-accent);
}

.dashboard-sidebar .dashboard-tab.is-active i { color: var(--kp-accent); }

.sidebar-group {
    margin-top: 0.25rem;
    border-radius: var(--r-sm);
}

.sidebar-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.5rem;
    padding: 0.65rem 0.75rem 0.3rem;
    color: var(--kp-text);
    font-size: 0.8125rem;
    font-weight: 650;
}

.dashboard-sidebar .dashboard-subtab {
    min-height: 2.2rem;
    margin-left: 2.1rem;
    width: calc(100% - 2.1rem);
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
}

.sidebar-footer {
    border-top: 1px solid var(--kp-border);
    padding-top: 0.75rem;
}

.sidebar-footer-row {
    display: grid;
    grid-template-columns: 1fr 2.75rem 2.75rem;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.sidebar-icon-action {
    display: inline-flex;
    min-width: 0;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid var(--kp-border-strong);
    border-radius: var(--r-sm);
    background: var(--kp-surface);
    color: var(--kp-text-soft);
    font-size: 0.75rem;
    font-weight: 600;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.sidebar-icon-action:hover {
    background: var(--kp-surface-hover);
    color: var(--kp-text);
}

.sidebar-logout:hover {
    border-color: #FBD5D5;
    background: var(--kp-danger-soft);
    color: var(--kp-danger);
}

/* --- Main column --------------------------------------------------------- */

.dashboard-main {
    min-width: 0;
    margin-left: 248px;
    padding: 0 2rem 3rem;
}

.app-brand-bar {
    position: sticky;
    top: 0;
    z-index: 35;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    margin: 0 -2rem 2rem;
    border: 0;
    border-bottom: 1px solid var(--kp-border);
    border-radius: 0;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    padding: 0.85rem 2rem;
    box-shadow: none;
}

.dashboard-page-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-header {
    display: flex;
    flex-direction: row;
    width: auto;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.business-lockup {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
    border-left: 1px solid var(--kp-border);
    padding-left: 0.75rem;
}

.business-logo {
    height: 2.25rem;
    width: 2.25rem;
    flex: 0 0 auto;
    border: 1px solid var(--kp-border);
    border-radius: var(--r-sm);
    background: var(--kp-surface);
    object-fit: contain;
}

.business-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kp-surface-hover);
    color: var(--kp-text-muted);
}

.dashboard-icon-action {
    height: 2.5rem;
    width: 2.5rem;
    min-height: 2.5rem;
    border-radius: var(--r-sm);
    padding: 0;
}

.dashboard-view {
    margin: 0 auto;
    max-width: 1280px;
}

.dashboard-main .rounded-2xl { border-radius: var(--r-lg); }

/* --- Overview ------------------------------------------------------------ */

.overview-welcome {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.overview-eyebrow {
    color: var(--kp-accent);
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.overview-title {
    margin-top: 0.35rem;
    color: var(--kp-text);
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.2;
}

.overview-copy {
    max-width: 680px;
    margin-top: 0.45rem;
    color: var(--kp-text-soft);
    font-size: 0.875rem;
    line-height: 1.6;
}

.overview-primary-action {
    display: inline-flex;
    min-height: 2.75rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: var(--r-md);
    background: var(--kp-accent);
    color: #ffffff;
    padding: 0.75rem 1.125rem;
    font-size: 0.8125rem;
    font-weight: 650;
    box-shadow: var(--kp-shadow-xs);
    transition: background-color .15s ease;
}

.overview-primary-action:hover { background: var(--kp-accent-hover); }

.overview-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.overview-metric {
    display: flex;
    min-width: 0;
    min-height: 112px;
    align-items: center;
    gap: 0.85rem;
    border: 1px solid var(--kp-border);
    border-radius: var(--r-lg);
    background: var(--kp-surface);
    padding: 1.125rem;
    text-align: left;
    box-shadow: var(--kp-shadow-sm);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.overview-metric:hover {
    transform: translateY(-2px);
    border-color: var(--kp-border-strong);
    box-shadow: var(--kp-shadow-md);
}

.overview-metric-icon {
    display: inline-flex;
    height: 2.75rem;
    width: 2.75rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-md);
    font-size: 0.9375rem;
}

.overview-metric strong,
.overview-metric small { display: block; }

.overview-metric strong {
    color: var(--kp-text);
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.022em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.overview-metric small {
    margin-top: 0.35rem;
    color: var(--kp-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Metric marks stay quiet: accent for the primary figure, semantic hues only
   where they carry meaning. No four-colour rainbow. */
.overview-metric-blue   .overview-metric-icon { background: var(--kp-accent-soft);  color: var(--kp-accent); }
.overview-metric-orange .overview-metric-icon { background: var(--kp-warn-soft);    color: var(--kp-warn); }
.overview-metric-green  .overview-metric-icon { background: var(--kp-success-soft); color: var(--kp-success); }
.overview-metric-purple .overview-metric-icon { background: var(--kp-surface-hover);color: var(--kp-text-soft); }

.overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
    gap: 1rem;
    margin-top: 1rem;
}

.overview-panel {
    border: 1px solid var(--kp-border);
    border-radius: var(--r-lg);
    background: var(--kp-surface);
    padding: 1.375rem;
    box-shadow: var(--kp-shadow-sm);
}

.overview-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.overview-panel h3 {
    color: var(--kp-text);
    font-size: 0.9375rem;
    font-weight: 650;
    letter-spacing: -0.011em;
}

.overview-panel p {
    margin-top: 0.25rem;
    color: var(--kp-text-muted);
    font-size: 0.75rem;
    line-height: 1.55;
}

.overview-panel-heading button,
.overview-next-step > button {
    flex: 0 0 auto;
    color: var(--kp-accent);
    font-size: 0.75rem;
    font-weight: 650;
    transition: color .15s ease;
}

.overview-panel-heading button:hover,
.overview-next-step > button:hover { color: var(--kp-accent-press); }

/* --- Platform health ----------------------------------------------------- */

.platform-health-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.platform-health {
    display: inline-flex;
    min-height: 2.7rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid var(--kp-border);
    border-radius: var(--r-sm);
    background: var(--kp-surface-sunk);
    color: var(--kp-text-muted);
    padding: 0.55rem;
    font-size: 0.6875rem;
    font-weight: 600;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

/* Connected: the row lifts to the live surface and the dot goes green. */
.platform-health.is-on {
    background: var(--kp-surface);
    border-color: var(--kp-border-strong);
    color: var(--kp-text);
}

.platform-dot {
    width: 0.4375rem;
    height: 0.4375rem;
    flex: 0 0 auto;
    border-radius: 9999px;
    background: #C7CEDA;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.platform-health.is-on .platform-dot {
    background: var(--kp-success);
    box-shadow: 0 0 0 2.5px var(--kp-success-soft);
}

/* --- Section headers ------------------------------------------------------
   A card header should not be a coloured slab. The surface stays neutral and
   a small icon tile carries the section's meaning, so several cards can sit
   together without competing. */

.kp-section-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1.375rem;
    border-bottom: 1px solid var(--kp-border);
    background: var(--kp-surface);
}

.kp-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 9px;
    font-size: 0.8125rem;
    background: var(--kp-accent-soft);
    color: var(--kp-accent);
}

.kp-section-icon-warn    { background: var(--kp-warn-soft);    color: var(--kp-warn); }
.kp-section-icon-success { background: var(--kp-success-soft); color: var(--kp-success); }

.kp-section-title {
    font-size: 0.9375rem;
    font-weight: 650;
    letter-spacing: -0.011em;
    color: var(--kp-text);
    min-width: 0;
}

/* Neutral counter — a number, not an alert. */
.kp-count {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--kp-border);
    border-radius: 9999px;
    background: var(--kp-surface-sunk);
    color: var(--kp-text-soft);
    padding: 0.2rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Live indicator: a pulsing dot reads as "running" without shouting. */
.kp-live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    border: 1px solid var(--kp-border);
    border-radius: 9999px;
    background: var(--kp-surface-sunk);
    color: var(--kp-text-soft);
    padding: 0.2rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 650;
    white-space: nowrap;
}

.kp-live .platform-dot {
    background: var(--kp-success);
    box-shadow: 0 0 0 2.5px var(--kp-success-soft);
}

@media (prefers-reduced-motion: no-preference) {
    .kp-live .platform-dot { animation: kp-pulse 2.4s ease-in-out infinite; }
}

@keyframes kp-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .45; }
}

.lang-dari .kp-count,
.lang-dari .kp-live { margin-left: 0; margin-right: auto; }

/* --- Next step ----------------------------------------------------------- */

.overview-next-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    align-content: start;
    border-color: var(--kp-accent-line);
    background: var(--kp-accent-soft);
}

.overview-next-icon {
    display: inline-flex;
    height: 2.75rem;
    width: 2.75rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-md);
    background: var(--kp-accent);
    color: #ffffff;
}

.overview-next-step > button {
    grid-column: 2;
    justify-self: start;
    margin-top: 0.35rem;
}

/* --- Recent activity (latest comments & replies) -------------------------- */

.recent-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-height: 22rem;
    overflow-y: auto;
}

.recent-activity-empty {
    padding: 1.5rem 0;
    text-align: center;
    color: var(--kp-text-muted);
    font-size: 0.8125rem;
}

.recent-activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--kp-border);
    border-radius: var(--r-md);
    background: var(--kp-surface-sunk);
}

.recent-activity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 9999px;
    background: var(--kp-surface);
    border: 1px solid var(--kp-border);
    font-size: 0.75rem;
    color: var(--kp-text-soft);
}

.recent-activity-body { min-width: 0; flex: 1; }

.recent-activity-meta {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.75rem;
}

.recent-activity-sender { font-weight: 650; color: var(--kp-text); }
.recent-activity-time { color: var(--kp-text-muted); }

.recent-activity-text {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--kp-text-soft);
    overflow-wrap: anywhere;
}

.recent-activity-reply {
    margin-top: 0.375rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--kp-accent-line);
    font-size: 0.8125rem;
    color: var(--kp-text);
    overflow-wrap: anywhere;
}

.lang-dari .recent-activity-reply {
    padding-left: 0;
    padding-right: 0.75rem;
    border-left: 0;
    border-right: 2px solid var(--kp-accent-line);
}

/* --- Inbox lite ---------------------------------------------------------- */

.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    max-height: 34rem;
    overflow-y: auto;
    background: var(--kp-surface-sunk);
}

.inbox-item {
    display: flex;
    gap: 0.875rem;
    padding: 1rem;
    border: 1px solid var(--kp-border);
    border-radius: var(--r-md);
    background: var(--kp-surface);
    box-shadow: var(--kp-shadow-xs);
}

.inbox-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border-radius: 9999px;
    background: var(--kp-accent-soft);
    color: var(--kp-accent);
    font-size: 0.85rem;
}

.inbox-item-lead .inbox-item-icon {
    background: var(--kp-warn-soft);
    color: var(--kp-warn);
}

.inbox-item-body {
    min-width: 0;
    flex: 1;
}

.inbox-item-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: var(--kp-text-muted);
}

.inbox-item-title {
    font-weight: 800;
    color: var(--kp-text);
}

.inbox-item-platform {
    padding: 0.125rem 0.4rem;
    border-radius: 9999px;
    background: var(--kp-surface-sunk);
    border: 1px solid var(--kp-border);
    text-transform: capitalize;
}

.inbox-item-time {
    margin-left: auto;
}

.lang-dari .inbox-item-time {
    margin-left: 0;
    margin-right: auto;
}

.inbox-item-sender {
    margin-top: 0.25rem;
    font-weight: 700;
    color: var(--kp-text);
    overflow-wrap: anywhere;
}

.inbox-item-text,
.inbox-item-reply {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--kp-text-soft);
    overflow-wrap: anywhere;
}

.inbox-item-reply {
    padding-left: 0.75rem;
    border-left: 2px solid var(--kp-accent-line);
    color: var(--kp-text);
}

.lang-dari .inbox-item-reply {
    padding-left: 0;
    padding-right: 0.75rem;
    border-left: 0;
    border-right: 2px solid var(--kp-accent-line);
}

.inbox-item-link {
    display: inline-flex;
    margin-top: 0.625rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--r-sm);
    background: var(--kp-accent-soft);
    color: var(--kp-accent);
    font-size: 0.75rem;
    font-weight: 800;
}

/* --- Pricing comparison -------------------------------------------------- */

.pricing-page-shell,
.settings-inline-view {
    width: 100%;
}

.pricing-page-shell {
    font-family: 'Manrope', 'Inter', 'Vazirmatn', ui-sans-serif, system-ui, sans-serif;
}

.pricing-page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.4rem;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(6, 182, 212, 0.18), transparent 32%),
        radial-gradient(circle at 92% 6%, rgba(37, 99, 235, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 246, 252, 0.98));
    box-shadow: 0 22px 44px rgba(148, 163, 184, 0.16);
}

.pricing-page-hero h3 {
    margin-top: 0.25rem;
    color: #102033;
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 900;
    letter-spacing: 0;
}

.pricing-page-hero p {
    margin-top: 0.35rem;
    max-width: 46rem;
    color: #2f435c;
    font-size: 0.92rem;
    line-height: 1.55;
}

.pricing-page-current {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0 0.9rem;
    border-radius: 9999px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 900;
}

.pricing-comparison {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--kp-border);
}

.pricing-page-comparison {
    margin-top: 0;
    padding: 1.35rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 22px 44px rgba(148, 163, 184, 0.14);
    backdrop-filter: blur(20px);
}

.pricing-comparison-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.pricing-eyebrow {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d4ed8;
}

.pricing-comparison h4 {
    margin-top: 0.2rem;
    font-size: 1rem;
    font-weight: 800;
    color: #102033;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.pricing-page-comparison .pricing-grid {
    gap: 1.2rem;
}

.pricing-plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--kp-border);
    border-radius: var(--r-lg);
    background: var(--kp-surface);
    box-shadow: var(--kp-shadow-xs);
}

.pricing-page-comparison .pricing-plan-card {
    min-height: 100%;
    padding: 1.45rem;
    border-radius: 24px;
    border-color: rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.96));
    box-shadow: 0 20px 40px rgba(148, 163, 184, 0.12);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.pricing-page-comparison .pricing-plan-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 26px 54px rgba(148, 163, 184, 0.18);
}

.pricing-plan-featured {
    border-color: rgba(37, 99, 235, 0.24);
    background:
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(239, 248, 255, 0.98), rgba(255, 255, 255, 0.98) 44%);
}

.pricing-plan-card.is-current {
    border-color: rgba(6, 182, 212, 0.34);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12), 0 24px 52px rgba(37, 99, 235, 0.14);
}

.pricing-popular {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.55rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #06b6d4, #1d4ed8);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.28);
}

.lang-dari .pricing-popular {
    right: auto;
    left: 0.75rem;
}

.pricing-plan-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 5.5rem;
}

.lang-dari .pricing-plan-top {
    padding-right: 0;
    padding-left: 5.5rem;
}

.pricing-plan-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.pricing-plan-pill {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--kp-text-soft);
}

.pricing-plan-card h5 {
    margin-top: 0.75rem;
    font-size: 1.14rem;
    font-weight: 900;
    color: #102033;
}

.pricing-plan-desc {
    margin-top: 0.25rem;
    min-height: 2.6rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #2f435c;
}

.pricing-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-top: 0.85rem;
    color: #586b82;
}

.pricing-price-row strong {
    color: #102033;
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 900;
}

.pricing-primary-action,
.pricing-secondary-action {
    width: 100%;
    min-height: 2.5rem;
    margin-top: 0.9rem;
    border-radius: var(--r-md);
    font-size: 0.82rem;
    font-weight: 850;
}

.pricing-primary-action {
    background: linear-gradient(135deg, #06b6d4, #1d4ed8);
    color: white;
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.22);
}

.pricing-primary-action:hover {
    filter: brightness(1.04);
    box-shadow: 0 20px 38px rgba(37, 99, 235, 0.28);
}

.pricing-primary-action.is-disabled,
.pricing-primary-action:disabled {
    background: var(--kp-success-soft);
    color: var(--kp-success);
    cursor: default;
}

.pricing-secondary-action {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.16);
}

.pricing-feature-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.9rem;
    font-size: 0.76rem;
    color: #2f435c;
}

.pricing-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.pricing-feature-list i {
    margin-top: 0.15rem;
    color: #1d4ed8;
    font-size: 0.72rem;
}

.pricing-feature-list .fa-xmark {
    color: #91a4bd;
}

.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] {
    overflow: hidden;
    border-color: rgba(37, 99, 235, 0.18);
    background:
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.18), transparent 32%),
        linear-gradient(160deg, #10243d 0%, #1d4ed8 52%, #0ea5e9 100%);
    box-shadow: 0 30px 62px rgba(37, 99, 235, 0.2);
}

.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] .pricing-plan-icon {
    background: rgba(255, 255, 255, 0.16);
    color: #eff8ff;
}

.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] .pricing-plan-pill,
.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] h5,
.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] .pricing-price-row,
.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] .pricing-price-row strong {
    color: #f8fbff;
}

.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] .pricing-plan-desc,
.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] .pricing-feature-list {
    color: rgba(248, 250, 252, 0.92);
}

.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] .pricing-feature-list i {
    color: #86efac;
}

.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] .pricing-primary-action {
    background: rgba(255, 255, 255, 0.96);
    color: #12315c;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
}

.pricing-page-comparison .pricing-plan-card[data-pricing-plan="pro"] .pricing-primary-action:hover {
    background: #ffffff;
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.2);
}

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

    .pricing-plan-desc {
        min-height: 0;
    }
}

.settings-inline-view .settings-inline-panel {
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: var(--r-lg);
    border: 1px solid var(--kp-border);
    box-shadow: var(--kp-shadow-sm);
}

.settings-inline-view .settings-inline-panel > .bg-gray-50:first-child button[onclick="toggleModal()"] {
    display: none;
}

.settings-inline-view .settings-inline-panel > .overflow-y-auto {
    max-height: none;
    overflow: visible;
}

.settings-inline-view .settings-tabs {
    max-width: 720px;
    margin-inline: auto;
}

@media (max-width: 760px) {
    .pricing-page-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .pricing-page-comparison,
    .pricing-page-hero {
        padding: 1rem;
    }
}

/* --- Mobile nav ---------------------------------------------------------- */

.dashboard-nav-backdrop { display: none; }

.lang-dari .dashboard-sidebar {
    inset: 0 0 0 auto;
    border-right: 0;
    border-left: 1px solid var(--kp-border);
}

.lang-dari .dashboard-main {
    margin-right: 248px;
    margin-left: 0;
}

.lang-dari .dashboard-sidebar .dashboard-tab.is-active {
    box-shadow: inset -3px 0 0 var(--kp-accent);
}

.lang-dari .dashboard-sidebar .dashboard-subtab {
    margin-right: 2.1rem;
    margin-left: 0;
}

.lang-dari .business-lockup {
    border-right: 1px solid var(--kp-border);
    border-left: 0;
    padding-right: 0.75rem;
    padding-left: 0;
}

@media (max-width: 1100px) {
    .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .platform-health-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--kp-shadow-lg);
        transition: transform 0.2s ease;
    }

    .dashboard-sidebar.is-open { transform: translateX(0); }

    .lang-dari .dashboard-sidebar { transform: translateX(100%); }
    .lang-dari .dashboard-sidebar.is-open { transform: translateX(0); }

    .dashboard-nav-backdrop.is-open {
        position: fixed;
        inset: 0;
        z-index: 45;
        display: block;
        background: rgba(20, 27, 45, .45);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .sidebar-close,
    .mobile-menu-button { display: inline-flex; }

    .dashboard-main,
    .lang-dari .dashboard-main {
        margin: 0;
        padding: 0 1rem 2rem;
    }

    .app-brand-bar {
        margin: 0 -1rem 1.5rem;
        padding: 0.7rem 1rem;
    }

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

@media (max-width: 560px) {
    .app-brand-bar { align-items: flex-start; }

    .dashboard-page-heading p,
    .business-lockup > div:last-child > div:last-child,
    .app-brand-bar .dashboard-icon-action { display: none; }

    .business-lockup {
        max-width: 47%;
        border-left: 0;
        padding-left: 0;
    }

    #headerPlanBadge { display: none; }

    .business-lockup h1 { display: none; }

    .lang-dari .business-lockup {
        border-right: 0;
        padding-right: 0;
    }

    .overview-welcome {
        align-items: stretch;
        flex-direction: column;
    }

    .overview-primary-action { width: 100%; }

    .overview-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .overview-metric {
        min-height: 118px;
        align-items: flex-start;
        flex-direction: column;
    }

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