/* ── Geist — offline, single font for the entire app ── */
@font-face { font-family:'Geist'; src:url('/fonts/Geist-Thin.woff2') format('woff2'); font-weight:100; font-style:normal; font-display:swap; }
@font-face { font-family:'Geist'; src:url('/fonts/Geist-Light.woff2') format('woff2'); font-weight:300; font-style:normal; font-display:swap; }
@font-face { font-family:'Geist'; src:url('/fonts/Geist-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Geist'; src:url('/fonts/Geist-Medium.woff2') format('woff2'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'Geist'; src:url('/fonts/Geist-SemiBold.woff2') format('woff2'); font-weight:600; font-style:normal; font-display:swap; }
@font-face { font-family:'Geist'; src:url('/fonts/Geist-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'Geist'; src:url('/fonts/Geist-Black.woff2') format('woff2'); font-weight:900; font-style:normal; font-display:swap; }
@font-face { font-family:'Geist'; src:url('/fonts/Geist-UltraBlack.woff2') format('woff2'); font-weight:950; font-style:normal; font-display:swap; }

:root {
    --font-primary: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-secondary: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --navbar-font: 'Geist', sans-serif;
    --color-primary: #2563eb;
    --color-secondary: #64748b;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-bg: #f8fafc;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --navbar-bg: #0a1628;
    --sidebar-bg: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
    --sidebar-btn-bg: rgba(255,255,255,0.05);
    --sidebar-btn-border: transparent;
    --sidebar-sub-btn-bg: rgba(0,0,0,0.2);
    --sidebar-sub-btn-border: transparent;
    --btn-border-color: #ffffff;
    --btn-border-thickness: 1px;
    --btn-border-radius: 10px;
    --font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-weight: 500;
    --font-size: 17px;
}

html, body {
    font-family: var(--font-family, 'Geist', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: var(--font-size, 17px);
    font-weight: var(--font-weight, 500);
    line-height: 1.65;
    color: #1e293b;
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
}

.btn {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    border: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border: none;
}

.form-control, .form-select {
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: #94a3b8;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.table {
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 500;
}

.table thead th {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 13px;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.navbar {
    font-family: var(--font-primary);
}

.top-navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
    height: 56px !important;
    background: linear-gradient(135deg, #0a1628 0%, #1a56db 60%, #38bdf8 100%) !important;
    box-shadow: var(--shadow-md) !important;
}

.page-body {
    padding-top: 56px !important;
}

.text-muted {
    color: #64748b !important;
}

.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
}

.dropdown-item {
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 15px;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--color-primary);
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
}

.toast {
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.badge {
    font-family: var(--font-primary);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 6px 12px;
    border-radius: 6px;
}

.blazor-error-ui {
    font-family: var(--font-primary);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}

/* ── Top Navbar Links ── */

/* Reusable green-border navbar button — add this class to any future navbar button */
.navbar-btn-green {
    border: 1.5px solid #22c55e !important;
    box-shadow: 0 0 8px rgba(34,197,94,0.2) !important;
}
.navbar-btn-green:hover {
    border-color: #16a34a !important;
    box-shadow: 0 4px 14px rgba(34,197,94,0.35) !important;
}

.top-nav-link {
    position: relative;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    border-radius: var(--btn-border-radius, 10px) !important;
    padding: 8px 20px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: none !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white !important;
    margin: 0 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    white-space: nowrap;
}

.top-nav-link:hover {
    background: #059669 !important;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.4) !important;
    transform: translateY(-1px);
    color: white !important;
}

.top-nav-link:focus,
.top-nav-link:focus-visible,
.top-nav-link:active,
.top-nav-link:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

.top-nav-link::after {
    display: none;
}

.nav-arrow {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.75em;
    opacity: 0.9;
    margin-left: 4px;
}

.nav-arrow.rotated {
    transform: rotate(180deg);
}

/* ── Premium Dropdown ── */
.top-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 300px;
    z-index: 9999;
    transform-origin: top left;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.92) translateY(-8px);
}

/* Right-aligned dropdown (for items near right edge of navbar) */
.top-dropdown-right {
    left: auto;
    right: 0;
    transform-origin: top right;
}

.top-dropdown.dropdown-open {
    pointer-events: all;
    animation: dropdownIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes dropdownOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.92) translateY(-8px);
    }
}

.dropdown-inner {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,.18), 0 6px 20px rgba(26,86,219,.12), 0 0 0 1px rgba(226,232,240,.6);
    overflow: hidden;
    padding: 10px;
}

.dropdown-header {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    padding: 8px 14px 6px;
}

.dropdown-section-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    padding: 8px 14px 4px;
}

.dropdown-section-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 6px 10px;
}

.top-dropdown-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    transition: background 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.top-dropdown-item:hover {
    background: linear-gradient(135deg, #1040a0, #1a56db, #1c64f2);
    transform: translateX(4px);
    color: white;
}

.top-dropdown-item:hover .item-title { color: white; }
.top-dropdown-item:hover .item-desc { color: rgba(255,255,255,.75); }
.top-dropdown-item:hover .item-icon {
    background: rgba(255,255,255,.2);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.top-dropdown-item-danger:hover {
    background: linear-gradient(135deg, #991b1b, #dc2626, #ef4444) !important;
}

.top-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 16px;
}

.item-icon {
    font-size: 1.6rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(26,86,219,.12);
}

.item-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.item-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}

.item-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.3;
    font-weight: 400;
}

/* ════════════════════════════════════════
   MOBILE DESIGN SYSTEM
   সব নতুন page এ automatically apply হবে
   ════════════════════════════════════════ */

/* viewport meta fallback */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

/* ── Touch-friendly base ── */
@media (max-width: 767px) {

    html, body {
        font-size: 15px;
        overscroll-behavior: none;
    }

    /* Buttons — minimum 44px touch target */
    .btn {
        min-height: 44px;
        padding: 10px 18px;
        font-size: 15px;
        border-radius: 12px;
    }

    .btn-sm {
        min-height: 36px;
        padding: 6px 14px;
        font-size: 13px;
    }

    /* Inputs */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* prevents iOS zoom */
        border-radius: 10px;
        padding: 10px 14px;
    }

    /* Cards — full width, more padding */
    .card {
        border-radius: 16px;
        margin-bottom: 12px;
    }

    /* Tables — horizontal scroll */
    .table-responsive-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }

    .table {
        font-size: 13px;
        min-width: 500px;
    }

    /* Headings scale down */
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    h4 { font-size: 1rem; }

    /* Modal — bottom sheet style */
    .modal-dialog {
        margin: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
    }

    .modal-content {
        border-radius: 20px 20px 0 0;
        border: none;
    }

    /* Dropdown — full width on mobile */
    .dropdown-menu {
        width: 100%;
        border-radius: 16px;
    }

    /* Badge */
    .badge {
        font-size: 11px;
        padding: 4px 10px;
    }

    /* Spacing utilities */
    .px-3 { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
    .py-3 { padding-top: 0.875rem !important; padding-bottom: 0.875rem !important; }
}

/* ── Reusable Mobile-first Components ── */

/* Page container — use this in every new page */
.mobile-page {
    max-width: 100%;
    padding-bottom: 80px; /* space for bottom nav */
}

/* Section card */
.mobile-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* List item — app-style row */
.mobile-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.mobile-list-item:last-child {
    border-bottom: none;
}

.mobile-list-item:active {
    background: #f8fafc;
}

/* Stat card — for dashboard numbers */
.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    flex: 1;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Pull-to-refresh feel — smooth scroll handled in MainLayout.razor.css */

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(37,99,235,0.4);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    z-index: 150;
}

.fab:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

/* ── Error Boundary UI ── */
.error-boundary-ui {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #f8fafc;
    padding: 24px;
}

.error-boundary-card {
    background: white;
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    max-width: 420px;
    width: 100%;
}

.error-boundary-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.error-boundary-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.error-boundary-msg {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 24px;
    word-break: break-word;
}

.error-boundary-btn {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-weight: 600;
    text-decoration: none;
}

.error-boundary-btn:hover {
    color: white;
    opacity: 0.9;
}

/* ── Navbar active tab ── */
.top-nav-active {
    background: rgba(5,150,105,0.3) !important;
    border-color: rgba(5,150,105,0.4) !important;
    box-shadow: 0 4px 16px rgba(5,150,105,0.2) !important;
    color: white !important;
    font-weight: 700;
}

.top-nav-active:hover {
    background: #059669 !important;
    box-shadow: 0 4px 16px rgba(5,150,105,0.4) !important;
}

.top-nav-active::after {
    display: none !important;
}

/* ── Sidebar Glass Buttons ── */
.snav {
    background: transparent !important;
    transition: all 0.3s ease;
    min-height: 100% !important;
    height: 100% !important;
    display: flex;
    flex-direction: column;
    color: white !important;
    margin: 0 !important;
    padding: 0 !important;
}

.snav-toggle, .snav-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 12px !important;
    margin: 6px 10px !important;
    padding: 8px 14px !important;
    color: white !important;
    font-weight: 500 !important;
    letter-spacing: 0.3px !important;
    position: relative !important;
    overflow: hidden !important;
}

.snav-toggle::before, .snav-item::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent) !important;
    transition: left 0.5s ease !important;
}

.snav-toggle:hover, .snav-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.12) 100%) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    transform: translateX(6px) scale(1.02) !important;
    color: white !important;
}

.snav-toggle:hover::before, .snav-item:hover::before {
    left: 100% !important;
}

.snav-active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    backdrop-filter: none !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    font-weight: 700 !important;
    transform: translateX(2px) !important;
}

.snav-active:hover {
    transform: translateX(6px) scale(1.02) !important;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.snav-sub-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-left: 4px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 8px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 6px 14px 6px 26px !important;
    margin: 3px 12px !important;
    font-size: 13px !important;
    font-weight: 450 !important;
    letter-spacing: 0.2px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: block !important;
    position: relative !important;
    overflow: hidden !important;
}

.snav-sub-item::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent) !important;
    transition: left 0.4s ease !important;
}

.snav-sub-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
    color: white !important;
    transform: translateX(5px) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    border-left: 4px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.snav-sub-item:hover::before {
    left: 100% !important;
}

.snav-item-danger {
    border-left: 4px solid #ef4444 !important;
}

.snav-sub-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    margin-right: 8px;
}

/* ── Dropdown active item ── */
.top-dropdown-active {
    background: #f1f5f9;
    color: var(--color-primary) !important;
}

.top-dropdown-active .item-title {
    color: var(--color-primary);
    font-weight: 700;
}

/* ── FOUC prevention — hides content until Blazor interactive renders ── */
blazor-ssr-end ~ * {
    animation: none !important;
}

/* ── Smooth page transition to mask FOUC on navigation ── */
.content-area > *, .content-area-full > * {
    animation: pageIn 0.18s ease forwards;
}

@keyframes pageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ════════════════════════════════════════
   THEME SETTINGS PANEL — Premium Side Panel
   ════════════════════════════════════════ */

.tsm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1060;
}
.tsm-backdrop-in  { animation: tsmBackdropIn  0.3s ease forwards; }
.tsm-backdrop-out { animation: tsmBackdropOut 0.3s ease forwards; }
@keyframes tsmBackdropIn  { from { opacity:0; } to { opacity:1; } }
@keyframes tsmBackdropOut { from { opacity:1; } to { opacity:0; } }

.tsm-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 680px;
    max-width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 1070;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 48px rgba(0,0,0,0.18), -2px 0 12px rgba(0,0,0,0.08);
    transform: translateX(100%);
    transition: none;
    border-left: 1px solid #e2e8f0;
}
.tsm-panel-open {
    animation: tsmSlideIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.tsm-panel-closing {
    animation: tsmSlideOut 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes tsmSlideIn  { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes tsmSlideOut { from { transform: translateX(0); }    to { transform: translateX(100%); } }

/* Header */
.tsm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    flex-shrink: 0;
}
.tsm-header-left { display: flex; align-items: center; gap: 14px; }
.tsm-header-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
}
.tsm-header-title { font-size: 17px; font-weight: 800; color: white; letter-spacing: -0.01em; }
.tsm-header-sub   { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 1px; }
.tsm-close-btn {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.tsm-close-btn:hover { background: rgba(255,255,255,0.28); transform: scale(1.08); }

/* Tabs */
.tsm-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 12px 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    overflow-x: auto;
}
.tsm-tab {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tsm-tab:hover { color: #1e40af; background: rgba(37,99,235,0.06); }
.tsm-tab-active {
    color: #1e40af;
    background: #ffffff;
    border-bottom-color: #2563eb;
    font-weight: 700;
}

/* Body */
.tsm-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tsm-body::-webkit-scrollbar { width: 4px; }
.tsm-body::-webkit-scrollbar-track { background: transparent; }
.tsm-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* Section */
.tsm-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    transition: border-color 0.2s ease;
}
.tsm-section:hover { border-color: #cbd5e1; }
.tsm-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    margin-bottom: 8px;
}
.tsm-mini-label { font-size: 11px; color: #94a3b8; font-weight: 600; margin-bottom: 6px; }
.tsm-hint { font-size: 11px; color: #94a3b8; margin-top: 6px; }
.mt-3 { margin-top: 12px; }

/* Color row */
.tsm-color-row { display: flex; align-items: center; gap: 10px; }
.tsm-color-swatch {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.tsm-color-swatch:hover { border-color: #2563eb; transform: scale(1.05); }
.tsm-text-input {
    flex: 1;
    height: 40px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    font-family: 'Geist', monospace;
    color: #1e293b;
    background: white;
    transition: border-color 0.2s ease;
    outline: none;
}
.tsm-text-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.tsm-text-input.w-100 { width: 100%; }

/* Preview bar */
.tsm-preview-bar {
    height: 36px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid rgba(0,0,0,0.06);
    transition: background 0.3s ease;
}

/* Range */
.tsm-range {
    width: 100%;
    height: 4px;
    accent-color: #2563eb;
    cursor: pointer;
    margin: 4px 0;
}

/* Two col */
.tsm-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Toggle group */
.tsm-toggle-group {
    display: flex;
    gap: 6px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
}
.tsm-toggle-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tsm-toggle-btn.active {
    background: white;
    color: #1e40af;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Button preview */
.tsm-btn-preview {
    margin-top: 12px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Select */
.tsm-select {
    width: 100%;
    height: 40px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    color: #1e293b;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}
.tsm-select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Font preview */
.tsm-font-preview {
    margin-top: 12px;
    padding: 14px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    line-height: 1.5;
    transition: all 0.3s ease;
}

/* Presets grid */
.tsm-presets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.tsm-preset-card {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 0 0 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
    text-align: left;
    overflow: hidden;
}
.tsm-preset-card:hover { border-color: #2563eb; transform: translateY(-3px); box-shadow: 0 8px 24px rgba(37,99,235,0.15); }
.tsm-preset-swatch { height: 56px; width: 100%; margin-bottom: 12px; }
.tsm-preset-name { font-size: 13px; font-weight: 700; color: #0f172a; padding: 0 14px; }
.tsm-preset-desc { font-size: 11px; color: #94a3b8; padding: 2px 14px 0; }

.tsm-preset-blue  .tsm-preset-swatch { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.tsm-preset-green .tsm-preset-swatch { background: linear-gradient(135deg, #14532d, #22c55e); }
.tsm-preset-red   .tsm-preset-swatch { background: linear-gradient(135deg, #7f1d1d, #ef4444); }
.tsm-preset-dark  .tsm-preset-swatch { background: linear-gradient(180deg, #0f172a, #334155); }
.tsm-preset-purple .tsm-preset-swatch { background: linear-gradient(135deg, #4c1d95, #7c3aed); }
.tsm-preset-teal  .tsm-preset-swatch { background: linear-gradient(120deg, #134e4a, #0891b2); }

/* Footer */
.tsm-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}
.tsm-btn-cancel {
    flex: 1;
    height: 42px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tsm-btn-cancel:hover { border-color: #cbd5e1; background: #f1f5f9; }
.tsm-btn-save {
    flex: 2;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.tsm-btn-save:hover { background: linear-gradient(135deg, #1d4ed8, #2563eb); box-shadow: 0 4px 16px rgba(37,99,235,0.4); transform: translateY(-1px); }

@media print {
    .mobile-bottom-nav { display: none !important; }
    .mobile-header { display: none !important; }
    .top-navbar { display: none !important; }
    .sidebar-thin { display: none !important; }
    .snav { display: none !important; }
}
