:root {
    --dms-bg: #f5f7fb;
    --dms-surface: #ffffff;
    --dms-text: #1f2937;
    --dms-muted: #667085;
    --dms-border: #e4e7ec;
    --dms-red: #e5293a;
    --dms-red-2: #c31d2c;
    --dms-navy: #0d1220;
    --dms-shadow: 0 14px 35px rgba(31, 41, 55, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    background: var(--dms-bg);
    color: var(--dms-text);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
    overflow-x: hidden;
}

body.wa-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

body.wa-page > main {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}


img, svg {
    max-width: 100%;
    height: auto;
}

.dms-navbar {
    background: var(--dms-surface);
    border-bottom: 1px solid var(--dms-border);
    box-shadow: 0 4px 14px rgba(31, 41, 55, 0.04);
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 1050;
    padding-top: 4px;
}

.dms-navbar-spacer {
    height: var(--dms-navbar-height, 72px);
}
.dms-navbar::before {
    content: "";
    display: block;
    height: 3px;
    margin-top: -4px;
    background: linear-gradient(90deg, var(--dms-red), var(--dms-navy) 60%, var(--dms-navy));
}
.dms-navbar .nav-link {
    transition: color .15s, background .15s;
    border-radius: 8px;
}
.dms-navbar .nav-link:hover,
.dms-navbar .nav-link:focus {
    color: var(--dms-red);
}
.dms-navbar .nav-link.active {
    color: var(--dms-red);
    background: rgba(229, 41, 58, .08);
    font-weight: 700;
}
.dms-portal-toggle {
    background: color-mix(in srgb, var(--portal-color, var(--dms-red)) 10%, transparent);
    border-radius: 999px;
    padding: 6px 14px !important;
}

/* Top-of-page navigation progress bar, pinned to the bottom edge of the
   sticky navbar. Hidden by default; JS toggles .is-loading on it whenever a
   real page navigation (link click / form submit) is in flight. Since this
   app is server-rendered (full page loads, not an SPA), the bar is only
   visible during the actual network/round-trip gap and disappears the
   instant the next page's DOM replaces this one - it isn't a fake infinite
   spinner. */
.page-loader-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%);
    height: 3px;
    background: rgba(229, 41, 58, 0.12);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1029;
}

.page-loader-bar.is-loading {
    opacity: 1;
}

.page-loader-bar__fill {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(90deg, var(--dms-red), var(--dms-navy));
}

.page-loader-bar.is-loading .page-loader-bar__fill {
    animation: page-loader-fill 2s ease infinite;
}

@keyframes page-loader-fill {
    0%   { width: 0%; }
    10%  { width: 10%; }
    50%  { width: 40%; }
    60%  { width: 60%; }
    100% { width: 100%; }
}

.brand-mark {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--dms-border);
    border-radius: 10px;
    color: #ffffff;
    display: inline-flex;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    width: 40px;
    padding: 1px;
    box-shadow: 0 6px 14px rgba(13, 18, 32, .08);
}
.brand-mark img,
.home-hero-mark img,
.brand-mark-lg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dms-branch-header-logo-wrap {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    height: 48px;
    justify-content: flex-start;
    max-width: 260px;
    overflow: hidden;
}

.dms-branch-header-logo {
    display: block;
    height: 100%;
    max-height: 48px;
    max-width: 260px;
    object-fit: contain;
    width: auto;
}

.brand-title,
.brand-subtitle {
    display: block;
    line-height: 1.1;
}

.brand-title {
    color: var(--dms-text);
    font-size: 0.98rem;
    font-weight: 800;
}

.brand-subtitle {
    color: var(--dms-muted);
    font-size: 0.75rem;
    margin-top: 3px;
}

.dms-user {
    color: var(--dms-text);
    font-weight: 600;
    background: #f4f6fb;
    border-radius: 999px;
    padding: 4px 14px;
    font-size: .85rem;
}

.dms-logout {
    min-width: 88px;
    font-weight: 600;
    transition: background .15s, color .15s;
}
.dms-logout:hover {
    background: var(--dms-red);
    border-color: var(--dms-red);
    color: #fff;
}

.dms-branch-link {
    font-weight: 700;
}

.dms-branch-menu {
    min-width: 240px;
}

.dms-dashboard {
    min-height: calc(100vh - 66px);
    padding: 54px 0 70px;
    background:
        radial-gradient(circle at 8% 0%, rgba(229, 41, 58, .05), transparent 40%),
        radial-gradient(circle at 95% 15%, rgba(13, 18, 32, .05), transparent 40%),
        var(--dms-bg);
}

.dms-home {
    padding-top: 38px;
}

/* Shared full-width shell for portal dashboards (Accounts/Sales/Service/
   User Management/Home). Replaces Bootstrap's fixed-breakpoint .container
   (540/720/960/1140/1320px steps), which was the actual cause of the
   dashboard staying ~1200px wide on much larger viewports no matter what
   the inner hero/grid CSS said. */
.portal-page-container {
    width: calc(100% - clamp(24px, 4vw, 64px));
    max-width: none;
    margin-inline: auto;
}

.home-hero {
    position: relative;
    align-items: center;
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 18px;
    box-shadow: 0 24px 48px -16px rgba(13, 18, 32, .16), 0 4px 14px rgba(13, 18, 32, .05);
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    justify-content: space-between;
    margin: 0 auto 30px;
    max-width: none;
    width: 100%;
    padding: clamp(18px, 2.5vw, 30px) clamp(18px, 3vw, 34px);
    overflow: hidden;
}
.home-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--dms-red), var(--dms-navy) 60%, var(--dms-navy));
}

.home-hero-brand {
    align-items: center;
    display: flex;
    gap: 18px;
    min-width: 0;
}

.home-hero-mark {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--dms-border);
    border-radius: 16px;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 900;
    height: clamp(58px, 6vw, 76px);
    justify-content: center;
    width: clamp(58px, 6vw, 76px);
    padding: 3px;
    box-shadow: 0 14px 28px rgba(13, 18, 32, .1), inset 0 1px 0 rgba(255,255,255,.2);
}

.home-hero h1 {
    color: #152238;
    font-size: clamp(1.65rem, 2.6vw, 2.1rem);
    font-weight: 900;
    letter-spacing: -.01em;
    line-height: 1.1;
    margin: 0;
}

.home-hero-subtitle {
    color: var(--dms-muted);
    font-size: 0.94rem;
    margin: 8px 0 0;
}

.home-hero-meta {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 10px;
    white-space: nowrap;
}

.home-branch-chip,
.home-meta-line {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 800;
    gap: 8px;
}

.home-branch-chip {
    background: linear-gradient(135deg, #fff5f5, #fff1f2);
    border: 1px solid rgba(229, 41, 58, .2);
    color: var(--dms-red);
    padding: 8px 16px;
    font-size: .85rem;
}

.home-meta-line {
    color: var(--dms-muted);
    font-size: 0.82rem;
}

.home-section-header {
    align-items: center;
    display: flex;
    gap: 14px;
}

.home-section-icon {
    align-items: center;
    border-radius: 12px;
    display: flex;
    font-size: 1.4rem;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.home-section-title {
    font-size: 1.2rem;
    font-weight: 800;
}

.home-section-subtitle {
    font-size: 0.88rem;
}

.dashboard-heading {
    margin: 0 auto 34px;
    max-width: 720px;
}

.section-kicker {
    color: var(--dms-red);
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.dashboard-heading h1 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
}

.dashboard-heading p,
.workspace-panel p {
    color: var(--dms-muted);
}

.module-header-info h1 {
    color: var(--dms-text);
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin: 2px 0 4px;
    white-space: nowrap;
}

.module-header-info p {
    color: var(--dms-muted);
    font-size: 14px;
    line-height: 1.35;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-grid {
    display: grid;
    gap: clamp(12px, 1.4vw, 22px);
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
    margin: 0 auto;
    max-width: none;
    width: 100%;
}

.dashboard-counters {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    margin: 0 auto 28px;
    max-width: none;
    width: 100%;
}

.module-grid > *,
.dashboard-counters > * {
    min-width: 0;
    width: 100%;
}

.dms-analytics {
    padding-top: 28px;
}

.analytics-hero {
    align-items: center;
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    box-shadow: var(--dms-shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin: 0 auto 18px;
    max-width: 1680px;
    width: 100%;
    padding: clamp(16px, 2vw, 24px) clamp(16px, 2.5vw, 28px);
}

.analytics-hero h1 {
    color: #152238;
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 900;
    line-height: 1.1;
    margin: 0;
}

.analytics-hero p {
    color: var(--dms-muted);
    margin: 8px 0 0;
}

.analytics-hero-side {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-kpi-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    margin: 0 auto 18px;
    max-width: 1680px;
    width: 100%;
}

.dashboard-kpi-card {
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(31, 41, 55, 0.045);
    min-height: 122px;
    padding: 18px;
}

.dashboard-kpi-icon {
    align-items: center;
    background: #fff1f2;
    border-radius: 8px;
    color: var(--dms-red);
    display: inline-flex;
    height: 34px;
    justify-content: center;
    margin-bottom: 14px;
    width: 34px;
}

.dashboard-kpi-label {
    color: var(--dms-muted);
    display: block;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-kpi-card strong {
    color: #152238;
    display: block;
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1.2;
    margin-top: 6px;
}

.analytics-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 auto 18px;
    max-width: 1680px;
}

.analytics-grid-wide {
    align-items: start;
}

.analytics-panel {
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.05);
    margin: 0 auto 18px;
    max-width: 1680px;
    padding: 18px;
    width: 100%;
}

.analytics-panel-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--dms-border);
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
}

/* Unified automotive executive dashboard */
.auto-command {
    --cmd-navy: #0b1f3a;
    --cmd-blue: #1769e0;
    --cmd-green: #0b9b6f;
    --cmd-amber: #e79018;
    --cmd-red: #d94645;
    --cmd-purple: #7656d6;
    background: #f3f6fa;
    min-height: calc(100vh - 72px);
    padding: 24px 0 42px;
}

.command-hero {
    align-items: center;
    background:
        radial-gradient(circle at 82% 15%, rgba(68, 124, 208, .32), transparent 30%),
        linear-gradient(128deg, #071629 0%, #102d51 62%, #123969 100%);
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(8, 30, 58, .18);
    color: #fff;
    display: flex;
    gap: 28px;
    justify-content: space-between;
    margin: 0 auto 18px;
    max-width: 1720px;
    overflow: hidden;
    padding: 30px 34px;
    position: relative;
}

.command-hero::after {
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    content: "";
    height: 260px;
    position: absolute;
    right: 9%;
    top: -155px;
    width: 260px;
}

.command-eyebrow, .panel-kicker {
    color: #6f9ddc;
    display: block;
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.command-eyebrow i { color: #53d2a7; margin-right: 6px; }
.command-hero h1 { font-size: clamp(1.75rem, 3vw, 2.7rem); font-weight: 850; letter-spacing: -.035em; margin: 7px 0; }
.command-subtitle { color: #bdcce0; margin: 0; max-width: 760px; }
.command-context { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.command-context span { color: #d8e2ef; font-size: .78rem; font-weight: 650; }
.command-context i { color: #7fa9df; margin-right: 5px; }
.command-context .command-live { color: #7ee2bc; }
.command-context .command-live i { color: #32c48d; font-size: .48rem; vertical-align: 2px; }
.command-hero-actions { display: flex; flex-shrink: 0; gap: 10px; position: relative; z-index: 1; }
.command-btn { align-items: center; border-radius: 9px; display: inline-flex; font-size: .82rem; font-weight: 750; gap: 8px; padding: 11px 15px; text-decoration: none; }
.command-btn-ghost { border: 1px solid rgba(255,255,255,.25); color: #fff; }
.command-btn-primary { background: #fff; color: var(--cmd-navy); }
.command-btn:hover { filter: brightness(.96); transform: translateY(-1px); }

.command-kpis {
    display: grid;
    gap: 13px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0 auto 18px;
    max-width: 1720px;
}

.command-kpi, .command-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 7px 20px rgba(17, 35, 60, .045);
}

.command-kpi { border-top: 3px solid var(--tone, var(--cmd-blue)); min-width: 0; padding: 16px; }
.command-kpi.tone-navy { --tone: var(--cmd-navy); }
.command-kpi.tone-green { --tone: var(--cmd-green); }
.command-kpi.tone-amber { --tone: var(--cmd-amber); }
.command-kpi.tone-purple { --tone: var(--cmd-purple); }
.command-kpi.tone-blue { --tone: var(--cmd-blue); }
.command-kpi.tone-red { --tone: var(--cmd-red); }
.command-kpi-top { align-items: center; display: flex; justify-content: space-between; margin-bottom: 15px; }
.command-kpi-icon { align-items: center; background: color-mix(in srgb, var(--tone) 11%, white); border-radius: 9px; color: var(--tone); display: inline-flex; height: 34px; justify-content: center; width: 34px; }
.command-kpi-trend { color: #b6c1cf; font-size: .75rem; }
.command-kpi-label { color: #6b7b90; display: block; font-size: .68rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.command-kpi strong { color: #11233d; display: block; font-size: clamp(1.08rem, 1.45vw, 1.52rem); font-weight: 850; letter-spacing: -.025em; margin: 6px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-kpi small { color: #8a98aa; display: block; font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.command-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); margin: 0 auto 18px; max-width: 1720px; }
.command-main, .command-side { min-width: 0; }
.command-side { display: flex; flex-direction: column; gap: 18px; }
.command-panel { padding: 20px; }
.command-side .command-panel { padding: 18px; }
.command-panel-head { align-items: flex-start; display: flex; gap: 15px; justify-content: space-between; margin-bottom: 18px; }
.command-panel-head h2 { color: #10233d; font-size: 1.06rem; font-weight: 850; margin: 4px 0 2px; }
.command-panel-head p { color: #8794a6; font-size: .74rem; margin: 0; }
.panel-link { color: #3b6fab; flex-shrink: 0; font-size: .72rem; font-weight: 750; margin-top: 7px; text-decoration: none; }
.panel-link i { font-size: .62rem; margin-left: 4px; }
.command-split { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.portal-sales .command-split,
.portal-service .command-split { grid-template-columns: 1fr; }
.portal-sales .command-split .command-panel,
.portal-service .command-split .command-panel { margin: 0; }
.portal-user_management { grid-template-columns: 1fr; }
.portal-user_management .command-main { display: none; }
.portal-user_management .command-side {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.portal-user_management .command-side > .command-panel {
    height: 100%;
    margin: 0;
}

.revenue-chart { align-items: end; display: grid; gap: clamp(12px, 3vw, 42px); grid-template-columns: repeat(6, 1fr); height: 250px; padding: 28px 20px 0; position: relative; }
.chart-grid-lines { inset: 18px 0 28px; position: absolute; }
.chart-grid-lines i { border-top: 1px dashed #dfe6ef; display: block; height: 25%; }
.revenue-column { align-items: center; display: flex; flex-direction: column; height: 100%; justify-content: end; min-width: 0; position: relative; z-index: 1; }
.revenue-bar-wrap { align-items: end; display: flex; height: 175px; justify-content: center; width: 100%; }
.revenue-bar { background: linear-gradient(180deg, #327fe6, #0b2d58); border-radius: 6px 6px 2px 2px; box-shadow: 0 7px 15px rgba(20, 74, 139, .2); max-width: 44px; min-height: 5px; width: 72%; }
.revenue-value { color: #54657b; font-size: .58rem; font-weight: 750; margin-bottom: 5px; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.revenue-column:hover .revenue-value { opacity: 1; }
.revenue-column > strong { color: #748397; font-size: .7rem; margin-top: 9px; }
.chart-legend { border-top: 1px solid #edf1f6; color: #8693a4; display: flex; font-size: .68rem; justify-content: space-between; margin-top: 8px; padding-top: 13px; }
.legend-dot { border-radius: 50%; display: inline-block; height: 7px; margin-right: 5px; width: 7px; }
.legend-navy { background: #174f91; }

.workshop-pipeline { display: grid; gap: 13px; }
.pipeline-row { align-items: center; display: grid; gap: 8px; grid-template-columns: 9px minmax(86px, auto) 25px 1fr; }
.pipeline-row > span:nth-child(2) { color: #596a7f; font-size: .73rem; }
.pipeline-row strong { color: #142741; font-size: .76rem; text-align: right; }
.pipeline-dot { border-radius: 50%; height: 8px; width: 8px; }
.pipeline-track { background: #edf1f5; border-radius: 10px; height: 6px; overflow: hidden; }
.pipeline-track i { border-radius: inherit; display: block; height: 100%; max-width: 100%; min-width: 3px; }
.pipeline-dot.tone-blue,
.pipeline-track .tone-blue,
.activity-avatar.tone-blue { background-color: var(--cmd-blue); }
.pipeline-dot.tone-amber,
.pipeline-track .tone-amber,
.activity-avatar.tone-amber { background-color: var(--cmd-amber); }
.pipeline-dot.tone-red,
.pipeline-track .tone-red,
.activity-avatar.tone-red { background-color: var(--cmd-red); }
.pipeline-dot.tone-purple,
.pipeline-track .tone-purple,
.activity-avatar.tone-purple { background-color: var(--cmd-purple); }
.pipeline-dot.tone-green,
.pipeline-track .tone-green,
.activity-avatar.tone-green { background-color: var(--cmd-green); }
.pipeline-footer { border-top: 1px solid #edf1f5; color: #8794a5; display: flex; font-size: .68rem; gap: 24px; margin-top: 18px; padding-top: 13px; }
.pipeline-footer strong { color: #203550; }

.stock-orbit {
    background: conic-gradient(
        var(--cmd-green) 0 var(--stock-available-end, 0%),
        var(--cmd-amber) var(--stock-available-end, 0%) var(--stock-booked-end, 0%),
        var(--cmd-blue) var(--stock-booked-end, 0%) 100%
    );
    border-radius: 50%;
    height: 145px;
    margin: 5px auto 16px;
    padding: 18px;
    width: 145px;
}
.stock-orbit-center { align-items: center; background: #fff; border-radius: 50%; display: flex; flex-direction: column; height: 100%; justify-content: center; width: 100%; }
.stock-orbit-center strong { color: #122944; font-size: 1.65rem; line-height: 1; }
.stock-orbit-center span { color: #8794a6; font-size: .66rem; margin-top: 5px; }
.stock-legend { display: grid; gap: 9px; }
.stock-legend div { align-items: center; color: #69798d; display: grid; font-size: .7rem; grid-template-columns: 8px 1fr auto; }
.stock-legend i { border-radius: 50%; height: 7px; width: 7px; }
.stock-legend strong { color: #203550; }
.stock-available { background: var(--cmd-green); }
.stock-booked { background: var(--cmd-amber); }
.stock-delivered { background: var(--cmd-blue); }

.alert-count { align-items: center; background: #eef3f9; border-radius: 20px; color: #52667f; display: flex; font-size: .68rem; font-weight: 800; height: 27px; justify-content: center; width: 27px; }
.alert-list { display: grid; gap: 9px; }
.alert-item { align-items: center; border: 1px solid #e7ecf2; border-radius: 9px; color: #506176; display: grid; font-size: .72rem; gap: 9px; grid-template-columns: 30px 1fr auto 7px; padding: 9px; text-decoration: none; }
.alert-item:hover { background: #f8fafc; color: #203650; }
.alert-icon { align-items: center; background: #f0f4f8; border-radius: 7px; display: flex; height: 30px; justify-content: center; width: 30px; }
.severity-danger .alert-icon { background: #fff0f0; color: var(--cmd-red); }
.severity-warning .alert-icon { background: #fff7e8; color: var(--cmd-amber); }
.severity-ok .alert-icon { background: #eaf9f3; color: var(--cmd-green); }
.alert-item > strong { color: #1c304b; font-size: .8rem; }
.alert-item > .fa-chevron-right { color: #b2bdc9; font-size: .55rem; }

.quick-action-grid { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-action-grid a { align-items: center; background: #f7f9fc; border: 1px solid #e7ecf2; border-radius: 9px; color: #4e6076; display: flex; flex-direction: column; font-size: .65rem; font-weight: 700; gap: 7px; min-height: 72px; justify-content: center; padding: 8px; text-align: center; text-decoration: none; }
.quick-action-grid a:hover { background: #edf4fd; border-color: #c9dbf1; color: #174f91; transform: translateY(-1px); }
.quick-action-grid i { color: #2e6eb8; font-size: 1rem; }
.compact-stat-row { align-items: center; border-top: 1px solid #edf1f5; color: #687a90; display: flex; font-size: .72rem; justify-content: space-between; padding: 10px 0; }
.compact-stat-row:first-of-type { border-top: 0; }
.compact-stat-row strong { color: #19314f; }

.activity-panel, .branch-panel { margin: 0 auto 18px; max-width: 1720px; }
.activity-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.activity-portal-sales { grid-template-columns: 1fr; }
.activity-portal-service,
.activity-portal-accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.activity-column { border-left: 1px solid #e8edf3; min-width: 0; padding: 0 20px; }
.activity-column:first-child { border-left: 0; padding-left: 0; }
.activity-column:last-child { padding-right: 0; }
.activity-column h3 { color: #324963; font-size: .75rem; font-weight: 800; margin: 0 0 10px; }
.activity-column h3 i { color: #7890aa; margin-right: 6px; }
.activity-row { align-items: center; border-top: 1px solid #edf1f5; display: grid; gap: 9px; grid-template-columns: 34px minmax(0, 1fr) auto; padding: 10px 0; }
.activity-avatar { align-items: center; border-radius: 8px; color: #fff; display: flex; height: 32px; justify-content: center; width: 32px; }
.activity-row div { min-width: 0; }
.activity-row div strong, .activity-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-row div strong { color: #243a55; font-size: .7rem; }
.activity-row small { color: #8b98a8; font-size: .62rem; margin-top: 2px; }
.activity-row b { color: #263d58; font-size: .67rem; white-space: nowrap; }
.activity-empty { color: #95a1af; font-size: .72rem; padding: 15px 0; }

@media (max-width: 1280px) {
    .command-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .command-layout { grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); }
}

@media (max-width: 992px) {
    .command-layout { grid-template-columns: 1fr; }
    .command-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .command-side .compact-stats { grid-column: 1 / -1; }
    .portal-user_management .command-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-user_management .command-side > .compact-stats { grid-column: 1 / -1; }
    .activity-columns { grid-template-columns: 1fr; }
    .activity-column, .activity-column:first-child, .activity-column:last-child { border-left: 0; border-top: 1px solid #e8edf3; padding: 18px 0; }
    .activity-column:first-child { border-top: 0; padding-top: 0; }
}

@media (max-width: 700px) {
    .auto-command { padding-top: 12px; }
    .command-hero { align-items: flex-start; border-radius: 13px; flex-direction: column; padding: 23px 20px; }
    .command-hero-actions { width: 100%; }
    .command-btn { flex: 1; justify-content: center; }
    .command-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .command-split, .command-side { grid-template-columns: 1fr; }
    .portal-user_management .command-side { grid-template-columns: 1fr; }
    .portal-user_management .command-side > .compact-stats { grid-column: auto; }
    .command-side .compact-stats { grid-column: auto; }
    .revenue-chart { gap: 7px; padding-left: 4px; padding-right: 4px; }
    .revenue-value { display: none; }
    .chart-legend { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (max-width: 430px) {
    .command-kpis { grid-template-columns: 1fr; }
    .command-hero-actions { flex-direction: column; }
    .command-context { flex-direction: column; gap: 7px; }
}

/* CRM workspaces */
.crm-workspace { background: #f3f6fa; min-height: calc(100vh - 72px); padding: 24px 0 42px; }
.crm-hero { align-items: center; background: linear-gradient(125deg, #09223f, #134f83); border-radius: 16px; color: #fff; display: flex; justify-content: space-between; margin-bottom: 14px; padding: 26px 30px; }
.crm-sales .crm-hero { background: linear-gradient(125deg, #332008, #9b5a0c); }
.crm-kicker { color: #76a9e5; font-size: .7rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.crm-sales .crm-kicker { color: #ffd38b; }
.crm-hero h1, .crm-list-head h1 { font-size: clamp(1.6rem, 2.5vw, 2.3rem); font-weight: 850; margin: 5px 0; }
.crm-hero p { color: rgba(255,255,255,.72); margin: 0; }
.crm-hero-actions { display: flex; gap: 9px; }
.crm-nav { background: #fff; border: 1px solid #e1e7ef; border-radius: 11px; display: flex; gap: 5px; margin-bottom: 14px; padding: 6px; }
.crm-nav a { border-radius: 7px; color: #5d6c80; font-size: .76rem; font-weight: 750; padding: 9px 13px; text-decoration: none; }
.crm-nav a.active { background: #eaf2fd; color: #15569f; }
.crm-sales .crm-nav a.active { background: #fff3df; color: #9b5a0c; }
.crm-module-grid { display: grid; gap: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 18px 0 22px; }
.crm-module-card { align-items: center; background: #fff; border: 1px solid #dce4ee; border-radius: 15px; box-shadow: 0 9px 24px rgba(30,51,76,.055); color: #15243a; display: flex; flex-direction: column; justify-content: center; min-height: 190px; padding: 24px 18px; text-align: center; text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.crm-module-card:hover { border-color: #d99b35; box-shadow: 0 15px 32px rgba(77,47,9,.13); color: #7b4708; transform: translateY(-4px); }
.crm-module-card.active { border: 2px solid #d99020; box-shadow: 0 14px 30px rgba(108,65,10,.13); color: #7c4708; padding: 23px 17px; }
.crm-module-icon { align-items: center; background: #245ddd; border-radius: 14px; box-shadow: 0 12px 25px rgba(36,93,221,.2); color: #fff; display: inline-flex; font-size: 1.45rem; height: 72px; justify-content: center; margin-bottom: 17px; width: 72px; }
.crm-module-card-2 .crm-module-icon, .crm-module-card-7 .crm-module-icon { background: #0797bd; box-shadow-color: rgba(7,151,189,.2); }
.crm-module-card-3 .crm-module-icon, .crm-module-card-8 .crm-module-icon { background: #7c35ea; box-shadow-color: rgba(124,53,234,.2); }
.crm-module-card-4 .crm-module-icon, .crm-module-card-9 .crm-module-icon { background: #e11d2e; box-shadow-color: rgba(225,29,46,.2); }
.crm-module-card-5 .crm-module-icon, .crm-module-card-10 .crm-module-icon { background: #be7918; box-shadow-color: rgba(190,121,24,.2); }
.crm-module-card-6 .crm-module-icon, .crm-module-card-11 .crm-module-icon { background: #149f57; box-shadow-color: rgba(20,159,87,.2); }
.crm-module-card.active .crm-module-icon { box-shadow: 0 13px 27px rgba(110,66,8,.2); }
.crm-module-copy { display: flex; flex-direction: column; min-width: 0; }
.crm-module-copy strong { font-size: 1rem; font-weight: 850; line-height: 1.2; }
.crm-module-copy small { color: #697a91; font-size: .76rem; line-height: 1.45; margin-top: 8px; }
.crm-module-card.active .crm-module-copy small { color: #845d26; }
.crm-module-back-wrap { display: flex; margin: 2px 0 16px; }
.crm-module-back { align-items: center; background: #fff; border: 1px solid #d8e0ea; border-radius: 10px; color: #4e6076; display: inline-flex; font-size: .78rem; font-weight: 800; gap: 9px; padding: 10px 15px; text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease; }
.crm-module-back i { color: #bb7414; }
.crm-module-back:hover { border-color: #d39a42; box-shadow: 0 7px 18px rgba(91,55,9,.1); color: #8b5209; transform: translateX(-2px); }
.crm-hero .crm-module-back { border-color: rgba(255,255,255,.72); color: #27384c; min-height: 42px; }
.crm-hero .crm-module-back:hover { background: #fff8ec; border-color: #fff; color: #7d4908; }
.crm-visit-section { border-bottom: 1px solid #e3e8ef; margin-bottom: 23px; padding-bottom: 23px; }
.crm-visit-section-head { align-items: center; display: flex; gap: 12px; margin-bottom: 16px; }
.crm-visit-section-head > span { align-items: center; background: #fff2dd; border-radius: 10px; color: #a7630b; display: inline-flex; flex: 0 0 42px; height: 42px; justify-content: center; }
.crm-visit-section-head h2 { color: #17283d; font-size: .94rem; font-weight: 850; margin: 0; }
.crm-visit-section-head p { color: #8290a2; font-size: .68rem; margin: 2px 0 0; }
.crm-visit-checks { background: #f7f9fc; border: 1px solid #dde5ee; border-radius: 10px; display: grid; gap: 9px; min-height: 100%; padding: 15px; }
.crm-visit-checks label { align-items: center; color: #34465c; cursor: pointer; display: flex; font-size: .75rem; font-weight: 700; gap: 9px; margin: 0; }
.crm-visit-checks .form-check-input { margin: 0; }
.crm-visit-actions { align-items: center; display: flex; justify-content: flex-end; margin-top: 22px; }
.crm-visit-actions .btn { min-width: 190px; padding: 11px 18px; }
.crm-kpi-grid { display: grid; gap: 13px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 14px; }
.crm-kpi { background: #fff; border: 1px solid #e1e7ef; border-radius: 12px; border-top: 3px solid #2e72bd; padding: 16px; }
.crm-kpi.danger { border-top-color: #d94645; }.crm-kpi.success { border-top-color: #0b9b6f; }.crm-kpi.wide { border-top-color: #7656d6; }
.crm-kpi span { color: #76869a; display: block; font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.crm-kpi strong { color: #122a47; display: block; font-size: 1.45rem; margin: 6px 0 2px; }
.crm-kpi small { color: #98a3b1; font-size: .65rem; }
.crm-dashboard-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.crm-panel { background: #fff; border: 1px solid #e1e7ef; border-radius: 12px; box-shadow: 0 6px 18px rgba(20,42,70,.04); padding: 18px; }
.crm-panel-head { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 14px; }
.crm-panel-head h2 { color: #142b47; font-size: 1rem; font-weight: 850; margin: 0; }
.crm-panel-head p { color: #8b98a8; font-size: .7rem; margin: 3px 0 0; }
.crm-panel-head > i { color: #6f91b8; }
.crm-stage-list { display: grid; gap: 9px; }
.crm-stage-list > div { align-items: center; display: grid; gap: 9px; grid-template-columns: 1fr 28px 42%; }
.crm-stage-list span, .crm-stage-list strong { color: #54677e; font-size: .72rem; }
.crm-stage-list strong { color: #183653; text-align: right; }
.crm-stage-list i { background: #eaf0f6; border-radius: 8px; height: 7px; max-width: 100%; min-width: 3px; position: relative; }
.crm-stage-list i::after { background: #2e72bd; border-radius: inherit; content: ""; inset: 0; position: absolute; }
.crm-followup-list { display: grid; }
.crm-followup-list a { align-items: center; border-top: 1px solid #edf1f5; color: inherit; display: grid; gap: 9px; grid-template-columns: 34px 1fr 8px; padding: 10px 0; text-decoration: none; }
.crm-followup-list a:first-child { border-top: 0; }
.crm-avatar { align-items: center; background: #e8f1fd; border-radius: 50%; color: #1c65b5; display: flex; font-size: .75rem; font-weight: 850; height: 32px; justify-content: center; width: 32px; }
.crm-followup-list strong, .crm-followup-list small { display: block; }.crm-followup-list strong { color: #243b55; font-size: .72rem; }.crm-followup-list small { color: #8a97a7; font-size: .64rem; }
.crm-list-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 14px; }.crm-list-head p { color: #7c899a; margin: 0; }
.crm-filter { display: grid; gap: 9px; grid-template-columns: 1fr 220px auto; margin-bottom: 15px; }
.crm-status { background: #eef4fb; border-radius: 20px; color: #346493; font-size: .65rem; font-weight: 750; padding: 5px 9px; white-space: nowrap; }
.crm-row-overdue { background: #fdecec !important; }
.crm-row-overdue:hover { background: #fbdede !important; }
.crm-row-overdue td:first-child { box-shadow: inset 3px 0 0 #d94645; }
.crm-overdue-badge { background: #fbdede; border-radius: 20px; color: #b3261e; display: inline-block; font-size: .62rem; font-weight: 800; margin-top: 4px; padding: 3px 8px; text-transform: uppercase; }
.crm-pipeline-scroll { border: 1px solid #e5e9ef; border-radius: 10px; }
.crm-pipeline-table { table-layout: fixed; min-width: 1480px; }
.crm-pipeline-table th { background: #f7f9fc; color: #243448; font-size: .74rem; padding: 13px 12px; vertical-align: middle; white-space: nowrap; }
.crm-pipeline-table td { color: #26384c; font-size: .75rem; line-height: 1.45; padding: 15px 12px; vertical-align: middle; overflow-wrap: break-word; }
.crm-pipeline-table th:nth-child(1), .crm-pipeline-table td:nth-child(1) { width: 175px; }
.crm-pipeline-table th:nth-child(2), .crm-pipeline-table td:nth-child(2) { width: 185px; }
.crm-pipeline-table th:nth-child(3), .crm-pipeline-table td:nth-child(3) { width: 190px; }
.crm-pipeline-table th:nth-child(4), .crm-pipeline-table td:nth-child(4) { width: 280px; }
.crm-pipeline-table th:nth-child(5), .crm-pipeline-table td:nth-child(5) { width: 125px; }
.crm-pipeline-table th:nth-child(6), .crm-pipeline-table td:nth-child(6) { width: 100px; }
.crm-pipeline-table th:nth-child(7), .crm-pipeline-table td:nth-child(7) { width: 105px; }
.crm-pipeline-table th:nth-child(8), .crm-pipeline-table td:nth-child(8) { width: 155px; }
.crm-pipeline-table th:nth-child(9), .crm-pipeline-table td:nth-child(9) { width: 265px; }
.crm-pipeline-table td:first-child > strong { display: block; white-space: nowrap; }
.crm-pipeline-table td:last-child { white-space: normal !important; }
.crm-pipeline-table td:last-child .btn { margin: 2px 1px; white-space: nowrap; }
.crm-pipeline-scroll { overflow: visible; }
.crm-pipeline-table { min-width: 0; table-layout: fixed; width: 100%; }
.crm-pipeline-table th:nth-child(1), .crm-pipeline-table td:nth-child(1) { width: 14%; }
.crm-pipeline-table th:nth-child(2), .crm-pipeline-table td:nth-child(2) { width: 20%; }
.crm-pipeline-table th:nth-child(3), .crm-pipeline-table td:nth-child(3) { width: 23%; }
.crm-pipeline-table th:nth-child(4), .crm-pipeline-table td:nth-child(4) { width: 14%; }
.crm-pipeline-table th:nth-child(5), .crm-pipeline-table td:nth-child(5) { width: 16%; }
.crm-pipeline-table th:nth-child(6), .crm-pipeline-table td:nth-child(6) { width: 13%; }
.crm-row-title { color: #243448; font-size: .76rem; font-weight: 750; }
.crm-row-meta { color: #748398; font-size: .67rem; margin-top: 4px; }
.crm-row-meta i { margin-right: 3px; }
.crm-row-actions { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-start; }
.crm-row-actions .btn { margin: 0 !important; }
@media (max-width: 900px) {
  .crm-pipeline-scroll { border: 0; }
  .crm-pipeline-table, .crm-pipeline-table tbody, .crm-pipeline-table tr, .crm-pipeline-table td { display: block; width: 100% !important; }
  .crm-pipeline-table thead { display: none; }
  .crm-pipeline-table tr { border: 1px solid #e3e8ef; border-radius: 10px; margin-bottom: 12px; padding: 12px; }
  .crm-pipeline-table td { border: 0; padding: 6px 4px; }
  .crm-row-actions { margin-top: 5px; }
}
@media (max-width: 992px) { .crm-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.crm-dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 1400px) { .crm-module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .crm-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.crm-module-card { min-height: 175px; } }
@media (max-width: 650px) { .crm-hero, .crm-list-head { align-items: flex-start; flex-direction: column; gap: 15px; }.crm-hero-actions { width: 100%; }.crm-hero-actions .btn { flex: 1; }.crm-kpi-grid { grid-template-columns: 1fr; }.crm-filter { grid-template-columns: 1fr; }.crm-nav { overflow-x: auto; }.crm-nav a { white-space: nowrap; }.crm-module-grid { gap: 10px; grid-template-columns: 1fr 1fr; }.crm-module-card { min-height: 148px; padding: 17px 10px; }.crm-module-card.active { padding: 16px 9px; }.crm-module-icon { border-radius: 12px; font-size: 1.1rem; height: 54px; margin-bottom: 12px; width: 54px; }.crm-module-copy strong { font-size: .82rem; }.crm-module-copy small { font-size: .65rem; margin-top: 5px; } }

.analytics-panel-head h2 {
    color: #152238;
    font-size: 1rem;
    font-weight: 900;
    margin: 0;
}

.analytics-panel-head p {
    color: var(--dms-muted);
    font-size: 0.86rem;
    margin: 4px 0 0;
}

.analytics-panel-head > i {
    color: var(--dms-red);
    font-size: 1.35rem;
}

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

.metric-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
}

.metric-row span {
    color: var(--dms-muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.metric-row i {
    color: var(--dms-red);
    margin-right: 8px;
}

.metric-row strong {
    color: #152238;
    font-size: 1rem;
    font-weight: 900;
}

.counter-card {
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(31, 41, 55, 0.04);
    padding: 14px;
}

.counter-card i {
    color: var(--dms-red);
    margin-right: 8px;
}

.counter-card span {
    color: var(--dms-muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.counter-card strong {
    color: var(--dms-text);
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
}

.module-card {
    align-items: center;
    background: var(--dms-surface);
    border: 1.5px solid var(--dms-border);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(13, 18, 32, 0.05);
    color: var(--dms-text);
    display: flex;
    flex-direction: column;
    min-height: clamp(160px, 20vw, 188px);
    padding: clamp(16px, 2.2vw, 24px) clamp(12px, 1.6vw, 18px);
    text-align: center;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
    position: relative;
}

.module-card:hover {
    background: #fff;
    border-color: var(--dms-red);
    box-shadow: 0 16px 32px -8px rgba(13, 18, 32, .16);
    color: var(--dms-text);
    transform: translateY(-4px);
}

.module-icon {
    align-items: center;
    border-radius: 12px;
    color: #ffffff;
    display: inline-flex;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    height: clamp(52px, 6vw, 66px);
    justify-content: center;
    margin-bottom: 16px;
    width: clamp(52px, 6vw, 66px);
    box-shadow: 0 8px 16px rgba(13, 18, 32, .12);
}

.module-title {
    font-size: clamp(.92rem, 1.1vw, 1rem);
    font-weight: 800;
    margin-bottom: 8px;
}

.module-description {
    color: var(--dms-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.module-card-badge {
    align-items: center;
    background: #d71920;
    border: 3px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(215, 25, 32, .28);
    color: #ffffff;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    min-width: 34px;
    padding: 0 9px;
    position: absolute;
    right: 14px;
    top: 14px;
}

.module-card-mini-counts {
    background: rgba(215, 25, 32, .07);
    border-radius: 999px;
    color: #d71920;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 10px;
    padding: 6px 10px;
}

.dms-accent-blue { background: #2563eb; }
.dms-accent-red { background: #d71920; }
.dms-accent-green { background: #16a34a; }
.dms-accent-gold { background: #b7791f; }
.dms-accent-purple { background: #7c3aed; }
.dms-accent-cyan { background: #0891b2; }
.dms-accent-orange { background: #ea580c; }
.dms-accent-slate { background: #475569; }
.dms-accent-teal { background: #0f766e; }
.dms-accent-indigo { background: #4f46e5; }
.dms-accent-gray { background: #52525b; }

.module-shell {
    padding: 24px 0 42px;
}

.module-header {
    align-items: center;
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 20px -10px rgba(16, 24, 40, 0.12);
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    justify-content: space-between;
    margin-bottom: 16px;
    min-height: auto;
    padding: clamp(12px, 1.6vw, 14px) clamp(16px, 2.4vw, 22px);
    transition: box-shadow 0.18s ease;
    width: 100%;
}

.module-header:hover {
    box-shadow: 0 2px 4px rgba(16, 24, 40, 0.05), 0 10px 26px -8px rgba(16, 24, 40, 0.16);
}

.module-header-content {
    align-items: center;
    display: flex;
    gap: 16px;
    min-width: 0;
}

.module-header-info {
    min-width: 0;
}

.module-header-badge {
    color: var(--dms-red);
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.module-header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* General Journal uses a single module, so its actions sit below the title
   at the left instead of leaving an unnecessary one-item tab pill. */
.jv-actions-left .module-header {
    align-items: flex-start;
    flex-direction: column;
}

.jv-actions-left .module-header-actions {
    justify-content: flex-start;
    width: 100%;
}

.module-header-icon {
    align-items: center;
    background: #fff1f2;
    border-radius: 12px;
    color: var(--dms-red);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: clamp(1.05rem, 1.4vw, 1.15rem);
    height: clamp(38px, 4vw, 44px);
    justify-content: center;
    min-width: clamp(38px, 4vw, 44px);
    width: clamp(38px, 4vw, 44px);
}

.workspace-icon {
    align-items: center;
    background: #fff1f2;
    border-radius: 8px;
    color: var(--dms-red);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.55rem;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.module-menu {
    background: linear-gradient(135deg, rgba(13, 18, 32, 0.88), rgba(47, 54, 69, 0.8));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    overflow-x: auto;
    padding: 3px;
    position: relative;
}

.module-menu-slider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 15px;
    opacity: 0;
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.2),
        0 1px 4px rgba(0, 0, 0, 0.15);
    transition:
        left 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.32s ease;
    z-index: 0;
    pointer-events: none;
}

.module-menu-item {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    flex: 1 1 auto;
    font-size: 0.78rem;
    font-weight: 600;
    justify-content: center;
    padding: 6px 12px;
    position: relative;
    text-align: center;
    text-decoration: none;
    transition: color 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    z-index: 1;
}

.module-menu-item:hover {
    color: rgba(255, 255, 255, 0.95);
}

.module-menu-item.active {
    color: var(--dms-red);
    text-shadow: none;
}

.module-workspace {
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    min-height: 420px;
    padding: 22px;
}

.workspace-panel {
    align-items: center;
    border: 1px dashed #cfd6e3;
    border-radius: 8px;
    display: flex;
    gap: 16px;
    min-height: 180px;
    padding: 24px;
}

.workspace-panel h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 66px);
    padding: 28px 14px;
}

.login-card {
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    box-shadow: var(--dms-shadow);
    max-width: 420px;
    padding: 30px;
    width: 100%;
}

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

.login-brand h1 {
    font-size: 1.45rem;
    font-weight: 800;
    margin: 14px 0 4px;
}

.login-brand p {
    color: var(--dms-muted);
    margin: 0;
}

.login-card input {
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    display: block;
    padding: 10px 12px;
    width: 100%;
}

/* Premium page shell (matches the login/navbar theme) - applied to every
   .module-shell page (forms AND list/report pages alike). Tables are
   already wrapped in .table-responsive, so a centered max-width here just
   adds a scrollbar inside the table on very wide grids instead of ever
   clipping/breaking content. */
.module-shell .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

.data-card {
    position: relative;
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 16px;
    box-shadow: 0 16px 40px -12px rgba(13, 18, 32, .12), 0 4px 14px rgba(13, 18, 32, .05);
    padding: 24px 26px;
}
.data-card::before,
.data-card::after {
    /* The pseudo-element's own box is made as tall as the card's
       border-radius (16px) so its corner arc is a genuine 16px curve
       matching the card's — a shallower box would force the browser to
       clamp/scale the radius down to fit, which renders as a barely
       visible nub instead of a real curve. Only the outer 4px of that
       16px box is actually painted (via background-size/position); since
       backgrounds are clipped to the box's rounded shape by default, that
       thin painted strip follows the same curve near the corners without
       needing overflow:hidden on .data-card (which would otherwise clip
       .dms-combo-menu dropdowns that intentionally open past the card
       edge). Inset by the card's border-width (-1px) so the arc is
       concentric with the card's own outer border curve. */
    content: "";
    position: absolute;
    left: -1px; right: -1px;
    height: 16px;
    background-image: linear-gradient(90deg, var(--dms-red), var(--dms-navy) 65%, var(--dms-navy));
    background-repeat: no-repeat;
    background-size: 100% 4px;
    pointer-events: none;
}
.data-card::before {
    top: -1px;
    border-radius: 16px 16px 0 0;
    background-position: top;
}
.data-card::after {
    bottom: -1px;
    border-radius: 0 0 16px 16px;
    background-position: bottom;
}
.data-card + .data-card {
    margin-top: 20px;
}

.delete-card,
.print-card {
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.05);
    padding: 20px;
}

.data-card .form-label {
    font-size: 0.85rem;
    font-weight: 600;
}
.data-card .form-control,
.data-card .form-select {
    border-radius: 8px;
}
.data-card .form-control:focus,
.data-card .form-select:focus {
    border-color: var(--dms-red);
    box-shadow: 0 0 0 3px rgba(229, 41, 58, .14);
}
.data-card .form-text {
    font-size: 0.78rem;
    color: #8a93a6;
}
.data-card .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
@media (max-width: 767.98px) {
    .data-card { padding: 20px; }
}

.settings-info-tile {
    background: #f8fafc;
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    min-height: 112px;
    padding: 18px;
}

.settings-info-tile span {
    color: var(--dms-muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.settings-info-tile strong {
    color: var(--dms-text);
    display: block;
    font-size: 1.15rem;
    line-height: 1.35;
}

.accounting-entry-card {
    padding-top: 18px;
}

.accounting-voucher-strip {
    background: #f8fafc;
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    display: grid;
    gap: 8px 14px;
    grid-template-columns: repeat(3, auto 1fr);
    margin-bottom: 18px;
    padding: 12px 14px;
}

.accounting-voucher-strip span {
    color: var(--dms-muted);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.accounting-voucher-strip strong {
    color: var(--dms-text);
    font-weight: 900;
}

.purchase-entry-card {
    background: #f8fbff;
}

.purchase-header-grid {
    align-items: end;
    display: grid;
    gap: 12px 16px;
    grid-template-columns: 1fr 170px 170px 130px;
}

.purchase-vendor-cell {
    grid-column: span 2;
}

.purchase-entry-table {
    background: #ffffff;
    border: 1px solid var(--dms-border);
}

.purchase-entry-table thead th {
    text-align: center;
}

.purchase-entry-table td {
    padding: 6px;
}

.purchase-items-total-row td {
    background: #f1f5f9;
    font-size: 0.875rem;
    padding: 10px 8px;
}

.purchase-entry-table .form-control,
.purchase-entry-table .form-select {
    min-height: 34px;
    padding: 4px 8px;
    font-size: 0.875rem;
}

.purchase-footer-grid {
    align-items: start;
    display: grid;
    gap: 12px 16px;
    grid-template-columns: 160px minmax(220px, 1fr);
    margin-top: 14px;
}

.purchase-footer-grid > div:nth-child(2) textarea {
    min-height: 148px;
}

.purchase-totals {
    display: grid;
    gap: 12px 16px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.purchase-totals .form-control,
.purchase-entry-table input[readonly],
.purchase-entry-card input[readonly] {
    background: #eaf0f8;
    font-weight: 700;
}

.purchase-totals input[type="number"]:not([readonly]) {
    background: #ffffff;
    font-weight: 400;
}

.role-card-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 18px;
}

.role-permission-card {
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.05);
    padding: 18px;
}

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

.role-permission-head h2 {
    color: #152238;
    font-size: 1.08rem;
    font-weight: 900;
    margin: 3px 0 0;
}

.role-scope {
    color: var(--dms-red);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.role-user-count {
    background: #f8fafc;
    border: 1px solid var(--dms-border);
    border-radius: 999px;
    color: var(--dms-muted);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 5px 9px;
    white-space: nowrap;
}

.role-permission-card p {
    color: var(--dms-muted);
    font-size: 0.9rem;
    min-height: 62px;
}

.role-meta-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
}

.role-meta-row span {
    color: var(--dms-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.role-meta-row strong {
    color: #152238;
    font-weight: 900;
}

.role-matrix-table {
    min-width: 1180px;
}

.permission-dot {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.permission-yes {
    background: #ecfdf3;
    color: #039855;
}

.permission-no {
    background: #f8fafc;
    color: #98a2b3;
}

.permission-layout {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: 290px minmax(0, 1fr);
}

.role-sidebar,
.permission-editor {
    background: var(--dms-surface);
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.05);
}

.role-sidebar {
    padding: 14px;
    position: sticky;
    top: 94px;
}

.role-sidebar-head,
.permission-editor-head {
    align-items: center;
    border-bottom: 1px solid var(--dms-border);
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
}

.role-sidebar-head span {
    color: var(--dms-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.role-list-row {
    align-items: center;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    overflow: hidden;
}

.role-list-item {
    align-items: center;
    color: var(--dms-text);
    display: flex;
    flex: 1;
    justify-content: space-between;
    min-width: 0;
    padding: 11px 12px;
    text-decoration: none;
}

.role-list-row:hover,
.role-list-row.active {
    background: #fff1f2;
}

.role-list-item:hover {
    color: var(--dms-text);
}

.role-list-item small {
    color: var(--dms-muted);
    display: block;
    font-size: 0.75rem;
    margin-top: 2px;
}

.role-list-item em {
    color: var(--dms-red);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 900;
}

.role-list-actions {
    align-items: center;
    display: flex;
    gap: 3px;
    padding-right: 7px;
}

.role-list-actions form {
    margin: 0;
}

.role-list-actions a,
.role-list-actions button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #64748b;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    width: 30px;
}

.role-list-actions a:hover {
    background: #e2e8f0;
    color: #2563eb;
}

.role-list-actions button:hover {
    background: #fee2e2;
    color: #dc2626;
}

.role-list-actions button.is-disabled,
.role-list-actions button:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.8;
}

.role-list-actions button.is-disabled:hover,
.role-list-actions button:disabled:hover {
    background: transparent;
    color: #cbd5e1;
}

.permission-editor {
    padding: 18px;
}

.permission-editor-head h2 {
    color: #152238;
    font-size: 1.4rem;
    font-weight: 900;
    margin: 2px 0;
}

.permission-editor-head p {
    color: var(--dms-muted);
    margin: 0;
}

.permission-module {
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.permission-module summary {
    background: #f8fafc;
    cursor: pointer;
    font-weight: 900;
    list-style: none;
    padding: 14px 16px;
}

.permission-module summary::-webkit-details-marker {
    display: none;
}

.permission-table-wrap {
    overflow-x: auto;
}

.permission-table {
    margin-bottom: 0;
    min-width: 1120px;
}

.permission-module-row td {
    background: #fffafb;
}

.delete-card {
    margin: 48px auto;
    max-width: 560px;
    text-align: center;
}

.dms-table {
    font-size: 0.92rem;
    margin-bottom: 0;
}

.dms-list-table {
    min-width: 1120px;
}

.dms-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--dms-border);
    color: #344054;
    font-size: 0.76rem;
    text-transform: uppercase;
}

.dms-table td,
.dms-table th {
    line-height: 1.45;
    padding: 12px;
    vertical-align: middle;
    white-space: nowrap;
}

.dms-table .truncate-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dms-table .actions-cell {
    min-width: 210px;
    white-space: nowrap;
}

.dms-table .actions-cell .btn {
    margin: 2px;
}

.dms-table .actions-cell .btn i {
    margin-right: 4px;
}

.form-actions {
    border-top: 1px solid var(--dms-border);
    display: flex;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
}

.data-card .form-label {
    font-weight: 650;
    margin-bottom: 6px;
}

.required-star {
    color: var(--dms-danger);
    font-weight: 900;
}

.data-card .form-control,
.data-card .form-select {
    min-height: 42px;
}

.dms-form-section {
    border-bottom: 1px solid var(--dms-border);
    margin-bottom: 18px;
    padding-bottom: 18px;
}

.dms-form-section:last-of-type {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-footer-actions {
    border-top: 1px solid var(--dms-border, #e5e7eb);
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 18px;
}

.dms-form-section-title {
    color: var(--dms-red);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: .06em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.dms-file-current {
    display: flex;
    align-items: center;
}
.dms-file-current-img {
    max-height: 64px;
    max-width: 200px;
    object-fit: contain;
    border: 1px solid var(--dms-border);
    border-radius: 8px;
    padding: 4px;
    background: #fff;
}
.dms-file-current-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dms-red);
    text-decoration: none;
}
.dms-file-current-link:hover {
    text-decoration: underline;
}

.data-card textarea.form-control {
    min-height: 92px;
}

.dms-lookup-field .form-select,
.dms-lookup-field .form-control {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
}

.dms-lookup-field .btn {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 44px;
}

.dms-lookup-field .btn:last-child {
    border-bottom-right-radius: 6px;
    border-top-right-radius: 6px;
}

.dms-combo {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.dms-combo-toggle {
    align-items: center;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-bottom-left-radius: 6px;
    border-top-left-radius: 6px;
    color: var(--dms-text);
    display: flex;
    flex: 1 1 auto;
    font: inherit;
    height: 42px;
    justify-content: space-between;
    min-height: 42px;
    min-width: 0;
    overflow: hidden;
    padding: 8px 14px;
    text-align: left;
    white-space: nowrap;
    width: 1%;
}

.dms-combo-toggle-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dms-combo-toggle::after {
    border-bottom: 0;
    border-left: 0.35em solid transparent;
    border-right: 0.35em solid transparent;
    border-top: 0.35em solid currentColor;
    content: "";
    flex: 0 0 auto;
    margin-left: 10px;
}

.dms-combo-menu {
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.16);
    left: 0;
    margin-top: 4px;
    padding: 8px;
    position: absolute;
    right: -88px;
    top: 100%;
    z-index: 1040;
}
/* Defensive: guarantee the menu is never visible/in-flow except when the
   widget JS explicitly opens it (removes the [hidden] attribute), no
   matter what else on the page might otherwise affect its display. */
.dms-combo-menu[hidden] {
    display: none !important;
}

/* Defensive: the searchable-select JS hides the original native <select>
   by adding .d-none once it builds the combo widget on top of it. If that
   JS is ever delayed, blocked, or fails for a given field, this guarantees
   the raw multi-row <select> never renders as a giant unstyled listbox -
   the field simply stays visually collapsed instead of breaking layout. */
.dms-lookup-field select.form-select,
.dms-lookup-field select.form-control {
    display: none;
}

.dms-combo-search {
    margin-bottom: 8px;
}

.dms-combo-list {
    max-height: 220px;
    overflow-y: auto;
}

.dms-combo-option {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--dms-text);
    display: block;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.dms-combo-option:hover,
.dms-combo-option.active {
    background: #e9f2ff;
    color: #0b5ed7;
}

.dms-combo-empty {
    color: var(--dms-muted);
    padding: 8px 10px;
}

.dms-lookup-field + .form-text {
    color: var(--dms-muted);
    font-size: 0.78rem;
    margin-top: 5px;
}

.dms-check-field {
    align-items: center;
    display: flex;
    gap: 10px;
    min-height: 44px;
    padding-left: 0;
    padding-top: 6px;
}

.dms-check-field .form-check-input {
    float: none;
    margin-left: 0;
    margin-top: 0;
    min-width: 2.5em;
}

.dms-check-field .form-check-label {
    font-weight: 600;
    line-height: 1.2;
}

.messages-stack,
.dms-toast-stack {
    bottom: 22px;
    display: grid;
    gap: 12px;
    max-width: min(430px, calc(100vw - 28px));
    pointer-events: none;
    position: fixed;
    right: 22px;
    width: 430px;
    z-index: 3000;
}

.dms-toast {
    --toast-accent: #2563eb;
    --toast-soft: #eff6ff;
    --toast-icon: #2563eb;
    align-items: center;
    animation: dmsToastIn .46s cubic-bezier(.16, 1, .3, 1) both;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(226, 232, 240, .9);
    border-left: 5px solid var(--toast-accent);
    border-radius: 18px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .18), 0 5px 14px rgba(15, 23, 42, .08);
    color: #162033;
    display: grid;
    gap: 13px;
    grid-template-columns: 42px 1fr 28px;
    min-height: 72px;
    overflow: hidden;
    padding: 15px 15px 15px 17px;
    pointer-events: auto;
    position: relative;
}

.dms-toast-success {
    --toast-accent: #16a34a;
    --toast-soft: #eafaf0;
    --toast-icon: #16a34a;
}

.dms-toast-error,
.dms-toast-danger {
    --toast-accent: #e11d48;
    --toast-soft: #fff1f2;
    --toast-icon: #e11d48;
}

.dms-toast-warning {
    --toast-accent: #f59e0b;
    --toast-soft: #fffbeb;
    --toast-icon: #d97706;
}

.dms-toast-info,
.dms-toast-debug {
    --toast-accent: #2563eb;
    --toast-soft: #eff6ff;
    --toast-icon: #2563eb;
}

.dms-toast-icon {
    align-items: center;
    background: var(--toast-soft);
    border-radius: 50%;
    color: var(--toast-icon);
    display: flex;
    font-size: 1rem;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.dms-toast-title {
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.dms-toast-message {
    color: #263448;
    font-size: .93rem;
    font-weight: 700;
    line-height: 1.35;
}

.dms-toast-close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: #94a3b8;
    display: flex;
    height: 28px;
    justify-content: center;
    padding: 0;
    transition: background .15s ease, color .15s ease;
    width: 28px;
}

.dms-toast-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.dms-toast-progress {
    animation: dmsToastProgress 5s linear forwards;
    background: linear-gradient(90deg, var(--toast-accent), rgba(255,255,255,.45));
    bottom: 0;
    height: 3px;
    left: 0;
    opacity: .85;
    position: absolute;
    width: 100%;
}

.dms-toast.is-hiding {
    animation: dmsToastOut .22s ease-in forwards;
}

@keyframes dmsToastIn {
    from {
        opacity: 0;
        transform: translateX(34px) translateY(10px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1);
    }
}

@keyframes dmsToastOut {
    to {
        opacity: 0;
        transform: translateX(28px) translateY(4px) scale(.98);
    }
}

@keyframes dmsToastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

@media (max-width: 575.98px) {
    .messages-stack,
    .dms-toast-stack {
        bottom: 14px;
        left: 14px;
        max-width: none;
        right: 14px;
        width: auto;
    }
}

.panel-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.print-card {
    color: #111827;
}

.print-header {
    align-items: flex-start;
    border-bottom: 2px solid #111827;
    display: flex;
    justify-content: space-between;
    padding-bottom: 16px;
}

.print-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
}

.print-card h2 {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
}

@media print {
    .dms-navbar,
    .dms-navbar-spacer,
    .no-print {
        display: none !important;
    }

    body {
        background: #ffffff;
    }

    .module-shell {
        padding: 0;
    }

    .print-card {
        border: 0;
        box-shadow: none;
    }
}

/* Tablet / small-laptop bridge: keeps cards, KPI tiles and analytics
   panels from staying artificially cramped between desktop width and the
   767px mobile breakpoint below. */
@media (max-width: 1199.98px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .home-hero,
    .analytics-hero {
        max-width: 100%;
    }

    .module-grid,
    .dashboard-counters,
    .dashboard-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
    }
}

@media (max-width: 991.98px) {
    .module-header-info h1 {
        white-space: normal;
    }

    .module-header-actions {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .dms-dashboard {
        padding-top: 34px;
    }

    .dms-analytics {
        padding-top: 18px;
    }

    .analytics-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .analytics-hero h1 {
        font-size: 1.55rem;
    }

    .analytics-hero-side {
        align-items: flex-start;
        width: 100%;
    }

    .dashboard-kpi-grid,
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-card {
        min-height: 110px;
    }

    .metric-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .accounting-voucher-strip {
        grid-template-columns: 1fr;
    }

    .purchase-header-grid,
    .purchase-footer-grid {
        grid-template-columns: 1fr;
    }

    .purchase-vendor-cell {
        grid-column: auto;
    }

    .permission-layout {
        grid-template-columns: 1fr;
    }

    .role-sidebar {
        position: static;
    }

    .home-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .home-hero-brand {
        align-items: flex-start;
    }

    .home-hero-mark {
        font-size: 1.5rem;
        height: 58px;
        width: 58px;
    }

    .home-hero h1 {
        font-size: 1.65rem;
    }

    .home-hero-meta {
        align-items: flex-start;
        white-space: normal;
    }

    .dashboard-heading h1 {
        font-size: 1.55rem;
    }

    .module-header-info h1 {
        font-size: 1.55rem;
        white-space: normal;
    }

    .module-header-info p {
        white-space: normal;
    }

    .module-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 20px;
    }

    .module-header-actions {
        width: 100%;
    }

    .module-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .module-card {
        min-height: 178px;
        padding: 20px 14px;
    }

    .workspace-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

.dms-module-switcher-toggle {
    align-items: center;
    background: rgba(229, 41, 58, .1);
    border: 1px solid rgba(229, 41, 58, .25);
    border-radius: 999px;
    color: var(--dms-red);
    display: inline-flex;
    font-size: .9rem;
    font-weight: 700;
    height: 38px;
    justify-content: center;
    padding: 0 16px !important;
}
.dms-module-switcher-toggle::after {
    display: none;
}
.dms-navbar .dms-module-switcher-toggle:hover,
.dms-navbar .dms-module-switcher-toggle:focus,
.dms-navbar .dms-module-switcher-toggle.show {
    background: var(--dms-red);
    border-color: var(--dms-red);
    color: #fff !important;
}

.dms-module-switcher {
    min-width: 240px;
    max-height: 420px;
    overflow-y: auto;
}

/* Branch-isolated WhatsApp Web-style portal */
.wa-shell {
    --wa-green: #00a884;
    --wa-green-dark: #008069;
    --wa-ink: #111b21;
    --wa-muted: #667781;
    --wa-line: #dbe5e7;
    background: #f0f2f5;
    color: var(--wa-ink);
    display: grid;
    grid-template-columns: clamp(215px, 13vw, 250px) minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}
.wa-sidebar {
    background: #0b3b35;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 22px 14px 14px;
}
.wa-brand {
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.13);
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
    padding: 4px 8px 20px;
}
.wa-brand > span {
    background: #25d366;
    border-radius: 50%;
    display: grid;
    font-size: 25px;
    height: 46px;
    place-items: center;
    width: 46px;
}
.wa-brand strong,.wa-brand small{display:block}
.wa-brand strong{font-size:1rem}
.wa-brand small{color:#b7d5d0;font-size:.74rem;margin-top:3px}
.wa-sidebar nav {
    display: grid;
    gap: 3px;
    margin-top: 14px;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-color: #ffffff35 transparent;
    scrollbar-width: thin;
}
.wa-sidebar nav a {
    align-items: center;
    border-radius: 9px;
    color: #cce0dc;
    display: flex;
    font-size: .84rem;
    font-weight: 700;
    gap: 11px;
    min-height: 42px;
    padding: 9px 12px;
    text-decoration: none;
    transition: background .16s,color .16s;
}
.wa-sidebar nav a:hover,.wa-sidebar nav a.active{background:rgba(255,255,255,.12);color:#fff}
.wa-sidebar nav a.active{box-shadow:inset 3px 0 #25d366}
.wa-sidebar nav i{font-size:.93rem;text-align:center;width:20px}
.wa-main {
    min-width: 0;
    overflow-y: auto;
    padding: 26px clamp(22px,2.4vw,38px) 40px;
    scrollbar-color: #aab7bd transparent;
    scrollbar-width: thin;
}
.wa-mobile-title{display:none}
.wa-heading{align-items:flex-start;display:flex;gap:18px;justify-content:space-between;margin:0 0 22px}
.wa-heading h1{font-size:clamp(1.7rem,2.2vw,2.35rem);font-weight:800;letter-spacing:-.025em;line-height:1.12;margin:4px 0 6px}
.wa-heading p,.wa-card p{color:var(--wa-muted);margin:0}
.wa-heading .btn{flex:0 0 auto}
.wa-eyebrow{color:var(--wa-green-dark);font-size:.7rem;font-weight:800;letter-spacing:.15em}
.wa-main .btn-success{background:var(--wa-green-dark);border-color:var(--wa-green-dark)}
.wa-main .btn-success:hover{background:#006e5a;border-color:#006e5a}
.wa-kpis{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));margin-bottom:20px}
.wa-kpis a{background:#fff;border:1px solid var(--wa-line);border-radius:14px;box-shadow:0 5px 18px rgba(17,27,33,.04);color:var(--wa-ink);min-height:142px;padding:20px;text-decoration:none;transition:transform .16s,box-shadow .16s}
.wa-kpis a:hover{box-shadow:0 10px 24px rgba(17,27,33,.08);transform:translateY(-2px)}
.wa-kpis i{color:var(--wa-green);font-size:1.25rem}
.wa-kpis span,.wa-kpis strong{display:block}
.wa-kpis span{color:var(--wa-muted);font-size:.78rem;margin-top:18px}
.wa-kpis strong{font-size:1.7rem;margin-top:3px}
.wa-card{background:#fff;border:1px solid var(--wa-line);border-radius:16px;box-shadow:0 5px 18px rgba(17,27,33,.035);margin:0 0 20px;padding:24px}
.wa-card h2{font-size:1.03rem;font-weight:800;margin:0 0 18px}
.wa-card-head{display:flex;justify-content:space-between;margin-bottom:18px}
.wa-card-head h2{margin-bottom:3px}
.wa-two{align-items:start;display:grid;gap:20px;grid-template-columns:minmax(330px,.72fr) minmax(0,1.28fr)}
.wa-two-equal{grid-template-columns:repeat(2,minmax(0,1fr))}
.wa-grid{display:grid;gap:18px 20px;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr))}
.wa-grid-one{grid-template-columns:1fr}
.wa-field{min-width:0}
.wa-field-wide{grid-column:1/-1}
.wa-field>label,.wa-form>label{color:#34444d;display:block;font-size:.77rem;font-weight:750;margin:0 0 7px}
.wa-field .form-control,.wa-field .form-select,.wa-form>label .form-control,.wa-form>label .form-select{background:#fff;border:1px solid #cfdadd;border-radius:10px;box-shadow:none;color:var(--wa-ink);font-size:.88rem;min-height:44px;padding:10px 12px}
.wa-field textarea.form-control{min-height:118px;resize:vertical}
.wa-field select[multiple].form-select{min-height:130px}
.wa-field .form-control:focus,.wa-field .form-select:focus{border-color:var(--wa-green);box-shadow:0 0 0 3px rgba(0,168,132,.12)}
.wa-field-check{align-self:end}
.wa-check-row{align-items:center;display:flex;gap:9px;min-height:44px}
.wa-check-row label{color:#34444d;font-size:.82rem;font-weight:750}
.wa-check-row .form-check-input{height:18px;margin:0;width:18px}
.wa-choice-grid>div{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}
.wa-choice-grid label{align-items:center;background:#f7faf9;border:1px solid #dbe5e3;border-radius:9px;color:#34444d;display:flex;font-size:.8rem;font-weight:650;gap:8px;min-height:42px;padding:9px 11px}
.wa-choice-grid input{height:17px;margin:0;width:17px}
.wa-help,.wa-error{display:block;font-size:.7rem;font-weight:500;line-height:1.4;margin-top:6px}
.wa-help{color:#7b8990}.wa-error{color:#d92d20}
.wa-form-actions{border-top:1px solid #edf1f2;display:flex;justify-content:flex-end;gap:12px;margin-top:22px;padding-top:18px}
.wa-form-actions .btn{min-width:150px}
.wa-form summary{align-items:center;cursor:pointer;display:flex;gap:10px;list-style:none}
.wa-form summary::-webkit-details-marker{display:none}
.wa-form summary strong{font-size:1rem}.wa-form summary span{color:var(--wa-muted);font-size:.78rem}
.wa-form details[open] summary,.wa-form[open] summary{border-bottom:1px solid #edf1f2;margin-bottom:22px;padding-bottom:18px}
.wa-full{display:block;margin-bottom:20px}
.wa-full .form-control{margin-top:7px}
.wa-table{border-collapse:collapse;font-size:.82rem;width:100%}
.wa-table th{border-bottom:1px solid #cbd7db;color:#4c5c65;font-size:.68rem;font-weight:800;letter-spacing:.035em;padding:12px;text-transform:uppercase;white-space:nowrap}
.wa-table td{border-bottom:1px solid #e8edef;padding:14px 12px;vertical-align:middle}
.wa-table tbody tr:hover{background:#f8fbfa}
.wa-table tbody tr:last-child td{border-bottom:0}
.wa-table td small{color:#7b899a;display:block;margin-top:3px}
.wa-table a{color:var(--wa-green-dark);font-weight:700}
.wa-empty{color:#829097;padding:38px 20px!important;text-align:center}
.wa-badge{background:#e9f0f2;border-radius:999px;color:#52626b;display:inline-flex;font-size:.69rem;font-weight:800;padding:5px 10px}
.wa-badge.green{background:#e2f6ee;color:#087443}
.wa-inbox-page{height:100%;min-height:0;overflow:hidden}
@media(min-width:901px){body:has(.wa-inbox-page){height:100dvh;overflow:hidden}}
/* Inbox is intentionally a desktop-style workspace, matching WhatsApp Web. */
.wa-shell:has(.wa-inbox-page){
    grid-template-columns:72px minmax(0,1fr);
}
.wa-shell:has(.wa-inbox-page) .wa-sidebar{
    align-items:center;
    background:#f7f7f7;
    border-right:1px solid #dcdfe1;
    padding:12px 8px;
}
.wa-shell:has(.wa-inbox-page) .wa-brand{
    border:0;
    display:block;
    padding:0 0 10px;
}
.wa-shell:has(.wa-inbox-page) .wa-brand>span{
    background:transparent;
    color:#0aa76f;
    font-size:27px;
    height:42px;
    width:42px;
}
.wa-shell:has(.wa-inbox-page) .wa-brand>div,
.wa-shell:has(.wa-inbox-page) .wa-sidebar nav a span{display:none}
.wa-shell:has(.wa-inbox-page) .wa-sidebar nav{
    align-content:start;
    gap:7px;
    margin-top:0;
    padding:0;
    width:100%;
}
.wa-shell:has(.wa-inbox-page) .wa-sidebar nav a{
    border-radius:10px;
    color:#5f6365;
    justify-content:center;
    min-height:44px;
    padding:0;
}
.wa-shell:has(.wa-inbox-page) .wa-sidebar nav a:hover,
.wa-shell:has(.wa-inbox-page) .wa-sidebar nav a.active{
    background:#e7e7e7;
    box-shadow:none;
    color:#111;
}
.wa-shell:has(.wa-inbox-page) .wa-sidebar nav a.active::after{
    background:#14a66f;
    border-radius:4px;
    content:"";
    height:22px;
    left:0;
    position:absolute;
    width:3px;
}
.wa-shell:has(.wa-inbox-page) .wa-sidebar nav a{position:relative}
.wa-shell:has(.wa-inbox-page) .wa-sidebar nav i{font-size:1.15rem}
.wa-shell:has(.wa-inbox-page) .wa-main{
    height:100%;
    min-height:0;
    overflow:hidden;
    padding:0;
}
.wa-inbox{
    background:#fff;
    border:0;
    border-radius:0;
    box-shadow:none;
    display:grid;
    grid-template-columns:clamp(360px,34vw,570px) minmax(0,1fr);
    height:100%;
    min-height:0;
    overflow:hidden;
}
.wa-chat-list{background:#fff;border-right:1px solid #e1e7e9;display:flex;flex-direction:column;min-width:0;overflow:hidden}
.wa-list-head{align-items:center;background:#fff;display:flex;justify-content:space-between;min-height:68px;padding:10px 22px 6px}
.wa-list-head h1{font-size:1.4rem;font-weight:700;letter-spacing:-.025em;margin:0}
.wa-chat-count{color:#86969e;display:block;font-size:.68rem;margin-top:2px}
.wa-list-actions{display:flex;gap:8px}
.wa-head-action{align-items:center;background:transparent;border-radius:50%;color:#111;display:flex;font-size:.88rem;height:34px;justify-content:center;text-decoration:none;width:34px}
.wa-head-action:hover{background:#eee;color:#111}
.wa-chat-search{align-items:center;background:#f4f4f4;border-radius:20px;display:flex;margin:3px 22px 10px;min-height:38px;padding:0 14px}
.wa-chat-search i{color:#667781;font-size:.78rem;width:28px}
.wa-chat-search input{background:transparent;border:0;color:#26353c;font-size:.78rem;outline:0;width:100%}
.wa-chat-search input::placeholder{color:#7d8c93}
.wa-chat-filter{border-bottom:1px solid #edf1f2;display:flex;gap:7px;padding:0 22px 9px}
.wa-chat-filter button{background:#fff;border:1px solid #d7d9da;border-radius:999px;color:#586168;font-size:.68rem;font-weight:650;padding:4px 12px}
.wa-chat-filter button.active{background:#d9fdd3;border-color:#a7dba1;color:#08745e}
.wa-chat-items{flex:1;overflow:auto;scrollbar-color:#bec9cd transparent;scrollbar-width:thin}
.wa-chat-item{align-items:center;color:var(--wa-ink);display:flex;gap:12px;min-height:64px;padding:8px 16px 8px 22px;position:relative;text-decoration:none}
.wa-chat-item::after{background:#edf1f2;bottom:0;content:"";height:1px;left:70px;position:absolute;right:0}
.wa-chat-item:hover{background:#f5f7f8;color:var(--wa-ink)}
.wa-chat-item.active{background:#f0f0f0;color:var(--wa-ink)}
.wa-chat-item.active::before{background:var(--wa-green);bottom:8px;content:"";left:0;position:absolute;top:8px;width:3px}
.wa-chat-summary{flex:1;min-width:0}
.wa-chat-row{align-items:center;display:flex;gap:8px;justify-content:space-between;min-width:0}
.wa-chat-row strong{font-size:.88rem;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wa-chat-row time{color:#86969e;font-size:.62rem;white-space:nowrap}
.wa-chat-row small{color:#75868e;font-size:.7rem;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wa-chat-row small i{color:#21b97a;margin-right:2px}
.wa-chat-row b{background:#25d366;border-radius:20px;color:#fff;font-size:.62rem;line-height:19px;min-width:19px;padding:0 5px;text-align:center}
.wa-avatar{background:linear-gradient(145deg,#d6f7e7,#bcecd7);border-radius:50%;color:#08764d;display:grid!important;flex:0 0 44px;font-size:.88rem;font-weight:800;height:44px;place-items:center;width:44px}
.wa-list-empty,.wa-search-empty{align-items:center;color:#819098;display:flex;flex-direction:column;padding:50px 24px;text-align:center}
.wa-list-empty span{background:#eaf7f3;border-radius:50%;color:var(--wa-green);display:grid;font-size:1.2rem;height:48px;margin-bottom:12px;place-items:center;width:48px}
.wa-list-empty strong{color:#52616a;font-size:.83rem}.wa-list-empty p{font-size:.7rem;margin:5px 0}
.wa-search-empty{display:none;font-size:.74rem;gap:8px}.wa-search-empty.show{display:flex}
.wa-chat{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;min-height:0;min-width:0;overflow:hidden;position:relative}
.wa-conversation-head{align-items:center;background:#fff;border-bottom:1px solid #e1e7e9;display:flex;gap:10px;min-height:66px;padding:8px 18px}
.wa-contact-title{flex:1;min-width:0}.wa-contact-title strong,.wa-contact-title small{display:block}
.wa-contact-title strong{font-size:.88rem}.wa-contact-title small{color:#77868d;font-size:.65rem;margin-top:2px}
.wa-online-dot{background:#25d366;border-radius:50%;display:inline-block;height:6px;margin-right:3px;width:6px}
.wa-conversation-actions{align-items:center;display:flex!important;flex:0 0 auto!important;gap:4px}
.wa-conversation-actions button,.wa-conversation-actions a,.wa-compose-icon{align-items:center;background:transparent;border:0;border-radius:50%;color:#202526;display:flex;font-size:.86rem;height:34px;justify-content:center;text-decoration:none;width:34px}
.wa-conversation-actions button:hover,.wa-compose-icon:hover{background:#e8edef;color:#26353c}
.wa-conversation-actions .wa-badge{margin-left:5px}
.wa-message-search{align-items:center;background:#fff;border-bottom:1px solid #e1e7e9;display:none;gap:10px;padding:7px 16px}
.wa-message-search.show{display:flex}
.wa-message-search>i{color:#73828a;font-size:.75rem}
.wa-message-search input{border:0;flex:1;font-size:.75rem;outline:0}
.wa-message-search button{background:transparent;border:0;color:#65757d;height:30px;width:30px}
.wa-message.wa-search-hidden{display:none}
.wa-message.wa-search-match{outline:2px solid #f5c542;outline-offset:2px}
.wa-messages{
    background-color:#efeae2;
    background-image:linear-gradient(rgba(239,234,226,.89),rgba(239,234,226,.89)),url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%239e9689' fill-opacity='.18'%3E%3Cpath d='M12 10h3v3h-3zM50 4h2v2h-2zM69 24h3v3h-3zM28 34h2v2h-2zM6 60h3v3H6zM44 67h3v3h-3zM66 55h2v2h-2z'/%3E%3C/g%3E%3C/svg%3E");
    min-height:0;
    overflow:auto;
    padding:12px clamp(16px,3vw,46px) 66px;
    scrollbar-color:#b7b1a8 transparent;
    scrollbar-width:thin;
}
.wa-day-divider{text-align:center}.wa-day-divider span,.wa-encryption-note{background:#fff;border-radius:7px;box-shadow:0 1px 1px rgba(11,20,26,.08);color:#667781;display:inline-block;font-size:.62rem;padding:6px 10px}
.wa-encryption-note{background:#ffeecd;color:#74654b;display:block;margin:10px auto 18px;max-width:max-content;text-align:center}
.wa-encryption-note i{font-size:.55rem;margin-right:4px}
.wa-message{background:#fff;border-radius:8px;box-shadow:0 1px 1px rgba(11,20,26,.13);margin:6px 0;max-width:min(72%,560px);padding:6px 8px 4px;position:relative;width:max-content}
.wa-message.inbound{border-top-left-radius:2px}.wa-message.outbound{background:#d9fdd3;border-top-right-radius:2px;margin-left:auto}
.wa-message p{color:#1d2930;font-size:.8rem;line-height:1.45;margin:0;padding-right:34px;white-space:normal}
.wa-message small{color:#718087;display:block;font-size:.56rem;letter-spacing:.01em;margin-top:2px;text-align:right}
.wa-message small i{font-size:.58rem;margin-left:2px}.wa-message small i.read{color:#53bdeb}
.wa-audio-message{align-items:center;display:flex;gap:8px;min-width:min(300px,60vw)}
.wa-audio-message>span{align-items:center;background:#d8eee8;border-radius:50%;color:#087d68;display:flex;flex:0 0 34px;height:34px;justify-content:center;width:34px}
.wa-audio-message audio{height:36px;max-width:270px;width:100%}
.wa-image-message{display:block}.wa-image-message img{border-radius:6px;display:block;max-height:320px;max-width:min(360px,60vw);object-fit:cover;width:auto}
.wa-video-message{border-radius:6px;display:block;max-height:340px;max-width:min(400px,62vw)}
.wa-media-caption{margin-top:6px!important;padding-right:4px!important}
.wa-no-messages{align-items:center;color:#718087;display:flex;flex-direction:column;height:calc(100% - 70px);justify-content:center;text-align:center}
.wa-no-messages span{color:#00a884;font-size:2.4rem}.wa-no-messages strong{color:#415058;font-size:.9rem;margin-top:7px}.wa-no-messages p{font-size:.7rem;margin-top:4px}
.wa-composer{align-items:center;background:rgba(247,247,247,.98);border-top:1px solid #dfe5e7;bottom:0;display:flex;gap:8px;left:0;padding:8px 14px;position:absolute;right:0;z-index:5}
@media(min-width:901px){
    .wa-messages{
        bottom:var(--wa-messages-bottom,57px);
        left:var(--wa-composer-left,0px);
        position:fixed;
        right:0;
        top:var(--wa-messages-top,0px);
        z-index:1;
    }
    .wa-composer{
        box-shadow:0 -2px 8px rgba(17,27,33,.06);
        left:var(--wa-composer-left,0px);
        position:fixed;
        z-index:1050;
    }
}
.wa-compose-field{flex:1;position:relative}
.wa-composer textarea{background:#fff!important;border:1px solid #e4e6e7!important;border-radius:20px!important;box-shadow:0 1px 2px rgba(0,0,0,.03)!important;font-size:.78rem;height:40px!important;line-height:20px;max-height:40px;min-height:40px;padding:9px 15px!important;resize:none}
.wa-composer textarea:focus{border-color:#b9ddd5!important}
.wa-compose-hint{color:#839198;font-size:.75rem;left:16px;pointer-events:none;position:absolute;top:10px}.wa-compose-hint.hidden{display:none}
.wa-send-button{align-items:center;background:var(--wa-green-dark);border:0;border-radius:50%;color:#fff;display:flex;font-size:.78rem;font-weight:750;gap:7px;height:40px;justify-content:center;padding:0;width:40px}
.wa-send-button span{display:none}
.wa-send-button:hover{background:#006e5a}.wa-send-button:active{transform:scale(.97)}
.wa-mic-button{align-items:center;background:transparent;border:0;border-radius:50%;color:#52636b;display:flex;flex:0 0 40px;font-size:.92rem;height:40px;justify-content:center;width:40px}
.wa-mic-button:hover{background:#e4e9eb;color:var(--wa-green-dark)}
.wa-attach-button{align-items:center;background:transparent;border:0;border-radius:50%;color:#52636b;display:flex;flex:0 0 40px;height:40px;justify-content:center;width:40px}
.wa-attach-button:hover{background:#e4e9eb;color:var(--wa-green-dark)}
.wa-composer.sending-media{opacity:.65;pointer-events:none}
.wa-composer.sending-media::after{color:#52636b;content:"Uploading…";font-size:.68rem;position:absolute;right:58px;top:-22px}
.wa-voice-recording{align-items:center;color:#64757d;display:none;flex:1;font-size:.72rem;gap:10px;min-height:40px;padding:0 8px}
.wa-voice-recording strong{color:#25343b;font-variant-numeric:tabular-nums}
.wa-voice-recording>span:nth-of-type(2){flex:1}
.wa-voice-recording button{align-items:center;border:0;border-radius:50%;display:flex;height:36px;justify-content:center;width:36px}
.wa-voice-recording [data-wa-voice-cancel]{background:#fde9e9;color:#cf3030}
.wa-voice-recording [data-wa-voice-send]{background:var(--wa-green-dark);color:#fff}
.wa-recording-dot{animation:wa-record-pulse 1s infinite;background:#e53935;border-radius:50%;height:9px;width:9px}
.wa-composer.recording .wa-compose-field,.wa-composer.recording .wa-mic-button,.wa-composer.recording .wa-send-button,
.wa-composer.sending-voice .wa-compose-field,.wa-composer.sending-voice .wa-mic-button,.wa-composer.sending-voice .wa-send-button{display:none}
.wa-composer.recording .wa-voice-recording,.wa-composer.sending-voice .wa-voice-recording{display:flex}
.wa-composer.sending-voice .wa-voice-recording{opacity:.65;pointer-events:none}
.wa-composer.sending-voice .wa-voice-recording>span:nth-of-type(2)::after{content:" Sending…"}
@keyframes wa-record-pulse{50%{box-shadow:0 0 0 5px rgba(229,57,53,.15);opacity:.55}}
.wa-welcome{align-items:center;background:#f7f9fa;border-bottom:6px solid #25d366;display:flex;flex-direction:column;height:100%;justify-content:center;padding:40px;text-align:center}
.wa-welcome-icon{background:#dcf8ef;border-radius:50%;color:#00a884;display:grid;font-size:3.5rem;height:100px;margin-bottom:22px;place-items:center;width:100px}
.wa-welcome h2{font-size:1.4rem;font-weight:400;margin:0}.wa-welcome p{color:#667781;font-size:.76rem;line-height:1.6;margin:10px auto 30px;max-width:440px}.wa-welcome small{color:#8696a0;font-size:.64rem}
.wa-notice{background:#e7f6f2;border-left:3px solid var(--wa-green);border-radius:8px;color:#247063;font-size:.8rem;margin:20px 0 0;padding:13px}
.wa-filters{background:#fff;border:1px solid var(--wa-line);border-radius:14px;display:flex;gap:10px;margin-bottom:18px;padding:14px}.wa-filters .form-control{max-width:300px}.wa-filters .form-select{max-width:190px}.wa-api{color:#278264;max-width:300px;word-break:break-all}
@media (max-width: 1400px) and (min-width: 901px) {
    .wa-shell{grid-template-columns:clamp(215px,17vw,235px) minmax(0,1fr)}
    .wa-sidebar{padding-left:11px;padding-right:11px}
    .wa-sidebar nav a{font-size:.8rem;padding-left:10px;padding-right:9px}
    .wa-brand{gap:9px;padding-left:4px;padding-right:4px}
    .wa-brand>span{height:42px;width:42px}
    .wa-brand strong{font-size:.9rem}
    .wa-main{padding-left:clamp(18px,2vw,28px);padding-right:clamp(18px,2vw,28px)}
    .wa-two{grid-template-columns:1fr}
    .wa-inbox{grid-template-columns:minmax(240px,31%) minmax(0,1fr)}
}
@media(max-width:1100px) and (min-width:901px){
    .wa-heading h1{font-size:1.75rem}
    .wa-kpis{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))}
    .wa-kpis a{min-height:125px;padding:16px}
}
@media(max-width:900px){
    .wa-shell{display:block;height:auto;min-height:calc(100dvh - 65px);overflow:visible}
    .wa-sidebar{height:auto;padding:10px 12px;position:static}
    .wa-brand{display:none}
    .wa-sidebar nav{display:flex;margin:0;overflow-x:auto;padding:0}
    .wa-sidebar nav a{flex:0 0 auto;min-height:40px;white-space:nowrap}.wa-sidebar nav a.active{box-shadow:inset 0 -3px #25d366}
    .wa-main{overflow:visible;padding:18px 12px 30px}
    .wa-heading{align-items:stretch;flex-direction:column;margin-bottom:18px}.wa-heading .btn,.wa-heading form .btn{width:100%}
    .wa-grid{grid-template-columns:1fr}.wa-field-wide{grid-column:auto}.wa-two{grid-template-columns:1fr}
    .wa-kpis{grid-template-columns:repeat(2,1fr)}.wa-kpis a{min-height:120px;padding:16px}
    .wa-card{border-radius:13px;padding:18px}
    .wa-inbox{border-radius:12px;display:block;height:auto;min-height:0}.wa-chat-list{border-bottom:1px solid #d8e1e4;border-right:0;max-height:330px}.wa-chat{min-height:560px}
    .wa-list-head{min-height:62px}.wa-conversation-head{min-height:62px}
    .wa-chat-items{min-height:0}.wa-chat-item{padding-bottom:10px;padding-top:10px}
    .wa-messages{min-height:430px;padding-left:18px;padding-right:18px}
    .wa-filters{flex-wrap:wrap}.wa-filters .form-control,.wa-filters .form-select{max-width:none;width:100%}
}
@media(max-width:520px){
    .wa-kpis{grid-template-columns:1fr 1fr}.wa-kpis a{min-height:108px}.wa-kpis span{margin-top:11px}.wa-two-equal{grid-template-columns:1fr}
    .wa-message{max-width:88%}.wa-choice-grid>div{grid-template-columns:1fr}
    .wa-conversation-actions button:first-child,.wa-conversation-actions .wa-badge{display:none}
    .wa-conversation-head{padding-left:12px;padding-right:10px}.wa-conversation-head .wa-avatar{height:40px;width:40px;flex-basis:40px}
    .wa-composer{padding-left:7px;padding-right:7px}.wa-compose-icon{width:32px}.wa-send-button{border-radius:50%;padding:0;width:44px}.wa-send-button span{display:none}
}
.dms-list-scroll-toggle,
.dms-list-horizontal-toggle {
    align-items: center;
    background: linear-gradient(145deg, #101827, #202b3d);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    bottom: 28px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .28);
    color: #fff;
    display: none;
    height: 48px;
    justify-content: center;
    position: fixed;
    right: 26px;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    width: 48px;
    z-index: 1040;
}

.dms-list-horizontal-toggle {
    bottom: 86px;
    right: 26px;
}

.dms-list-scroll-toggle.is-visible,
.dms-list-horizontal-toggle.is-visible {
    display: inline-flex;
}

.dms-list-scroll-toggle:hover,
.dms-list-scroll-toggle:focus-visible,
.dms-list-horizontal-toggle:hover,
.dms-list-horizontal-toggle:focus-visible {
    background: linear-gradient(145deg, #e52b3e, #b91c2d);
    box-shadow: 0 14px 34px rgba(229, 43, 62, .3);
    color: #fff;
    outline: none;
    transform: translateY(-2px);
}

.dms-list-scroll-toggle i,
.dms-list-horizontal-toggle i {
    font-size: 1.15rem;
    transition: transform .25s ease;
}

.dms-list-scroll-toggle.is-up i,
.dms-list-horizontal-toggle.is-left i {
    transform: rotate(180deg);
}

@media (max-width: 767px) {
    .dms-list-scroll-toggle,
    .dms-list-horizontal-toggle {
        bottom: 18px;
        height: 44px;
        right: 16px;
        width: 44px;
    }
    .dms-list-horizontal-toggle {
        bottom: 70px;
        right: 16px;
    }
}

.dms-pagination{align-items:center;border-top:1px solid #e2e8f0;display:flex;flex-wrap:wrap;gap:14px;justify-content:flex-end;margin-top:14px;padding-top:12px}
.dms-pagination-size{align-items:center;display:inline-flex;gap:8px;margin:0 auto 0 0}
.dms-pagination-size label,.dms-pagination-summary{color:#64748b;font-size:.92rem;white-space:nowrap}
.dms-pagination-size select{appearance:auto;background:#fff;border:1px solid #cbd5e1;border-radius:9px;color:#172033;font-weight:600;height:40px;min-width:76px;padding:0 30px 0 12px}
.dms-pagination-size select:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.14);outline:none}
.dms-pagination-pages{align-items:center;display:flex;gap:6px;list-style:none;margin:0;padding:0}
.dms-pagination-pages a,.dms-pagination-pages span{align-items:center;border:1px solid #d5deea;border-radius:9px;color:#334155;display:inline-flex;font-size:.9rem;font-weight:700;height:40px;justify-content:center;min-width:40px;padding:0 10px;text-decoration:none}
.dms-pagination-pages a:hover{background:#eef4ff;border-color:#9db8f7;color:#1746b0}
.dms-pagination-pages .active{background:#2455c3;border-color:#2455c3;box-shadow:0 5px 13px rgba(36,85,195,.23);color:#fff}
.dms-pagination-pages .disabled{background:#f8fafc;color:#b0bccd}
.dms-pagination-pages .ellipsis{border-color:transparent;min-width:24px;padding:0}
@media(max-width:640px){.dms-pagination{justify-content:space-between}.dms-pagination-size{margin-right:0}.dms-pagination-summary{order:3;text-align:center;width:100%}}
