/*
 * Randevuix ortak UI/UX yenileme katmanı.
 *
 * Bu dosya yalnızca görünüm ve etkileşim durumlarını düzenler. PHP/JS
 * seçicileri, form adları, veri akışı ve yönlendirme davranışı değiştirilmez.
 * menu_styles.php tarafından son katman olarak yüklenir.
 */

:root {
    --ux-radius-xs: 8px;
    --ux-radius-sm: 10px;
    --ux-radius-md: 14px;
    --ux-radius-lg: 18px;
    --ux-line: var(--app-line, #e2e8f0);
    --ux-muted: #475569;
    --ux-text: #172033;
    --ux-surface: #ffffff;
    --ux-surface-soft: #f8fafc;
    --ux-shadow-sm: 0 4px 14px rgba(15, 23, 42, .055);
    --ux-shadow-md: 0 10px 26px rgba(15, 23, 42, .085);
    --ux-focus: 0 0 0 3px rgba(var(--app-primary-rgb, 245, 158, 11), .20);
    --ux-content-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.login-phone-hint {
    display: block;
    margin: 6px 2px 0;
    color: #64748b;
    font-size: .75rem;
    font-weight: 400;
    line-height: 1.5;
}

html {
    overflow-x: clip;
}

html body {
    color: var(--ux-text) !important;
    background: linear-gradient(180deg, #f8fafc 0%, var(--app-bg, #f4f7f6) 100%) !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* The page shell owns the space left after the fixed desktop sidebar. Keep
   the shell fluid; readable limits belong to the components inside it. */
html body #app-content {
    width: 100%;
    max-width: none !important;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
}

/* Bootstrap's container and page-specific shells carry their own desktop
   max-widths. They are direct children of the panel root, so remove only
   those outer caps and margins while preserving inner card/form limits. */
html body #app-content > .container,
html body #app-content > .container-fluid,
html body #app-content > .container[class],
html body #app-content > .container-fluid[class] {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

/* These two routes use the main element itself as the constrained shell. */
html body #app-content.app-live-content.branch-page,
html body #app-content.app-live-content.kra-shell {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

/* The landing/panel stack is the content reference. Keep it scoped to the
   application content so the sidebar, logo and icon font remain untouched. */
html body #app-content,
html body #app-content :where(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, optgroup, option, label, th, td, small, strong, em, [role="button"]) {
    font-family: var(--ux-content-font);
}

/* Select2, Bootstrap dialogs and other content widgets can be portalled to
   body. They receive the same content stack without changing menu typography. */
html body :where(.modal-content, .dropdown-menu, .offcanvas, .tooltip, .popover, .select2-container, .select2-dropdown),
html body :where(.modal-content, .dropdown-menu, .offcanvas, .tooltip, .popover, .select2-container, .select2-dropdown) :where(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, optgroup, option, label, li, small, strong, em, span, [role="button"]) {
    font-family: var(--ux-content-font);
}

/* Technical/secret fields intentionally keep their page-specific monospace
   face. Bootstrap Icons keep their own vendor-provided font declaration. */
html body #app-content :where(code, pre, kbd, samp, .secret-field),
html body :where(.modal-content, .dropdown-menu, .offcanvas, .tooltip, .popover, .select2-container, .select2-dropdown) :where(code, pre, kbd, samp, .secret-field) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

html body #app-content h1,
html body #app-content h2,
html body #app-content h3,
html body #app-content h4,
html body #app-content h5,
html body #app-content h6 {
    color: var(--ux-text);
    letter-spacing: -.025em;
}

html body #app-content .text-muted,
html body #app-content .form-text,
html body #app-content .hint,
html body #app-content .help-text,
html body #app-content .small.text-muted {
    color: var(--ux-muted) !important;
}

/* Common surface language: quiet borders, restrained shadow and one radius
   scale. Coloured/status surfaces keep their own background and semantics. */
html body #app-content .card:not(.bg-dark):not(.text-bg-dark),
html body #app-content .card-custom,
html body #app-content .cardx,
html body #app-content .main-card,
html body #app-content .filter-card,
html body #app-content .filter-bar,
html body #app-content .settings-card,
html body #app-content .settings-section-card,
html body #app-content .finance-card,
html body #app-content .table-card,
html body #app-content .panel-card,
html body #app-content .archive-card,
html body #app-content .perf-card,
html body #app-content .product-card,
html body #app-content .customer-card,
html body #app-content .debt-card,
html body #app-content .report-card,
html body #app-content .summary-card,
html body #app-content .compact-card,
html body #app-content .sms-card,
html body #app-content .branch-panel,
html body #app-content .kra-card,
html body #app-content .kr-card,
html body #app-content .home-panel,
html body #app-content .home-kpi-card,
html body #app-content .reminder-list-clean,
html body #app-content .debt-filter-card,
html body #app-content .debt-sms-card,
html body #app-content .bulk-sms-card,
html body #app-content .inline-customer-card,
html body #app-content .customer-work-panel,
html body #app-content .stock-filter-card,
html body #app-content .stock-alert-panel {
    border-radius: var(--ux-radius-lg) !important;
    border-color: rgba(148, 163, 184, .28) !important;
    box-shadow: var(--ux-shadow-sm) !important;
}

html body #app-content .card-header,
html body #app-content .card-footer,
html body #app-content .home-panel-head,
html body #app-content .branch-panel-head {
    border-color: rgba(148, 163, 184, .22) !important;
}

html body #app-content .card-header,
html body #app-content .home-panel-head,
html body #app-content .branch-panel-head {
    background: rgba(248, 250, 252, .74) !important;
}

/* Buttons: explicit rounded-pill classes remain pills (badges and intentional
   chips), while ordinary actions use a calmer control radius. */
html body #app-content .btn:not(.rounded-pill):not(.btn-link),
html body #app-content button.btn:not(.rounded-pill):not(.btn-link),
html body #app-content .home-action-list a,
html body #app-content .reminder-load-more-btn,
html body #app-content .home-flow-action {
    border-radius: var(--ux-radius-sm) !important;
}

html body #app-content .btn:not(.rounded-pill):not(.btn-link) {
    min-height: 40px;
    padding: .56rem .9rem;
    font-weight: 650 !important;
    letter-spacing: -.005em;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

html body #app-content .btn-primary:not(:disabled),
html body #app-content .btn-warning:not(:disabled),
html body #app-content .btn-gold:not(:disabled),
html body #app-content .btn-success:not(:disabled),
html body #app-content .btn-dark:not(:disabled) {
    box-shadow: 0 5px 14px rgba(15, 23, 42, .09) !important;
}

html body #app-content .btn:not(:disabled):not(.disabled):not(.btn-link):hover {
    transform: translateY(-1px);
}

html body #app-content .btn:disabled,
html body #app-content .btn.disabled,
html body #app-content [aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .62;
    box-shadow: none !important;
}

/* Form controls share one readable geometry. Native select, Select2 and
   textarea are kept aligned without changing names, values or validation. */
html body #app-content .form-control,
html body #app-content .form-select,
html body #app-content textarea.form-control,
html body #app-content .select2-container--bootstrap-5 .select2-selection,
html body #app-content .select2-container--bootstrap-5 .select2-selection--single,
html body #app-content .select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 42px;
    border-radius: var(--ux-radius-sm) !important;
    border-color: #cbd5e1 !important;
    background-color: var(--ux-surface) !important;
    color: var(--ux-text) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78) !important;
}

html body #app-content textarea.form-control {
    min-height: 88px;
    resize: vertical;
}

html body #app-content .form-control:focus,
html body #app-content .form-select:focus,
html body #app-content textarea.form-control:focus,
html body #app-content .select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--app-primary, #f59e0b) !important;
    box-shadow: var(--ux-focus) !important;
    outline: 0;
}

html body #app-content .form-control:disabled,
html body #app-content .form-select:disabled,
html body #app-content .form-control[readonly] {
    color: #64748b !important;
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

html body #app-content .form-label,
html body #app-content label.form-label {
    margin-bottom: .42rem;
    color: #334155 !important;
    font-size: .78rem;
    font-weight: 650 !important;
    line-height: 1.25;
}

html body #app-content ::placeholder {
    color: #64748b !important;
    opacity: 1;
}

/* Tables remain data-dense but gain a calmer reading rhythm. Mobile card
   tables keep their page-specific display rules. */
html body #app-content .table-responsive {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: var(--ux-radius-md);
    background: var(--ux-surface);
}

html body #app-content .table {
    --bs-table-bg: transparent;
    color: var(--ux-text);
}

html body #app-content .table > :not(caption) > * > * {
    padding: .72rem .78rem;
    vertical-align: middle;
}

html body #app-content .table thead th {
    color: #475569 !important;
    background: #f8fafc !important;
    border-bottom-color: #dbe3ec !important;
    font-size: .67rem !important;
    font-weight: 700 !important;
    letter-spacing: .055em;
    line-height: 1.25;
    text-transform: uppercase;
}

html body #app-content .table tbody td {
    border-color: #edf2f7 !important;
}

@media (min-width: 992px) and (hover: hover) and (pointer: fine) {
    html body #app-content .table-hover > tbody > tr:hover > *,
    html body #app-content .table-hover tbody tr:hover > * {
        background: #fffbeb !important;
    }
}

/* Feedback, empty and loading states are visually distinct without taking
   excessive vertical space. */
html body #app-content .alert,
html body #app-content .app-status,
html body #app-content .empty-state,
html body #app-content .loading-state,
html body #app-content .error-state,
html body #app-content .kra-empty,
html body #app-content .kr-empty {
    border-radius: var(--ux-radius-md) !important;
    box-shadow: none !important;
}

html body #app-content .empty-state,
html body #app-content .loading-state,
html body #app-content .kra-empty,
html body #app-content .kr-empty {
    min-height: 64px;
    padding: 1rem;
    color: var(--ux-muted) !important;
    background: #f8fafc !important;
    border: 1px dashed #cbd5e1 !important;
}

html body #app-content .error-state {
    color: #991b1b !important;
    background: #fff7f7 !important;
    border: 1px solid #fecaca !important;
}

/* Dialog and menu surfaces use the same elevation. Dark lock/quick-login
   surfaces intentionally keep their existing dark treatment. */
html body .modal-content:not(.modal-dark-v2),
html body .dropdown-menu,
html body .branch-picker-menu,
html body .signup-select-menu {
    border-radius: var(--ux-radius-lg) !important;
    border-color: #dbe3ec !important;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .16) !important;
}

html body .modal-content:not(.modal-dark-v2) .modal-header,
html body .modal-content:not(.modal-dark-v2) .modal-footer {
    border-color: #edf2f7 !important;
}

/* Keyboard focus is always visible, including custom links and drawer cards. */
html body a:focus-visible,
html body button:focus-visible,
html body input:focus-visible,
html body select:focus-visible,
html body textarea:focus-visible,
html body summary:focus-visible,
html body [tabindex]:focus-visible {
    outline: 2px solid rgba(var(--app-primary-rgb, 245, 158, 11), .82) !important;
    outline-offset: 2px !important;
}

/* Dashboard hierarchy. Values stay tied to the existing server-rendered
   classes; only spacing, contrast and hover affordances change. */
html body #app-content .home-dashboard-shell {
    margin-top: 22px;
}

html body #app-content .home-dashboard-head {
    margin-bottom: 16px;
}

html body #app-content .home-dashboard-title h1 {
    font-size: clamp(1.45rem, 2.2vw, 1.9rem);
    font-weight: 750;
    line-height: 1.15;
}

html body #app-content .home-dashboard-kicker,
html body #app-content .home-panel-kicker {
    color: #64748b !important;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .10em;
}

html body #app-content .home-kpi-grid {
    gap: 12px;
    margin-bottom: 16px;
}

html body #app-content .home-kpi-card {
    min-height: 128px;
    padding: 15px;
    border-top-width: 3px;
    background: #fff !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

html body #app-content .home-kpi-card:hover,
html body #app-content .home-kpi-card:focus-visible {
    border-color: var(--kpi-accent, #cbd5e1) !important;
    box-shadow: var(--ux-shadow-md) !important;
    transform: translateY(-2px);
}

html body #app-content .home-kpi-card strong {
    font-size: clamp(1.25rem, 2.1vw, 1.55rem);
    font-weight: 750;
}

html body #app-content .home-kpi-label {
    color: #475569 !important;
    font-size: .68rem;
    font-weight: 650;
}

html body #app-content .home-kpi-card small {
    color: #64748b !important;
}

html body #app-content .home-dashboard-layout {
    gap: 16px;
}

html body #app-content .home-panel-head {
    padding: 15px 18px 11px;
}

html body #app-content .home-panel-head h2 {
    font-size: 1.08rem;
    font-weight: 700;
}

html body #app-content .home-chart-summary-item,
html body #app-content .home-chart-day,
html body #app-content .home-action-list a,
html body #app-content .home-flow-row--head {
    background: #f8fafc !important;
    border-color: #e8eef5 !important;
}

html body #app-content .home-action-list {
    gap: 9px;
}

html body #app-content .home-action-list a {
    min-height: 42px;
    color: #334155 !important;
    font-weight: 650;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

html body #app-content .home-action-list a:hover,
html body #app-content .home-action-list a:focus-visible {
    color: #172033 !important;
    background: #fff !important;
    border-color: rgba(var(--app-primary-rgb, 245, 158, 11), .38) !important;
    transform: translateY(-1px);
}

html body #app-content .home-flow-row {
    min-height: 50px;
}

html body #app-content .home-flow-name {
    font-weight: 700;
}

html body #app-content .home-flow-note {
    color: #64748b !important;
}

html body #app-content .home-empty-flow {
    min-height: 76px;
}

html body #app-content .home-reminder-strip .reminder-list-clean__empty {
    min-height: 58px !important;
    padding: 12px 14px !important;
}

/* Dark settings hero keeps its intended contrast even when the active theme
   normalizes headings inside light cards. */
html body.page-sistem-ayarlari #app-content .settings-head,
html body.page-sistem-ayarlari #app-content .settings-head h1,
html body.page-sistem-ayarlari #app-content .settings-head h2,
html body.page-sistem-ayarlari #app-content .settings-head h3,
html body.page-sistem-ayarlari #app-content .settings-head p,
html body.page-sistem-ayarlari #app-content .settings-head .text-muted {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

html body.page-sistem-ayarlari #app-content .settings-head .settings-head-back {
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    background: #fff !important;
    border-color: rgba(255, 255, 255, .72) !important;
}

/* Desktop sidebar: one measured surface with predictable scroll ownership. */
@media (min-width: 992px) {
    html body .main-nav-container {
        top: 12px !important;
        bottom: 12px !important;
        left: 12px !important;
        width: 260px !important;
        max-width: 260px !important;
        height: calc(100vh - 24px) !important;
        min-height: 0 !important;
        border-radius: 20px !important;
        border: 1px solid rgba(148, 163, 184, .30) !important;
        box-shadow: 12px 0 30px rgba(15, 23, 42, .12) !important;
        overflow: hidden !important;
    }

    html body .main-nav-container > .container-fluid {
        height: 100% !important;
        min-height: 0 !important;
        padding: 13px 10px 10px !important;
    }

    html body .main-nav-container .tenant-brand-v3 {
        min-height: 48px !important;
        padding: 6px 8px 12px !important;
        margin-bottom: 8px !important;
        border-bottom: 1px solid rgba(148, 163, 184, .20) !important;
    }

    html body .main-nav-container #navbarNav,
    html body .main-nav-container .navbar-collapse {
        min-height: 0 !important;
        max-height: none !important;
    }

    html body .main-nav-container .mobile-nav-fix {
        gap: 4px !important;
        padding: 0 2px 64px !important;
    }

    html body .main-nav-container .mobile-nav-fix .mini-link {
        min-height: 40px !important;
        height: 40px !important;
        padding: 5px 9px !important;
        gap: 9px !important;
        border-radius: var(--ux-radius-sm) !important;
        background: rgba(255, 255, 255, .48) !important;
        border-color: rgba(148, 163, 184, .18) !important;
        box-shadow: none !important;
        color: #475569 !important;
        font-size: .88rem !important;
    }

    html body .main-nav-container .mobile-nav-fix .mini-link .menu-link-icon {
        width: 27px !important;
        height: 27px !important;
        min-width: 27px !important;
        border-radius: var(--ux-radius-xs) !important;
        font-size: .90rem !important;
    }

    html body .main-nav-container .mobile-nav-fix .mini-link:hover,
    html body .main-nav-container .mobile-nav-fix .mini-link:focus-visible {
        background: rgba(255, 255, 255, .78) !important;
        border-color: rgba(var(--app-primary-rgb, 245, 158, 11), .32) !important;
        color: #172033 !important;
        box-shadow: 0 5px 14px rgba(15, 23, 42, .06) !important;
    }

    html body .main-nav-container .mobile-nav-fix .mini-link.is-active {
        background: rgba(var(--app-primary-rgb, 245, 158, 11), .14) !important;
        border-color: rgba(var(--app-primary-rgb, 245, 158, 11), .34) !important;
        color: #172033 !important;
        box-shadow: inset 3px 0 0 var(--app-primary, #f59e0b) !important;
    }

    html body .main-nav-container .mobile-nav-fix .mini-link.is-active .menu-link-icon {
        background: var(--app-primary, #f59e0b) !important;
        color: var(--app-primary-text, #111827) !important;
        border-color: transparent !important;
    }

    html body .main-nav-container .mobile-nav-fix .nav-category-label {
        min-height: 18px !important;
        margin: 13px 4px 4px !important;
        color: #64748b !important;
        font-size: .64rem !important;
        font-weight: 750 !important;
        letter-spacing: .11em !important;
    }

    html body .main-nav-container .nav-session-actions {
        gap: 7px !important;
    }

    html body .main-nav-container .nav-session-actions > .user-mobile-full,
    html body .main-nav-container .nav-session-actions > .exit-mobile-full {
        border-radius: var(--ux-radius-sm) !important;
    }
}

/* Mobile drawer: readable single-column rows replace tiny four-column labels.
   The existing Bootstrap collapse and menu.js open/close mechanics remain
   untouched. */
@media (max-width: 991.98px) {
    html body #app-content,
    html body .app-live-content {
        padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)) !important;
    }

    html body .main-nav-container {
        border-radius: 0 0 var(--ux-radius-lg) var(--ux-radius-lg) !important;
        box-shadow: 0 10px 26px rgba(15, 23, 42, .12) !important;
    }

    html body .main-nav-container #navbarNav,
    html body .main-nav-container .navbar-collapse {
        max-height: calc(100vh - 64px) !important;
        max-height: calc(100dvh - 64px) !important;
        padding: 8px !important;
        border-radius: 0 0 var(--ux-radius-lg) var(--ux-radius-lg) !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 5px !important;
        padding: 0 0 4px !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix > .nav-item {
        width: 100% !important;
        min-width: 0 !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .mini-link {
        width: 100% !important;
        height: auto !important;
        min-height: 44px !important;
        max-height: none !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        padding: 8px 11px !important;
        border-radius: var(--ux-radius-sm) !important;
        text-align: left !important;
        background: rgba(255, 255, 255, .62) !important;
        border-color: rgba(148, 163, 184, .22) !important;
        color: #334155 !important;
        box-shadow: none !important;
        font-size: .88rem !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .mini-link .menu-link-icon {
        flex: 0 0 28px !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        border-radius: var(--ux-radius-xs) !important;
        font-size: .92rem !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .mini-link .menu-link-text {
        width: auto !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        text-align: left !important;
        font-size: .84rem !important;
        line-height: 1.2 !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .link-performans .menu-link-text {
        display: block !important;
        white-space: nowrap !important;
        line-height: 1.2 !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .mini-link:hover,
    html body .main-nav-container #navbarNav .mobile-nav-fix .mini-link:focus-visible {
        background: #fff !important;
        border-color: rgba(var(--app-primary-rgb, 245, 158, 11), .34) !important;
        color: #172033 !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .mini-link.is-active {
        background: rgba(var(--app-primary-rgb, 245, 158, 11), .14) !important;
        border-color: rgba(var(--app-primary-rgb, 245, 158, 11), .34) !important;
        color: #172033 !important;
        box-shadow: inset 3px 0 0 var(--app-primary, #f59e0b) !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix > .branch-switcher-mobile {
        grid-column: 1 !important;
        margin-bottom: 4px !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix > .user-mobile-full,
    html body .main-nav-container #navbarNav .mobile-nav-fix > .exit-mobile-full {
        grid-column: 1 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 44px !important;
    }

    html body .main-nav-container #navbarNav > ul.nav-session-actions {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 5px !important;
        margin-top: 7px !important;
        padding-top: 7px !important;
    }

    html body .main-nav-container #navbarNav > ul.nav-session-actions > .user-mobile-full,
    html body .main-nav-container #navbarNav > ul.nav-session-actions > .exit-mobile-full {
        grid-column: 1 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 44px !important;
        max-height: none !important;
    }

    html body .main-nav-container #navbarNav > ul.nav-session-actions .user-badge-v2,
    html body .main-nav-container #navbarNav > ul.nav-session-actions .btn-exit-v2 {
        min-height: 44px !important;
        height: auto !important;
        justify-content: flex-start !important;
        border-radius: var(--ux-radius-sm) !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix > .user-mobile-full {
        margin-top: 6px !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .user-badge-v2,
    html body .main-nav-container #navbarNav .mobile-nav-fix .exit-mobile-full .logout-nav-form,
    html body .main-nav-container #navbarNav .mobile-nav-fix .exit-mobile-full .btn-exit-v2 {
        width: 100% !important;
        min-height: 44px !important;
        height: auto !important;
        border-radius: var(--ux-radius-sm) !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .user-badge-v2 {
        justify-content: flex-start !important;
        padding: 8px 11px !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .exit-mobile-full .btn-exit-v2 {
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        padding: 8px 11px !important;
    }

    html body .main-nav-container .branch-switcher-control {
        min-height: 42px !important;
        border-radius: var(--ux-radius-sm) !important;
    }

    html body .main-nav-container .branch-picker-menu {
        max-height: min(300px, calc(100dvh - 170px)) !important;
        border-radius: var(--ux-radius-md) !important;
    }

    html body .mobile-app-tabbar {
        min-height: 60px !important;
        border-radius: 20px !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, .14) !important;
    }

    html body .mobile-app-tab {
        min-height: 48px !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 430px) {
    html body #app-content .row > [class*="col-"] {
        min-width: 0;
    }

    html body #app-content > .container,
    html body #app-content > .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    html body #app-content .home-kpi-grid {
        gap: 8px;
    }

    html body #app-content .home-kpi-card {
        min-height: 118px;
        padding: 12px;
    }

    html body #app-content .home-kpi-card strong {
        font-size: 1.18rem;
    }

    html body #app-content .home-kpi-label,
    html body #app-content .home-kpi-card small {
        font-size: .64rem;
    }

    html body #app-content .home-chart-summary {
        gap: 6px;
    }

    html body #app-content .home-chart-summary-item {
        min-width: 0;
        padding: 8px 7px;
    }

    html body #app-content .home-chart-summary-item strong {
        font-size: .78rem;
    }

    html body #app-content .home-panel-head {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 360px) {
    html body .main-nav-container #navbarNav .mobile-nav-fix .mini-link {
        min-height: 42px !important;
        padding-left: 9px !important;
        padding-right: 9px !important;
    }

    html body .main-nav-container #navbarNav .mobile-nav-fix .mini-link .menu-link-text {
        font-size: .80rem !important;
    }

    html body #app-content .home-kpi-card {
        min-height: 112px;
    }
}

@media (min-width: 1440px) {
    html body #app-content > .container,
    html body #app-content > .container-fluid {
        max-width: none !important;
    }
}

@media (min-width: 1920px) {
    html body #app-content > .container,
    html body #app-content > .container-fluid {
        max-width: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html,
    html body {
        scroll-behavior: auto !important;
    }

    html body *,
    html body *::before,
    html body *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Public landing/login responsive guard. The landing page intentionally uses
   the same stylesheet as the panel, so keep its hero columns and login view
   inside the visual viewport even when a mobile browser reports a transient
   layout width. */
@media (max-width: 991.98px) {
    html body .navbar,
    html body .navbar > .container,
    html body .hero,
    html body .hero > .container,
    html body .hero > .container > .row,
    html body .hero-copy-col,
    html body .hero-login-col,
    html body .feature-card,
    html body .price-card,
    html body .signup-box {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    html body .navbar > .container {
        width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    html body .navbar .brand {
        min-width: 0 !important;
        max-width: calc(100% - 54px) !important;
        overflow: hidden !important;
    }

    html body .navbar .brand-logo {
        display: block !important;
        width: min(178px, 52vw) !important;
        max-width: 100% !important;
        height: auto !important;
    }

    html body .hero,
    html body .hero > .container,
    html body .hero > .container > .row,
    html body .hero-copy-col,
    html body .hero-login-col {
        width: 100% !important;
        overflow-x: clip !important;
        box-sizing: border-box !important;
    }

    html body .hero > .container > .row.align-items-center,
    html body .hero > .container > .row.align-items-center.g-5 {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        --bs-gutter-x: 0 !important;
    }

    html body .hero > .container > .row.align-items-center > [class*="col-"],
    html body .hero > .container > .row.align-items-center.g-5 > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    html body .hero > .container,
    html body .hero > .container > .row.align-items-center,
    html body .hero > .container > .row.align-items-center.g-5,
    html body .hero > .container > .row.align-items-center > [class*="col-"],
    html body .hero > .container > .row.align-items-center.g-5 > [class*="col-"] {
        width: min(100%, calc(100vw - 28px)) !important;
    }

    html body .hero > .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    html body .hero-title,
    html body .hero-title span,
    html body .hero-text {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    html body .hero-title,
    html body .hero-text,
    html body .section-title,
    html body .section-sub,
    html body .feature-card,
    html body .price-card,
    html body .signup-box {
        width: min(100%, calc(100vw - 28px)) !important;
    }

    html body .hero-title {
        font-size: clamp(1.78rem, 8.8vw, 2.5rem) !important;
        line-height: 1.15 !important;
        letter-spacing: -.055em !important;
    }

    html body .hero-text {
        font-size: .91rem !important;
        line-height: 1.52 !important;
    }

    html body .section-title,
    html body .section-sub,
    html body .feature-card,
    html body .feature-card h5,
    html body .feature-card p,
    html body .price-card,
    html body .price-card * {
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    html body .section-title {
        font-size: clamp(1.40rem, 7.4vw, 1.95rem) !important;
        line-height: 1.18 !important;
    }

    html body .text-center.mb-5 {
        width: 100% !important;
        min-width: 0 !important;
    }

    html body .hero-copy-col > .row {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    html body .hero-copy-col > .row > [class*="col-"] {
        min-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    html body.login-open {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    html body.login-open > .hero {
        position: fixed !important;
        top: 68px !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100dvh - 68px) !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    html body.login-open > .hero > .container {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 16px !important;
        overflow-x: hidden !important;
    }

    html body.login-open > .hero > .container > .row,
    html body.login-open .hero-login-col,
    html body.login-open .hero-login-col .switch-card,
    html body.login-open .hero-login-col .login-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    html body.login-open > .hero > .container > .row {
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html body.login-open .hero-copy-col {
        display: none !important;
    }

    html body.login-open .hero-login-col {
        display: block !important;
        position: static !important;
        flex: 0 0 100% !important;
        height: 100% !important;
        padding: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        overflow: visible !important;
        transform: none !important;
    }

    html body.login-open .hero-login-col .switch-card {
        display: block !important;
        position: static !important;
        height: 100% !important;
        padding: 0 !important;
    }

    html body.login-open .hero-login-col .login-card {
        display: flex !important;
        position: relative !important;
        inset: auto !important;
        height: auto !important;
        min-height: 100% !important;
        max-height: none !important;
        padding: 28px 0 30px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        justify-content: flex-start !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    html body.login-open .hero-login-col .login-card > .d-flex.mb-3,
    html body.login-open .hero-login-col .login-card > form,
    html body.login-open .hero-login-col .login-card > .alert,
    html body.login-open .hero-login-col .login-card > .saved-strip {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    html body.login-open .hero-login-col .login-title {
        font-size: clamp(1.35rem, 6.5vw, 1.72rem) !important;
    }

    html body.login-open .hero-login-col .login-sub {
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
    }

    html body.login-open .hero-login-col .login-card .form-control,
    html body.login-open .hero-login-col .login-card .form-floating,
    html body.login-open .hero-login-col .login-card .option-box,
    html body.login-open .hero-login-col .login-card form .btn {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    html body.login-open .hero-login-col .login-card .option-box {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        text-align: left !important;
    }

    /* Login view turns the hamburger into a back control. Reset Bootstrap's
       auto margin from the original hamburger so the approved wordmark stays
       beside it instead of being pushed outside narrow screens. */
    html body.login-open .navbar > .container {
        justify-content: flex-start !important;
    }

    html body.login-open .navbar .navbar-toggler.is-login-back {
        order: -1 !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        margin-left: 0 !important;
        margin-right: 12px !important;
    }

    html body.login-open .navbar .brand {
        order: 0 !important;
        flex: 0 1 auto !important;
        width: auto !important;
        max-width: calc(100% - 54px) !important;
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    html body.login-open .navbar .brand-logo {
        width: min(178px, 52vw) !important;
        max-width: 100% !important;
    }
}

@media (max-width: 420px) {
    html body .navbar > .container,
    html body .hero > .container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    html body .hero-title {
        font-size: clamp(1.68rem, 8.7vw, 2.18rem) !important;
    }

    html body.login-open .hero-login-col .login-card {
        padding-top: 22px !important;
        padding-bottom: 24px !important;
    }
}
