﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    --radius: 14px;
    --radius-sm: 10px;
    --ease: cubic-bezier(.2,.8,.2,1);
    --t: 160ms;
}

/* ===========================
   LIGHT THEME TOKENS
   =========================== */
[data-bs-theme="light"] {
    /* Brand tokens */
    --brand-primary: #0d6efd;
    --brand-secondary: #6c757d;
    --brand-on-primary: #ffffff;
    /* Surfaces + text */
    --color-text: #212529;
    --color-text-muted: #6c757d;
    --color-surface: #ffffff;
    --color-surface-muted: #f8f9fa;
    --color-surface-subtle: #f1f3f5;
    --color-border: #ced4da;
    --color-border-strong: #adb5bd;
    /* Actions + links */
    --color-action-bg: var(--brand-primary);
    --color-action-hover: color-mix(in srgb, var(--brand-primary) 88%, black);
    --color-action-text: var(--brand-on-primary);
    --color-link: var(--brand-primary);
    --color-link-hover: color-mix(in srgb, var(--brand-primary) 85%, black);
    /* Focus */
    --color-focus-ring: rgba(13, 110, 253, 0.20);
    --color-focus-border: var(--brand-primary);
    /* App-specific semantic tokens */
    --app-wrapper-bg: var(--color-surface-muted);
    --app-color-line: var(--brand-primary);
    --app-sidebar-bg: var(--color-surface);
    --app-sidebar-text: var(--color-text);
    --app-sidebar-link: var(--color-text);
    --app-sidebar-link-hover: var(--brand-primary);
    --app-sidebar-header: var(--color-text-muted);
    --app-sidebar-logo: var(--brand-primary);
    --app-topnav-bg: rgba(255, 255, 255, 0.85);
    --app-mobile-nav-bg: rgba(255, 255, 255, 0.92);
    --app-mobile-nav-text: #6c757d;
    --app-mobile-nav-hover: var(--brand-primary);
    --app-mobile-nav-active: var(--brand-primary);
    --app-mobile-sheet-bg: rgba(255, 255, 255, 0.98);
    --app-mobile-sheet-text: var(--color-text);
    --app-card-header-bg: var(--color-surface);
    --app-card-header-text: var(--color-text);
    --app-card-accent: var(--brand-primary);
    --app-dropdown-bg: var(--color-surface);
    --app-dropdown-text: var(--color-text);
    --app-dropdown-hover-bg: var(--color-surface-muted);
    --app-list-bg: var(--color-surface);
    --app-list-text: var(--color-text);
    --app-list-hover-bg: var(--color-surface-muted);
    --app-form-bg: var(--color-surface);
    --app-form-border: var(--color-border-strong);
    --app-form-text: var(--color-text);
    --app-pill-active-bg: var(--brand-primary);
    --app-pill-active-text: #ffffff;
    --app-accordion-header-bg: var(--brand-primary);
    --app-accordion-header-text: #ffffff;
    --app-goto-bg: var(--color-surface);
    --app-goto-text: var(--color-text);
    --app-theme-toggle-color: var(--color-text);
    --app-switch-knob: #ffffff;
}

/* ===========================
   DARK THEME TOKENS
   =========================== */
[data-bs-theme="dark"] {
    /* Brand tokens
       Usually keep tenant brand stable across themes */
    --brand-primary: #0d6efd;
    --brand-secondary: #6c757d;
    --brand-on-primary: #ffffff;
    /* Surfaces + text */
    --color-text: #f8f9fa;
    --color-text-muted: #adb5bd;
    --color-surface: #212529;
    --color-surface-muted: #2b3035;
    --color-surface-subtle: #343a40;
    --color-border: #495057;
    --color-border-strong: #6c757d;
    /* Actions + links */
    --color-action-bg: var(--brand-primary);
    --color-action-hover: color-mix(in srgb, var(--brand-primary) 82%, white);
    --color-action-text: var(--brand-on-primary);
    --color-link: #8ab4ff;
    --color-link-hover: #cfe2ff;
    /* Focus */
    --color-focus-ring: rgba(138, 180, 255, 0.22);
    --color-focus-border: #8ab4ff;
    /* App-specific semantic tokens */
    --app-wrapper-bg: var(--color-surface-muted);
    --app-color-line: var(--brand-primary);
    --app-sidebar-bg: var(--color-surface-muted);
    --app-sidebar-text: var(--color-text);
    --app-sidebar-link: var(--color-text);
    --app-sidebar-link-hover: #ffffff;
    --app-sidebar-header: var(--color-text-muted);
    --app-sidebar-logo: var(--brand-primary);
    --app-topnav-bg: rgba(33, 37, 41, 0.85);
    --app-mobile-nav-bg: rgba(33, 37, 41, 0.92);
    --app-mobile-nav-text: #adb5bd;
    --app-mobile-nav-hover: #ffffff;
    --app-mobile-nav-active: #ffffff;
    --app-mobile-sheet-bg: rgba(33, 37, 41, 0.98);
    --app-mobile-sheet-text: var(--color-text);
    --app-card-header-bg: var(--color-surface);
    --app-card-header-text: var(--color-text);
    --app-card-accent: var(--brand-primary);
    --app-dropdown-bg: var(--color-surface-subtle);
    --app-dropdown-text: var(--color-text);
    --app-dropdown-hover-bg: #495057;
    --app-list-bg: var(--color-surface-subtle);
    --app-list-text: var(--color-text);
    --app-list-hover-bg: #495057;
    --app-form-bg: var(--color-surface-subtle);
    --app-form-border: var(--color-border);
    --app-form-text: var(--color-text);
    --app-pill-active-bg: var(--brand-primary);
    --app-pill-active-text: #ffffff;
    --app-accordion-header-bg: var(--color-surface);
    --app-accordion-header-text: var(--color-text);
    --app-goto-bg: var(--color-surface);
    --app-goto-text: var(--color-text);
    --app-theme-toggle-color: var(--color-text);
    --app-switch-knob: var(--color-text);
}

*,
::after,
::before {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 1.15rem;
    opacity: 1;
    overflow-y: scroll;
    margin: 0;
    color: var(--color-text);
    background: var(--color-surface);
}

html,
body {
    overflow-x: hidden;
}

/* reserve space for fixed bottom nav on mobile */
@media (max-width: 767.98px) {
    .main {
        padding-bottom: 92px;
    }
}

.color-line {
    width: 100%;
    color: var(--app-color-line);
    background-color: var(--app-color-line);
    background-image: none;
    height: 5px;
}

#topnav.navbar {
    background: var(--app-topnav-bg);
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(8px);
}

.tenant-primary {
    background: var(--brand-primary);
}

.tenant-secondary {
    background: var(--brand-secondary);
}

a {
    cursor: pointer;
    text-decoration: none;
    color: var(--color-link);
}

li {
    list-style: none;
}

/* progress bar */
.progress-bar {
    background: var(--brand-primary);
}

/* Toast */
.toast-container-app {
    top: 0.85rem !important;
    right: 0.85rem !important;
    z-index: 1080;
}

.app-toast {
    min-width: 300px;
    max-width: min(92vw, 420px);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 0.75rem 1.75rem color-mix(in srgb, var(--color-text) 15%, transparent);
}

.app-toast-header {
    background: transparent;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.app-toast-message {
    line-height: 1.45;
    word-break: break-word;
}

.app-toast-progress {
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-primary) 14%, transparent);
    overflow: hidden;
}

.app-toast-progress-fill {
    height: 100%;
    width: 100%;
    background: var(--brand-primary);
    transition: width 0.05s linear;
}

.app-toast.toast-info #toastIcon,
.app-toast.toast-info .app-toast-progress-fill {
    color: var(--brand-primary);
    background: var(--brand-primary);
}

.app-toast.toast-success #toastIcon,
.app-toast.toast-success .app-toast-progress-fill {
    color: var(--bs-success);
    background: var(--bs-success);
}

.app-toast.toast-warning #toastIcon,
.app-toast.toast-warning .app-toast-progress-fill {
    color: var(--bs-warning);
    background: var(--bs-warning);
}

.app-toast.toast-error #toastIcon,
.app-toast.toast-error .app-toast-progress-fill {
    color: var(--bs-danger);
    background: var(--bs-danger);
}

/* ===========================
   Layout + Sticky footer
   =========================== */

.wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    width: 100%;
    background: var(--app-wrapper-bg);
}

.footer {
    margin-top: auto;
}

.admin-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    width: 100%;
}

.admin-footer-fixed {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1015;
}

.admin-footer-inner {
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
}

.admin-footer-copy {
    font-size: 0.9rem;
}

.admin-footer-link {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.admin-footer-link:hover,
.admin-footer-link:focus {
    color: var(--color-link-hover);
}

.has-fixed-admin-footer main.content {
    padding-bottom: 5.5rem !important;
}

.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    overflow: hidden;
    transition: all 0.35s ease-in-out;
    width: 100%;
}

main.content {
    flex: 1 1 auto;
    min-width: 0;
}

/* Reserve space for fixed-bottom mobile nav */
@media (max-width: 767.98px) {
    .footer {
        display: none;
    }

    .admin-footer-fixed {
        display: none;
    }

    .has-fixed-admin-footer main.content {
        padding-bottom: 6rem !important;
    }
}

.position-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
}

/* Sidebar */
#sidebar {
    max-width: 244px;
    min-width: 244px;
    transition: all 0.35s ease-in-out;
    background: var(--app-sidebar-bg);
    color: var(--app-sidebar-text);
    border-right: 1px solid var(--color-border);
}

a.sidebar-link {
    color: var(--app-sidebar-link);
    position: relative;
    display: block;
    padding: 0.7rem 1rem;
    margin: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.2;
}

    a.sidebar-link:hover,
    a.sidebar-link.active,
    a.sidebar-link.selected {
        color: var(--app-sidebar-link-hover);
    }

    a.sidebar-link i {
        width: 20px;
        text-align: center;
        opacity: 0.9;
    }

.sidebar-logo {
    padding: 1rem 1.25rem;
}

    .sidebar-logo a {
        color: var(--app-sidebar-logo);
        font-weight: 700;
        letter-spacing: 0.2px;
    }

.sidebar-nav {
    list-style: none;
    margin-bottom: 0;
    padding-left: 0;
    margin-left: 0;
}

.sidebar-header {
    color: var(--app-sidebar-header);
    font-size: 0.75rem;
    padding: 1.5rem 1.5rem 0.375rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
}

.sidebar-link[data-bs-toggle="collapse"]::after {
    border: solid;
    border-width: 0 0.075rem 0.075rem 0;
    content: "";
    display: inline-block;
    padding: 2px;
    position: absolute;
    right: 1.25rem;
    top: 1.2rem;
    transform: rotate(-135deg);
    transition: all 0.2s ease-out;
}

.sidebar-link[data-bs-toggle="collapse"].collapsed::after {
    transform: rotate(45deg);
    transition: all 0.2s ease-out;
}

/* dropdown items: indent + slightly smaller */
.sidebar-dropdown a.sidebar-link {
    margin-left: 1.25rem;
    padding-left: 1rem;
    font-size: 0.95rem;
}


.navbar-expand .navbar-nav {
    margin-left: auto;
}

.content {
    flex: 1;
    min-width: 0;
    width: auto;
}

.page-shell {
    max-width: 1400px;
    margin: 0 auto;
 /*  padding: 1rem;*/
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header-main {
    min-width: 0;
}

.page-breadcrumb {
    font-size: 0.85rem;
}

    .page-breadcrumb a {
        text-decoration: none;
    }

        .page-breadcrumb a:hover {
            text-decoration: underline;
        }

.page-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

.page-subtitle {
    margin-top: 0.35rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.page-alerts,
.page-tools,
.page-content {
    margin-bottom: 1rem;
}

/* Reusable settings form component */
.settings-form-shell {
    --settings-form-max-width: 1440x;
    --settings-form-bg: var(--color-surface);
    --settings-form-border: var(--color-border);
    --settings-form-border-hover: color-mix(in srgb, var(--brand-primary) 35%, var(--color-border));
    --settings-form-shadow: 0 0.6rem 1.5rem color-mix(in srgb, var(--color-text) 8%, transparent);
    --settings-form-shadow-hover: 0 1rem 2rem color-mix(in srgb, var(--color-text) 12%, transparent);
}

.settings-form {
    max-width: var(--settings-form-max-width);
}

.settings-form-card {
    background: var(--settings-form-bg);
    border: 1px solid var(--settings-form-border);
    border-radius: var(--radius);
    box-shadow: var(--settings-form-shadow);
    overflow: hidden;
    transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}

.settings-form-card:hover,
.settings-form-card:focus-within {
    border-color: var(--settings-form-border-hover);
    box-shadow: var(--settings-form-shadow-hover);
}

.settings-form-card-header {
    padding: 0.9rem 1.1rem;
}

.settings-form-card-title {
    align-items: center;
    color: var(--app-card-header-text);
    display: inline-flex;
    font-size: 1.05rem;
    font-weight: 700;
    gap: 0.55rem;
    letter-spacing: 0;
    margin: 0;
}

.settings-form-card-body {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
}

.settings-form-group {
    max-width: 720px;
}

.settings-form-label {
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.settings-form-validation {
    margin-bottom: 0;
}

.settings-form-status {
    align-items: center;
    color: var(--color-text-muted);
    display: none;
    gap: 0.5rem;
    font-size: 0.92rem;
    margin-top: -0.1rem;
}

.settings-form-test-link {
    justify-self: start;
    text-decoration: none;
}

.settings-form-test-result {
    display: none;
    font-size: 0.92rem;
    margin-top: -0.2rem;
}

.settings-form-test-result.is-pending {
    color: var(--color-text-muted);
}

.settings-form-test-result.is-success {
    color: var(--bs-success);
}

.settings-form-test-result.is-error {
    color: var(--bs-danger);
}

.settings-form-actions {
    align-items: center;
    background: transparent;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
    padding: 0.9rem 1.1rem;
}

@media (max-width: 767.98px) {
    .page-shell {
        padding: 0.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        width: 100%;
        justify-content: stretch;
    }

    .page-actions .btn {
        flex: 1 1 auto;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .settings-form {
        max-width: 100%;
    }

    .settings-form-group {
        max-width: 100%;
    }

    .settings-form-actions .btn {
        flex: 1 1 auto;
    }
}

/* Cards */
.card-header {
    background-color: var(--app-card-header-bg);
    color: var(--app-card-header-text);
}

.card-tenant {
    border-left-color: var(--app-card-accent);
    border-left-width: 5px;
}

/* Reusable settings card component */
.settings-card-grid {
    --settings-card-bg: var(--color-surface);
    --settings-card-border: var(--color-border);
    --settings-card-border-hover: color-mix(in srgb, var(--brand-primary) 35%, var(--color-border));
    --settings-card-shadow: 0 0.6rem 1.5rem color-mix(in srgb, var(--color-text) 8%, transparent);
    --settings-card-shadow-hover: 0 1rem 2rem color-mix(in srgb, var(--color-text) 12%, transparent);
    --settings-card-accent: var(--brand-primary);
    --settings-card-icon-bg: color-mix(in srgb, var(--settings-card-accent) 14%, transparent);
    --settings-card-icon-color: var(--settings-card-accent);
    --settings-card-title: var(--color-text);
    --settings-card-description: var(--color-text-muted);
    --settings-card-action-bg: var(--color-action-bg);
    --settings-card-action-hover-bg: var(--color-action-hover);
    --settings-card-action-text: var(--color-action-text);
    --settings-card-action-border: var(--color-action-bg);
}

.settings-card {
    background: var(--settings-card-bg);
    border: 1px solid var(--settings-card-border);
    border-radius: var(--radius);
    box-shadow: var(--settings-card-shadow);
    transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}

.settings-card:hover,
.settings-card:focus-within {
    border-color: var(--settings-card-border-hover);
    box-shadow: var(--settings-card-shadow-hover);
    transform: translateY(-2px);
}

.settings-card-body {
    align-items: center;
    column-gap: 0.75rem;
    display: grid;
    grid-template-areas:
        "icon title"
        "description description"
        "action action";
    grid-template-columns: auto 1fr;
    padding: 1.1rem;
    row-gap: 0.6rem;
}

.settings-card-icon {
    align-items: center;
    background: var(--settings-card-icon-bg);
    border-radius: var(--radius-sm);
    color: var(--settings-card-icon-color);
    display: inline-flex;
    font-size: 1.1rem;
    height: 2.6rem;
    justify-content: center;
    width: 2.6rem;
    grid-area: icon;
}

.settings-card-title {
    color: var(--settings-card-title);
    font-weight: 700;
    grid-area: title;
    letter-spacing: 0;
    margin-bottom: 0;
}

.settings-card-description {
    color: var(--settings-card-description);
    grid-area: description;
    line-height: 1.5;
    margin-bottom: 0;
}

.settings-card-action {
    background: var(--settings-card-action-bg);
    border: 1px solid var(--settings-card-action-border);
    color: var(--settings-card-action-text);
    grid-area: action;
    font-weight: 600;
    justify-self: start;
    min-width: 7.5rem;
}

.settings-card-action:hover,
.settings-card-action:focus {
    background: var(--settings-card-action-hover-bg);
    border-color: var(--settings-card-action-hover-bg);
    color: var(--settings-card-action-text);
}

/* mobile navigation */
.mobilenav {
    background: var(--app-mobile-nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
}

.mobile-nav-list {
    gap: 0.25rem;
}

.mobilenav .nav-item {
    display: flex;
    justify-content: center;
}

.mobilenav .nav-link {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--app-mobile-nav-text);
    border-radius: 0.9rem;
    padding: 0.5rem 0.25rem;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    transition: all 0.2s ease;
}

    .mobilenav .nav-link:hover,
    .mobilenav .nav-link:focus {
        color: var(--app-mobile-nav-hover);
        background-color: color-mix(in srgb, var(--brand-primary) 12%, transparent);
    }

    .mobilenav .nav-link.active {
        color: var(--app-mobile-nav-active);
        background: color-mix(in srgb, var(--brand-primary) 16%, transparent);
        font-weight: 600;
    }

/* icon + label */
.mobile-nav-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.mobile-nav-label {
    font-size: 0.72rem;
    line-height: 1;
}

/* remove bootstrap caret */
.mobile-more .dropdown-toggle::after {
    display: none;
}

/* highlight more button when open */
.mobile-more.show .nav-link {
    color: var(--app-mobile-nav-active);
    background: color-mix(in srgb, var(--brand-primary) 16%, transparent);
}

/* dropdown panel (optional fallback if you still use dropup anywhere) */
.mobile-more-menu {
    margin-bottom: 10px;
    border-radius: 16px;
    border: none;
    padding: 0.5rem;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    animation: mobileDropUp 0.18s ease;
    overflow: hidden;
    background-color: var(--app-dropdown-bg);
    color: var(--app-dropdown-text);
}

    .mobile-more-menu .dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--app-dropdown-text);
    }

        .mobile-more-menu .dropdown-item i {
            width: 18px;
            text-align: center;
            font-size: 1rem;
            opacity: 0.75;
        }

        .mobile-more-menu .dropdown-item:hover {
            background-color: var(--app-dropdown-hover-bg);
        }

    .mobile-more-menu .dropdown-divider {
        margin: 0.4rem 0;
    }

@keyframes mobileDropUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* bottom sheet trigger in nav */
.mobile-more-btn {
    cursor: pointer;
}

/* mobile bottom sheet */
.offcanvas.offcanvas-bottom.mobile-sheet {
    bottom: 0;
    height: 80vh !important;
    max-height: 80vh !important;
    border-top-left-radius: 1.25rem;
    border-top-right-radius: 1.25rem;
    border: 0;
    background: var(--app-mobile-sheet-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.16);
}

.mobile-sheet-header {
    position: relative;
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.mobile-sheet-handle {
    position: absolute;
    top: 0.45rem;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-text-muted) 45%, transparent);
}

.mobile-sheet-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 auto;
    color: var(--app-mobile-sheet-text);
}

.mobile-sheet .btn-close {
    margin: 0;
    padding: 0.5rem;
    border-radius: 50%;
    box-shadow: none;
}

.mobile-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 0.75rem calc(2rem + env(safe-area-inset-bottom)) !important;
}

.mobile-sheet-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 0.9rem;
    text-decoration: none;
    color: var(--app-mobile-sheet-text);
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

    .mobile-sheet-item:hover,
    .mobile-sheet-item:focus {
        background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
        color: var(--color-link-hover);
    }

    .mobile-sheet-item i {
        width: 20px;
        text-align: center;
        font-size: 1rem;
        opacity: 0.8;
    }

    .mobile-sheet-item:last-child {
        margin-bottom: 0.5rem;
    }

.mobile-sheet-divider {
    margin: 0.5rem 0;
    opacity: 0.12;
}

/* optional darker backdrop feel */
.offcanvas-backdrop.show {
    opacity: 0.35;
}

.illustration-img {
    max-width: 150px;
    width: 100%;
}

/* Sidebar Toggle */
#sidebar.collapsed {
    margin-left: -244px;
}

@media (max-width: 767.98px) {
    .js-sidebar {
        margin-left: -244px;
        overflow-y: auto;
        height: 100vh;
    }

    #sidebar.collapsed {
        margin-left: 0;
    }

    .navbar,
    footer {
        width: 100%;
    }
}

/* Theme Toggler */
.theme-toggle {
}

html[data-bs-theme="dark"] .theme-toggle .fa-sun-o,
html[data-bs-theme="light"] .theme-toggle .fa-moon-o {
    cursor: pointer;
    padding: 10px;
    display: block;
    font-size: 1.25rem;
    color: var(--app-theme-toggle-color);
}

html[data-bs-theme="dark"] .theme-toggle .fa-moon-o {
    display: none;
}

html[data-bs-theme="light"] .theme-toggle .fa-sun-o {
    display: none;
}

/* scroll to top button */
#goTop {
    position: fixed;
    right: 15px;
    bottom: 25px;
    opacity: 0.7;
}

    #goTop a {
        background: var(--app-goto-bg);
        color: var(--app-goto-text);
        width: 50px;
        height: 50px;
        justify-content: center;
        align-items: center;
        display: flex;
        text-decoration: none;
        transition: opacity 0.3s linear;
    }

        #goTop a:hover {
            opacity: 0.4;
        }

/* Login page */
.bg-image {
    position: absolute;
    width: 100%;
    min-height: 100%;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* progress bar height */
.progressbar-height-sm {
    height: 2px;
}

/* OTP */
.otp input {
    width: 40px;
    height: 40px;
}

otp input[type=number]::-webkit-inner-spin-button,
otp input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
}

/* bootstrap-table */
.btn-toolbar {
    margin-right: 5px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    --bs-btn-border-radius: 0 !important;
}

/* pills */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: var(--app-pill-active-text);
    background-color: var(--app-pill-active-bg);
}

/* Nav links */
.nav-link,
.nav-link-bottom {
    color: var(--color-link);
}

    .nav-link:hover,
    .nav-link-bottom:hover {
        color: var(--color-link-hover);
    }

/* Form controls */
.form-control,
.form-select {
    background-color: var(--app-form-bg);
    border-color: var(--app-form-border);
    color: var(--app-form-text);
}

    .form-control:focus,
    .dropdown-item:focus,
    .form-check-input:focus,
    .form-select:focus {
        border-color: var(--color-focus-border);
        box-shadow: 0 0 0 0.25rem var(--color-focus-ring);
    }

/* switch in focus */
.form-switch .form-check-input {
    background-image: none !important;
    position: relative;
}

    .form-switch .form-check-input::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 0.125rem;
        transform: translateY(-50%);
        width: 1rem;
        height: 1rem;
        background-color: var(--app-switch-knob);
        border-radius: 50%;
        transition: transform 0.3s ease, background-color 0.3s ease;
        z-index: 1;
    }

    .form-switch .form-check-input:checked::before {
        transform: translate(1rem, -50%);
    }

/* Form check */
.form-check-input:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* Dropdowns */
.dropdown-menu {
    background-color: var(--app-dropdown-bg);
    color: var(--app-dropdown-text);
}

.dropdown-item:hover {
    background-color: var(--app-dropdown-hover-bg);
}

/* List group */
.list-group-item {
    background-color: var(--app-list-bg);
    color: var(--app-list-text);
}

    .list-group-item:hover {
        background-color: var(--app-list-hover-bg);
    }

/* accordion */
.accordion-button:not(.collapsed) {
    background-color: var(--app-accordion-header-bg);
    color: var(--app-accordion-header-text);
}

/* canvas */
.offcanvas-fullscreen-custom {
    width: 100vw !important;
    height: 100vh;
    max-width: 100%;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    border: none;
    border-radius: 0;
}

/* motion tokens */
:root {
    --radius: 14px;
    --radius-sm: 10px;
    --ease: cubic-bezier(.2,.8,.2,1);
    --t: 160ms;
}

/* Buttons */
.btn {
    border-radius: 12px;
}

.btn-primary {
    background-color: var(--color-action-bg);
    color: var(--color-action-text);
    border-color: var(--color-action-bg);
    transition: transform var(--t) var(--ease), filter var(--t) var(--ease);
}

    .btn-primary:hover {
        filter: brightness(0.98);
        transform: translateY(-1px);
        background-color: var(--color-action-hover);
        border-color: var(--color-action-hover);
    }

/* Focus rings */
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.25rem var(--color-focus-ring);
    border-radius: 10px;
}

/* Cards: bordered surface style */
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: none;
    margin-bottom: 24px;
    transition: transform var(--t) var(--ease), border-color var(--t) var(--ease);
}

    .card:hover {
        transform: translateY(-1px);
        border-color: color-mix(in srgb, var(--color-border) 65%, var(--brand-primary));
    }

/* Form builder */
.builder-layout {
    --builder-panel-bg: var(--color-surface);
    --builder-panel-border: var(--color-border);
    --builder-panel-muted: var(--color-text-muted);
    --builder-dropzone-bg: var(--color-surface-subtle);
    --builder-dropzone-item-border: color-mix(in srgb, var(--color-border) 75%, var(--brand-primary));
    --builder-dropzone-item-bg: var(--color-surface);
}

.builder-panel {
    background: var(--builder-panel-bg);
    border: 1px solid var(--builder-panel-border);
}

.builder-panel .settings-card-body {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    grid-template-areas: none;
    grid-template-columns: none;
}

.builder-panel-sticky {
    position: sticky;
    top: 1rem;
}

.builder-palette-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.builder-palette-header {
    text-align: left;
}

.builder-palette-help {
    color: var(--builder-panel-muted);
    font-size: 0.875rem;
}

.builder-palette-btn {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
    justify-content: flex-start;
    min-height: 2.65rem;
    text-align: left;
    width: 100%;
}

.builder-palette-btn i {
    opacity: 0.9;
    width: 1rem;
}

.builder-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.builder-preview-header {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.builder-dropzone {
    background: var(--builder-dropzone-bg);
    border: 1px dashed var(--builder-panel-border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 0;
    min-height: 22rem;
    max-height: min(74vh, 58rem);
    overflow-y: auto;
    padding: 1rem;
}

.builder-dropzone .form-group-border {
    background: var(--builder-dropzone-item-bg);
    border: 1px solid var(--builder-dropzone-item-border);
    border-radius: var(--radius-sm);
    margin: 0;
    padding: 1.05rem 0.9rem 0.9rem 2.9rem;
    position: relative;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}

.builder-dropzone .my-handle {
    cursor: grab;
}

.builder-dropzone .form-group-border.my-handle::before {
    content: "\f142";
    font-family: FontAwesome;
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.65;
    position: absolute;
    right: 0.6rem;
    top: 0.55rem;
}

.builder-dropzone .builder-quick-move {
    display: inline-flex;
    gap: 0.25rem;
    left: 0.45rem;
    opacity: 0.08;
    position: absolute;
    top: 0.35rem;
    transition: opacity var(--t) var(--ease);
    z-index: 2;
}

.builder-dropzone .form-group-border:hover .builder-quick-move,
.builder-dropzone .form-group-border:focus-within .builder-quick-move,
.builder-dropzone .builder-quick-move:hover {
    opacity: 0.95;
}

.builder-dropzone .builder-quick-move .btn {
    align-items: center;
    display: inline-flex;
    height: 1.65rem;
    justify-content: center;
    min-width: 1.65rem;
    padding: 0;
}

.builder-dropzone .builder-quick-move .btn i {
    font-size: 0.9rem;
    line-height: 1;
}

.builder-dropzone .form-group-border.my-handle:active {
    cursor: grabbing;
}

.builder-dropzone .form-group-border:hover {
    border-color: color-mix(in srgb, var(--builder-dropzone-item-border) 65%, var(--brand-primary));
    box-shadow: 0 0.45rem 1rem color-mix(in srgb, var(--color-text) 10%, transparent);
}

.builder-dropzone .btn-default {
    background: var(--app-list-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.builder-dropzone .btn-default:hover,
.builder-dropzone .btn-default:focus {
    background: var(--app-list-hover-bg);
    border-color: color-mix(in srgb, var(--color-border) 70%, var(--brand-primary));
    color: var(--color-text);
}

.builder-dropzone .text-center {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-start !important;
    margin-top: 0.75rem;
}

.builder-dropzone .text-center .btn {
    min-width: 5.25rem;
}

.builder-dropzone.is-dragging {
    border-color: var(--brand-primary);
    background: color-mix(in srgb, var(--builder-dropzone-bg) 84%, var(--brand-primary));
}

.builder-dropzone .builder-sortable-ghost {
    background: color-mix(in srgb, var(--builder-dropzone-item-bg) 75%, var(--brand-primary));
    border-color: var(--brand-primary);
    opacity: 0.7;
}

.builder-dropzone .builder-sortable-chosen {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--brand-primary) 22%, transparent);
}

.builder-dropzone .builder-sortable-drag {
    transform: rotate(0.2deg);
}

@media (max-width: 991.98px) {
    .builder-panel-sticky {
        position: static;
    }
}

@media (max-width: 575.98px) {
    .builder-palette-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .builder-preview-header {
        align-items: stretch;
        flex-direction: column;
    }
}
