/* =========================================================
   CustomerDesk — Admin design system
   All colours, type, spacing, radii, shadows and motion live in
   the tokens below; components only reference tokens.
   Brand palette is taken from the logo: royal blue #0046B2 + gold #F8A708.
   ========================================================= */
:root {
    /* Brand */
    --c-primary: #0046B2;
    --c-primary-hover: #003A94;
    --c-primary-light: #1E66D8;
    --c-primary-soft: #EBF2FD;
    --c-primary-ring: rgba(0, 70, 178, .18);
    /* Gold is a fill colour: pair it with --c-on-accent text. --c-accent-text is the AA-safe gold for text on white. */
    --c-accent: #F8A708;
    --c-accent-hover: #E39400;
    --c-accent-soft: #FFF6E0;
    --c-accent-text: #9A5B00;
    --c-accent-ring: rgba(248, 167, 8, .3);
    --c-on-accent: #241900;

    /* Neutrals */
    --c-bg: #F5F6F8;
    --c-surface: #FFFFFF;
    --c-surface-raised: #FFFFFF;
    --c-surface-muted: #F9FAFB;
    --c-border: #E4E7EC;
    --c-border-strong: #D0D5DD;
    --c-text: #101828;
    --c-text-2: #475467;
    --c-text-muted: #667085;

    /* Sidebar */
    --c-side-bg: #061B44;
    --c-side-bg-2: #0A2A63;
    --c-side-text: #A9B9D6;
    --c-side-text-strong: #FFFFFF;
    --c-side-hover: rgba(255, 255, 255, .07);
    --c-side-active: rgba(30, 102, 216, .35);
    --c-side-border: rgba(255, 255, 255, .08);
    --c-side-accent: #F8A708;

    /* Status */
    --c-success: #067647;  --c-success-bg: #ECFDF3;  --c-success-border: #ABEFC6;
    --c-warning: #B54708;  --c-warning-bg: #FFFAEB;  --c-warning-border: #FEDF89;
    --c-error:   #B42318;  --c-error-bg:   #FEF3F2;  --c-error-border:   #FECDCA;
    --c-info:    #175CD3;  --c-info-bg:    #EFF8FF;  --c-info-border:    #B2DDFF;
    --c-purple:  #5925DC;  --c-purple-bg:  #F4F3FF;
    --c-neutral-bg: #F2F4F7;

    /* Typography */
    --font-sans: "Inter", "Noto Sans Devanagari", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --fs-xs: 12px;  --fs-sm: 13px;  --fs-base: 14px;  --fs-md: 15px;
    --fs-lg: 17px;  --fs-xl: 20px;  --fs-2xl: 24px;  --fs-3xl: 30px;
    --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
    --lh-tight: 1.25; --lh-base: 1.5;

    /* Spacing (4px scale) */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
    --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

    /* Radius */
    --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;

    /* Shadows */
    --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --sh-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --sh-md: 0 8px 24px -4px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .05);
    --sh-lg: 0 20px 40px -8px rgba(16, 24, 40, .18);

    /* Motion */
    --ease: cubic-bezier(.2, .7, .3, 1);
    --t-fast: .12s var(--ease);
    --t-base: .2s var(--ease);

    /* Layers */
    --z-dropdown: 40; --z-sticky: 30; --z-drawer: 60; --z-backdrop: 55; --z-tooltip: 80; --z-modal: 90;

    /* Layout */
    --sidebar-w: 256px;
    --sidebar-w-collapsed: 72px;
    --topbar-h: 64px;
    --control-h: 40px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    background: var(--c-bg);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
.content td > a:not(.btn):not(.icon-btn), .content p a:not(.btn), .card-link { color: var(--c-primary); font-weight: var(--fw-medium); }
.content td > a:not(.btn):not(.icon-btn):hover, .content p a:not(.btn):hover, .card-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.chat-sidebar a:hover { background: var(--c-neutral-bg); }
p { line-height: 1.6; }
.card p + p { margin-top: var(--sp-2); }
h1, h2, h3 { line-height: var(--lh-tight); color: var(--c-text); }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
::selection { background: var(--c-primary-soft); }
.skip-link {
    position: absolute; left: var(--sp-4); top: -60px; z-index: var(--z-modal);
    background: var(--c-primary); color: #fff; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-md);
}
.skip-link:focus { top: var(--sp-4); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--c-side-bg) 0%, var(--c-side-bg-2) 100%);
    color: var(--c-side-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width var(--t-base), transform var(--t-base);
    z-index: var(--z-drawer);
}
.sidebar-brand {
    height: var(--topbar-h);
    padding: 0 var(--sp-3) 0 var(--sp-4);
    border-bottom: 1px solid var(--c-side-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    flex-shrink: 0;
}
.brand-link { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #FFC94A 0%, var(--c-accent) 100%);
    color: var(--c-on-accent); font-size: 13px; font-weight: var(--fw-bold); letter-spacing: .02em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
/* The logo icon sits on a white tile so its royal blue stays crisp against the navy sidebar */
.brand-mark-img { background: #fff; padding: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); object-fit: contain; }
.brand-text {
    font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--c-side-text-strong);
    letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text-accent { color: var(--c-side-accent); }
.sidebar-toggle {
    background: none; border: none; color: var(--c-side-text); cursor: pointer;
    width: 32px; height: 32px; border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-toggle:hover { background: var(--c-side-hover); color: #fff; }
.sidebar-nav, .sidebar nav {
    display: flex; flex-direction: column; gap: 2px;
    padding: var(--sp-3) var(--sp-3) var(--sp-6);
    overflow-y: auto; overflow-x: hidden; flex: 1;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent;
}

.nav-link, .nav-group-header {
    display: flex; align-items: center; gap: var(--sp-3);
    width: 100%; min-height: 38px;
    padding: 0 var(--sp-3);
    border-radius: var(--r-md);
    font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium);
    color: var(--c-side-text);
    white-space: nowrap;
    position: relative;
    transition: background var(--t-fast), color var(--t-fast);
}
.nav-icon { flex-shrink: 0; opacity: .85; }
.nav-link:hover, .nav-group-header:hover { background: var(--c-side-hover); color: #fff; }
.nav-link:hover .nav-icon, .nav-group-header:hover .nav-icon { opacity: 1; }
.nav-link.active { background: var(--c-side-active); color: #fff; font-weight: var(--fw-semibold); }
.nav-link.active::before {
    content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--c-side-accent);
}
.nav-link.active .nav-icon { opacity: 1; color: var(--c-side-accent); }

/* Collapsible groups */
.nav-group { display: flex; flex-direction: column; margin-top: 2px; }
.nav-group-header { background: none; border: none; cursor: pointer; }
.nav-group-header span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.nav-group-header .nav-icon:last-child { width: 14px; height: 14px; opacity: .55; transition: transform var(--t-base); }
.nav-group.open .nav-group-header .nav-icon:last-child { transform: rotate(180deg); opacity: .9; }
.nav-group.open .nav-group-header, .nav-group.has-active .nav-group-header { color: #fff; }
.nav-group-items {
    display: flex; flex-direction: column; gap: 1px;
    max-height: 0; overflow: hidden;
    transition: max-height var(--t-base);
}
.nav-group.open .nav-group-items { max-height: 480px; }
.nav-sublink { min-height: 34px; padding-left: 42px; font-size: var(--fs-sm); position: relative; }
.nav-sublink .nav-icon { width: 16px; height: 16px; }
.nav-group-items::before { content: none; }

/* Collapsed rail (desktop) */
.sidebar-is-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-is-collapsed .brand-text,
.sidebar-is-collapsed .nav-link span,
.sidebar-is-collapsed .nav-group-header span,
.sidebar-is-collapsed .nav-group-header .nav-icon:last-child,
.sidebar-is-collapsed .nav-group-items { display: none; }
.sidebar-is-collapsed .sidebar-brand { flex-direction: column; justify-content: center; padding: 0; gap: 0; }
.sidebar-is-collapsed .sidebar-brand .brand-link { display: none; }
.sidebar-is-collapsed .nav-link, .sidebar-is-collapsed .nav-group-header { justify-content: center; padding: 0; min-height: 42px; }
.sidebar-is-collapsed .nav-group.has-active .nav-group-header { background: var(--c-side-active); }
.sidebar-is-collapsed .nav-group.has-active .nav-group-header .nav-icon { color: var(--c-side-accent); }

.nav-tooltip {
    position: fixed; z-index: var(--z-tooltip); transform: translateY(-50%);
    background: #101828; color: #fff; font-size: var(--fs-xs); font-weight: var(--fw-medium);
    padding: 6px 10px; border-radius: var(--r-sm); box-shadow: var(--sh-md);
    pointer-events: none; opacity: 0; transition: opacity var(--t-fast); white-space: nowrap;
}
.nav-tooltip.show { opacity: 1; }
.sidebar-backdrop { display: none; }

/* ---------- Main area / topbar ---------- */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: var(--topbar-h);
    position: sticky; top: 0; z-index: var(--z-sticky);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--c-border);
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
    padding: 0 var(--sp-6);
}
.topbar-left { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.topbar .topbar-menu-btn { display: none; }
.topbar-heading { min-width: 0; }
.breadcrumb { font-size: var(--fs-xs); color: var(--c-text-muted); font-weight: var(--fw-medium); line-height: 1.2; }
.page-title {
    font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--c-text);
    letter-spacing: -.01em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-user { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-2); }
.btn-link { color: var(--c-primary); font-weight: var(--fw-semibold); }

.topbar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 var(--sp-3);
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md);
    font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--c-text-2);
    cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.topbar-btn:hover { background: var(--c-surface-muted); border-color: var(--c-border-strong); color: var(--c-text); }
.topbar-btn .nav-icon { width: 16px; height: 16px; }
.topbar-btn .nav-icon:last-child:not(:first-child) { width: 13px; height: 13px; opacity: .6; }
.topbar-icon-btn { width: 36px; padding: 0; justify-content: center; position: relative; }
.topbar-icon-btn .nav-icon { width: 18px; height: 18px; }
.notif-count {
    position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--r-full); background: var(--c-error); color: #fff;
    font-size: 10.5px; font-weight: var(--fw-bold); line-height: 18px; text-align: center;
    box-shadow: 0 0 0 2px var(--c-surface);
}

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px;
    background: var(--c-surface-raised); border: 1px solid var(--c-border); border-radius: var(--r-lg);
    box-shadow: var(--sh-lg); padding: 6px; z-index: var(--z-dropdown);
    display: flex; flex-direction: column;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: flex; align-items: center; gap: var(--sp-2); width: 100%;
    padding: 8px 10px; border-radius: var(--r-sm); border: none; background: none;
    font-family: inherit; font-size: var(--fs-sm); color: var(--c-text); text-align: left; cursor: pointer;
    transition: background var(--t-fast);
}
.dropdown-item:hover { background: var(--c-surface-muted); }
.dropdown-item.active { color: var(--c-primary); font-weight: var(--fw-semibold); justify-content: space-between; }
.dropdown-item .nav-icon { width: 16px; height: 16px; }
.dropdown-item-danger { color: var(--c-error); }
.dropdown-item-danger:hover { background: var(--c-error-bg); }
.dropdown-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px 10px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--c-text);
    border-bottom: 1px solid var(--c-border); margin: -6px -6px 6px; padding: 12px 16px;
}
.dropdown-foot {
    display: block; text-align: center; padding: 10px; margin: 6px -6px -6px;
    border-top: 1px solid var(--c-border); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--c-primary);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.dropdown-foot:hover { background: var(--c-surface-muted); }
.lang-switcher-menu { min-width: 160px; }

/* Notifications */
.notif-menu { width: 340px; max-width: calc(100vw - 24px); }
.notif-item { display: flex; gap: var(--sp-3); padding: 10px; border-radius: var(--r-md); transition: background var(--t-fast); }
.notif-item:hover { background: var(--c-surface-muted); }
.notif-item.unread { background: var(--c-primary-soft); }
.notif-item.unread:hover { background: #DCE8FB; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-text { font-size: var(--fs-sm); color: var(--c-text); font-weight: var(--fw-medium); }
.notif-snippet { font-size: var(--fs-xs); color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 11.5px; color: var(--c-text-muted); }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-4); color: var(--c-text-muted); font-size: var(--fs-sm); }
.notif-empty .nav-icon { width: 28px; height: 28px; opacity: .5; }

/* Profile */
.profile-btn {
    display: flex; align-items: center; gap: var(--sp-2);
    height: 40px; padding: 0 var(--sp-2) 0 4px; margin-left: var(--sp-1);
    background: none; border: 1px solid transparent; border-radius: var(--r-full);
    font-family: inherit; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast);
}
.profile-btn:hover, .dropdown.open .profile-btn { background: var(--c-surface-muted); border-color: var(--c-border); }
.profile-btn > .nav-icon { width: 14px; height: 14px; color: var(--c-text-muted); }
.profile-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.profile-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--c-text); }
.profile-role { font-size: 11.5px; color: var(--c-text-muted); }
.profile-email { font-size: var(--fs-xs); color: var(--c-text-2); margin: 1px 0 6px; word-break: break-all; }
.profile-menu { min-width: 260px; }
.profile-card { display: flex; gap: var(--sp-3); align-items: flex-start; padding: 10px 10px 12px; border-bottom: 1px solid var(--c-border); margin-bottom: 6px; }
.profile-card .badge { margin-top: 4px; }
.avatar {
    width: 32px; height: 32px; border-radius: var(--r-full); flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--c-primary-light), var(--c-primary)); color: #fff;
    font-size: 12px; font-weight: var(--fw-semibold); letter-spacing: .02em;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 42px; height: 42px; font-size: 15px; }

/* ---------- Content ---------- */
.content { padding: var(--sp-6); width: 100%; max-width: 1600px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-header h1 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.02em; }
.page-header p { color: var(--c-text-2); font-size: var(--fs-base); margin-top: 4px; }
.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* Cards */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xs);
    padding: var(--sp-5);
    margin-bottom: var(--sp-5);
}
.card-title {
    font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--c-text);
    margin-bottom: var(--sp-4); letter-spacing: -.005em;
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
}
.card-title .card-link { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-title { padding: var(--sp-4) var(--sp-5); margin: 0; border-bottom: 1px solid var(--c-border); }

/* KPI tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.stat-card {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg);
    padding: var(--sp-4) var(--sp-5); box-shadow: var(--sh-xs);
    display: flex; flex-direction: column; gap: 2px; position: relative;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
a.stat-card:hover { border-color: var(--c-border-strong); box-shadow: var(--sh-sm); }
.stat-card .num { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); color: var(--c-text); letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
/* padding-right keeps long labels clear of the corner icon (they wrap instead of hiding under it) */
.stat-card .label { font-size: var(--fs-sm); color: var(--c-text-2); font-weight: var(--fw-medium); order: -1; margin-bottom: var(--sp-2); padding-right: 40px; line-height: 1.35; }
.stat-card .sub { font-size: var(--fs-xs); color: var(--c-text-muted); margin-top: 2px; }
.stat-icon {
    position: absolute; top: var(--sp-4); right: var(--sp-4);
    width: 34px; height: 34px; border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c-primary-soft); color: var(--c-primary);
}
.stat-icon .nav-icon { width: 17px; height: 17px; opacity: 1; }
.stat-icon.tone-success { background: var(--c-success-bg); color: var(--c-success); }
.stat-icon.tone-warning { background: var(--c-warning-bg); color: var(--c-warning); }
.stat-icon.tone-error { background: var(--c-error-bg); color: var(--c-error); }
.stat-icon.tone-accent { background: var(--c-accent-soft); color: var(--c-accent-text); }
.stat-card.is-alert { border-color: var(--c-error-border); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 var(--sp-4);
    border-radius: var(--r-md);
    font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    background: var(--c-primary); color: #fff;
    box-shadow: var(--sh-xs);
    transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
    position: relative;
}
.btn:hover { background: var(--c-primary-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--c-primary-ring); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-accent { background: var(--c-accent); color: var(--c-on-accent); }
.btn-accent:hover { background: var(--c-accent-hover); color: var(--c-on-accent); }
.btn-accent:focus-visible { box-shadow: 0 0 0 4px var(--c-accent-ring); }
.btn-accent.is-loading::after { border-color: rgba(36, 25, 0, .3); border-top-color: var(--c-on-accent); }
.btn-outline { background: var(--c-surface); border-color: var(--c-border-strong); color: var(--c-text); }
.btn-outline:hover { background: var(--c-surface-muted); color: var(--c-text); }
.btn-danger { background: var(--c-error); color: #fff; }
.btn-danger:hover { background: #912018; }
.btn-ghost { background: none; box-shadow: none; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-neutral-bg); color: var(--c-text); }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn-lg { height: 44px; padding: 0 var(--sp-5); font-size: var(--fs-base); }
.btn-block { width: 100%; }
/* Loading state (added automatically on submit, or manually) */
.is-loading { color: transparent !important; pointer-events: none; }
.is-loading > * { visibility: hidden; }
.is-loading::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
    animation: spin .6s linear infinite; visibility: visible;
}
.btn-outline.is-loading::after, .btn-ghost.is-loading::after, .icon-btn .is-loading::after { border-color: var(--c-border-strong); border-top-color: var(--c-primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--c-border); border-top-color: var(--c-primary); border-radius: 50%; animation: spin .6s linear infinite; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); gap: var(--sp-3); flex-wrap: wrap; }
.toolbar-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar input[type=text] { min-width: 240px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: var(--sp-4); }
.form-group label, .form-label {
    display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--c-text);
    margin-bottom: 6px;
}
.form-hint { font-size: var(--fs-xs); color: var(--c-text-muted); margin-top: 4px; }
.form-error { font-size: var(--fs-xs); color: var(--c-error); margin-top: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=url], input[type=search],
input[type=password], input[type=date], input[type=datetime-local], input[type=time],
select, textarea {
    width: 100%;
    height: var(--control-h);
    padding: 0 var(--sp-3);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    font-family: inherit; font-size: var(--fs-base);
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: var(--sh-xs);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
select { padding-right: 32px; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; }
select[multiple] { height: auto; min-height: 80px; padding: 6px; background-image: none; }
textarea { height: auto; min-height: 88px; padding: 10px var(--sp-3); resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #98A2B3; }
input:hover, select:hover, textarea:hover { border-color: #B8C0CC; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--c-surface-muted); color: var(--c-text-muted); cursor: not-allowed; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--c-primary); vertical-align: middle; cursor: pointer; }
input[type=file] { font-family: inherit; font-size: var(--fs-sm); }
.is-invalid, input:user-invalid { border-color: var(--c-error) !important; }
.is-invalid:focus, input:user-invalid:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, .15) !important; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-row > .card { margin-bottom: 0; }
.form-row + .card, .form-row + .form-row { margin-top: var(--sp-5); }
.input-icon { position: relative; }
.input-icon > .nav-icon, .input-icon > .action-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--c-text-muted); pointer-events: none; }
.input-icon > input { padding-left: 38px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
thead th {
    text-align: left; font-size: var(--fs-xs); font-weight: var(--fw-semibold);
    text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-muted);
    background: var(--c-surface-muted);
    border-bottom: 1px solid var(--c-border); border-top: 1px solid var(--c-border);
    padding: 10px var(--sp-3); white-space: nowrap;
}
thead th:first-child { border-top-left-radius: var(--r-md); border-left: 1px solid var(--c-border); }
thead th:last-child { border-top-right-radius: var(--r-md); border-right: 1px solid var(--c-border); }
tbody td { padding: 12px var(--sp-3); border-bottom: 1px solid #EEF0F3; color: var(--c-text-2); vertical-align: middle; height: 48px; }
tbody td:first-child { color: var(--c-text); }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: #FAFBFC; }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    height: 22px; padding: 0 8px; border-radius: var(--r-full);
    font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap;
    background: var(--c-neutral-bg); color: var(--c-text-2);
    border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-new, .badge-open, .badge-low, .badge-sent, .badge-scheduled, .badge-info { background: var(--c-info-bg); color: var(--c-info); border-color: var(--c-info-border); }
.badge-contacted, .badge-pending, .badge-medium, .badge-in_progress, .badge-trial, .badge-warning { background: var(--c-warning-bg); color: var(--c-warning); border-color: var(--c-warning-border); }
.badge-qualified, .badge-won, .badge-done, .badge-resolved, .badge-active, .badge-approved, .badge-accepted, .badge-completed, .badge-success { background: var(--c-success-bg); color: var(--c-success); border-color: var(--c-success-border); }
.badge-lost, .badge-urgent, .badge-rejected, .badge-failed, .badge-expired, .badge-error { background: var(--c-error-bg); color: var(--c-error); border-color: var(--c-error-border); }
.badge-high { background: #FFF4ED; color: #C4320A; border-color: #F9DBAF; }
.badge-waiting_customer { background: var(--c-purple-bg); color: var(--c-purple); border-color: #D9D6FE; }
.badge-closed, .badge-inactive, .badge-draft, .badge-cancelled { background: var(--c-neutral-bg); color: var(--c-text-2); border-color: var(--c-border); }
.sla-overdue { color: var(--c-error); font-weight: var(--fw-semibold); }
.sla-ok { color: var(--c-text-muted); }

/* ---------- Alerts / toasts ---------- */
.alert {
    display: flex; align-items: flex-start; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
    font-size: var(--fs-sm); margin-bottom: var(--sp-4); border: 1px solid; line-height: 1.5;
    animation: fade-in var(--t-base);
}
.alert-error { background: var(--c-error-bg); color: var(--c-error); border-color: var(--c-error-border); }
.alert-success { background: var(--c-success-bg); color: var(--c-success); border-color: var(--c-success-border); }
.alert-info { background: var(--c-info-bg); color: var(--c-info); border-color: var(--c-info-border); }
.alert-warning { background: var(--c-warning-bg); color: var(--c-warning); border-color: var(--c-warning-border); }
@keyframes fade-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* ---------- Empty / loading / error states ---------- */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
    text-align: center; color: var(--c-text-muted); padding: var(--sp-10) var(--sp-4); font-size: var(--fs-sm);
}
.empty-state::before {
    content: ""; width: 44px; height: 44px; border-radius: var(--r-lg); margin-bottom: var(--sp-1);
    background: var(--c-surface-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%2398A2B3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.5 5.1 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.5-6.9A2 2 0 0 0 16.8 4H7.2a2 2 0 0 0-1.7 1.1z'/%3E%3C/svg%3E") center no-repeat;
    border: 1px solid var(--c-border);
}
.empty-state .btn { margin-top: var(--sp-2); }
.empty-title { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--c-text); }
.skeleton { background: linear-gradient(90deg, #EEF0F3 25%, #F6F7F9 37%, #EEF0F3 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--r-sm); min-height: 12px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-6); background: var(--c-bg); }
.error-card { max-width: 440px; text-align: center; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); padding: var(--sp-10) var(--sp-8); box-shadow: var(--sh-md); }
.error-card .nav-icon { width: 40px; height: 40px; color: var(--c-error); margin-bottom: var(--sp-3); }
.error-card h1 { font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.error-card p { color: var(--c-text-2); margin-bottom: var(--sp-5); }

/* ---------- Modal / drawer (generic) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); z-index: var(--z-modal); display: none; align-items: center; justify-content: center; padding: var(--sp-4); }
.modal-backdrop.open { display: flex; animation: fade-in var(--t-base); }
.modal { width: 100%; max-width: 520px; background: var(--c-surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg); }
.modal-header { padding: var(--sp-5) var(--sp-6) 0; }
.modal-header h2 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.modal-header p { font-size: var(--fs-sm); color: var(--c-text-2); margin-top: 4px; }
.modal-body { padding: var(--sp-5) var(--sp-6); }
.modal-footer { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: var(--sp-2); }

/* ---------- Login language switch (legacy class kept) ---------- */
.login-lang-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--c-neutral-bg); border-radius: var(--r-full); }
.login-lang-switch a { padding: 5px 12px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--c-text-2); transition: background var(--t-fast), color var(--t-fast); }
.login-lang-switch a:hover { color: var(--c-text); }
.login-lang-switch a.active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--sh-sm); }

/* ---------- Auth (login / register) split layout ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--c-surface); }
.auth-brand {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(900px 500px at 110% -10%, rgba(248, 167, 8, .22), transparent 60%),
        radial-gradient(700px 500px at -20% 110%, rgba(30, 102, 216, .5), transparent 60%),
        linear-gradient(160deg, var(--c-side-bg) 0%, var(--c-side-bg-2) 100%);
    padding: var(--sp-12) clamp(32px, 6vw, 88px);
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-10);
}
.auth-brand::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-logo {
    align-self: flex-start; display: inline-flex; align-items: center;
    background: #fff; border-radius: var(--r-xl); padding: 14px 22px;
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .6);
    color: var(--c-primary); font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -.01em;
    transition: transform var(--t-base), box-shadow var(--t-base);
}
.auth-logo:hover { transform: translateY(-1px); box-shadow: 0 16px 36px -8px rgba(0, 0, 0, .5); }
.auth-logo .brand-logo-full { display: inline-flex; align-items: center; gap: var(--sp-3); }
.auth-logo img.brand-logo-full { display: block; height: 72px; width: auto; max-width: 100%; }
.auth-logo .brand-text-accent { color: var(--c-accent-text); }
.auth-logo .brand-mark { width: 40px; height: 40px; font-size: 15px; border-radius: 12px; box-shadow: none; padding: 0; }
.auth-eyebrow { display: inline-block; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .12em; text-transform: uppercase; color: var(--c-side-accent); margin-bottom: var(--sp-4); }
.auth-headline { font-size: clamp(26px, 2.6vw, 36px); font-weight: var(--fw-semibold); line-height: 1.2; letter-spacing: -.025em; color: #fff; max-width: 520px; }
.auth-lead { font-size: var(--fs-md); color: #B9C3D6; margin-top: var(--sp-4); max-width: 480px; line-height: 1.6; }
.auth-features { list-style: none; display: grid; gap: var(--sp-4); margin-top: var(--sp-8); max-width: 480px; }
.auth-features li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.auth-feature-icon { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: var(--c-side-accent); }
.auth-feature-icon .nav-icon { width: 17px; height: 17px; opacity: 1; }
.auth-features strong { display: block; font-size: var(--fs-base); font-weight: var(--fw-semibold); color: #fff; }
.auth-features span { font-size: var(--fs-sm); color: #9FABC1; }
.auth-foot { font-size: var(--fs-xs); color: #7F8BA3; }

.auth-panel { display: flex; flex-direction: column; padding: var(--sp-6) clamp(24px, 5vw, 64px); }
.auth-panel-top { display: flex; justify-content: flex-end; }
.auth-form-wrap { width: 100%; max-width: 400px; margin: auto; padding: var(--sp-8) 0; }
.auth-form-wrap h1 { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: -.02em; }
.auth-form-wrap .sub { font-size: var(--fs-base); color: var(--c-text-2); margin: 6px 0 var(--sp-6); }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 var(--sp-5); font-size: var(--fs-sm); }
.check-label { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-2); cursor: pointer; font-weight: var(--fw-regular) !important; margin: 0 !important; }
.auth-divider { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0; font-size: var(--fs-xs); color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .06em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }
.social-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.btn-social { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border-strong); height: 40px; }
.btn-social:hover { background: var(--c-surface-muted); }
.btn-social[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.auth-switch { text-align: center; margin-top: var(--sp-6); font-size: var(--fs-sm); color: var(--c-text-2); }
.auth-switch a, .auth-row a, .auth-link { color: var(--c-primary); font-weight: var(--fw-semibold); }
.auth-switch a:hover, .auth-row a:hover, .auth-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 28px; padding: 0 8px; border: none; background: none; font-family: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--c-text-muted); cursor: pointer; border-radius: var(--r-sm); }
.password-toggle:hover { background: var(--c-neutral-bg); color: var(--c-text); }
.consent { font-size: var(--fs-xs); color: var(--c-text-muted); margin-bottom: var(--sp-5); line-height: 1.5; }
/* legacy login container (kept for compatibility) */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--c-side-bg); }
.login-box { width: 380px; background: var(--c-surface); border-radius: var(--r-xl); padding: var(--sp-8); }

/* ---------- Kanban ---------- */
.kanban-board { display: flex; gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-3); }
.kanban-col { background: #EEF0F4; border: 1px solid var(--c-border); border-radius: var(--r-lg); min-width: 264px; flex-shrink: 0; display: flex; flex-direction: column; max-height: 76vh; }
.kanban-col-head { padding: var(--sp-3) var(--sp-4); font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--c-text); display: flex; justify-content: space-between; }
.kanban-col-body { padding: 0 var(--sp-2) var(--sp-2); overflow-y: auto; flex: 1; }
.kanban-card {
    background: var(--c-surface); border-radius: var(--r-md); padding: var(--sp-3); margin-bottom: var(--sp-2);
    border: 1px solid var(--c-border); box-shadow: var(--sh-xs); cursor: grab; font-size: var(--fs-sm);
    transition: box-shadow var(--t-fast), border-color var(--t-fast);
}
.kanban-card:hover { box-shadow: var(--sh-sm); border-color: var(--c-border-strong); }
.kanban-card:active { cursor: grabbing; }
.kanban-card .title { font-weight: var(--fw-semibold); color: var(--c-text); margin-bottom: 4px; }
.kanban-card .value { color: var(--c-accent-text); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.kanban-card .meta { color: var(--c-text-muted); font-size: var(--fs-xs); margin-top: 4px; }
.kanban-col.drag-over { background: var(--c-primary-soft); border-color: var(--c-primary); }

/* ---------- Row actions / icon buttons ---------- */
.action-icon { vertical-align: middle; flex-shrink: 0; }
.btn-icon-text { display: inline-flex; align-items: center; gap: 6px; }
.row-actions { display: flex; gap: 6px; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--r-md);
    border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text-2); cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--c-surface-muted); color: var(--c-primary); border-color: var(--c-border-strong); }
.icon-btn.icon-btn-danger:hover { background: var(--c-error-bg); color: var(--c-error); border-color: var(--c-error-border); }
.icon-btn form { display: contents; }
.icon-btn button { position: relative; }

/* Filter dropdown */
.filter-select-wrap { display: flex; align-items: center; gap: 6px; color: var(--c-text-muted); }
.filter-select-wrap select { min-width: 170px; height: 38px; }

/* Bulk selection bar */
.bulk-actions {
    display: flex; align-items: center; gap: var(--sp-3);
    background: var(--c-primary-soft); border: 1px solid #C9DBF7; border-radius: var(--r-md);
    padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); font-size: var(--fs-sm); color: var(--c-primary); font-weight: var(--fw-medium);
}

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-4); flex-wrap: wrap; }
.pagination-summary { font-size: var(--fs-sm); color: var(--c-text-muted); }
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--r-md);
    border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium);
    transition: background var(--t-fast), border-color var(--t-fast);
}
.page-link:hover { background: var(--c-surface-muted); border-color: var(--c-border-strong); }
.page-link.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* Quotation line items */
.item-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
.item-row input { width: 100%; }
.total-row { text-align: right; font-size: var(--fs-lg); font-weight: var(--fw-semibold); margin-top: var(--sp-3); color: var(--c-text); }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--sp-5); margin-bottom: var(--sp-5); }
.dash-grid > .card { margin-bottom: 0; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.quick-action {
    display: flex; align-items: center; gap: var(--sp-2); padding: 10px var(--sp-3);
    border: 1px solid var(--c-border); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: var(--fw-medium);
    color: var(--c-text) !important; transition: background var(--t-fast), border-color var(--t-fast);
}
.quick-action:hover { background: var(--c-surface-muted); border-color: var(--c-border-strong); text-decoration: none !important; }
.quick-action .nav-icon { width: 16px; height: 16px; color: var(--c-primary); opacity: 1; }
.status-bar { display: flex; height: 10px; border-radius: var(--r-full); overflow: hidden; background: var(--c-neutral-bg); margin-bottom: var(--sp-4); }
.status-bar span { display: block; height: 100%; }
.status-bar span + span { box-shadow: -2px 0 0 var(--c-surface); }
.status-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--sp-2) var(--sp-4); }
.status-legend div { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-2); }
.status-legend i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.status-legend b { margin-left: auto; color: var(--c-text); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.welcome h1 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -.015em; }
.welcome p { color: var(--c-text-2); font-size: var(--fs-sm); margin-top: 2px; }

/* ---------- Team chat layout hooks ---------- */
.chat-layout { display: flex; height: 72vh; }
.chat-sidebar { width: 260px; border-right: 1px solid var(--c-border); overflow-y: auto; flex-shrink: 0; background: var(--c-surface-muted); }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- Section heading (within a page) ---------- */
.section-head { margin: var(--sp-2) 0 var(--sp-4); }
.section-head h2 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -.01em; }
.section-head p { font-size: var(--fs-sm); color: var(--c-text-muted); margin-top: 2px; }
* + .section-head { margin-top: var(--sp-8); }

/* ---------- Integrations ---------- */
.integration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.integration-card { display: flex; flex-direction: column; gap: var(--sp-3); margin: 0; }
.integration-card p { font-size: var(--fs-sm); color: var(--c-text-2); flex: 1; }
.integration-head { display: flex; align-items: center; gap: var(--sp-3); }
.integration-head .card-title { margin: 0; }
.integration-icon {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c-primary-soft); color: var(--c-primary);
}
.integration-icon-whatsapp { background: #E7F8EE; color: #128C4A; }
.integration-icon-instagram { background: #FDEBF3; color: #C13584; }
.integration-icon-facebook { background: #EAF1FE; color: #1877F2; }
.integration-icon-indiamart { background: var(--c-accent-soft); color: var(--c-accent-text); }
.integration-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- Small utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--c-text-muted); font-size: var(--fs-sm); }
.cell-sub { font-size: var(--fs-xs); color: var(--c-text-muted); margin-top: 2px; }
.text-warning { color: var(--c-warning); font-weight: var(--fw-medium); }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.toolbar-search { display: flex; gap: var(--sp-2); }
.toolbar-search input { min-width: 260px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--c-text-muted); margin-bottom: var(--sp-2); }
.back-link:hover { color: var(--c-primary); }
.page-header h1 .badge { vertical-align: middle; margin-left: var(--sp-2); }
.detail-list { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 10px var(--sp-5); font-size: var(--fs-base); }
.detail-list dt { color: var(--c-text-muted); }
.detail-list dd { color: var(--c-text); font-weight: var(--fw-medium); }

/* ---------- Free trial ---------- */
.trial-pill {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--sp-4);
    padding: 5px 12px 5px 10px; border-radius: var(--r-full);
    background: var(--c-accent-soft); color: var(--c-accent-text); border: 1px solid #FBE3A6;
    font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .01em;
}
.trial-pill .nav-icon { width: 15px; height: 15px; }
.trial-banner {
    display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5);
    padding: 10px var(--sp-4); border-radius: var(--r-md);
    background: var(--c-primary-soft); border: 1px solid #C9DBF7; color: var(--c-primary-hover); font-size: var(--fs-sm);
}
.trial-banner .nav-icon { width: 17px; height: 17px; flex-shrink: 0; }
.trial-banner span { flex: 1; }
.trial-banner.is-urgent { background: var(--c-warning-bg); border-color: var(--c-warning-border); color: var(--c-warning); }
.trial-banner-link { font-weight: var(--fw-semibold); white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.plan-hero {
    position: relative; display: flex; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap;
    padding: var(--sp-5); margin-bottom: var(--sp-5); border-radius: var(--r-lg); border: 1px solid;
}
.plan-hero-trial { background: linear-gradient(120deg, var(--c-primary-soft), #fff 70%); border-color: #C9DBF7; }
.plan-hero-blocked { background: var(--c-error-bg); border-color: var(--c-error-border); }
.plan-hero-icon { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--c-surface); color: var(--c-primary); box-shadow: var(--sh-xs); }
.plan-hero-blocked .plan-hero-icon { color: var(--c-error); }
.plan-hero-body { flex: 1; min-width: 220px; }
.plan-hero h2 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.plan-hero p { color: var(--c-text-2); font-size: var(--fs-sm); margin-top: 4px; max-width: 640px; }
.trial-meter { flex-basis: 100%; height: 6px; border-radius: var(--r-full); background: rgba(0, 70, 178, .1); overflow: hidden; }
.trial-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c-primary-light), var(--c-primary)); }
.contact-box { margin-top: var(--sp-5); padding: var(--sp-4); border-radius: var(--r-md); background: var(--c-surface-muted); border: 1px dashed var(--c-border-strong); }
.contact-box-title { font-weight: var(--fw-semibold); }
.contact-box p { font-size: var(--fs-sm); color: var(--c-text-2); margin: 2px 0 var(--sp-3); }
.contact-box-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

/* ---------- Plans ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.plan-card { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base); }
.plan-card.is-current, .plan-card.is-featured { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-ring), var(--sh-sm); }
.plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.plan-name { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.plan-price { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -.03em; color: var(--c-text); line-height: 1.1; margin-top: var(--sp-2); }
.plan-price span { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--c-text-muted); letter-spacing: 0; }
.plan-price-custom { font-size: var(--fs-xl); }
.plan-yearly { font-size: var(--fs-xs); color: var(--c-text-muted); }
.plan-features { font-size: var(--fs-sm); color: var(--c-text-2); flex: 1; margin: var(--sp-2) 0; }
.plan-users { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--c-text-2); padding-top: var(--sp-3); border-top: 1px solid var(--c-border); }
.plan-users .nav-icon { width: 16px; height: 16px; color: var(--c-text-muted); }
.plan-card .btn-block { margin-top: var(--sp-3); }

/* ---------- Platform (super admin) actions ---------- */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.action-card { display: flex; flex-direction: column; margin: 0; }
.action-card .card-title { justify-content: flex-start; margin-bottom: var(--sp-2); }
.action-card .card-title .nav-icon { color: var(--c-primary); }
.action-card > p { font-size: var(--fs-sm); color: var(--c-text-2); margin-bottom: var(--sp-4); }
.action-card .btn { align-self: flex-start; margin-top: auto; }

/* =========================================================
   Landing page (public/home.php) — same tokens as the app
   ========================================================= */
.lp { background: var(--c-surface); }
.lp-container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--sp-6); }
.lp-header { position: sticky; top: 0; z-index: var(--z-sticky); background: rgba(255, 255, 255, .9); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--c-border); }
.lp-header-inner { height: 72px; display: flex; align-items: center; gap: var(--sp-6); }
.lp-logo { display: inline-flex; flex-shrink: 0; }
.lp-logo-img { height: 44px; width: auto; display: block; }
.lp-nav { display: flex; gap: var(--sp-5); margin-right: auto; }
.lp-nav a { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--c-text-2); transition: color var(--t-fast); }
.lp-nav a:hover { color: var(--c-primary); }
.lp-header-actions { display: flex; align-items: center; gap: var(--sp-2); }
.lp-lang { display: flex; background: var(--c-neutral-bg); border-radius: var(--r-full); padding: 3px; margin-right: var(--sp-2); }
.lp-lang a { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--c-text-2); padding: 4px 10px; border-radius: var(--r-full); }
.lp-lang a.active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--sh-xs); }

.lp-hero {
    position: relative; overflow: hidden; padding: var(--sp-12) 0 72px;
    background:
        radial-gradient(800px 420px at 85% 0%, rgba(248, 167, 8, .14), transparent 60%),
        radial-gradient(700px 480px at 0% 100%, rgba(30, 102, 216, .12), transparent 60%),
        linear-gradient(180deg, #F7FAFF 0%, var(--c-surface) 100%);
}
.lp-hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.lp-hero h1 { font-size: clamp(32px, 4.2vw, 52px); font-weight: var(--fw-bold); line-height: 1.08; letter-spacing: -.035em; color: var(--c-text); }
.lp-lead { font-size: var(--fs-lg); line-height: 1.6; color: var(--c-text-2); margin-top: var(--sp-5); max-width: 560px; }
.lp-cta-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-8); }
.lp-cta-row .btn-lg { height: 50px; padding: 0 var(--sp-6); font-size: var(--fs-md); }
.lp-ticks { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin-top: var(--sp-6); }
.lp-ticks li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--c-text-2); }
.lp-ticks .nav-icon { width: 16px; height: 16px; color: var(--c-success); }

/* Decorative product preview */
.lp-preview { position: relative; border-radius: var(--r-xl); background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: 0 30px 60px -20px rgba(6, 27, 68, .28), 0 0 0 8px rgba(255, 255, 255, .6); overflow: visible; }
.lp-preview-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--c-border); }
.lp-preview-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--c-border-strong); }
.lp-preview-body { display: flex; min-height: 300px; }
.lp-preview-side { width: 56px; flex-shrink: 0; background: linear-gradient(180deg, var(--c-side-bg), var(--c-side-bg-2)); border-bottom-left-radius: var(--r-xl); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lp-preview-mark { width: 30px; height: 30px; border-radius: 8px; background: #fff; padding: 2px; object-fit: contain; }
.lp-preview-side i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .18); }
.lp-preview-side i.on { background: var(--c-accent); }
.lp-preview-main { flex: 1; padding: var(--sp-4); background: var(--c-bg); border-bottom-right-radius: var(--r-xl); }
.lp-preview-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.lp-preview-kpis div { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; }
.lp-preview-kpis b { font-size: 10px; font-weight: var(--fw-medium); color: var(--c-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-preview-kpis strong { font-size: var(--fs-xl); letter-spacing: -.02em; color: var(--c-text); }
.lp-preview-kpis em { font-style: normal; font-size: 10px; font-weight: var(--fw-semibold); color: var(--c-success); }
.lp-preview-pipe { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin-top: var(--sp-3); }
.lp-preview-col { background: #EEF0F4; border-radius: var(--r-md); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.lp-preview-col b { font-size: 10px; font-weight: var(--fw-semibold); color: var(--c-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-preview-col span { height: 30px; border-radius: 6px; background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--sh-xs); }
.lp-preview-col:last-child span { border-left: 3px solid var(--c-success); }
.lp-preview-toast { position: absolute; left: -24px; bottom: 28px; display: flex; align-items: center; gap: var(--sp-2); padding: 10px 14px; border-radius: var(--r-md); background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--sh-md); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--c-text); }
.lp-preview-toast .nav-icon { color: #128C4A; }

.lp-channels { padding: var(--sp-8) 0; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); background: var(--c-surface); }
.lp-channels-title { text-align: center; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .12em; text-transform: uppercase; color: var(--c-text-muted); margin-bottom: var(--sp-5); }
.lp-channel-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3) var(--sp-8); }
.lp-channel-list li { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--c-text-2); }
.lp-channel-list .integration-icon { width: 32px; height: 32px; border-radius: 9px; }

.lp-section { padding: 88px 0; }
.lp-section-alt { background: var(--c-surface-muted); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.lp-section-head { text-align: center; max-width: 680px; margin: 0 auto var(--sp-10); }
.lp-eyebrow { display: inline-block; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent-text); margin-bottom: var(--sp-3); }
.lp-section-head h2, .lp-final h2 { font-size: clamp(26px, 3vw, 36px); font-weight: var(--fw-bold); letter-spacing: -.03em; line-height: 1.15; }
.lp-section-head p { font-size: var(--fs-md); color: var(--c-text-2); margin-top: var(--sp-3); }
.lp-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.lp-feature { padding: var(--sp-6); border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base); }
.lp-feature:hover { border-color: #C9DBF7; box-shadow: var(--sh-md); transform: translateY(-2px); }
.lp-feature-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-primary-soft); color: var(--c-primary); margin-bottom: var(--sp-4); }
.lp-feature h3 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.lp-feature p { font-size: var(--fs-sm); color: var(--c-text-2); margin-top: var(--sp-2); }
.lp-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); counter-reset: step; }
.lp-steps li { position: relative; padding: var(--sp-6); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.lp-step-num { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--c-primary); color: #fff; font-weight: var(--fw-bold); margin-bottom: var(--sp-4); }
.lp-steps li:nth-child(2) .lp-step-num { background: var(--c-accent); color: var(--c-on-accent); }
.lp-steps h3 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.lp-steps p { font-size: var(--fs-sm); color: var(--c-text-2); margin-top: var(--sp-2); }
.lp-plan-grid .plan-card { padding: var(--sp-6); }
.lp-plan-grid .plan-card.is-featured { transform: translateY(-6px); }
.lp-faq-wrap { max-width: 820px; }
.lp-faq details { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); margin-bottom: var(--sp-3); }
.lp-faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); font-weight: var(--fw-semibold); font-size: var(--fs-md); }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary .nav-icon { flex-shrink: 0; color: var(--c-text-muted); transition: transform var(--t-base); }
.lp-faq details[open] summary .nav-icon { transform: rotate(180deg); }
.lp-faq details p { padding: 0 var(--sp-5) var(--sp-5); color: var(--c-text-2); font-size: var(--fs-base); }
.lp-final { padding: 72px 0; background: radial-gradient(700px 300px at 90% 0%, rgba(248, 167, 8, .2), transparent 60%), linear-gradient(160deg, var(--c-side-bg), var(--c-side-bg-2)); color: #fff; }
.lp-final-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); flex-wrap: wrap; }
.lp-final h2 { color: #fff; }
.lp-final p { color: var(--c-side-text); margin-top: var(--sp-2); font-size: var(--fs-md); }
.lp-footer { padding: var(--sp-8) 0; border-top: 1px solid var(--c-border); }
.lp-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4) var(--sp-8); flex-wrap: wrap; }
.lp-footer-brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-bold); color: var(--c-primary); }
.lp-footer-brand .brand-mark-img { box-shadow: none; padding: 0; width: 30px; height: 30px; }
.lp-footer-brand .brand-text-accent { color: var(--c-accent-text); }
.lp-footer-links { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.lp-footer-links a { font-size: var(--fs-sm); color: var(--c-text-2); }
.lp-footer-links a:hover { color: var(--c-primary); }
.lp-copy { font-size: var(--fs-xs); color: var(--c-text-muted); flex-basis: 100%; }

@media (max-width: 1023px) {
    .lp-nav { display: none; }
    .lp-hero-inner { grid-template-columns: 1fr; gap: var(--sp-10); }
    .lp-preview { max-width: 560px; }
    .lp-preview-toast { left: auto; right: 12px; bottom: -18px; }
    .lp-feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .lp-container { padding: 0 var(--sp-4); }
    .lp-header-inner { height: 62px; gap: var(--sp-3); }
    .lp-logo-img { height: 34px; }
    .lp-header .lp-lang, .lp-signin { display: none; }
    .lp-hero { padding: var(--sp-8) 0 var(--sp-12); }
    .lp-lead { font-size: var(--fs-md); }
    .lp-cta-row .btn-lg { flex: 1 1 100%; }
    .lp-preview-kpis strong { font-size: var(--fs-md); }
    .lp-section { padding: 56px 0; }
    .lp-feature-grid, .lp-steps { grid-template-columns: 1fr; }
    .lp-plan-grid .plan-card.is-featured { transform: none; }
    .lp-final-inner .btn-lg { width: 100%; }
    .toolbar-search { width: 100%; }
    .toolbar-search input { min-width: 0; flex: 1; }
    .detail-list { grid-template-columns: 1fr; gap: 2px; }
    .detail-list dd { margin-bottom: var(--sp-2); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
    .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: 280px !important;
        transform: translateX(-100%); box-shadow: var(--sh-lg);
    }
    .drawer-open .sidebar { transform: none; }
    .drawer-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: var(--z-backdrop); animation: fade-in var(--t-base); }
    .sidebar-is-collapsed .sidebar .brand-text,
    .sidebar-is-collapsed .sidebar .nav-link span,
    .sidebar-is-collapsed .sidebar .nav-group-header span { display: inline; }
    .sidebar-is-collapsed .sidebar .nav-group-header .nav-icon:last-child { display: block; }
    .sidebar-is-collapsed .sidebar .nav-group-items { display: flex; }
    .sidebar-is-collapsed .sidebar-brand { flex-direction: row; justify-content: space-between; padding: 0 var(--sp-3) 0 var(--sp-4); }
    .sidebar-is-collapsed .sidebar-brand .brand-link { display: flex; }
    .sidebar-is-collapsed .nav-link, .sidebar-is-collapsed .nav-group-header { justify-content: flex-start; padding: 0 var(--sp-3); min-height: 38px; }
    .sidebar-is-collapsed .nav-sublink { padding-left: 42px; }
    .topbar .topbar-menu-btn { display: inline-flex; }
    .topbar { padding: 0 var(--sp-4); }
    .content { padding: var(--sp-5) var(--sp-4); }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { padding: var(--sp-8) var(--sp-6); gap: var(--sp-6); }
    .auth-features, .auth-foot { display: none; }
    .auth-lead { margin-top: var(--sp-2); }
}
@media (max-width: 767px) {
    :root { --topbar-h: 58px; }
    .form-row { grid-template-columns: 1fr; }
    .form-row > .card + .card { margin-top: 0; }
    .profile-meta, .profile-btn > .nav-icon, .lang-switcher-btn span, .lang-switcher-btn .nav-icon:last-child { display: none; }
    .lang-switcher-btn { width: 36px; padding: 0; justify-content: center; }
    .breadcrumb { display: none; }
    .page-title { font-size: var(--fs-md); }
    .card { padding: var(--sp-4); border-radius: var(--r-md); }
    .card:has(> table), .card:has(> form > table) { overflow-x: auto; }
    .card > table, .card > form > table { min-width: 640px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar > div, .toolbar form { flex-wrap: wrap; }
    .toolbar input[type=text] { min-width: 0; flex: 1; }
    .toolbar-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
    .stat-card { padding: var(--sp-3) var(--sp-4); }
    .stat-card .num { font-size: var(--fs-xl); }
    .stat-icon { display: none; }
    .item-row { grid-template-columns: 1fr 1fr; }
    .pagination { justify-content: center; }
    .chat-layout { flex-direction: column; height: auto; }
    .chat-sidebar { width: 100%; max-height: 260px; border-right: none; border-bottom: 1px solid var(--c-border); }
    .chat-main { min-height: 60vh; }
    .auth-panel { padding: var(--sp-4); }
    .auth-form-wrap { padding: var(--sp-4) 0 var(--sp-8); }
    .auth-brand { padding: var(--sp-6) var(--sp-4); }
    .auth-logo { padding: 10px 14px; border-radius: var(--r-lg); }
    .auth-logo img.brand-logo-full { height: 52px; }
    .auth-headline { font-size: var(--fs-xl); }
    .auth-lead { font-size: var(--fs-sm); }
    .quick-actions { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Platform → company → Modules ---------- */
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--c-border); }
.card:not(.card-flush) > .card-actions { padding: 16px 0 0; margin-top: 8px; }
.module-features { margin-top: 16px; }
.module-features .card-title { display: flex; align-items: center; gap: 8px; }
.feature-group { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.feature-group legend { font-weight: 600; font-size: .8125rem; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; padding: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 20px; align-items: start; }
.feature-grid .form-group { margin: 0; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface-muted); cursor: pointer; }
.check-row:hover { border-color: var(--c-border-strong); }
.check-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--c-primary); }
.check-row > span { display: flex; flex-direction: column; gap: 2px; }
.check-row .check-label { font-weight: 500; color: var(--c-text); }

/* ---------- CallMitra pages ---------- */
.check-row.is-locked { opacity: .6; cursor: not-allowed; }
.module-features code { display: inline-block; padding: 1px 6px; margin: 2px 2px 2px 0; border-radius: 6px; background: var(--c-primary-soft); color: var(--c-primary); font-size: .8125rem; }
.module-features textarea { width: 100%; }

/* ---------- CallMitra packages & payments ---------- */
.pay-info { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); margin: var(--sp-4) 0; font-size: var(--fs-sm); }
.pay-info dt { color: var(--c-text-muted); }
.pay-info dd { margin: 0; color: var(--c-text); }
.plan-card form { margin-top: auto; }
