/* =========================================================
   ISU Cauayan City FabLab — CCHAP global UI/UX refinement
   Scope: layout/spacing/alignment/proportion/color/typography only.
   Business logic, workflow, data, and report content remain untouched.
   ========================================================= */

:root {
    --cchap-green-950: #063d2d;
    --cchap-green-900: #07543d;
    --cchap-green-800: #0a684b;
    --cchap-green-700: #0d7a58;
    --cchap-green-600: #129064;
    --cchap-green-100: #dff4ea;
    --cchap-green-50: #effaf5;
    --cchap-gold: #f4b400;
    --cchap-ink: #17342a;
    --cchap-muted: #667a72;
    --cchap-border: #dfe8e3;
    --cchap-canvas: #f5f8f6;
    --cchap-card: #ffffff;
    --cchap-danger: #b94750;
    --cchap-warning: #a66d0a;
    --cchap-info: #2f6f9f;
    --cchap-radius-sm: .7rem;
    --cchap-radius: 1rem;
    --cchap-radius-lg: 1.25rem;
    --cchap-shadow-sm: 0 6px 20px rgba(6, 61, 45, .065);
    --cchap-shadow: 0 14px 36px rgba(6, 61, 45, .09);
    --cchap-page-gutter: clamp(.85rem, 1.8vw, 1.5rem);
    --cchap-section-gap: 1rem;
}

/* ---------- Color harmony ---------- */
body.cchap-ui.portal-ui-v3 {
    --portal-green-950: var(--cchap-green-950);
    --portal-green-900: var(--cchap-green-900);
    --portal-green-800: var(--cchap-green-800);
    --portal-green-700: var(--cchap-green-700);
    --portal-green-600: var(--cchap-green-600);
    --portal-green-100: var(--cchap-green-100);
    --portal-green-50: var(--cchap-green-50);
    --portal-gold: var(--cchap-gold);
    --portal-ink: var(--cchap-ink);
    --portal-muted: var(--cchap-muted);
    --portal-line: var(--cchap-border);
    --portal-canvas: var(--cchap-canvas);
    --portal-radius-sm: var(--cchap-radius-sm);
    --portal-radius: var(--cchap-radius);
    --portal-radius-lg: var(--cchap-radius-lg);
    --portal-shadow-sm: var(--cchap-shadow-sm);
    --portal-shadow: var(--cchap-shadow);
    font-size: .94rem;
    line-height: 1.45;
}

body.cchap-ui .admin-overview-page {
    --overview-green-950: var(--cchap-green-950);
    --overview-green-900: var(--cchap-green-900);
    --overview-green-700: var(--cchap-green-700);
    --overview-green-500: var(--cchap-green-600);
    --overview-gold: var(--cchap-gold);
    --overview-ink: var(--cchap-ink);
    --overview-muted: var(--cchap-muted);
    --overview-border: rgba(6, 61, 45, .13);
    --overview-shadow: var(--cchap-shadow-sm);
}

body.cchap-ui .home-v4 {
    --home-green-950: var(--cchap-green-950);
    --home-green-900: var(--cchap-green-900);
    --home-green-800: var(--cchap-green-800);
    --home-green-700: var(--cchap-green-700);
    --home-green-600: var(--cchap-green-600);
    --home-green-100: var(--cchap-green-100);
    --home-green-50: var(--cchap-green-50);
    --home-ink: var(--cchap-ink);
    --home-muted: var(--cchap-muted);
    --home-line: var(--cchap-border);
}

/* ---------- Shared content width and page spacing ---------- */
body.cchap-ui.portal-ui-v3 .dashboard-page,
body.cchap-ui.portal-ui-v3 .inquiry-page,
body.cchap-ui.portal-ui-v3 .inquiry-thread-page,
body.cchap-ui.portal-ui-v3 .order-create-page,
body.cchap-ui.portal-ui-v3 .order-details-page,
body.cchap-ui.portal-ui-v3 .queue-page,
body.cchap-ui.portal-ui-v3 .customer-queue-page,
body.cchap-ui.portal-ui-v3 .forecast-page,
body.cchap-ui.portal-ui-v3 .sms-page,
body.cchap-ui.portal-ui-v3 .report-page,
body.cchap-ui.portal-ui-v3 .chat-page {
    min-height: auto;
    padding-top: 1.2rem !important;
    padding-bottom: 2rem !important;
}

body.cchap-ui.portal-ui-v3 .admin-content > main > .container-fluid,
body.cchap-ui.portal-ui-v3 .admin-content > main > .container,
body.cchap-ui.portal-ui-v3 .customer-content > main > .container-fluid,
body.cchap-ui.portal-ui-v3 .customer-content > main > .container,
body.cchap-ui.portal-ui-v3 main.dashboard-page > .container-fluid,
body.cchap-ui.portal-ui-v3 main.dashboard-page > .container {
    width: 100%;
    max-width: 1540px;
    margin-inline: auto;
    padding-left: var(--cchap-page-gutter) !important;
    padding-right: var(--cchap-page-gutter) !important;
}

body.cchap-ui.portal-ui-v3 main .g-4 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}
body.cchap-ui.portal-ui-v3 main .g-3 {
    --bs-gutter-x: .8rem;
    --bs-gutter-y: .8rem;
}
body.cchap-ui.portal-ui-v3 main .gap-4 { gap: 1rem !important; }
body.cchap-ui.portal-ui-v3 main .gap-3 { gap: .75rem !important; }
body.cchap-ui.portal-ui-v3 main .mt-4 { margin-top: 1rem !important; }
body.cchap-ui.portal-ui-v3 main .mb-4 { margin-bottom: 1rem !important; }
body.cchap-ui.portal-ui-v3 main .py-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
body.cchap-ui.portal-ui-v3 main .py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

/* ---------- Typography hierarchy ---------- */
body.cchap-ui.portal-ui-v3 .dashboard-heading h1 {
    margin: .2rem 0 .25rem;
    font-size: clamp(1.6rem, 2.2vw, 2.2rem);
    line-height: 1.12;
    letter-spacing: -.035em;
}
body.cchap-ui.portal-ui-v3 .dashboard-heading p {
    max-width: 760px;
    font-size: .9rem;
    line-height: 1.48;
}
body.cchap-ui.portal-ui-v3 .content-card h2,
body.cchap-ui.portal-ui-v3 .section-title-row h2 {
    font-size: 1.15rem;
    line-height: 1.25;
}
body.cchap-ui.portal-ui-v3 .content-card h3 { font-size: 1rem; }
body.cchap-ui.portal-ui-v3 .eyebrow {
    padding: .25rem .52rem;
    font-size: .64rem;
    letter-spacing: .11em;
}
body.cchap-ui.portal-ui-v3 .text-secondary,
body.cchap-ui.portal-ui-v3 .text-muted { color: var(--cchap-muted) !important; }

/* ---------- Page title block ---------- */
body.cchap-ui.portal-ui-v3 .dashboard-heading {
    gap: .85rem;
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-radius: var(--cchap-radius-lg);
    box-shadow: var(--cchap-shadow-sm);
}
body.cchap-ui.portal-ui-v3 .dashboard-heading::before { width: 12rem; height: 12rem; top: -5rem; right: -3rem; }
body.cchap-ui.portal-ui-v3 .dashboard-heading::after { display: none; }
body.cchap-ui.portal-ui-v3 .dashboard-heading > .d-flex,
body.cchap-ui.portal-ui-v3 .dashboard-heading > .toolbar {
    align-items: center;
    gap: .5rem !important;
}

/* ---------- Cards and compact information blocks ---------- */
body.cchap-ui.portal-ui-v3 .content-card,
body.cchap-ui.portal-ui-v3 .order-form-section,
body.cchap-ui.portal-ui-v3 fieldset.content-card,
body.cchap-ui.portal-ui-v3 .report-filter-card,
body.cchap-ui.portal-ui-v3 .forecast-service-card,
body.cchap-ui.portal-ui-v3 .forecast-readiness-card,
body.cchap-ui.portal-ui-v3 .dss-card,
body.cchap-ui.portal-ui-v3 .queue-job-card,
body.cchap-ui.portal-ui-v3 .customer-queue-card,
body.cchap-ui.portal-ui-v3 .inquiry-form-card,
body.cchap-ui.portal-ui-v3 .inquiry-summary,
body.cchap-ui.portal-ui-v3 .quotation-summary-card,
body.cchap-ui.portal-ui-v3 .quotation-workflow-card,
body.cchap-ui.portal-ui-v3 .order-estimate-card {
    padding: 1rem !important;
    border-radius: var(--cchap-radius) !important;
    box-shadow: var(--cchap-shadow-sm);
}

body.cchap-ui.portal-ui-v3 .metric-card {
    min-height: 0 !important;
    padding: .95rem 1rem !important;
}
body.cchap-ui.portal-ui-v3 .metric-card .metric-icon,
body.cchap-ui.portal-ui-v3 .dashboard-action-card .metric-icon {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: .75rem;
}
body.cchap-ui.portal-ui-v3 .metric-card p { margin: .65rem 0 .12rem; font-size: .78rem; }
body.cchap-ui.portal-ui-v3 .metric-card strong { font-size: clamp(1.45rem, 2vw, 1.9rem); }
body.cchap-ui.portal-ui-v3 .dashboard-action-card {
    min-height: 0;
    padding: .85rem .95rem;
}

body.cchap-ui.portal-ui-v3 .empty-state,
body.cchap-ui.portal-ui-v3 .chat-empty,
body.cchap-ui.portal-ui-v3 .overview-empty,
body.cchap-ui.portal-ui-v3 .customer-chat-empty {
    min-height: 0 !important;
    padding: 1.5rem 1rem !important;
}

/* Remove artificial text-height fillers while preserving all text. */
body.cchap-ui.portal-ui-v3 .service-admin-card p,
body.cchap-ui.portal-ui-v3 .order-service-choice p,
body.cchap-ui.portal-ui-v3 .order-service-choice--with-photo p,
body.cchap-ui.portal-ui-v3 .dashboard-service-copy p {
    min-height: 0 !important;
}

/* ---------- Forms ---------- */
body.cchap-ui.portal-ui-v3 .form-label {
    margin-bottom: .3rem;
    font-size: .78rem;
    line-height: 1.25;
}
body.cchap-ui.portal-ui-v3 .form-control,
body.cchap-ui.portal-ui-v3 .form-select {
    min-height: 2.45rem;
    padding: .48rem .75rem;
    border-radius: .7rem;
    font-size: .9rem;
}
body.cchap-ui.portal-ui-v3 .form-control-lg,
body.cchap-ui.portal-ui-v3 .form-select-lg,
body.cchap-ui.portal-ui-v3 .input-group-lg > .form-control,
body.cchap-ui.portal-ui-v3 .input-group-lg > .form-select,
body.cchap-ui.portal-ui-v3 .input-group-lg > .input-group-text,
body.cchap-ui.portal-ui-v3 .input-group-lg > .btn {
    min-height: 2.7rem;
    padding-top: .55rem;
    padding-bottom: .55rem;
    font-size: .92rem;
}
body.cchap-ui.portal-ui-v3 textarea.form-control {
    min-height: 5rem;
    padding-block: .6rem;
    resize: vertical;
}
body.cchap-ui.portal-ui-v3 .form-text { margin-top: .25rem; font-size: .73rem; line-height: 1.35; }
body.cchap-ui.portal-ui-v3 .input-group-text { padding-inline: .7rem; }
body.cchap-ui.portal-ui-v3 .form-check { min-height: 1.35rem; }

/* ---------- Buttons ---------- */
body.cchap-ui.portal-ui-v3 .btn {
    min-height: 2.3rem;
    padding: .42rem .8rem;
    border-radius: .7rem;
    font-size: .88rem;
    line-height: 1.25;
}
body.cchap-ui.portal-ui-v3 .btn-sm {
    min-height: 1.95rem;
    padding: .32rem .62rem;
    border-radius: .6rem;
    font-size: .8rem;
}
body.cchap-ui.portal-ui-v3 .btn-lg {
    min-height: 2.65rem;
    padding: .52rem .95rem;
    border-radius: .78rem;
    font-size: .92rem;
}
body.cchap-ui.portal-ui-v3 .btn-isu,
body.cchap-ui.portal-ui-v3 .btn-success {
    background: linear-gradient(135deg, var(--cchap-green-700), var(--cchap-green-900));
    border-color: var(--cchap-green-700);
    box-shadow: 0 6px 16px rgba(6,61,45,.13);
}
body.cchap-ui.portal-ui-v3 .btn-outline-success { color: var(--cchap-green-800); border-color: rgba(10,104,75,.38); }
body.cchap-ui.portal-ui-v3 .toolbar,
body.cchap-ui.portal-ui-v3 .filter-line,
body.cchap-ui.portal-ui-v3 .report-active-filters { gap: .5rem; }

/* ---------- Tables ---------- */
body.cchap-ui.portal-ui-v3 .table-responsive,
body.cchap-ui.portal-ui-v3 .table-wrap,
body.cchap-ui.portal-ui-v3 .report-preview-table-wrap {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-radius: .8rem;
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: #b7cfc4 transparent;
}
body.cchap-ui.portal-ui-v3 .table { margin-bottom: 0; font-size: .84rem; }
body.cchap-ui.portal-ui-v3 .table thead th {
    padding: .58rem .68rem;
    font-size: .66rem;
    letter-spacing: .055em;
    vertical-align: middle;
}
body.cchap-ui.portal-ui-v3 .table tbody td {
    padding: .58rem .68rem;
    line-height: 1.35;
}
body.cchap-ui.portal-ui-v3 .table .btn,
body.cchap-ui.portal-ui-v3 .table .btn-sm { white-space: nowrap; }
body.cchap-ui.portal-ui-v3 .badge { padding: .38em .62em; font-size: .72rem; }

/* ---------- Sidebar proportion ---------- */
@media (min-width: 992px) {
    body.cchap-ui.admin-sidebar-layout { --admin-sidebar-width: 252px !important; }
    body.cchap-ui.customer-sidebar-layout { --customer-sidebar-width: 248px !important; }

    body.cchap-ui.admin-sidebar-layout .admin-sidebar,
    body.cchap-ui.customer-sidebar-layout .customer-sidebar {
        box-shadow: 12px 0 30px rgba(6,61,45,.12);
    }
    body.cchap-ui.admin-sidebar-layout .admin-sidebar-brand,
    body.cchap-ui.customer-sidebar-layout .customer-sidebar-brand {
        min-height: 76px;
        padding: .85rem .9rem .75rem;
    }
    body.cchap-ui.admin-sidebar-layout .admin-brand-mark,
    body.cchap-ui.customer-sidebar-layout .customer-brand-mark {
        width: 2.5rem;
        height: 2.5rem;
    }
    body.cchap-ui.admin-sidebar-layout .admin-sidebar-nav,
    body.cchap-ui.customer-sidebar-layout .customer-sidebar-nav {
        padding: .65rem .62rem .8rem;
    }
    body.cchap-ui.admin-sidebar-layout .admin-nav-section + .admin-nav-section,
    body.cchap-ui.customer-sidebar-layout .customer-nav-section + .customer-nav-section { margin-top: .8rem; }
    body.cchap-ui.admin-sidebar-layout .admin-nav-label,
    body.cchap-ui.customer-sidebar-layout .customer-nav-label {
        margin: 0 .6rem .28rem;
        font-size: .61rem;
    }
    body.cchap-ui.admin-sidebar-layout .admin-nav-tab,
    body.cchap-ui.customer-sidebar-layout .customer-nav-tab {
        min-height: 39px;
        gap: .6rem;
        margin: .1rem 0;
        padding: .52rem .62rem;
        border-radius: .7rem;
        font-size: .82rem;
    }
    body.cchap-ui.admin-sidebar-layout .admin-sidebar-footer,
    body.cchap-ui.customer-sidebar-layout .customer-sidebar-footer { padding: .6rem; }
    body.cchap-ui.admin-sidebar-layout .admin-profile-tab,
    body.cchap-ui.customer-sidebar-layout .customer-profile-tab { padding: .55rem; }
    body.cchap-ui.admin-sidebar-layout .admin-avatar,
    body.cchap-ui.customer-sidebar-layout .customer-avatar { width: 2.15rem; height: 2.15rem; }
    body.cchap-ui.admin-sidebar-layout .admin-logout-button,
    body.cchap-ui.customer-sidebar-layout .customer-logout-button { padding: .52rem .62rem; }
}

/* ---------- Admin dashboard ---------- */
body.cchap-ui .admin-overview-page {
    min-height: auto;
    background: linear-gradient(180deg, #f5f9f7 0%, #f8fbfa 100%);
}
body.cchap-ui .admin-overview-page > .container-fluid {
    max-width: 1540px;
    margin-inline: auto;
    padding: 1rem var(--cchap-page-gutter) 1.5rem !important;
}
body.cchap-ui .overview-hero {
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(4,58,43,.14);
}
body.cchap-ui .overview-hero h1 {
    margin: .28rem 0 0;
    font-size: clamp(1.65rem, 2.3vw, 2.25rem);
    line-height: 1.1;
}
body.cchap-ui .overview-hero-actions { gap: .45rem; min-width: 0; }
body.cchap-ui .overview-hero-actions .btn { min-height: 2.2rem; padding: .4rem .7rem; }
body.cchap-ui .overview-date { font-size: .78rem; }
body.cchap-ui .overview-panel {
    padding: .9rem;
    border-radius: 16px;
    box-shadow: var(--cchap-shadow-sm);
}
body.cchap-ui .overview-panel-header { gap: .75rem; margin-bottom: .7rem; }
body.cchap-ui .overview-panel-header h2 { font-size: 1.05rem; }
body.cchap-ui .overview-panel-header p { font-size: .76rem; line-height: 1.4; }
body.cchap-ui .overview-module-grid { gap: .65rem; }
body.cchap-ui .overview-module-card { min-height: 0; padding: .7rem; border-radius: 13px; }
body.cchap-ui .overview-stat-card { min-height: 0; padding: .85rem; border-radius: 15px; }
body.cchap-ui .overview-empty-state { min-height: 110px; padding: .8rem; }
body.cchap-ui .overview-empty-state.tall { min-height: 180px; }

body.cchap-ui .dashboard-analytics-panel { padding: .9rem !important; }
body.cchap-ui .dashboard-analytics-heading { margin-bottom: .65rem; }
body.cchap-ui .dashboard-request-summary { gap: .6rem; margin-bottom: .7rem; }
body.cchap-ui .dashboard-request-card {
    min-height: 0;
    gap: .6rem;
    padding: .65rem .75rem;
    border-radius: 12px;
}
body.cchap-ui .dashboard-request-icon { width: 34px; height: 34px; border-radius: 9px; }
body.cchap-ui .dashboard-request-card strong { font-size: .92rem; }
body.cchap-ui .dashboard-request-card span:not(.dashboard-request-icon) { font-size: .68rem; }
body.cchap-ui .dashboard-analytics-main {
    grid-template-columns: minmax(0, 2fr) minmax(235px, .72fr);
    gap: .7rem;
}
body.cchap-ui .dashboard-demand-trend-panel,
body.cchap-ui .dashboard-forecast-panel {
    padding: .75rem;
    border-radius: 13px;
}
body.cchap-ui .dashboard-subpanel-header { gap: .6rem; margin-bottom: .4rem; }
body.cchap-ui .dashboard-demand-controls { gap: .35rem; }
body.cchap-ui .dashboard-demand-view-control { width: 105px; }
body.cchap-ui .dashboard-demand-month-control { width: 118px; }
body.cchap-ui .dashboard-demand-year-control { width: 92px; }
body.cchap-ui .dashboard-monthly-filter-controls { gap: .35rem; }
body.cchap-ui .dashboard-demand-chart-wrap { height: 260px; min-height: 0; }
body.cchap-ui .dashboard-forecast-values { gap: .5rem; margin-top: .5rem; }
body.cchap-ui .dashboard-forecast-value {
    min-height: 72px;
    padding: .58rem .65rem;
    border-radius: 10px;
}
body.cchap-ui .dashboard-forecast-value span { font-size: .68rem; }
body.cchap-ui .dashboard-forecast-value strong { margin-top: .15rem; font-size: 1.35rem; }
body.cchap-ui .dashboard-audit-panel { padding: .75rem .9rem; }
body.cchap-ui .dashboard-audit-item { padding-top: .35rem; padding-bottom: .35rem; }

/* ---------- Client dashboard and ordering ---------- */
body.cchap-ui .customer-dashboard-order-section {
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: var(--cchap-shadow-sm);
}
body.cchap-ui .customer-dashboard-section-heading {
    align-items: center;
    gap: .75rem;
    margin-bottom: .8rem;
}
body.cchap-ui .customer-dashboard-section-heading h2 {
    margin: .25rem 0 .15rem;
    font-size: clamp(1.2rem, 1.8vw, 1.55rem);
}
body.cchap-ui .customer-dashboard-order-section > .mt-4.mb-4 { margin-top: .8rem !important; margin-bottom: .8rem !important; }
body.cchap-ui .dashboard-service-card { border-radius: 1rem; box-shadow: var(--cchap-shadow-sm); }
body.cchap-ui .dashboard-service-image { aspect-ratio: 16 / 9; }
body.cchap-ui .dashboard-service-copy { padding: .85rem .9rem .9rem; }
body.cchap-ui .dashboard-service-copy h3 { margin-bottom: .3rem; font-size: 1.02rem; }
body.cchap-ui .dashboard-service-copy p { margin-bottom: .65rem; font-size: .82rem; line-height: 1.4; }
body.cchap-ui .dashboard-service-actions { gap: .4rem; }
body.cchap-ui .dashboard-service-actions .btn { min-height: 2.25rem; }
body.cchap-ui .dashboard-service-actions .btn.mt-2 { margin-top: 0 !important; }

body.cchap-ui .service-configurator { gap: .9rem; grid-template-columns: minmax(0, 1.75fr) minmax(260px, .7fr); }
body.cchap-ui .service-picker-card,
body.cchap-ui .service-estimate-panel { border-radius: 1rem; box-shadow: var(--cchap-shadow-sm); }
body.cchap-ui .service-picker-product { grid-template-columns: 180px 1fr; gap: 1rem; padding: .85rem; }
body.cchap-ui .service-picker-product__image,
body.cchap-ui .service-gallery__viewport { height: 145px; }
body.cchap-ui .service-picker-product__info h2 { font-size: 1.35rem; }
body.cchap-ui .service-picker-group { padding: .8rem .9rem; }
body.cchap-ui .service-option-grid { gap: .45rem; }
body.cchap-ui .service-option-chip { min-height: 40px; padding: .5rem .6rem; }
body.cchap-ui .service-option-tile { min-height: 58px; padding: .6rem .7rem; }
body.cchap-ui .service-option-tile--compact { min-height: 48px; }
body.cchap-ui .service-upload-box { min-height: 96px; padding: .75rem; }
body.cchap-ui .service-estimate-panel { padding: .9rem; }

/* ---------- Clients, reports, services, settings ---------- */
body.cchap-ui .client-profile-card { padding: 1rem; }
body.cchap-ui .client-profile-header { gap: .75rem; padding-bottom: .75rem; }
body.cchap-ui .client-profile-avatar { width: 3.25rem; height: 3.25rem; font-size: 1.2rem; }
body.cchap-ui .client-profile-grid,
body.cchap-ui .client-history-summary { gap: .7rem; margin-top: .8rem; }
body.cchap-ui .client-profile-grid div,
body.cchap-ui .client-history-summary article { padding: .7rem .75rem; border-radius: 10px; }
body.cchap-ui .client-history-summary strong { margin-top: .2rem; font-size: 1.15rem; }
body.cchap-ui .client-list-toolbar { gap: .7rem; padding: .7rem .85rem; }
body.cchap-ui .client-order-count { min-width: 1.8rem; height: 1.8rem; }
body.cchap-ui .report-filter-card,
body.cchap-ui .report-preview-summary,
body.cchap-ui .report-active-filters { border-radius: .8rem; }
body.cchap-ui .report-filter-field { min-width: 0; }

/* ---------- Chat, notifications, lists ---------- */
body.cchap-ui.portal-ui-v3 .chat-messages,
body.cchap-ui.portal-ui-v3 .customer-chat-stream {
    height: clamp(300px, 46vh, 460px);
    min-height: 0 !important;
    max-height: 460px !important;
    padding: .9rem !important;
    gap: .65rem;
}
body.cchap-ui.portal-ui-v3 .chat-header,
body.cchap-ui.portal-ui-v3 .customer-chat-header { padding: .8rem 1rem; }
body.cchap-ui.portal-ui-v3 .chat-composer,
body.cchap-ui.portal-ui-v3 .customer-chat-composer { padding: .75rem 1rem 1rem; }
body.cchap-ui.portal-ui-v3 .message-bubble,
body.cchap-ui.portal-ui-v3 .customer-message-bubble { padding: .7rem .85rem; border-radius: 1rem; }
body.cchap-ui.portal-ui-v3 .notification-item,
body.cchap-ui.portal-ui-v3 .order-file-item,
body.cchap-ui.portal-ui-v3 .workflow-file-item { padding: .7rem .8rem; }
body.cchap-ui.portal-ui-v3 .chat-inbox-item { padding: .75rem .9rem; }
body.cchap-ui.portal-ui-v3 .chat-inbox-avatar { width: 40px; height: 40px; }

/* ---------- Modals ---------- */
body.cchap-ui.portal-ui-v3 .modal-dialog:not(.modal-sm):not(.modal-lg):not(.modal-xl) { max-width: min(92vw, 620px); }
body.cchap-ui.portal-ui-v3 .modal-content { border-radius: 1rem; border-color: var(--cchap-border); }
body.cchap-ui.portal-ui-v3 .modal-header,
body.cchap-ui.portal-ui-v3 .modal-footer { padding: .8rem 1rem; }
body.cchap-ui.portal-ui-v3 .modal-body { padding: 1rem; }

/* ---------- Authentication ---------- */
body.cchap-ui.portal-ui-v3 .auth-shell { grid-template-columns: minmax(0, 1.12fr) minmax(380px, .88fr); }
body.cchap-ui.portal-ui-v3 .auth-visual { padding: clamp(2rem, 4vw, 4rem); }
body.cchap-ui.portal-ui-v3 .auth-visual-content { max-width: 650px; padding: 1rem 1.1rem; }
body.cchap-ui.portal-ui-v3 .auth-visual h1 {
    margin: .7rem 0 1rem;
    font-size: clamp(2.25rem, 4.6vw, 4.2rem);
    line-height: .98;
}
body.cchap-ui.portal-ui-v3 .auth-visual p { font-size: 1rem; line-height: 1.5; }
body.cchap-ui.portal-ui-v3 .auth-panel { padding: clamp(1rem, 2.6vw, 2.4rem); }
body.cchap-ui.portal-ui-v3 .auth-card {
    width: min(100%, 520px);
    padding: clamp(1.05rem, 2vw, 1.5rem);
    border-radius: 1.15rem;
    box-shadow: var(--cchap-shadow);
}
body.cchap-ui.portal-ui-v3 .auth-card h2 { font-size: clamp(1.45rem, 2.2vw, 1.8rem); }
body.cchap-ui.portal-ui-v3 .brand-mark.brand-mark-logo { width: 3rem; height: 3rem; }

/* ---------- Public homepage: same theme, tighter proportions ---------- */
body.cchap-ui .home-navbar { padding: .55rem 0; }
body.cchap-ui .home-brand-logo { width: 3rem; height: 3rem; }
body.cchap-ui .home-hero-grid { min-height: 500px; }
body.cchap-ui .home-hero-copy { padding: clamp(1.8rem, 4vw, 3.5rem); }
body.cchap-ui .home-hero-copy h1 { font-size: clamp(3rem, 5vw, 5.3rem); }
body.cchap-ui .home-hero-banner { min-height: 500px; }
body.cchap-ui .home-section { padding: 3rem 0; }
body.cchap-ui .home-section-header { gap: 1rem; margin-bottom: 1.1rem; }
body.cchap-ui .home-services-grid { gap: .8rem; }
body.cchap-ui .home-service-body { padding: .85rem; }
body.cchap-ui .home-service-body p { min-height: 0; }
body.cchap-ui .home-info-grid { gap: .8rem; }
body.cchap-ui .home-panel { padding: 1rem; }
body.cchap-ui .home-process { gap: .55rem; }
body.cchap-ui .home-process-step > i { width: 3.4rem; height: 3.4rem; }

/* ---------- Responsive alignment ---------- */
@media (max-width: 1199.98px) {
    body.cchap-ui .dashboard-analytics-main { grid-template-columns: minmax(0, 1fr); }
    body.cchap-ui .dashboard-forecast-values { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    body.cchap-ui .service-configurator { grid-template-columns: minmax(0, 1.55fr) minmax(240px, .75fr); }
}

@media (max-width: 991.98px) {
    body.cchap-ui.admin-sidebar-layout,
    body.cchap-ui.customer-sidebar-layout { padding-top: 60px !important; }

    body.cchap-ui.admin-sidebar-layout .admin-mobile-header,
    body.cchap-ui.customer-sidebar-layout .customer-mobile-header {
        height: 60px;
        gap: .6rem;
        padding: .45rem .7rem;
    }
    body.cchap-ui.admin-sidebar-layout .admin-sidebar-toggle,
    body.cchap-ui.admin-sidebar-layout .admin-mobile-notifications,
    body.cchap-ui.customer-sidebar-layout .customer-sidebar-toggle,
    body.cchap-ui.customer-sidebar-layout .customer-mobile-notifications {
        width: 2.35rem;
        height: 2.35rem;
    }
    body.cchap-ui.portal-ui-v3 .dashboard-heading {
        padding: .9rem;
        gap: .65rem;
    }
    body.cchap-ui.portal-ui-v3 .dashboard-heading .btn { flex: 0 1 auto; }
    body.cchap-ui .overview-hero { align-items: flex-start; flex-direction: column; }
    body.cchap-ui .overview-hero-actions { width: 100%; justify-content: flex-start; }
    body.cchap-ui .overview-date { width: auto; justify-content: flex-start; }
    body.cchap-ui .service-configurator { grid-template-columns: 1fr; }
    body.cchap-ui .service-configurator__summary { position: static; }
    body.cchap-ui.portal-ui-v3 .auth-shell { display: block; }
}

@media (max-width: 767.98px) {
    :root { --cchap-page-gutter: .75rem; }
    body.cchap-ui.portal-ui-v3 { font-size: .92rem; }
    body.cchap-ui.portal-ui-v3 .dashboard-page,
    body.cchap-ui.portal-ui-v3 .inquiry-page,
    body.cchap-ui.portal-ui-v3 .order-create-page,
    body.cchap-ui.portal-ui-v3 .order-details-page,
    body.cchap-ui.portal-ui-v3 .queue-page,
    body.cchap-ui.portal-ui-v3 .forecast-page,
    body.cchap-ui.portal-ui-v3 .sms-page,
    body.cchap-ui.portal-ui-v3 .report-page,
    body.cchap-ui.portal-ui-v3 .chat-page { padding-top: .75rem !important; padding-bottom: 1.5rem !important; }

    body.cchap-ui.portal-ui-v3 .dashboard-heading { align-items: stretch; }
    body.cchap-ui.portal-ui-v3 .dashboard-heading > .d-flex,
    body.cchap-ui.portal-ui-v3 .dashboard-heading .toolbar { width: 100%; }
    body.cchap-ui.portal-ui-v3 .dashboard-heading .btn { flex: 1 1 auto; }

    body.cchap-ui .dashboard-request-summary,
    body.cchap-ui .dashboard-forecast-values { grid-template-columns: 1fr 1fr; }
    body.cchap-ui .dashboard-demand-chart-wrap { height: 235px; }
    body.cchap-ui .dashboard-demand-controls { width: 100%; justify-content: flex-start; }
    body.cchap-ui .dashboard-subpanel-header { flex-direction: column; }
    body.cchap-ui .client-profile-grid,
    body.cchap-ui .client-history-summary { grid-template-columns: 1fr 1fr; }
    body.cchap-ui .customer-dashboard-section-heading { align-items: flex-start; }
    body.cchap-ui .service-picker-product { grid-template-columns: 1fr; }
    body.cchap-ui .service-picker-product__image,
    body.cchap-ui .service-gallery__viewport { height: 190px; }
    body.cchap-ui.portal-ui-v3 .chat-messages,
    body.cchap-ui.portal-ui-v3 .customer-chat-stream { height: 48vh; max-height: 430px !important; }
    body.cchap-ui .home-section { padding: 2.4rem 0; }
}

@media (max-width: 575.98px) {
    body.cchap-ui.portal-ui-v3 .content-card,
    body.cchap-ui.portal-ui-v3 .order-form-section,
    body.cchap-ui.portal-ui-v3 fieldset.content-card { padding: .8rem !important; }
    body.cchap-ui .dashboard-request-summary,
    body.cchap-ui .dashboard-forecast-values,
    body.cchap-ui .client-profile-grid,
    body.cchap-ui .client-history-summary { grid-template-columns: 1fr; }
    body.cchap-ui .dashboard-demand-view-control,
    body.cchap-ui .dashboard-demand-month-control,
    body.cchap-ui .dashboard-demand-year-control { width: min(100%, 150px); }
    body.cchap-ui .dashboard-monthly-filter-controls { flex-wrap: wrap; }
    body.cchap-ui.portal-ui-v3 .table { font-size: .8rem; }
    body.cchap-ui.portal-ui-v3 .table thead th,
    body.cchap-ui.portal-ui-v3 .table tbody td { padding: .5rem .55rem; }
    body.cchap-ui.portal-ui-v3 .btn { font-size: .84rem; }
    body.cchap-ui.portal-ui-v3 .auth-panel { min-height: auto; padding: .7rem; }
    body.cchap-ui.portal-ui-v3 .auth-card { padding: .9rem; }
    body.cchap-ui .home-hero-copy { padding: 1.8rem 1rem; }
    body.cchap-ui .home-hero-copy h1 { font-size: clamp(2.65rem, 14vw, 4rem); }
}

/* Short laptop viewport: remove avoidable vertical bulk without hiding content. */
@media (min-width: 992px) and (max-height: 820px) {
    body.cchap-ui.portal-ui-v3 .dashboard-page { padding-top: .9rem !important; padding-bottom: 1.25rem !important; }
    body.cchap-ui.portal-ui-v3 .dashboard-heading { margin-bottom: .8rem; padding: .8rem .95rem; }
    body.cchap-ui .admin-overview-page > .container-fluid { padding-top: .75rem !important; padding-bottom: 1rem !important; }
    body.cchap-ui .overview-hero { padding: .8rem 1rem; }
    body.cchap-ui .overview-hero h1 { font-size: 1.7rem; }
    body.cchap-ui .dashboard-demand-chart-wrap { height: 235px; }
    body.cchap-ui .dashboard-forecast-value { min-height: 64px; }
    body.cchap-ui.portal-ui-v3 .chat-messages,
    body.cchap-ui.portal-ui-v3 .customer-chat-stream { height: 42vh; max-height: 390px !important; }
}

/* Keep printable documents controlled by their existing dedicated print styles. */
@media print {
    .cchap-screen-only { display: none !important; }
}

/* ---------- Additional module-specific proportion fixes ---------- */
body.cchap-ui.portal-ui-v3 .service-card,
body.cchap-ui.portal-ui-v3 .step-card { padding: 1rem; }
body.cchap-ui.portal-ui-v3 .service-icon {
    width: 2.65rem;
    height: 2.65rem;
    margin-bottom: .75rem;
    border-radius: .75rem;
    font-size: 1.05rem;
}
body.cchap-ui.portal-ui-v3 .forecast-readiness-card,
body.cchap-ui.portal-ui-v3 .report-metric-card { min-height: 0 !important; }
body.cchap-ui.portal-ui-v3 .empty-state-card {
    min-height: 120px !important;
    padding: 1.25rem !important;
}
body.cchap-ui.portal-ui-v3 .forecast-chart-wrap,
body.cchap-ui.portal-ui-v3 .report-chart-wrap {
    height: 260px;
    margin-top: .75rem;
}
body.cchap-ui.portal-ui-v3 .sms-phone-screen {
    min-height: 300px;
    padding: .9rem;
    border-radius: 1rem;
}
body.cchap-ui.portal-ui-v3 .order-inbox-page { padding-bottom: 1.5rem; }
body.cchap-ui.portal-ui-v3 .order-filter-panel {
    padding: .85rem .95rem;
    border-radius: 1rem;
    box-shadow: var(--cchap-shadow-sm);
}
body.cchap-ui.portal-ui-v3 .order-filter-panel .form-control,
body.cchap-ui.portal-ui-v3 .order-filter-panel .form-select,
body.cchap-ui.portal-ui-v3 .order-filter-panel .input-group-text { min-height: 2.45rem; }
body.cchap-ui.portal-ui-v3 .order-summary-grid { gap: .7rem; }
body.cchap-ui.portal-ui-v3 .order-summary-card {
    padding: .75rem .8rem;
    border-radius: .85rem;
    box-shadow: none;
}
body.cchap-ui.portal-ui-v3 .order-summary-card strong { font-size: 1.2rem; }

body.cchap-ui.portal-ui-v3 .cart-empty-state { padding: 1.5rem 1rem; }
body.cchap-ui.portal-ui-v3 .cart-empty-icon {
    width: 3.7rem;
    height: 3.7rem;
    margin-bottom: .7rem;
    font-size: 1.5rem;
}
body.cchap-ui.portal-ui-v3 .cart-toolbar { gap: .65rem; padding: .6rem .75rem; }
body.cchap-ui.portal-ui-v3 .cart-configured-item {
    grid-template-columns: 26px 136px minmax(0, 1fr);
    gap: .75rem;
    padding: .75rem .8rem;
    border-radius: 1rem;
}
body.cchap-ui.portal-ui-v3 .cart-configured-image { width: 136px; height: 102px; }

body.cchap-ui.portal-ui-v3 .laser-material-page { padding: 1rem 0 1.75rem; }
body.cchap-ui.portal-ui-v3 .laser-material-hero {
    margin-bottom: .9rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    box-shadow: var(--cchap-shadow-sm);
}
body.cchap-ui.portal-ui-v3 .laser-material-hero h1 {
    margin: .2rem 0 .35rem;
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
}
body.cchap-ui.portal-ui-v3 .laser-material-hero p { font-size: .9rem; }
body.cchap-ui.portal-ui-v3 .laser-material-grid { gap: .8rem; }
body.cchap-ui.portal-ui-v3 .laser-material-card { border-radius: 1rem; box-shadow: var(--cchap-shadow-sm); }
body.cchap-ui.portal-ui-v3 .laser-material-card__body { padding: .85rem; }
body.cchap-ui.portal-ui-v3 .laser-material-card h2 { font-size: 1.05rem; }
body.cchap-ui.portal-ui-v3 .laser-material-card p { margin-bottom: .6rem; font-size: .82rem; line-height: 1.4; }
body.cchap-ui.portal-ui-v3 .laser-material-card__price { padding-top: .6rem; }
body.cchap-ui.portal-ui-v3 .laser-material-card__action { margin-top: .6rem; }
body.cchap-ui.portal-ui-v3 .laser-material-note { margin-top: .7rem; padding: .7rem .85rem; }
body.cchap-ui.portal-ui-v3 .laser-material-hero--compact { gap: .8rem; padding: .85rem 1rem; }
body.cchap-ui.portal-ui-v3 .laser-material-counter { min-width: 100px; padding: .6rem .75rem; border-radius: .75rem; }
body.cchap-ui.portal-ui-v3 .laser-material-counter strong { font-size: 1.4rem; }
body.cchap-ui.portal-ui-v3 .laser-material-picker-shell { border-radius: 1rem; box-shadow: var(--cchap-shadow-sm); }
body.cchap-ui.portal-ui-v3 .laser-material-picker-toolbar { gap: .7rem; padding: .7rem .85rem; }
body.cchap-ui.portal-ui-v3 .laser-material-scroll { padding: .75rem; }

@media (max-width: 767.98px) {
    body.cchap-ui.portal-ui-v3 .cart-configured-item {
        grid-template-columns: 24px 96px minmax(0, 1fr);
    }
    body.cchap-ui.portal-ui-v3 .cart-configured-image { width: 96px; height: 76px; }
    body.cchap-ui .home-hero-banner { min-height: 0; }
}

@media (max-width: 575.98px) {
    body.cchap-ui.portal-ui-v3 .cart-configured-item { grid-template-columns: 24px minmax(0, 1fr); }
    body.cchap-ui.portal-ui-v3 .cart-configured-image { grid-column: 2; width: 100%; height: 150px; }
}
