/* ── 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: #0d9488;
    --color-secondary: #6b7280;
    --color-success: #0d9488;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-bg: #f6f5f1;
    --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(170deg,
        #060c18 0%,
        #091a18 20%,
        #0b2a26 40%,
        #0e3e38 60%,
        #0a5c52 80%,
        #0d9488 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: 12px;
}

html {
    font-family: var(--font-family, 'Geist', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: var(--font-size, 16px);
    font-weight: var(--font-weight, 500);
    line-height: 1.65;
    color: #1e293b;
    margin: 0;
    padding: 0;
}

html, body {
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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: #0f766e;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    box-shadow: 0 4px 8px rgba(13, 148, 136, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 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: 6px;
    border: 1.5px solid #e5e7eb;
    padding: 8px 12px;
}

    /* 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, #0d9488, #14b8a6);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(13,148,136,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(13,148,136,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, #0d9488, #14b8a6);
    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 glass nav link ── */
.top-nav-link {
    position: relative;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: white !important;
    margin: 0 2px;
    white-space: nowrap;
}

.top-nav-link:hover {
    background: rgba(255,255,255,0.25) !important;
    border-color: rgba(255,255,255,0.4) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.top-nav-link .bi-gear { font-size: 1.1rem !important; }

/* Settings gear button — deeper, bolder */
.nav-item:has(.bi-gear) .top-nav-link {
    background: rgba(255,255,255,0.2) !important;
    border-color: rgba(255,255,255,0.3) !important;
    padding: 6px 12px !important;
    min-width: 38px;
    justify-content: center;
    margin-right: 15px !important;
}
.nav-item:has(.bi-gear) .top-nav-link:hover {
    background: rgba(255,255,255,0.3) !important;
    border-color: rgba(255,255,255,0.5) !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.8em;
    opacity: 0.7;
    margin-left: 4px;
    font-weight: 900;
}

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

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

.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(-6px); }
    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(-6px); }
}

.dropdown-inner {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0,0,0,.18), 0 6px 20px rgba(13,148,136,.12), 0 0 0 1px rgba(229,229,235,.6);
    overflow: hidden;
    padding: 6px;
}

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

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

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

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

.top-dropdown-item:hover {
    background: linear-gradient(135deg, #0a5c52, #0d9488, #14b8a6);
    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: 4px 10px;
}

.item-icon {
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.03);
    border-radius: 8px;
    flex-shrink: 0;
    transition: all .15s ease;
}

.item-text { display: flex; flex-direction: column; gap: 1px; }
.item-title { font-size: 12px; font-weight: 700; color: #1e293b; transition: color .15s ease; }
.item-desc { font-size: 10px; color: #64748b; transition: color .15s ease; }

/* ── Navbar active tab ── */
.top-nav-active {
    background: rgba(255,255,255,0.3) !important;
    border-color: rgba(255,255,255,0.5) !important;
    color: white !important;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.top-nav-active:hover {
    background: rgba(255,255,255,0.4) !important;
    border-color: rgba(255,255,255,0.6) !important;
    color: white !important;
}

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

/* JS-opened navbar tab (client-side toggle) — mirrors .top-nav-active */
.top-nav-open {
    background: rgba(255,255,255,0.3) !important;
    border-color: rgba(255,255,255,0.5) !important;
    color: white !important;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.top-nav-open:hover {
    background: rgba(255,255,255,0.4) !important;
    border-color: rgba(255,255,255,0.6) !important;
    color: white !important;
}
.top-nav-open::after {
    display: none !important;
}

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

.snav::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(13,148,136,0.03) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.snav-toggle, .snav-item {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3), 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, #14b8a6 0%, #0d9488 100%) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4), inset 0 1px 0 rgba(255,255,255,.15) !important;
    transform: translateX(6px) scale(1.02) !important;
    color: white !important;
}

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

.snav-collapsed .snav-item, 
.snav-collapsed .snav-toggle {
    margin: 6px auto !important;
    padding: 0 !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 12px !important;
    transform: none !important;
}

.snav-collapsed .snav-item:hover, 
.snav-collapsed .snav-toggle:hover {
    transform: scale(1.1) !important;
    margin: 6px auto !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4) !important;
}

.snav-collapsed .snav-icon {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
}

.snav-active {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%) !important;
    backdrop-filter: none !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 6px 20px rgba(15, 118, 110, 0.45), 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(15, 118, 110, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.snav-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0;
    animation: snavSubIn .2s ease-out;
}

@keyframes snavSubIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.snav-sub-item, a.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(3px) !important;
    -webkit-backdrop-filter: blur(3px) !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;
    text-decoration: none !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(13,148,136,.45) 0%, rgba(20,184,166,.3) 100%) !important;
    color: white !important;
    transform: translateX(6px) scale(1.02) !important;
    border-color: rgba(13,148,136,.5) !important;
    border-left: 4px solid #14b8a6 !important;
    box-shadow: 0 6px 20px rgba(13,148,136,.35), inset 0 1px 0 rgba(255,255,255,.15) !important;
}

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

.snav-divider {
    height: 1px;
    margin: 8px 12px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), rgba(13,148,136,0.2), rgba(255,255,255,0.12), transparent);
    flex-shrink: 0;
}

.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: #f3f4f6;
    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, #0d3d38 0%, #0d9488 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: #0d9488; background: rgba(13,148,136,0.06); }
.tsm-tab-active {
    color: #0d9488;
    background: #ffffff;
    border-bottom-color: #0d9488;
    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: #0d9488; 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: #0d9488; box-shadow: 0 0 0 3px rgba(13,148,136,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: #0d9488;
    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: #0d9488;
    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: #0d9488; box-shadow: 0 0 0 3px rgba(13,148,136,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: #0d9488; transform: translateY(-3px); box-shadow: 0 8px 24px rgba(13,148,136,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, #0d3d38, #0d9488);
    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(13,148,136,0.3);
}
.tsm-btn-save:hover { background: linear-gradient(135deg, #0f766e, #0d9488); box-shadow: 0 4px 16px rgba(13,148,136,0.4); transform: translateY(-1px); }

/* ── Category Sidebar Dropdown ── */
.cat-dropdown-list { position:absolute; top:calc(100% + 4px); left:0; right:0; background:#ffffff; border-radius:12px; box-shadow:0 8px 28px rgba(0,0,0,.1); border:1px solid #e8edf2; z-index:500; max-height:200px; overflow-y:auto; padding:4px; isolation:isolate; backdrop-filter:blur(0px); -webkit-backdrop-filter:blur(0px); }
.cat-dropdown-item { padding:6px 10px; border-radius:6px; font-size:13px; font-weight:700; color:#475569; cursor:pointer; transition:all 0.15s ease; display:flex; align-items:center; font-family:'Outfit',sans-serif; letter-spacing:-.01em; background:#fff; }
.cat-dropdown-item i { color:#94a3b8; }
.cat-dropdown-item:hover { background:#f0fdfa; color:#0d9488; }
.cat-dropdown-item:hover i { color:#0d9488; }
.cat-dropdown-highlighted { background:#f0fdfa !important; color:#0d9488 !important; font-weight:800; }

@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; }
}

/* ── Quill editor: prevent horizontal overflow globally ── */
.ql-container { max-width:100% !important; width:100% !important; overflow:hidden !important; display:block !important; box-sizing:border-box !important; }
.ql-editor { white-space:pre-wrap !important; word-wrap:break-word !important; overflow-wrap:break-word !important; overflow-x:hidden !important; max-width:100% !important; width:100% !important; display:block !important; box-sizing:border-box !important; }
.ql-editor p { white-space:pre-wrap !important; word-wrap:break-word !important; overflow-wrap:break-word !important; overflow-x:hidden !important; max-width:100% !important; box-sizing:border-box !important; }
