        :root {
            --WEBTREE-primary: #2fc7a0;
            --WEBTREE-primary-dark: #1f87d5;
            --WEBTREE-bg: #eef7f8;
            --WEBTREE-text: #12313b;
            --WEBTREE-muted: #6a8790;
            --soft-shadow: 0 20px 27px 0 rgb(0 0 0 / 6%);
            --soft-shadow-sm: 0 6px 16px rgb(0 0 0 / 7%);
            --soft-radius: 1rem;
        }
        * { box-sizing: border-box; }
        body {
            margin: 0;
            font-family: "Inter", system-ui, -apple-system, sans-serif;
            background:
                radial-gradient(circle at top left, rgba(47, 199, 160, .18), transparent 34%),
                radial-gradient(circle at top right, rgba(31, 135, 213, .14), transparent 28%),
                linear-gradient(180deg, #f7fbfc 0%, var(--WEBTREE-bg) 100%);
            color: var(--WEBTREE-text);
            overflow-x: hidden;
        }
        a { color: var(--WEBTREE-primary-dark); text-decoration: none; }

        .app-shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; transition: grid-template-columns .2s ease; }
        .app-shell.sidebar-collapsed { grid-template-columns: 92px 1fr; }

        .sidebar { background: transparent; padding: 1.1rem .9rem; overflow-y: auto; position: sticky; top: 0; height: 100vh; align-self: start; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar::-webkit-scrollbar { width: 0; height: 0; }
        .sidebar-card { background: rgba(255, 255, 255, .96); border-radius: 1.4rem; box-shadow: 0 22px 40px rgba(10, 31, 38, .08); min-height: calc(100vh - 2.2rem); padding: .8rem; border: 1px solid rgba(31, 135, 213, .08); position: relative; overflow: hidden; }
        .sidebar-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--WEBTREE-primary), var(--WEBTREE-primary-dark)); }
        .brand { margin-bottom: .9rem; color: var(--WEBTREE-primary-dark); display: flex; align-items: center; gap: .55rem; padding: .55rem .6rem .95rem; border-bottom: 1px solid #e7f4f4; }
        .brand-logo { width: 46px; height: 46px; flex-shrink: 0; object-fit: contain; display: block; }
        .brand-text { font-weight: 800; letter-spacing: .02em; font-size: .76rem; text-transform: uppercase; line-height: 1.15; }

        .nav-heading { margin: 1rem .5rem .45rem; color: var(--WEBTREE-muted); font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
        .nav-list { display: grid; gap: .3rem; }
        .nav-link { display: flex; align-items: center; gap: .65rem; border-radius: .85rem; padding: .55rem .62rem; color: #4b6972; font-weight: 700; font-size: .84rem; }
        .nav-link.active, .nav-link:hover { color: var(--WEBTREE-text); background: #fff; box-shadow: 0 8px 18px rgba(17, 49, 59, .07); }
        .icn { width: 31px; height: 31px; border-radius: .65rem; display: grid; place-items: center; background: linear-gradient(180deg, rgba(47, 199, 160, .1), rgba(31, 135, 213, .08)); box-shadow: inset 0 0 0 1px rgba(31, 135, 213, .16), 0 6px 14px rgba(17, 49, 59, .06); color: var(--WEBTREE-primary-dark); }
        .icn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
        .nav-parent { cursor: pointer; }
        .caret { margin-left: auto; font-size: .8rem; }
        .nav-sub { margin-left: .5rem; display: grid; gap: .3rem; }
        .nav-sub.closed { display: none; }
        .nav-sub .nav-link { font-size: .78rem; }
        .nav-sub .icn { width: 22px; height: 22px; border-radius: .55rem; box-shadow: inset 0 0 0 1px #dbeef0; }

        .app-shell.sidebar-collapsed .brand-text,
        .app-shell.sidebar-collapsed .label,
        .app-shell.sidebar-collapsed .nav-heading,
        .app-shell.sidebar-collapsed .caret,
        .app-shell.sidebar-collapsed .nav-sub { display: none; }
        .app-shell.sidebar-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
        .app-shell.sidebar-collapsed .brand-logo { width: 60px; height: 60px; }
        .app-shell.sidebar-collapsed .nav-link { justify-content: center; }

        .main { padding: 1rem 1.2rem 1.2rem 0; overflow-x: hidden; position: relative; z-index: 1; min-width: 0; }
.mobile-sidebar-overlay { display: none; }
        .topbar { position: sticky; top: .5rem; z-index: 1020; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-radius: var(--soft-radius); padding: .7rem 1rem; box-shadow: 0 18px 32px rgba(10, 31, 38, .08); display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; border: 1px solid rgba(31, 135, 213, .08); }
        .topbar-left { display: flex; align-items: center; gap: .7rem; }
        .page-meta { display: grid; gap: .15rem; }
        .breadcrumbs { display: flex; align-items: center; gap: .35rem; color: #7f9ea3; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
        .breadcrumbs .current { color: var(--WEBTREE-primary-dark); }
.breadcrumbs a { color: #7f9ea3; text-decoration: none; }
.breadcrumbs a:hover { color: var(--WEBTREE-primary-dark); }
        .topbar h1 { margin: 0; font-size: 1.03rem; }
        .icon-btn { border: 1px solid rgba(31, 135, 213, .15); background: #fff; color: var(--WEBTREE-primary-dark); width: 36px; height: 36px; border-radius: .7rem; cursor: pointer; }

        .topbar-right { display: flex; align-items: center; gap: .6rem; }
        .pill { padding: .35rem .75rem; border-radius: 999px; background: linear-gradient(135deg, rgba(47, 199, 160, .12), rgba(31, 135, 213, .12)); color: var(--WEBTREE-primary-dark); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
        .profile-menu { position: relative; }
        .profile-toggle { width: 38px; height: 38px; border-radius: 999px; border: 1px solid rgba(31, 135, 213, .15); background: #fff; cursor: pointer; overflow: hidden; }
        .profile-toggle img { width: 100%; height: 100%; object-fit: cover; }
        .profile-toggle span { display: grid; place-items: center; width: 100%; height: 100%; color: var(--WEBTREE-primary-dark); font-weight: 700; }
        .profile-dropdown { position: absolute; right: 0; top: 44px; width: 220px; background: #fff; border: 1px solid rgba(31, 135, 213, .08); border-radius: .7rem; box-shadow: 0 18px 32px rgba(10, 31, 38, .08); display: none; z-index: 50; padding: .4rem; }
        .profile-menu.open .profile-dropdown { display: block; }
        .menu-item { width: 100%; display: flex; align-items: center; gap: .5rem; text-align: left; background: transparent; border: 0; padding: .65rem; border-radius: .5rem; cursor: pointer; color: #355c64; font-size: .9rem; font-weight: 700; }
        .menu-item:hover { background: #edf7fb; }

        .card { background: #fff; border-radius: var(--soft-radius); box-shadow: var(--soft-shadow); padding: 1.2rem; margin-bottom: 1rem; }
        /*.card-title { margin: 0 0 .85rem; }*/
        .card-subtle { color: var(--WEBTREE-muted); margin: 0; }
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
        .stat-title { color: var(--WEBTREE-muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; margin: 0; }
        .stat-value { margin-top: .35rem; font-size: 1.35rem; font-weight: 700; }
        .gradient-card { background: linear-gradient(310deg, var(--WEBTREE-primary-dark), var(--WEBTREE-primary)); color: #fff; }
        .charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
        .mini-bars { display: flex; align-items: end; gap: .45rem; height: 140px; margin-top: .8rem; }
        .mini-bars span { flex: 1; background: linear-gradient(180deg, var(--WEBTREE-primary), var(--WEBTREE-primary-dark)); border-radius: .4rem .4rem .2rem .2rem; }
        .pie { width: 160px; height: 160px; border-radius: 50%; background: conic-gradient(var(--WEBTREE-primary-dark) 0% 36%, #57c2c4 36% 70%, #a5e2e3 70% 100%); margin: .7rem auto; }

        .toolbar { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:1rem; }
        .status-text { color: var(--WEBTREE-primary-dark); font-weight: 600; }
        .btn { display:inline-flex; align-items:center; justify-content:center; gap:.35rem; border:1px solid transparent; border-radius:.62rem; padding:.44rem .78rem; cursor:pointer; font-weight:700; font-size:.84rem; line-height:1.2; color:#fff; background:var(--WEBTREE-primary-dark); box-shadow: var(--soft-shadow-sm); transition: transform .18s ease, box-shadow .2s ease, background .2s ease; min-height: 34px; }
        .btn:not(.btn-icon) { min-width: 92px; }
        .btn:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgb(0 0 0 / 10%); }
        .btn-primary,
        .btn-success,
        .btn-create,
        .btn-import,
        .btn-export,
        .export-btn,
        .import-btn {
            background: linear-gradient(135deg, var(--WEBTREE-primary-dark), var(--WEBTREE-primary));
            border-color: transparent;
            color: #fff;
        }
        .btn-primary:hover,
        .btn-success:hover,
        .btn-create:hover,
        .btn-import:hover,
        .btn-export:hover,
        .export-btn:hover,
        .import-btn:hover {
            color: #fff;
            filter: brightness(1.03);
        }
        .btn-outline,
        .btn-outline-primary,
        .btn-outline-secondary,
        .btn-reset {
            background:#fff;
            color:var(--WEBTREE-primary-dark);
            border:1px solid rgba(31, 135, 213, .2);
            box-shadow:none;
        }
        .btn-outline:hover,
        .btn-outline-primary:hover,
        .btn-outline-secondary:hover,
        .btn-reset:hover {
            background:rgba(31,135,213,.08);
            color:var(--WEBTREE-primary-dark);
        }
        .btn-danger { background: #e25564; }
        .btn-icon { width: 30px; height: 30px; padding: 0; border-radius: .55rem; background: transparent; color: var(--WEBTREE-primary-dark); border: 0; box-shadow: none; }
        .btn-icon i { font-size: .92rem; line-height: 1; }
        .btn-icon:hover { background: rgba(47, 199, 160, .12); }
        .action-group { display:flex; align-items:center; gap:.35rem; }
        .links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
        form { display: grid; gap: .8rem; }
        .form-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .9rem; }
        .form-span-2 { grid-column: span 2; }
        .form-actions { display:flex; gap:.55rem; flex-wrap:wrap; margin-top:.2rem; }
        .form-actions .btn,
        .form-actions-fixed .btn { min-width: 120px; }
        .field-toggle { display:flex; align-items:center; gap:.45rem; margin-top:.6rem; font-size:.9rem; }
        .form-label { font-weight: 700; font-size: .79rem; color: #4f7076; display: block; margin-bottom: .35rem; }
        .form-control { border: 1px solid #bed8db; border-radius: .6rem; padding: .52rem .68rem; font-size: .88rem; width: 100%; background: #fff; }
        .form-control:focus { outline: none; border-color: var(--WEBTREE-primary-dark); box-shadow: 0 0 0 3px rgba(31, 135, 213, .14); }
        .error { color: #f5365c; margin: .35rem 0 0; font-size: .83rem; }
        .js-auto-validate .invalid-feedback {
            display: none;
        }




        .js-auto-validate .form-control.is-invalid,
        .js-auto-validate .form-select.is-invalid,
        .js-auto-validate select.is-invalid,
        .js-auto-validate textarea.is-invalid {
            border-color: #dc3545 !important;
            box-shadow: 0 0 0 3px rgba(220, 53, 69, .12) !important;
        }

        .js-auto-validate .select2-selection.is-invalid,
        .js-auto-validate .select2-container--default .select2-selection--single.is-invalid {
            border-color: #dc3545 !important;
            box-shadow: 0 0 0 3px rgba(220, 53, 69, .12) !important;
        }

        .js-auto-validate .phone-input-group.is-invalid,
        .js-auto-validate [data-input-group].is-invalid {
            border-color: #dc3545 !important;
            box-shadow: 0 0 0 3px rgba(220, 53, 69, .12) !important;
        }
        .field-error,
        .invalid-feedback,
        .text-danger {
            color: #dc3545 !important;
            font-size: .82rem;
            margin-top: .3rem;
            font-weight: 600;
            animation: validationFade .2s ease;
        }
        .invalid-feedback {
            display: none;
        }
        .form-control.is-invalid + .invalid-feedback,
        .form-control.is-invalid ~ .invalid-feedback,
        select.is-invalid + .invalid-feedback,
        select.is-invalid ~ .invalid-feedback,
        textarea.is-invalid + .invalid-feedback,
        textarea.is-invalid ~ .invalid-feedback,
        .invalid-feedback.d-block {
            display: block;
        }
        .form-control.is-invalid,
        .form-select.is-invalid,
        select.is-invalid,
        textarea.is-invalid {
            border-color: #dc3545 !important;
            box-shadow: 0 0 0 3px rgba(220, 53, 69, .12) !important;
        }

        @keyframes validationFade {
            from { opacity: 0; transform: translateY(-2px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .mx-auto { margin-left: auto; margin-right: auto; }

        .row {
            display: flex;
            flex-wrap: wrap;
            margin-left: -.5rem;
            margin-right: -.5rem;
        }

        .row > [class*="col-"] {
            padding-left: .5rem;
            padding-right: .5rem;
        }

        .col-12 {
            width: 100%;
        }
        .g-2 { row-gap: .5rem; }
        .g-3 { row-gap: 1rem; }
        @media (min-width: 768px) {
            .col-md-3 { width: 25%; }
            .col-md-4 { width: 33.333333%; }
            .col-md-6 { width: 50%; }
            .col-md-8 { width: 66.666667%; }
            .col-md-9 { width: 75%; }
            .col-md-12 { width: 100%; }
        }

        .table-wrap { overflow-x: auto; }
        .table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 100%; }
        .table th, .table td { padding: .72rem .68rem; border-bottom: 1px solid #ecf1f2; text-align: left; font-size: .88rem; }
        .table th { color:#5f7f84; font-size:.74rem; letter-spacing:.04em; text-transform:uppercase; }
        .pagination-container { margin-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding-top: 1rem; border-top: 1px solid #eef4f4; flex-wrap: wrap; }
        .pagination { display: flex !important; flex-direction: row !important; list-style: none !important; padding: 0 !important; margin: 0 !important; gap: 4px; }
        .page-item .page-link { padding: 8px 14px; border: 1px solid rgba(31, 135, 213, .16); border-radius: 8px !important; color: var(--WEBTREE-primary-dark); font-weight: 700; background: #fff; text-decoration: none; font-size: 0.85rem; display: block; }
        .page-item.active .page-link { background-color: var(--WEBTREE-primary) !important; border-color: var(--WEBTREE-primary) !important; color: #fff !important; }
        .pagination-links nav > div:first-child { display: none !important; }

        .sort-link {
            color: inherit;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: .35rem;
            transition: color .15s ease;
        }
        .sort-link:hover {
            color: var(--WEBTREE-primary-dark);
        }

        .auth-card { width: 100%; max-width: 430px; background: #fff; border-radius: 1rem; box-shadow: var(--soft-shadow); padding: 1.4rem; }
        ul.clean { margin: .6rem 0 0; padding-left: 1.2rem; }

        @media (max-width: 980px) {
            .app-shell { grid-template-columns: 1fr; position: relative; }
            .sidebar {
                display: block;
                position: fixed;
                top: 0;
                left: 0;
                width: min(86vw, 320px);
                height: 100vh;
                z-index: 1060;
                padding: .7rem;
                transform: translateX(-110%);
                transition: transform .25s ease;
            }
            .sidebar-card { min-height: calc(100vh - 1.4rem); }
            .app-shell.mobile-sidebar-open .sidebar { transform: translateX(0); }
            .mobile-sidebar-overlay {
                display: block;
                position: fixed;
                inset: 0;
                border: 0;
                background: rgba(7, 21, 28, .45);
                opacity: 0;
                pointer-events: none;
                z-index: 1050;
                transition: opacity .2s ease;
            }
            .app-shell.mobile-sidebar-open .mobile-sidebar-overlay {
                opacity: 1;
                pointer-events: auto;
            }
            .main { padding: .8rem; }
            .topbar { flex-wrap: wrap; gap: .65rem; }
            .topbar-right { width: 100%; justify-content: flex-end; align-items: center; }
            .topbar-right .agent-status-card { min-width: 0; max-width: 100%; flex: 1 1 220px; margin-right: auto; }
            .topbar-right .agent-status-row { max-width: 100%; }
            .card { padding: .9rem; }
            .toolbar { flex-direction: column; align-items: stretch; }
            .charts-grid, .form-grid { grid-template-columns: 1fr; }
            .form-span-2 { grid-column: span 1; }
            .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
            .table { min-width: 720px; }
            .row { margin-left: -.35rem; margin-right: -.35rem; }
            .row > [class*="col-"] { padding-left: .35rem; padding-right: .35rem; }
            .btn { width: auto; }
            .form-actions { justify-content: stretch; }
            .form-actions .btn,
            .form-actions-fixed .btn { flex: 1 1 140px; min-width: 0; }
            .toolbar .btn { width: 100%; }
        }



/* Global typography and professional table refinements */
:root {
    --font-sans: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body {
    font-family: var(--font-sans);
    letter-spacing: .01em;
}
.card-title, h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: .01em; }
.table { background: #fff; border-radius: .85rem; overflow: hidden; }
.table thead th { background: #f7fbfc; font-weight: 800; color: #4f7277; }
.table tbody tr:hover { background: #f9fdfd; }
.table td { color: #335960; font-weight: 500; }
.page-index-shell .card { border: 1px solid #e0edef; border-radius: 14px; box-shadow: var(--soft-shadow-sm); }
.page-index-shell .status-text { margin: 1rem 1.2rem 0; }
.index-empty { text-align: center; color: #6a8790; padding: 2rem 0; font-weight: 600; }


/* Shared index page controls */
.search-box { margin-left: auto; }
.search-form { display: flex; gap: 10px; align-items: center; }
        .form-select-custom {
            height: 40px;
            border-radius: 8px;
            border: 1px solid #d2d6da;
            padding: 0 12px;
            font-size: 0.85rem;
            color: #495057;
            background-color: #fff;
            min-width: 140px;

            /* ðŸ”½ arrow control */
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;

            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23666' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center; /* move arrow left */
            background-size: 14px;
            padding-right: 30px; /* space for arrow */
        }

.input-group-custom { position: relative; width: 260px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #adb5bd; z-index: 5; }
.search-input { width: 100% !important; height: 40px; padding-left: 38px !important; padding-right: 35px !important; border-radius: 8px !important; border: 1px solid #d2d6da; font-size: 0.85rem; }
.clear-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #b4bdc2; display: none; line-height: 1; }
.clear-btn.visible { display: block; }
.clear-btn:hover { color: #658087; }
        .status-badge { display: inline-block; padding: 0.35em 0.65em; font-size: 0.75rem; font-weight: 700; line-height: 1; color: #fff; text-align: center; white-space: nowrap; border-radius: 0.35rem; text-transform: uppercase; }
        .bg-status-success { background: linear-gradient(135deg, var(--WEBTREE-primary), var(--WEBTREE-primary-dark)); }
        .bg-status-danger { background-color: #d94d5f; }
        .bg-status-warning { background-color: #f5b942; color: #212529; }
        .bg-status-secondary { background-color: #64748b; }
        .history-link { color: var(--WEBTREE-primary-dark); font-weight: 600; text-decoration: none; }
.status-active { color: #0f5132; background: #d1e7dd; }
.status-inactive { color: #842029; background: #f8d7da; }
.btn-icon .material-symbols-outlined { font-size: 18px; }

/* Fix header dropdown overlap and auditing UI cards */
.main, .topbar, .topbar-right, .profile-menu { overflow: visible; }
.topbar { position: relative; z-index: 2100; }
.profile-menu { z-index: 2200; }
.profile-dropdown { z-index: 3000; }

.audit-shell { padding: 0; }
        .audit-toolbar { padding: 1.1rem 1.2rem; border-bottom: 1px solid #e8f1f2; }
.audit-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; padding: 1rem 1.2rem; }
.audit-kpi-card { border: 1px solid #d8ecee; background: #f2fbfb; border-radius: 12px; padding: .8rem .9rem; display: grid; gap: .2rem; }
.audit-kpi-card span { font-size: .76rem; font-weight: 700; color: #5f8289; text-transform: uppercase; letter-spacing: .03em; }
.audit-kpi-card strong { font-size: 1.05rem; color: #204d55; }
.audit-kpi-card.warning { background: #fff9ec; border-color: #fde7bf; }
.audit-kpi-card.neutral { background: #f5f8fa; border-color: #e2e9ef; }
.audit-kpi-card.info { background: #eef7ff; border-color: #d8e9fc; }

/* Prevent overflow in Settings two-column pages */
.settings-layout {
    grid-template-columns: 260px minmax(0, 1fr) !important;
}
.settings-panel {
    min-width: 0;
}
.settings-panel .toolbar {
    flex-wrap: wrap;
}
.settings-panel .search-box {
    margin-left: auto;
    max-width: 100%;
}
.settings-panel .search-form {
    width: min(100%, 320px);
}
.settings-panel .input-group-custom {
    width: 100%;
}

/* Keep pagination inside container on all pages */
.pagination-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px;
    flex-wrap: wrap;
}
.pagination-links {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.pagination {
    flex-wrap: wrap !important;
}


        .auth-shell {
            min-height: 100vh;
            display: grid;
            place-items: center;
            padding: 1.2rem;
            background:
                radial-gradient(circle at 18% 18%, rgba(47, 199, 160, .22), transparent 28%),
                radial-gradient(circle at 82% 20%, rgba(31, 135, 213, .20), transparent 30%),
                radial-gradient(circle at 72% 82%, rgba(47, 199, 160, .14), transparent 26%),
                linear-gradient(135deg, #dfe9e6 0%, #cfdedd 45%, #c5d7e3 100%);
        }

.auth-card {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 1.1rem;
    box-shadow: 0 24px 40px rgba(10, 31, 38, .22);
    padding: 2rem 1.85rem;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--WEBTREE-primary-dark), var(--WEBTREE-primary));
    color: #fff;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 10px 18px rgba(31, 135, 213, .22);
}

.auth-intro { margin-bottom: 1rem; }
.auth-intro h2 { margin: 0; font-size: 1.65rem; line-height: 1.2; }
.auth-kicker { margin: 0 0 .45rem; color: var(--WEBTREE-primary-dark); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.auth-subtitle { margin-top: .55rem; color: #5f7f84; font-size: .93rem; }
.auth-form-shell { border: 1px solid rgba(31, 135, 213, .14); border-radius: 1rem; padding: 1.25rem 1.15rem; background: #fff; box-shadow: 0 10px 22px rgba(31,135,213,.1); }
.auth-form { display: grid; gap: .85rem; }
.auth-field { display: grid; gap: .45rem; }
.auth-field-header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.auth-meta-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding-top: .2rem; }
.auth-remember { font-size: .86rem; color: #4d6772; display: inline-flex; gap: .45rem; align-items: center; cursor: pointer; }
.auth-remember input { accent-color: var(--WEBTREE-primary-dark); }
.auth-link { font-size: .85rem; color: var(--WEBTREE-primary-dark); text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-submit-btn { margin-top: .3rem; min-height: 44px; border: none; border-radius: .7rem; }
.auth-loading-line { margin-top: .45rem; height: 3px; width: 100%; border-radius: 999px; background: linear-gradient(90deg, rgba(47,199,160,.2), rgba(31,135,213,.85), rgba(47,199,160,.2)); animation: authLoadingSlide 1.2s linear infinite; }
@keyframes authLoadingSlide {
    from { background-position: 0 0; }
    to { background-position: 200px 0; }
}

.flash-toast {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    left: auto;
    z-index: 5000;
    min-width: min(320px, calc(100vw - 2.4rem));
    max-width: min(460px, calc(100vw - 2.4rem));
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    border-radius: .9rem;
    box-shadow: 0 18px 30px rgba(0,0,0,.14);
    border: 1px solid transparent;
    transform: translateY(-10px);
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
}
.flash-toast.is-visible { opacity: 1; transform: translateY(0); }
.flash-toast-success { background: #effbf3; border-color: #b8ebca; color: #165e33; }
.flash-toast-error { background: #fff1f1; border-color: #ffc8c8; color: #7a1f1f; }
.flash-toast-icon { font-size: 1.3rem; line-height: 1; }
.flash-toast-content { display: grid; gap: .05rem; flex: 1; }
.flash-toast-content strong { font-size: .84rem; text-transform: uppercase; letter-spacing: .06em; }
.flash-toast-content span { font-size: .92rem; }
.flash-toast-list { display: grid; gap: .22rem; margin-top: .1rem; }
.flash-toast-close { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.1rem; }
        .patient-form-actions { padding-top: 0.25rem; display: flex; justify-content: flex-end; gap: 0.75rem; flex-wrap: wrap; }
        .required {
             color: red;
         }

        .select2-container--default .select2-selection--single {
            height: 38px;
            border: 1px solid #ced4da;
            border-radius: 0.375rem; /* Bootstrap rounded */
            padding: 5px 10px;
        }

        /* Align arrow properly */
        .select2-container--default .select2-selection--single .select2-selection__arrow {
            height: 36px;
            right: 8px;
        }

        /* Fix text alignment */
        .select2-container--default .select2-selection--single .select2-selection__rendered {
            line-height: 28px;
        }



.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #b9dfe7; border-radius: 999px; }
.table-wrap { scrollbar-color: #b9dfe7 transparent; }


@media (max-width: 576px) {
    .flash-toast {
        top: 1rem;
        right: 1rem;
        min-width: min(100%, calc(100vw - 2rem));
        max-width: min(100%, calc(100vw - 2rem));
    }
}


/* Smooth UI refinements */
.card, .btn, .form-control, .table, .topbar, .sidebar-card {
    transition: all .2s ease;
}

@media (max-width: 576px) {
    .card { padding: .78rem; border-radius: .8rem; }
    .topbar { padding: .55rem .65rem; }
    .pill { padding: .28rem .55rem; font-size: .68rem; }
    .table th, .table td { padding: .55rem .5rem; font-size: .8rem; }
    .btn { font-size: .8rem; min-height: 32px; }
}

