@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

[v-cloak] {
    display: none !important;
}

:root {
    --font-sans: 'Prompt', 'Noto Sans Thai', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Leelawadee UI', 'Tahoma', sans-serif;

    /* Authentic Pastel Blue Theme Colors */
    --primary: #0284c7;
    --primary-pastel: #e0f2fe;
    --primary-pastel-deep: #bae6fd;
    --primary-subtle: #f0f9ff;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --primary-glow: rgba(56, 189, 248, 0.25);

    --accent-emerald: #10b981;
    --accent-emerald-pastel: #d1fae5;
    --accent-rose: #f43f5e;
    --accent-rose-pastel: #ffe4e6;
    --accent-amber: #f59e0b;
    --accent-amber-pastel: #fef3c7;
    --accent-indigo: #6366f1;
    --accent-indigo-pastel: #e0e7ff;
    --accent-violet: #8b5cf6;

    /* Theme Tokens - Light (Soft Serene Pastel Sky) */
    --bg-base: #f0f6fc;
    --bg-card: #ffffff;
    --bg-sidebar: #f8fbfe;
    --bg-input: #f4f9fd;
    --border: #dbeafe;
    --border-subtle: #edf5fd;
    --text-heading: #082f49;
    --text-body: #1e3a5f;
    --text-muted: #527599;
    --text-light: #88a7c7;

    --shadow-sm: 0 1px 3px 0 rgba(2, 132, 199, 0.05);
    --shadow-md: 0 4px 16px -2px rgba(2, 132, 199, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 12px 28px -4px rgba(2, 132, 199, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 24px 48px -12px rgba(2, 132, 199, 0.16);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

[data-theme="dark"] {
    --bg-base: #060e1a;
    --bg-card: #0c1a2d;
    --bg-sidebar: #0a1526;
    --bg-input: #12253f;
    --border: #1a365d;
    --border-subtle: #0f243e;
    --text-heading: #f0f8ff;
    --text-body: #c8def4;
    --text-muted: #7ca1c7;
    --text-light: #527599;
    --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body,
button,
input,
select,
textarea,
optgroup {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background-color: var(--bg-base);
    color: var(--text-body);
    min-height: 100vh;
    line-height: 1.5;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Pastel Sky */
.app-sidebar {
    width: 255px;
    background: var(--bg-sidebar);
    color: var(--text-body);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 16px -4px rgba(2, 132, 199, 0.05);
}

.sidebar-brand {
    padding: 24px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(224, 242, 254, 0.4) 0%, transparent 100%);
}

.brand-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
    gap: 1.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.brand-icon-svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.brand-icon-label {
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #e0f2fe;
    line-height: 1;
    font-family: var(--font-sans);
}

.brand-text h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: normal;
}

.brand-text p {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 20px 14px;
    flex: 1;
    overflow-y: auto;
}

.nav-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    padding: 8px 12px;
    margin-top: 14px;
    opacity: 0.85;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    color: var(--text-body);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-item:hover {
    color: var(--primary);
    background: var(--primary-pastel);
    transform: translateX(3px);
}

.nav-link-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
    font-weight: 600;
}

.nav-link-item svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.sidebar-profile {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--primary-subtle);
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25);
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.95);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.profile-avatar:hover img {
    transform: scale(1.05);
}

.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ffffff;
}

.profile-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-details .name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    line-height: 1.35;
    margin-bottom: 3px;
}

.profile-details .role {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    line-height: 1.2;
}

.profile-role-badge {
    padding: 1.5px 6.5px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.profile-role-badge.superadmin {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.profile-role-badge.counter {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.profile-role-badge.staff {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.profile-role-badge.student {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.profile-id-chip {
    background: rgba(100, 116, 139, 0.08);
    color: #475569;
    padding: 1.5px 6.5px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.25);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Main Content Wrapper */
.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    padding-bottom: 80px;
}

/* Modern Topbar */
.modern-topbar {
    height: 72px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
}

.topbar-left h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: normal;
}

.topbar-left p {
    font-size: 12px;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-danger {
    background: #f43f5e;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-body);
}

.btn-outline:hover {
    background: var(--bg-input);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Page Body */
.page-body {
    padding: 16px 20px;
    flex: 1;
}

/* Compact User & Quota Bar */
.user-hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px -2px rgba(2, 132, 199, 0.06);
}

.user-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guest-identity {
    transition: transform 0.15s ease, background 0.15s ease;
}

.guest-identity:hover {
    background: rgba(2, 132, 199, 0.05);
}

.guest-identity:hover .user-avatar-mini {
    transform: scale(1.05);
}

.user-avatar-mini {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 3px 8px rgba(56, 189, 248, 0.3);
    flex-shrink: 0;
}

.user-online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid var(--bg-card);
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

.user-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: normal;
}

.user-id-badge {
    font-size: 11px;
    font-weight: 700;
    background: var(--primary-pastel);
    color: var(--primary);
    padding: 1px 7px;
    border-radius: 6px;
    border: 1px solid var(--primary-pastel-deep);
}

.user-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 11.5px;
}

.status-chip.success {
    color: #15803d;
    background: #dcfce7;
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.user-role-text {
    color: var(--text-muted);
    font-size: 11.5px;
}

/* Compact Date Picker Widget */
.date-picker-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.date-picker-compact:hover,
.date-picker-compact:focus-within {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.date-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.date-picker-inner {
    display: flex;
    flex-direction: column;
}

.date-picker-label {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 2px;
}

.date-input-clean {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-heading);
    outline: none;
    padding: 0;
    cursor: pointer;
}

/* Compact Quota Meter */
.quota-meter-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.45) 0%, rgba(240, 249, 255, 0.7) 100%);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    min-width: 210px;
}

.quota-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-pastel);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quota-info {
    flex: 1;
    min-width: 140px;
}

.quota-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
    color: var(--text-heading);
}

.quota-main-text {
    font-weight: 500;
}

.quota-main-text strong {
    color: var(--primary);
    font-weight: 800;
    font-size: 13px;
}

.quota-selection-badge {
    font-size: 10.5px;
    font-weight: 700;
    color: #e11d48;
    background: #ffe4e6;
    padding: 1px 6px;
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

.quota-progress-track {
    height: 5px;
    background: rgba(2, 132, 199, 0.15);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 5px;
    width: 100%;
}

.quota-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #0284c7);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Alert Banner */
.modern-alert {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

/* Category Filter Tabs */
.category-tab-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* ==========================================================================
   CATEGORY TAB DESIGN SYSTEM (5 DISTINCT COLORFUL STYLES)
   ========================================================================== */

/* Style Selector Bar */
.cat-tab-style-selector-container {
    background: rgba(2, 132, 199, 0.04);
    border: 1px dashed rgba(2, 132, 199, 0.25);
    border-radius: var(--radius-md, 12px);
    padding: 8px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.cat-tab-style-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}
.cat-tab-style-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.style-chip-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.style-chip-btn .style-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-heading);
    font-size: 10px;
    font-weight: 800;
}
.style-chip-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}
.style-chip-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}
.style-chip-btn.active .style-num {
    background: #ffffff;
    color: var(--primary);
}

/* Base Category Tab Button Elements */
.cat-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
    font-size: 13.5px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 9999px;
}
.cat-tab-btn .cat-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cat-tab-btn .cat-color-badge {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.2s ease;
}
.cat-tab-btn .cat-avatar-circle {
    display: none;
}
.cat-tab-btn .cat-count-badge {
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

/* ==========================================================================
   STYLE 1: Soft Pastel Tint & Vibrant Border (Modern Fintech / Linear Pill)
   ========================================================================== */
.category-tab-bar.tab-style-1 .cat-tab-btn,
.category-tab-bar.tab-style1 .cat-tab-btn {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.12);
    border: 1.5px solid rgba(var(--cat-color-rgb, 59, 130, 246), 0.4);
    color: var(--cat-color, #2563eb);
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(var(--cat-color-rgb, 59, 130, 246), 0.08);
}
.category-tab-bar.tab-style-1 .cat-tab-btn .cat-color-badge,
.category-tab-bar.tab-style1 .cat-tab-btn .cat-color-badge {
    background: var(--cat-color);
    box-shadow: 0 0 10px var(--cat-color);
    width: 10px;
    height: 10px;
}
.category-tab-bar.tab-style-1 .cat-tab-btn .cat-count-badge,
.category-tab-bar.tab-style1 .cat-tab-btn .cat-count-badge {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.2);
    color: var(--cat-color);
    font-weight: 700;
}
.category-tab-bar.tab-style-1 .cat-tab-btn:hover,
.category-tab-bar.tab-style1 .cat-tab-btn:hover {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.22);
    border-color: var(--cat-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--cat-color-rgb, 59, 130, 246), 0.25);
}
.category-tab-bar.tab-style-1 .cat-tab-btn.active,
.category-tab-bar.tab-style1 .cat-tab-btn.active {
    background: var(--cat-color) !important;
    color: #ffffff !important;
    border-color: var(--cat-color) !important;
    box-shadow: 0 6px 20px rgba(var(--cat-color-rgb, 59, 130, 246), 0.5);
    transform: translateY(-2px);
}
.category-tab-bar.tab-style-1 .cat-tab-btn.active .cat-color-badge,
.category-tab-bar.tab-style1 .cat-tab-btn.active .cat-color-badge {
    background: #ffffff !important;
    box-shadow: 0 0 10px #ffffff;
}
.category-tab-bar.tab-style-1 .cat-tab-btn.active .cat-count-badge,
.category-tab-bar.tab-style1 .cat-tab-btn.active .cat-count-badge {
    background: rgba(255, 255, 255, 0.32);
    color: #ffffff;
}

/* ==========================================================================
   STYLE 2: Vibrant Glowing Gradient Cards (Luxury Glassmorphism & Neon Aura)
   ========================================================================== */
.category-tab-bar.tab-style-2 .cat-tab-btn,
.category-tab-bar.tab-style2 .cat-tab-btn {
    background: var(--bg-card);
    border: 1.5px solid rgba(var(--cat-color-rgb, 59, 130, 246), 0.3);
    border-top: 4.5px solid var(--cat-color);
    color: var(--cat-color);
    padding: 10px 18px 8px 18px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(var(--cat-color-rgb, 59, 130, 246), 0.1);
}
.category-tab-bar.tab-style-2 .cat-tab-btn .cat-color-badge,
.category-tab-bar.tab-style2 .cat-tab-btn .cat-color-badge {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--cat-color);
    box-shadow: 0 0 8px var(--cat-color);
}
.category-tab-bar.tab-style-2 .cat-tab-btn .cat-count-badge,
.category-tab-bar.tab-style2 .cat-tab-btn .cat-count-badge {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.16);
    color: var(--cat-color);
    font-weight: 700;
}
.category-tab-bar.tab-style-2 .cat-tab-btn:hover,
.category-tab-bar.tab-style2 .cat-tab-btn:hover {
    border-color: var(--cat-color);
    box-shadow: 0 8px 20px rgba(var(--cat-color-rgb, 59, 130, 246), 0.3);
    transform: translateY(-2px);
}
.category-tab-bar.tab-style-2 .cat-tab-btn.active,
.category-tab-bar.tab-style2 .cat-tab-btn.active {
    background: linear-gradient(135deg, var(--cat-color) 0%, rgba(var(--cat-color-rgb, 59, 130, 246), 0.88) 100%) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    border-top: 4.5px solid #ffffff !important;
    box-shadow: 0 6px 22px rgba(var(--cat-color-rgb, 59, 130, 246), 0.52), inset 0 1px 3px rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-1px);
}
.category-tab-bar.tab-style-2 .cat-tab-btn.active .cat-color-badge,
.category-tab-bar.tab-style2 .cat-tab-btn.active .cat-color-badge {
    background: #ffffff !important;
    box-shadow: 0 0 8px #ffffff;
}
.category-tab-bar.tab-style-2 .cat-tab-btn.active .cat-count-badge,
.category-tab-bar.tab-style2 .cat-tab-btn.active .cat-count-badge {
    background: rgba(0, 0, 0, 0.25);
    color: #ffffff;
}

/* ==========================================================================
   STYLE 3: Left Accent Strip & Category Tag (Notion / Slack Pro Style)
   ========================================================================== */
.category-tab-bar.tab-style-3 .cat-tab-btn,
.category-tab-bar.tab-style3 .cat-tab-btn {
    background: var(--bg-card);
    border: 1px solid rgba(var(--cat-color-rgb, 59, 130, 246), 0.35);
    border-left: 6px solid var(--cat-color);
    color: var(--cat-color);
    font-weight: 700;
    padding: 9px 18px 9px 14px;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.category-tab-bar.tab-style-3 .cat-tab-btn .cat-color-badge,
.category-tab-bar.tab-style3 .cat-tab-btn .cat-color-badge {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--cat-color);
}
.category-tab-bar.tab-style-3 .cat-tab-btn .cat-count-badge,
.category-tab-bar.tab-style3 .cat-tab-btn .cat-count-badge {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.16);
    color: var(--cat-color);
    font-weight: 700;
}
.category-tab-bar.tab-style-3 .cat-tab-btn:hover,
.category-tab-bar.tab-style3 .cat-tab-btn:hover {
    border-color: var(--cat-color);
    border-left-width: 8px;
    transform: translateX(2px);
    box-shadow: 0 4px 14px rgba(var(--cat-color-rgb, 59, 130, 246), 0.2);
}
.category-tab-bar.tab-style-3 .cat-tab-btn.active,
.category-tab-bar.tab-style3 .cat-tab-btn.active {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.14) !important;
    border: 1.5px solid var(--cat-color) !important;
    border-left: 7px solid var(--cat-color) !important;
    color: var(--cat-color) !important;
    box-shadow: 0 4px 16px rgba(var(--cat-color-rgb, 59, 130, 246), 0.3);
}
.category-tab-bar.tab-style-3 .cat-tab-btn.active .cat-color-badge,
.category-tab-bar.tab-style3 .cat-tab-btn.active .cat-color-badge {
    background: var(--cat-color);
    box-shadow: 0 0 8px var(--cat-color);
}
.category-tab-bar.tab-style-3 .cat-tab-btn.active .cat-count-badge,
.category-tab-bar.tab-style3 .cat-tab-btn.active .cat-count-badge {
    background: var(--cat-color);
    color: #ffffff;
}

/* ==========================================================================
   STYLE 4: Bold Solid Color Block (High-Contrast Bold Dashboard Badges)
   ========================================================================== */
.category-tab-bar.tab-style-4 .cat-tab-btn,
.category-tab-bar.tab-style4 .cat-tab-btn {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.08);
    border: 2px solid var(--cat-color);
    color: var(--cat-color);
    font-weight: 800;
    padding: 8px 18px;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(var(--cat-color-rgb, 59, 130, 246), 0.12);
}
.category-tab-bar.tab-style-4 .cat-tab-btn .cat-color-badge,
.category-tab-bar.tab-style4 .cat-tab-btn .cat-color-badge {
    width: 9px;
    height: 9px;
    background: var(--cat-color);
}
.category-tab-bar.tab-style-4 .cat-tab-btn .cat-count-badge,
.category-tab-bar.tab-style4 .cat-tab-btn .cat-count-badge {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.2);
    color: var(--cat-color);
    font-weight: 800;
}
.category-tab-bar.tab-style-4 .cat-tab-btn:hover,
.category-tab-bar.tab-style4 .cat-tab-btn:hover {
    background: var(--cat-color);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(var(--cat-color-rgb, 59, 130, 246), 0.4);
    transform: translateY(-2px);
}
.category-tab-bar.tab-style-4 .cat-tab-btn:hover .cat-color-badge,
.category-tab-bar.tab-style4 .cat-tab-btn:hover .cat-color-badge {
    background: #ffffff;
}
.category-tab-bar.tab-style-4 .cat-tab-btn:hover .cat-count-badge,
.category-tab-bar.tab-style4 .cat-tab-btn:hover .cat-count-badge {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}
.category-tab-bar.tab-style-4 .cat-tab-btn.active,
.category-tab-bar.tab-style4 .cat-tab-btn.active {
    background: var(--cat-color) !important;
    color: #ffffff !important;
    border-color: var(--cat-color) !important;
    box-shadow: 0 6px 22px rgba(var(--cat-color-rgb, 59, 130, 246), 0.55);
    transform: translateY(-2px);
}
.category-tab-bar.tab-style-4 .cat-tab-btn.active .cat-color-badge,
.category-tab-bar.tab-style4 .cat-tab-btn.active .cat-color-badge {
    background: #ffffff !important;
    box-shadow: 0 0 10px #ffffff;
}
.category-tab-bar.tab-style-4 .cat-tab-btn.active .cat-count-badge,
.category-tab-bar.tab-style4 .cat-tab-btn.active .cat-count-badge {
    background: rgba(255, 255, 255, 0.32);
    color: #ffffff;
}

/* ==========================================================================
   STYLE 5: Modern Icon Avatar Bubble (Material 3 Expressive / Apple Floating Chip)
   ========================================================================== */
.category-tab-bar.tab-style-5 .cat-tab-btn,
.category-tab-bar.tab-style5 .cat-tab-btn {
    background: var(--bg-card);
    border: 1.5px solid rgba(var(--cat-color-rgb, 59, 130, 246), 0.35);
    color: var(--cat-color);
    padding: 6px 18px 6px 7px;
    border-radius: 9999px;
    box-shadow: 0 2px 10px rgba(var(--cat-color-rgb, 59, 130, 246), 0.1);
    gap: 10px;
    font-weight: 700;
}
.category-tab-bar.tab-style-5 .cat-tab-btn .cat-color-badge,
.category-tab-bar.tab-style5 .cat-tab-btn .cat-color-badge {
    display: none;
}
.category-tab-bar.tab-style-5 .cat-tab-btn .cat-avatar-circle,
.category-tab-bar.tab-style5 .cat-tab-btn .cat-avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cat-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(var(--cat-color-rgb, 59, 130, 246), 0.35);
    transition: all 0.2s ease;
}
.category-tab-bar.tab-style-5 .cat-tab-btn .cat-count-badge,
.category-tab-bar.tab-style5 .cat-tab-btn .cat-count-badge {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.15);
    color: var(--cat-color);
    font-weight: 700;
}
.category-tab-bar.tab-style-5 .cat-tab-btn:hover,
.category-tab-bar.tab-style5 .cat-tab-btn:hover {
    border-color: var(--cat-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--cat-color-rgb, 59, 130, 246), 0.25);
}
.category-tab-bar.tab-style-5 .cat-tab-btn:hover .cat-avatar-circle,
.category-tab-bar.tab-style5 .cat-tab-btn:hover .cat-avatar-circle {
    transform: scale(1.08);
}
.category-tab-bar.tab-style-5 .cat-tab-btn.active,
.category-tab-bar.tab-style5 .cat-tab-btn.active {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.14) !important;
    border-color: var(--cat-color) !important;
    color: var(--cat-color) !important;
    box-shadow: 0 4px 18px rgba(var(--cat-color-rgb, 59, 130, 246), 0.35);
    transform: translateY(-2px);
}
.category-tab-bar.tab-style-5 .cat-tab-btn.active .cat-avatar-circle,
.category-tab-bar.tab-style5 .cat-tab-btn.active .cat-avatar-circle {
    background: var(--cat-color);
    color: #ffffff;
    box-shadow: 0 0 12px var(--cat-color);
}
.category-tab-bar.tab-style-5 .cat-tab-btn.active .cat-count-badge,
.category-tab-bar.tab-style5 .cat-tab-btn.active .cat-count-badge {
    background: var(--cat-color);
    color: #ffffff;
}

/* ==========================================================================
   STYLE 6: HYBRID SIGNATURE (Styles 2 + 5 Combined: Gradient Glass & Icon Avatar)
   ========================================================================== */
.category-tab-bar.tab-style-6 .cat-tab-btn,
.category-tab-bar.tab-style6 .cat-tab-btn,
.category-tab-bar.tab-style-combo .cat-tab-btn,
.category-tab-bar.tab-stylecombo .cat-tab-btn {
    background: var(--bg-card);
    border: 1.5px solid rgba(var(--cat-color-rgb, 59, 130, 246), 0.28);
    border-top: 4.5px solid var(--cat-color);
    color: var(--text-heading);
    padding: 8px 18px 8px 10px;
    border-radius: 13px;
    box-shadow: 0 3px 12px rgba(var(--cat-color-rgb, 59, 130, 246), 0.08);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}
.category-tab-bar.tab-style-6 .cat-tab-btn .cat-color-badge,
.category-tab-bar.tab-style6 .cat-tab-btn .cat-color-badge,
.category-tab-bar.tab-style-combo .cat-tab-btn .cat-color-badge,
.category-tab-bar.tab-stylecombo .cat-tab-btn .cat-color-badge {
    display: none;
}
.category-tab-bar.tab-style-6 .cat-tab-btn .cat-avatar-circle,
.category-tab-bar.tab-style6 .cat-tab-btn .cat-avatar-circle,
.category-tab-bar.tab-style-combo .cat-tab-btn .cat-avatar-circle,
.category-tab-bar.tab-stylecombo .cat-tab-btn .cat-avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cat-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(var(--cat-color-rgb, 59, 130, 246), 0.35);
    transition: all 0.25s ease;
}
.category-tab-bar.tab-style-6 .cat-tab-btn .cat-count-badge,
.category-tab-bar.tab-style6 .cat-tab-btn .cat-count-badge,
.category-tab-bar.tab-style-combo .cat-tab-btn .cat-count-badge,
.category-tab-bar.tab-stylecombo .cat-tab-btn .cat-count-badge {
    background: rgba(var(--cat-color-rgb, 59, 130, 246), 0.16);
    color: var(--cat-color);
    font-weight: 700;
}
.category-tab-bar.tab-style-6 .cat-tab-btn:hover,
.category-tab-bar.tab-style6 .cat-tab-btn:hover,
.category-tab-bar.tab-style-combo .cat-tab-btn:hover,
.category-tab-bar.tab-stylecombo .cat-tab-btn:hover {
    border-color: var(--cat-color);
    box-shadow: 0 8px 22px rgba(var(--cat-color-rgb, 59, 130, 246), 0.32);
    transform: translateY(-2px);
}
.category-tab-bar.tab-style-6 .cat-tab-btn:hover .cat-avatar-circle,
.category-tab-bar.tab-style6 .cat-tab-btn:hover .cat-avatar-circle,
.category-tab-bar.tab-style-combo .cat-tab-btn:hover .cat-avatar-circle,
.category-tab-bar.tab-stylecombo .cat-tab-btn:hover .cat-avatar-circle {
    transform: scale(1.1);
}
.category-tab-bar.tab-style-6 .cat-tab-btn.active,
.category-tab-bar.tab-style6 .cat-tab-btn.active,
.category-tab-bar.tab-style-combo .cat-tab-btn.active,
.category-tab-bar.tab-stylecombo .cat-tab-btn.active {
    background: linear-gradient(135deg, var(--cat-color) 0%, rgba(var(--cat-color-rgb, 59, 130, 246), 0.88) 100%) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    border-top: 4.5px solid #ffffff !important;
    box-shadow: 0 6px 22px rgba(var(--cat-color-rgb, 59, 130, 246), 0.52), inset 0 1px 3px rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-1px);
}
.category-tab-bar.tab-style-6 .cat-tab-btn.active .cat-avatar-circle,
.category-tab-bar.tab-style6 .cat-tab-btn.active .cat-avatar-circle,
.category-tab-bar.tab-style-combo .cat-tab-btn.active .cat-avatar-circle,
.category-tab-bar.tab-stylecombo .cat-tab-btn.active .cat-avatar-circle {
    background: #ffffff;
    color: var(--cat-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.category-tab-bar.tab-style-6 .cat-tab-btn.active .cat-count-badge,
.category-tab-bar.tab-style6 .cat-tab-btn.active .cat-count-badge,
.category-tab-bar.tab-style-combo .cat-tab-btn.active .cat-count-badge,
.category-tab-bar.tab-stylecombo .cat-tab-btn.active .cat-count-badge {
    background: rgba(0, 0, 0, 0.25);
    color: #ffffff;
}

/* Sub-group Filter Chips */
.subgroup-filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: -10px;
    margin-bottom: 18px;
    padding: 8px 12px;
    background: rgba(2, 132, 199, 0.04);
    border: 1px solid rgba(2, 132, 199, 0.15);
    border-radius: var(--radius-lg);
}

.subgroup-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}

.subgroup-chip-btn {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.subgroup-chip-btn:hover {
    border-color: var(--primary);
    color: var(--text-heading);
}

.subgroup-chip-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

/* Sub Tab Bar for My Bookings */
.sub-tab-bar {
    display: flex;
    gap: 8px;
    background: var(--bg-input);
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    width: fit-content;
}

.sub-tab-btn {
    padding: 8px 18px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.sub-tab-btn:hover {
    color: var(--text-heading);
}

.sub-tab-btn.active {
    background: var(--bg-card);
    color: #0284c7;
    box-shadow: var(--shadow-sm);
}

.sub-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 11.5px;
    font-weight: 800;
    border-radius: var(--radius-full);
    background: #e0f2fe;
    color: #0369a1;
}

.sub-tab-btn.active .sub-tab-badge {
    background: #0284c7;
    color: #fff;
}


/* MODERN MATRIX SCHEDULE GRID */
.matrix-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: visible;
    margin-bottom: 28px;
    position: relative;
}

.matrix-header-bar {
    padding: 14px 22px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 50;
}

.matrix-title-group h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.4;
}

.matrix-title-subtype {
    font-size: 13.5px;
    color: var(--primary);
    font-weight: 600;
}

.matrix-title-date {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.matrix-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.matrix-refresh-btn {
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    border-radius: 9999px !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
    transition: all 0.18s ease !important;
    cursor: pointer;
}

.matrix-refresh-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
}

.matrix-scroll-wrapper {
    overflow-x: auto;
    scrollbar-width: thin;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.matrix-scroll-wrapper::-webkit-scrollbar {
    height: 6px;
}

.matrix-scroll-wrapper::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 4px;
}

.matrix-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.matrix-modern-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 11.5px;
    text-align: center;
}

.matrix-modern-table th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 700;
    padding: 8px 3px;
    font-size: 10.5px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    white-space: nowrap;
    text-align: center;
    min-width: 50px;
    letter-spacing: normal;
}

.matrix-modern-table td {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 3px 2px;
    min-width: 50px;
    height: 54px;
    vertical-align: middle;
}

.room-col-header {
    background: var(--bg-card) !important;
    position: sticky;
    left: 0;
    z-index: 10;
    text-align: left;
    padding: 6px 10px !important;
    width: 130px;
    min-width: 110px;
    max-width: 145px;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.03);
}

.room-col-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.35;
    word-break: break-word;
}

.room-col-key {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
}

/* Modern Matrix Cell States */
.grid-slot-btn {
    width: 100%;
    height: 100%;
    min-height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    padding: 3px 1px;
    user-select: none;
    text-align: center;
    box-sizing: border-box;
}

/* 3-Line Content Hierarchy */
.slot-line-status {
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1px;
    white-space: nowrap;
    letter-spacing: normal;
}

.slot-line-id {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: normal;
    line-height: 1.15;
    margin-bottom: 1px;
    white-space: nowrap;
}

.slot-line-time {
    font-size: 8px;
    font-weight: 500;
    opacity: 0.8;
    line-height: 1.1;
    white-space: nowrap;
    letter-spacing: normal;
}

/* 1. Available (Fresh Pastel Mint) */
.grid-slot-btn.available {
    background: #ecfdf5;
    border: 1.5px solid #a7f3d0;
    color: #047857;
}

.grid-slot-btn.available:hover {
    background: #d1fae5;
    border-color: #34d399;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.22);
}

.grid-slot-btn.available .slot-line-status {
    color: #047857;
    font-weight: 700;
}

.grid-slot-btn.available .slot-line-id {
    color: #059669;
}

.grid-slot-btn.available .slot-line-time {
    color: #10b981;
    opacity: 0.9;
}

/* 1.1 Locked for Unauthenticated Users (ต้องเข้าสู่ระบบก่อน) */
.grid-slot-btn.locked-unauth {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grid-slot-btn.locked-unauth:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
    transform: none;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.grid-slot-btn.locked-unauth .slot-line-status {
    color: #64748b;
}

.grid-slot-btn.locked-unauth:hover .slot-line-status {
    color: #b45309;
    font-weight: 800;
}

.grid-slot-btn.locked-unauth .slot-line-id {
    color: #94a3b8;
    font-size: 9px;
    font-weight: 700;
}

.grid-slot-btn.locked-unauth:hover .slot-line-id {
    color: #d97706;
}

.grid-slot-btn.locked-unauth .slot-line-time {
    color: #64748b;
}

/* ★ 2. DIRECT CLICKED / SELECTED STATE (เลือกแล้ว) ★ */
.grid-slot-btn.selected-slot {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border: 2px solid #93c5fd !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
    transform: scale(0.96) !important;
    animation: pulseSelect 1.5s infinite;
}

@keyframes pulseSelect {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.grid-slot-btn.selected-slot .slot-line-status,
.grid-slot-btn.selected-slot .slot-line-id,
.grid-slot-btn.selected-slot .slot-line-time {
    color: #ffffff !important;
    font-weight: 800;
}

/* 3. In-Use / Occupied (Warm Pastel Coral / Strawberry Rose) */
.grid-slot-btn.in-use {
    background: #ffe4e6;
    border: 1.5px solid #fda4af;
    color: #be123c;
    cursor: not-allowed;
}

.grid-slot-btn.in-use .slot-line-status {
    color: #be123c;
    font-weight: 800;
}

.grid-slot-btn.in-use .slot-line-id {
    color: #9f1239;
    font-weight: 800;
}

.grid-slot-btn.in-use .slot-line-time {
    color: #e11d48;
}

/* 3.1 Overdue / Late Returning Key (Bold Crimson-Red with pulse highlight) */
.grid-slot-btn.in-use-overdue {
    background: #fff1f2 !important;
    border: 2px solid #e11d48 !important;
    color: #9f1239 !important;
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.25) !important;
    animation: overduePulse 1.8s infinite;
}

@keyframes overduePulse {
    0% { border-color: #e11d48; box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
    70% { border-color: #f43f5e; box-shadow: 0 0 0 5px rgba(225, 29, 72, 0); }
    100% { border-color: #e11d48; box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

.grid-slot-btn.in-use-overdue .slot-line-status {
    color: #be123c !important;
    font-weight: 800;
}

.grid-slot-btn.in-use-overdue .slot-line-id {
    color: #881337 !important;
    font-weight: 900;
}

.grid-slot-btn.in-use-overdue .slot-line-time {
    color: #e11d48 !important;
}

.grid-slot-btn.in-use-overdue.staff-actionable:hover {
    background: #ffe4e6 !important;
    border-color: #be123c !important;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35) !important;
}

/* 4. Reserved / Pending Checkin (Soft Pastel Lilac / Violet) */
.grid-slot-btn.reserved {
    background: #f5f3ff;
    border: 1.5px solid #c4b5fd;
    color: #6d28d9;
    cursor: not-allowed;
}

.grid-slot-btn.reserved .slot-line-status {
    color: #6d28d9;
    font-weight: 800;
}

.grid-slot-btn.reserved .slot-line-id {
    color: #7c3aed;
    font-weight: 800;
}

.grid-slot-btn.reserved .slot-line-time {
    color: #8b5cf6;
}

/* Staff Actionable Slots */
.grid-slot-btn.staff-actionable {
    cursor: pointer !important;
    position: relative;
    transition: all 0.18s ease;
}

.grid-slot-btn.staff-actionable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.grid-slot-btn.in-use.staff-actionable:hover {
    background: #fecdd3;
    border-color: #f43f5e;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

.grid-slot-btn.reserved.staff-actionable:hover {
    background: #ede9fe;
    border-color: #a78bfa;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

/* User's Own Booked Slots */
.grid-slot-btn.user-own-slot {
    cursor: pointer !important;
    position: relative;
    transition: all 0.18s ease;
}

.grid-slot-btn.reserved.user-own-slot {
    border: 2px dashed #7c3aed !important;
    background: #f5f3ff !important;
}

.grid-slot-btn.user-own-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* 5. Past / Closed (Muted Neutral Grey) */
.grid-slot-btn.past {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.55;
}

/* 5.2 Room-Specific Early Close / Outside Room Hours (Striped Muted Pattern) */
.grid-slot-btn.outside-hours {
    background: repeating-linear-gradient(
        -45deg,
        #f8fafc,
        #f8fafc 6px,
        #f1f5f9 6px,
        #f1f5f9 12px
    );
    border: 1px dashed #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    opacity: 0.85;
}

.grid-slot-btn.outside-hours:hover {
    background: repeating-linear-gradient(
        -45deg,
        #f1f5f9,
        #f1f5f9 6px,
        #e2e8f0 6px,
        #e2e8f0 12px
    );
    border-color: #94a3b8;
}

.grid-slot-btn.outside-hours .slot-line-status {
    color: #e11d48;
    font-weight: 800;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.grid-slot-btn.outside-hours .slot-line-id {
    color: #64748b;
    font-size: 9.5px;
    font-weight: 700;
}

.grid-slot-btn.outside-hours .slot-line-time {
    color: #94a3b8;
    font-size: 9px;
}

/* 5.3 Room Under Maintenance / Blocked (Striped Amber-Orange Warning Pattern) */
.grid-slot-btn.maintenance-slot {
    background: repeating-linear-gradient(
        -45deg,
        #fff7ed,
        #fff7ed 6px,
        #ffedd5 6px,
        #ffedd5 12px
    );
    border: 1px dashed #fdba74;
    color: #c2410c;
    cursor: not-allowed;
    opacity: 0.95;
}

.grid-slot-btn.maintenance-slot:hover {
    background: repeating-linear-gradient(
        -45deg,
        #ffedd5,
        #ffedd5 6px,
        #fed7aa 6px,
        #fed7aa 12px
    );
    border-color: #fb923c;
}

.grid-slot-btn.maintenance-slot .slot-line-status {
    color: #ea580c;
    font-weight: 800;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.grid-slot-btn.maintenance-slot .slot-line-id {
    color: #9a3412;
    font-size: 9.5px;
    font-weight: 700;
}

.grid-slot-btn.maintenance-slot .slot-line-time {
    color: #9a3412;
    opacity: 0.75;
    font-size: 9px;
}

/* 5.1 Past Check-in Cutoff (เกิน 15 นาทีตามกฎนโยบาย - Pastel Amber-Muted) */
.grid-slot-btn.past-cutoff {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    color: #b45309;
    cursor: not-allowed;
    opacity: 0.95;
    position: relative;
}

.grid-slot-btn.past-cutoff .slot-line-status {
    color: #b45309;
    font-weight: 800;
    font-size: 9.5px;
}

.grid-slot-btn.past-cutoff .slot-line-id {
    color: #d97706;
    font-size: 8.5px;
    font-weight: 700;
}

.grid-slot-btn.past-cutoff .cutoff-hint-badge {
    background: rgba(245, 158, 11, 0.15);
    border-radius: 4px;
    padding: 1px 4px;
    display: inline-block;
    color: #b45309;
    font-weight: 800;
}

.grid-slot-btn.past-cutoff .slot-line-time {
    color: #92400e;
    opacity: 0.85;
}

.grid-slot-btn.past-cutoff:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    transform: none;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.18);
}

/* 6. Completed / Returned Key Slot (Auditable Past Slot - Elegant Slate-Blue) */
.grid-slot-btn.completed-slot {
    background: #f1f5f9;
    border: 1.5px solid #94a3b8;
    color: #0f172a;
    opacity: 1 !important;
}

.grid-slot-btn.completed-slot .slot-line-status {
    color: #0284c7;
    font-weight: 800;
}

.grid-slot-btn.completed-slot .slot-line-id {
    color: #0f172a;
    font-weight: 800;
}

.grid-slot-btn.completed-slot .slot-line-time {
    color: #64748b;
}

.grid-slot-btn.completed-slot.staff-actionable {
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease-in-out;
}

.grid-slot-btn.completed-slot.staff-actionable:hover {
    border-color: #0284c7 !important;
    background: #e2e8f0 !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.22);
}

.grid-slot-btn.completed-slot.user-own-slot {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
}

.grid-slot-btn.completed-slot.user-own-slot .slot-line-status {
    color: #15803d !important;
}

.grid-slot-btn.completed-slot.user-own-slot .slot-line-id {
    color: #166534 !important;
}

/* 6.1 Completed but Late Return (Warning Amber/Orange) */
.grid-slot-btn.completed-late {
    background: #fff7ed !important;
    border: 1.5px solid #fdba74 !important;
    color: #9a3412 !important;
    opacity: 1 !important;
}

.grid-slot-btn.completed-late .slot-line-status {
    color: #c2410c !important;
    font-weight: 800;
}

.grid-slot-btn.completed-late .slot-line-id {
    color: #ea580c !important;
    font-weight: 800;
}

.grid-slot-btn.completed-late .slot-line-time {
    color: #9a3412 !important;
}

.grid-slot-btn.completed-late.staff-actionable:hover {
    border-color: #ea580c !important;
    background: #ffedd5 !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.22);
}

/* ★ SUB-TYPE SECTION ROW IN MATRIX TABLE ★ */
.matrix-subtype-section-row td {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%) !important;
    padding: 10px 16px !important;
    border-top: 2px solid #cbd5e1 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    position: sticky;
    left: 0;
    z-index: 4;
}

.subtype-section-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.subtype-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subtype-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bae6fd;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.12);
}

.subtype-title-text {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
}

.subtype-subtitle-text {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
    margin-left: 6px;
}

.subtype-meta-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.subtype-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.subtype-pill-tag.capacity {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

/* ★ MODERN PASTEL LEGEND SUBBAR & BADGES ★ */
.matrix-legend-subbar {
    padding: 8px 22px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.matrix-legend-intro {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.1px;
}

.matrix-legend-container {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.matrix-legend-sep {
    width: 1px;
    height: 16px;
    background: #cbd5e1;
    margin: 0 4px;
}

.matrix-legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3.5px 10px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: all 0.15s ease;
    user-select: none;
}

.matrix-legend-badge:hover {
    transform: translateY(-1px);
}

.matrix-legend-badge.badge-available {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.matrix-legend-badge.badge-selected {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.matrix-legend-badge.badge-reserved {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #6d28d9;
}

.matrix-legend-badge.badge-inuse {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #be123c;
}

.matrix-legend-badge.badge-completed {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.matrix-legend-badge.badge-past-cutoff {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.matrix-legend-badge.badge-overdue {
    background: #fff1f2;
    border-color: #fda4af;
    color: #be123c;
}

/* ★ BESPOKE PASTEL MODAL (Handcrafted, Not Generic AI) ★ */
.pastel-modal-dialog {
    max-width: 560px;
    width: 95%;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.9);
    border: none;
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pastel-modal-header {
    padding: 22px 24px 18px;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
}

.pastel-modal-header.header-completed {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-bottom-color: #bae6fd;
}

.pastel-modal-header.header-inuse {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    border-bottom-color: #fecdd3;
}

.pastel-modal-header.header-confirmed {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-bottom-color: #e9d5ff;
}

.modal-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.modal-close-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.modal-close-circle:hover {
    background: #ffffff;
    color: #0f172a;
    transform: rotate(90deg);
}

.modal-hero-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-hero-subtitle {
    font-size: 13px;
    color: #475569;
    margin: 5px 0 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pastel-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #ffffff;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
}

/* 3-Step Visual Journey Stepper */
.booking-journey-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
}

.journey-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 2;
    text-align: center;
}

.journey-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: #94a3b8;
    transition: all 0.2s;
}

.journey-step.completed .journey-dot {
    background: #ecfdf5;
    border-color: #10b981;
    color: #059669;
}

.journey-step.active .journey-dot {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.journey-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
}

.journey-time {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 500;
}

.journey-line {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    margin: 0 10px;
    position: relative;
    top: -12px;
}

.journey-line.completed {
    background: #10b981;
}

/* 4 Pastel Feature Tiles */
.modal-pastel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pastel-tile {
    padding: 12px 14px;
    border-radius: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.pastel-tile-blue {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.pastel-tile-purple {
    background: #faf5ff;
    border-color: #e9d5ff;
}

.pastel-tile-amber {
    background: #fffbeb;
    border-color: #fde68a;
}

.pastel-tile-emerald {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.tile-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pastel-tile-blue .tile-icon-wrap {
    background: #e0f2fe;
    color: #0284c7;
}

.pastel-tile-purple .tile-icon-wrap {
    background: #f3e8ff;
    color: #7c3aed;
}

.pastel-tile-amber .tile-icon-wrap {
    background: #fef3c7;
    color: #d97706;
}

.pastel-tile-emerald .tile-icon-wrap {
    background: #dcfce7;
    color: #16a34a;
}

.tile-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    display: block;
}

.tile-val {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 1px;
    display: block;
}

.pastel-modal-foot {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Dark Mode Overrides */
[data-theme="dark"] .grid-slot-btn.completed-slot {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .grid-slot-btn.completed-slot .slot-line-status {
    color: #38bdf8;
}

[data-theme="dark"] .grid-slot-btn.completed-slot .slot-line-id {
    color: #f8fafc;
}

[data-theme="dark"] .grid-slot-btn.completed-slot.staff-actionable:hover {
    background: rgba(2, 132, 199, 0.18) !important;
    border-color: #38bdf8 !important;
}

[data-theme="dark"] .grid-slot-btn.past-cutoff {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

[data-theme="dark"] .grid-slot-btn.past-cutoff .slot-line-status {
    color: #fbbf24;
}

[data-theme="dark"] .grid-slot-btn.past-cutoff .slot-line-id,
[data-theme="dark"] .grid-slot-btn.past-cutoff .cutoff-hint-badge {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .grid-slot-btn.past-cutoff .slot-line-time {
    color: #d97706;
}

[data-theme="dark"] .matrix-legend-badge.badge-past-cutoff {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

/* ==========================================================================
   ★ FLOATING STICKY ACTION BAR FOR MATRIX BOOKING (Premium Luxury Design) ★
   ========================================================================== */
.floating-booking-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: min(95%, 1180px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    color: var(--text-heading);
    padding: 12px 22px;
    border-radius: 20px;
    box-shadow: 
        0 24px 48px -12px rgba(15, 23, 42, 0.16),
        0 8px 24px -4px rgba(2, 132, 199, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 990;
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(24px) saturate(180%);
    animation: slideUpFloatingBar 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
}

[data-theme="dark"] .floating-booking-bar {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.97) 0%, rgba(30, 41, 59, 0.95) 100%);
    border-color: rgba(51, 65, 85, 0.8);
    box-shadow: 
        0 24px 48px -12px rgba(0, 0, 0, 0.5),
        0 8px 24px -4px rgba(2, 132, 199, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes slideUpFloatingBar {
    from {
        transform: translate(-50%, 45px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
    }
}

.floating-bar-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    min-width: 280px;
}

.floating-slot-badge-box {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
    flex-shrink: 0;
}

.floating-slot-badge-box .slot-qty {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.floating-slot-badge-box .slot-hrs {
    font-size: 11px;
    opacity: 0.92;
    font-weight: 500;
}

.floating-bar-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.floating-bar-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.floating-room-chip {
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

[data-theme="dark"] .floating-room-chip {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

.floating-bar-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
}

.floating-bar-subtitle strong {
    color: #0284c7;
    font-weight: 700;
}

.floating-purpose-wrapper {
    flex: 1 1 300px;
    min-width: 240px;
    max-width: 440px;
}

.floating-input-inner {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.floating-input-icon {
    position: absolute;
    left: 12px;
    color: #0284c7;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

.floating-purpose-input {
    width: 100%;
    height: 42px;
    padding: 0 32px 0 36px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-heading);
    background: rgba(241, 245, 249, 0.85);
    border: 1.5px solid rgba(203, 213, 225, 0.85);
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-purpose-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16);
}

[data-theme="dark"] .floating-purpose-input {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(51, 65, 85, 0.9);
    color: #f8fafc;
}

[data-theme="dark"] .floating-purpose-input:focus {
    background: #1e293b;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.clear-input-icon {
    position: absolute;
    right: 10px;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    user-select: none;
}
.clear-input-icon:hover {
    color: #e11d48;
}

.floating-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-clear-selection {
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: rgba(241, 245, 249, 0.9);
    color: #64748b;
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-clear-selection:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: translateY(-1px);
}

.btn-confirm-booking {
    height: 42px;
    padding: 0 22px;
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 6px 18px -2px rgba(2, 132, 199, 0.42);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.btn-confirm-booking:hover:not(:disabled) {
    background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
    box-shadow: 0 8px 22px -2px rgba(2, 132, 199, 0.55);
    transform: translateY(-1.5px);
}

.btn-confirm-booking:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}

.btn-confirm-booking:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* SOFT PASTEL TOAST NOTIFICATIONS */
.app-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(12px);
    animation: slideDownToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownToast {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.app-toast.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #a7f3d0;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.18), 0 4px 10px rgba(0, 0, 0, 0.03);
}

.app-toast.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1.5px solid #fde68a;
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.18), 0 4px 10px rgba(0, 0, 0, 0.03);
}

.app-toast.danger,
.app-toast.error {
    background: #fff1f2;
    color: #9f1239;
    border: 1.5px solid #fecdd3;
    box-shadow: 0 10px 25px -5px rgba(244, 63, 94, 0.18), 0 4px 10px rgba(0, 0, 0, 0.03);
}

.app-toast.info {
    background: #f0f9ff;
    color: #0369a1;
    border: 1.5px solid #bae6fd;
    box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.18), 0 4px 10px rgba(0, 0, 0, 0.03);
}

.key-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-weight: 700;
    font-size: 12px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    padding: 20px;
}

.modal-dialog {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-head h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading);
}

.modal-body {
    padding: 24px;
}

.modal-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-input);
}

/* Form Controls */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-heading);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.status-pill.confirmed {
    background: #fefce8;
    color: #a16207;
}

.status-pill.checked_in {
    background: #ffe4e6;
    color: #e11d48;
}

.status-pill.completed {
    background: #f1f5f9;
    color: #475569;
}

.status-pill.cancelled {
    background: #fef2f2;
    color: #991b1b;
}

.status-pill.no_show {
    background: #fee2e2;
    color: #b91c1c;
}

@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .modern-topbar {
        padding: 0 16px;
    }

    .page-body {
        padding: 16px;
    }

    .floating-booking-bar {
        width: calc(100% - 24px);
        bottom: 16px;
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
        border-radius: 16px;
    }

    .floating-bar-info {
        width: 100%;
        min-width: auto;
        justify-content: space-between;
    }

    .floating-purpose-wrapper {
        flex: 1 1 200px;
        max-width: none;
    }

    .floating-bar-actions {
        width: auto;
    }
}

@media (max-width: 640px) {
    .floating-booking-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .floating-bar-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .btn-clear-selection {
        flex: 1;
        justify-content: center;
    }

    .btn-confirm-booking {
        flex: 2;
        justify-content: center;
        padding: 0 12px;
        font-size: 13px;
    }
}

/* ==========================================================================
   BOOKING CONFIRMATION SLIP (RECEIPT / PASS)
   ========================================================================== */
.slip-container {
    background: #ffffff;
    color: #1e293b;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.slip-header {
    text-align: center;
    border-bottom: 2px dashed #cbd5e1;
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.slip-org-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #64748b;
    text-transform: uppercase;
}

.slip-main-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 4px 0 2px 0;
}

.slip-code-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 800;
    font-size: 14px;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    margin-top: 6px;
    letter-spacing: 0.05em;
}

.slip-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13.5px;
    margin-bottom: 18px;
}

.slip-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.slip-row:last-child {
    border-bottom: none;
}

.slip-label {
    color: #64748b;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.slip-value {
    color: #0f172a;
    font-weight: 700;
    text-align: right;
    max-width: 65%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.slip-steps-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 12px;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 16px;
}

.slip-step-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.slip-step-item:last-child {
    margin-bottom: 0;
}

.slip-step-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0284c7;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

@media print {
    body * {
        visibility: hidden;
    }

    .slip-container,
    .slip-container *,
    #sticker-print-portal,
    #sticker-print-portal * {
        visibility: visible;
    }

    .slip-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .modal-backdrop,
    .modal-head,
    .modal-foot {
        background: transparent !important;
        border: none !important;
    }

    .no-print {
        display: none !important;
    }
}

/* ==========================================================================
   LUXURY PASTEL PRELOADER (ศูนย์บรรณสารและสื่อการศึกษา)
   ========================================================================== */
.luxury-preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 35%, #e0f2fe 0%, #f0f7fd 55%, #ffffff 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s ease;
}

.luxury-preloader-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-glow-orb {
    position: absolute;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, rgba(186, 230, 253, 0.4) 50%, transparent 75%);
    filter: blur(55px);
    border-radius: 50%;
    animation: preloaderPulseOrb 3s ease-in-out infinite alternate;
}

.preloader-emblem-wrap {
    position: relative;
    width: 124px;
    height: 124px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.preloader-ring-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(2, 132, 199, 0.45);
    animation: spinClockwise 12s linear infinite;
}

.preloader-ring-inner {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: #0284c7;
    border-right-color: #38bdf8;
    animation: spinCounterClockwise 1.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.preloader-emblem-center {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #ffffff;
    box-shadow: 0 8px 26px rgba(2, 132, 199, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    z-index: 2;
    animation: pulseEmblem 2.5s ease-in-out infinite alternate;
}

.preloader-emblem-svg {
    width: 26px;
    height: 26px;
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.preloader-emblem-label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.2px;
    color: #e0f2fe;
    line-height: 1;
    font-family: var(--font-sans);
}

.preloader-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.2px;
    margin-bottom: 6px;
    text-align: center;
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 60%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.preloader-subtitle {
    font-size: 13px;
    color: #527599;
    letter-spacing: 0.5px;
    margin-bottom: 28px;
    text-align: center;
    font-weight: 500;
}

.preloader-bar-wrap {
    width: 220px;
    height: 6px;
    background: rgba(2, 132, 199, 0.1);
    border: 1px solid rgba(2, 132, 199, 0.22);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(2, 132, 199, 0.08);
}

.preloader-bar-fill {
    position: absolute;
    top: 0;
    left: -50%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #0284c7, #38bdf8, transparent);
    border-radius: 99px;
    animation: preloaderShimmerBar 1.5s ease-in-out infinite;
}

@keyframes preloaderPulseOrb {
    0% {
        transform: scale(0.85);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.15);
        opacity: 0.9;
    }
}

@keyframes spinClockwise {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinCounterClockwise {
    100% {
        transform: rotate(-360deg);
    }
}

@keyframes pulseEmblem {
    0% {
        transform: scale(0.96);
        box-shadow: 0 4px 18px rgba(56, 189, 248, 0.3);
    }

    100% {
        transform: scale(1.04);
        box-shadow: 0 8px 32px rgba(2, 132, 199, 0.5);
    }
}

@keyframes preloaderShimmerBar {
    0% {
        left: -60%;
    }

    100% {
        left: 100%;
    }
}

/* ==========================================================================
   ADMIN ROOMS TAB BAR & TOGGLE SWITCH STYLES
   ========================================================================== */
.admin-category-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.admin-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-body);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.admin-category-btn:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.admin-category-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-glow);
}

.admin-subgroup-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--bg-input);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.admin-subgroup-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-body);
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-subgroup-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-subgroup-chip.active {
    background: var(--primary-pastel);
    color: var(--primary-hover);
    border-color: var(--primary);
    font-weight: 700;
}

.admin-group-control-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.status-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-toggle-btn.available {
    background: #dcfce7;
    color: #15803d;
}

.status-toggle-btn.available:hover {
    background: #bbf7d0;
}

.status-toggle-btn.maintenance {
    background: #fee2e2;
    color: #b91c1c;
}

.status-toggle-btn.maintenance:hover {
    background: #fecdd3;
}

/* Schedule Presets & Calendar System */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.preset-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.preset-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.preset-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.4) 0%, rgba(255, 255, 255, 0.95) 100%);
    box-shadow: 0 6px 20px -2px rgba(2, 132, 199, 0.15);
}

.preset-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--primary-pastel);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.day-schedule-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
    font-size: 13px;
    transition: background 0.15s;
}

.day-schedule-row:hover {
    background: var(--bg-input);
}

.day-schedule-row:last-child {
    border-bottom: none;
}

.exception-item-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.exception-item-card:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Visual Interactive Day Selector Bar */
.booking-days-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.booking-days-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.booking-days-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.booking-days-admin-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.booking-days-policy-badge {
    display: inline-flex;
    align-items: center;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.booking-days-legend {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.legend-dot.open { background: #10b981; }
.legend-dot.special { background: #0284c7; }
.legend-dot.closed { background: #f43f5e; }

.booking-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.booking-days-grid.compact-days-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 6px;
    max-height: 155px;
    overflow-y: auto;
    padding: 2px 2px 4px 2px;
}

/* Custom sleek slim scrollbar for compact days grid */
.booking-days-grid.compact-days-grid::-webkit-scrollbar {
    width: 5px;
}
.booking-days-grid.compact-days-grid::-webkit-scrollbar-track {
    background: transparent;
}
.booking-days-grid.compact-days-grid::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 4px;
}
.booking-days-grid.compact-days-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7);
}

.booking-day-card {
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: inherit;
}

.booking-day-card:hover {
    border-color: rgba(2, 132, 199, 0.4);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.booking-day-card.active {
    background: rgba(2, 132, 199, 0.08);
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.15);
}

.booking-day-card.closed {
    background: rgba(244, 63, 94, 0.04);
    border-color: rgba(244, 63, 94, 0.15);
}

.booking-day-card.closed.active {
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.09);
}

/* Compact Day Card Styling */
.booking-day-card.compact-day-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    padding: 5px 6px;
    gap: 2px;
    min-height: 44px;
    box-sizing: border-box;
}

.booking-day-card.compact-day-card:hover {
    border-color: #38bdf8;
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.booking-day-card.compact-day-card.active {
    background: rgba(2, 132, 199, 0.1);
    border-color: var(--primary, #0284c7);
    box-shadow: 0 0 0 1px var(--primary, #0284c7), 0 2px 6px rgba(2, 132, 199, 0.18);
}

.booking-day-card.compact-day-card.closed {
    background: rgba(244, 63, 94, 0.04);
    border-color: rgba(244, 63, 94, 0.2);
}

.booking-day-card.compact-day-card.closed.active {
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
    box-shadow: 0 0 0 1px #f43f5e, 0 2px 6px rgba(244, 63, 94, 0.18);
}

.booking-day-card.compact-day-card.fully-booked {
    background: rgba(244, 63, 94, 0.05);
    border-color: rgba(244, 63, 94, 0.35);
}

.booking-day-card.compact-day-card.fully-booked.active {
    border-color: #e11d48;
    background: rgba(244, 63, 94, 0.12);
    box-shadow: 0 0 0 1px #e11d48, 0 2px 6px rgba(225, 29, 72, 0.22);
}

.day-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    line-height: 1.2;
}

.day-card-badge-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading);
}

.booking-day-card.compact-day-card .day-card-badge-title {
    font-size: 11px;
    white-space: nowrap;
}

.booking-day-card.active .day-card-badge-title {
    color: var(--primary);
}

.day-card-date-text {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.booking-day-card.compact-day-card .day-card-date-text {
    font-size: 10px;
    white-space: nowrap;
}

.day-card-status-badge {
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.booking-day-card.compact-day-card .day-card-status-badge {
    font-size: 10px;
    margin-top: 1px;
    gap: 3.5px;
    line-height: 1.2;
}

.status-dot-mini {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.dot-open { background: #10b981; }
.dot-special { background: #0284c7; }
.dot-closed { background: #f43f5e; }
.dot-fully-booked { background: #e11d48; box-shadow: 0 0 0 1.5px rgba(225, 29, 72, 0.3); }

.status-fully-booked-text {
    color: #be123c;
    font-weight: 700;
}

.booking-day-card.compact-day-card .status-fully-booked-text {
    font-size: 9.5px;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.status-open-text {
    color: #059669;
    font-weight: 700;
}

.booking-day-card.compact-day-card .status-open-text {
    font-size: 10px;
    letter-spacing: -0.1px;
    white-space: nowrap;
    font-weight: 700;
}

.status-exam-text {
    color: #0284c7;
    font-weight: 700;
}

.booking-day-card.compact-day-card .status-exam-text {
    font-size: 10px;
    letter-spacing: -0.1px;
    white-space: nowrap;
    font-weight: 700;
}

.status-closed-text {
    color: #e11d48;
    font-weight: 700;
}

.booking-day-card.compact-day-card .status-closed-text {
    font-size: 10px;
    white-space: nowrap;
    font-weight: 700;
}

.day-card-special-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #fef3c7;
    color: #b45309;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 2px;
}

.booking-day-card.compact-day-card .day-card-special-tag {
    font-size: 8.5px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    margin-top: 1px;
}

.day-card-reason-tag {
    font-size: 10px;
    color: #be123c;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.booking-day-card.compact-day-card .day-card-reason-tag {
    font-size: 8.5px;
    margin-top: 1px;
}

.day-card-time-tag {
    font-size: 8.5px;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0.85;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

/* ==========================================================
   REPORT & STATISTICS MODULE STYLING
   ========================================================== */
.report-filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: flex-end;
}

.report-stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.report-stat-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.report-stat-chip .chip-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.report-stat-chip .chip-value {
    font-size: 22px;
    font-weight: 800;
    margin-top: 4px;
}

/* Leaderboard Podium */
.podium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.podium-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.podium-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.podium-card.gold {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(180deg, rgba(254, 243, 199, 0.2) 0%, var(--bg-card) 100%);
}

.podium-card.silver {
    border-color: rgba(148, 163, 184, 0.4);
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.2) 0%, var(--bg-card) 100%);
}

.podium-card.bronze {
    border-color: rgba(217, 119, 6, 0.4);
    background: linear-gradient(180deg, rgba(255, 237, 213, 0.2) 0%, var(--bg-card) 100%);
}

.rank-badge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

.rank-badge-1 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.rank-badge-2 {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
}

.rank-badge-3 {
    background: linear-gradient(135deg, #d97706, #92400e);
    color: #fff;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.rank-badge-other {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Event Action Badges */
.event-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
}

.event-action-login {
    background: #e0f2fe;
    color: #0369a1;
}

.event-action-booking {
    background: #dbeafe;
    color: #1d4ed8;
}

.event-action-checkin {
    background: #d1fae5;
    color: #047857;
}

.event-action-checkout {
    background: #ccfbf1;
    color: #0f766e;
}

.event-action-cancel {
    background: #ffe4e6;
    color: #e11d48;
}

.event-action-noshow {
    background: #fee2e2;
    color: #b91c1c;
}

.event-action-admin {
    background: #fef3c7;
    color: #b45309;
    border: 0.8px solid #fde68a;
}

.event-action-system {
    background: #ede9fe;
    color: #6d28d9;
    border: 0.8px solid #ddd6fe;
}

.event-action-default {
    background: #f1f5f9;
    color: #475569;
}

/* Actor Role Badges */
.actor-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
}

.actor-badge.admin {
    background: #fef3c7;
    color: #b45309;
    border: 0.8px solid #fde68a;
}

.actor-badge.staff {
    background: #e0f2fe;
    color: #0369a1;
    border: 0.8px solid #bae6fd;
}

.actor-badge.student {
    background: #d1fae5;
    color: #047857;
    border: 0.8px solid #a7f3d0;
}

.actor-badge.system {
    background: #f1f5f9;
    color: #475569;
    border: 0.8px solid #cbd5e1;
}

/* ==========================================================================
   COUNTER SMART SCAN HUB & LIVE PERSISTENT NOTIFICATION PANEL (SPLIT LAYOUT)
   ========================================================================== */
.counter-scan-hub-card {
    background: var(--bg-card);
    border: 2px solid #0284c7;
    border-radius: var(--radius-xl);
    padding: 18px 22px;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px -4px rgba(2, 132, 199, 0.12), var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.counter-scan-hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0284c7, #38bdf8, #10b981);
}

.counter-scan-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .counter-scan-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Left Col: Controller */
.counter-scan-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 18px;
    border-right: 1px dashed var(--border);
}

@media (max-width: 1024px) {
    .counter-scan-left {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px dashed var(--border);
        padding-bottom: 16px;
    }
}

.counter-scan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.counter-scan-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.counter-scan-icon-bubble {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
    flex-shrink: 0;
}

.counter-scan-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.counter-scan-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.counter-scan-badge {
    font-size: 11px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.counter-scan-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.counter-scan-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.counter-scan-input-wrap i,
.counter-scan-input-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #0284c7;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 2;
}

.counter-scan-input {
    width: 100%;
    padding-left: 44px;
    padding-right: 12px;
    height: 46px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #0284c7;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-heading);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.counter-scan-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.18);
    border-color: #0284c7;
}

.counter-scan-btn {
    padding: 0 22px;
    font-size: 13.5px;
    font-weight: 700;
    height: 46px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    transition: all 0.2s;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
}

.counter-scan-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

.counter-scan-tips {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* Right Col: Persistent Display Card */
.counter-scan-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Standby State */
.scan-standby-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-base);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    height: 100%;
}

.scan-standby-radar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.scan-standby-radar::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #38bdf8;
    animation: radar-pulse 2s infinite ease-out;
}

@keyframes radar-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

.scan-standby-content h4 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-heading);
}

.scan-standby-content p {
    margin: 2px 0 0 0;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Active Live Card */
.scan-live-card {
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.scan-live-card.checkin-mode {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: #10b981;
}

.scan-live-card.checkout-mode {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #0284c7;
}

.scan-live-card.warn-mode {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #f59e0b;
}

[data-theme="dark"] .scan-live-card.checkin-mode {
    background: linear-gradient(135deg, #062e22 0%, #04241b 100%);
    border-color: #10b981;
}

[data-theme="dark"] .scan-live-card.checkout-mode {
    background: linear-gradient(135deg, #082845 0%, #061c33 100%);
    border-color: #0284c7;
}

[data-theme="dark"] .scan-live-card.warn-mode {
    background: linear-gradient(135deg, #382405 0%, #291a03 100%);
    border-color: #f59e0b;
}

.scan-live-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.scan-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.scan-action-pill.checkin {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.scan-action-pill.checkout {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.scan-action-pill.warn {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.scan-live-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.scan-room-title {
    font-size: 18px;
    font-weight: 800;
    color: #0284c7;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scan-room-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.scan-key-tag {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1.5px solid #f59e0b;
    color: #92400e;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
    animation: key-attention 2s infinite ease-in-out;
}

@keyframes key-attention {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.scan-live-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-body);
}

.scan-live-user {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.scan-jump-btn {
    border: none;
    background: transparent;
    color: #0284c7;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0;
}

.scan-jump-btn:hover {
    color: #0369a1;
}

.scan-dismiss-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.scan-dismiss-btn:hover {
    background: rgba(0,0,0,0.06);
    color: var(--text-heading);
}

/* =====================================================================
   Rich Text Guidelines Editor Component (Pastel Theme)
   ===================================================================== */
.rich-editor-wrapper {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rich-editor-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.rich-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 2px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-heading);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transition: all 0.15s ease;
}

.toolbar-btn:hover {
    background: var(--primary-pastel);
    color: var(--primary-hover);
    border-color: var(--primary-pastel-deep);
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 4px;
}

.color-dot-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-dot-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--primary);
}

.color-picker-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    border: 1px dashed var(--border);
    background: var(--bg-card);
    transition: all 0.15s ease;
}

.color-picker-label:hover {
    background: var(--primary-pastel);
    border-color: var(--primary);
}

.toolbar-mode-btn {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.toolbar-mode-btn:hover {
    color: var(--text-heading);
    background: rgba(0, 0, 0, 0.04);
}

.toolbar-mode-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.rich-editor-content {
    min-height: 140px;
    max-height: 280px;
    overflow-y: auto;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-body);
    background: var(--bg-card);
    outline: none;
    word-break: break-word;
}

.rich-editor-content[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: var(--text-light);
    pointer-events: none;
    display: block;
}

.rich-editor-content ol,
.rich-editor-content ul {
    padding-left: 24px;
    margin: 6px 0;
}

.rich-editor-content li {
    margin-bottom: 4px;
}

.rich-editor-preview {
    padding: 12px;
    max-height: 280px;
    overflow-y: auto;
}

.rich-editor-html {
    width: 100%;
    min-height: 140px;
    padding: 10px 12px;
    font-family: Consolas, Monaco, monospace;
    font-size: 12.5px;
    border: none;
    outline: none;
    background: var(--bg-input);
    color: var(--text-heading);
    resize: vertical;
}

/* ==========================================================================
   ROOM BARCODE & QR CODE STICKER PRINTING STYLES
   ========================================================================== */

/* ==========================================================================
   ROOM BARCODE & QR CODE STICKER PRINTING STYLES (SUT CLREM THEME)
   ========================================================================== */

/* Sticker Card Base (Aesthetic, Compact, High-contrast, SUT Branded) */
.room-sticker-card {
    background: #ffffff !important;
    border: 1.2px solid #1e293b;
    border-radius: 6px;
    padding: 6px 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    color: #0f172a;
    font-family: 'Prompt', 'Noto Sans Thai', sans-serif;
    overflow: hidden;
    page-break-inside: avoid;
    break-inside: avoid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Preset: Compact (56mm x 33mm) - Perfect for key tags & cards */
.room-sticker-card.compact {
    width: 226px;
    height: 132px;
}

/* Preset: Standard (66mm x 39mm) - Perfect for door plates & desks */
.room-sticker-card.standard {
    width: 266px;
    height: 154px;
}

/* Sticker Header Row */
.sticker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0.8px solid #e2e8f0;
    padding-bottom: 3px;
    margin-bottom: 2px;
    gap: 6px;
}

/* SUT CLREM Official Logo */
.sticker-logo-wrap {
    display: flex;
    align-items: center;
    height: 17px;
    max-width: 125px;
    flex-shrink: 0;
}

.sticker-logo-img {
    height: 100%;
    width: auto;
    max-height: 17px;
    object-fit: contain;
    display: block;
}

.room-sticker-card.standard .sticker-logo-wrap {
    height: 21px;
    max-width: 150px;
}

.room-sticker-card.standard .sticker-logo-img {
    max-height: 21px;
}

/* Room Category Pill Tag */
.sticker-cat-pill {
    font-size: 7.5px;
    font-weight: 700;
    padding: 1.5px 6px;
    border-radius: 4px;
    background: #fff7ed;
    border: 0.8px solid #ea580c;
    color: #ea580c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 105px;
    line-height: 1.15;
}

.room-sticker-card.standard .sticker-cat-pill {
    font-size: 8px;
    padding: 1.5px 7px;
    max-width: 125px;
}

/* Sticker Body (Split Layout: Left Info & Barcode, Right QR) */
.sticker-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex: 1;
    min-height: 0;
}

.sticker-left-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
    text-align: left;
}

/* Primary Room Name (Prominent, Bold Headline) */
.sticker-room-name-primary {
    font-family: 'Prompt', 'Noto Sans Thai', sans-serif;
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.room-sticker-card.standard .sticker-room-name-primary {
    font-size: 17px;
}

/* Secondary Meta: Room Code Badge & Location */
.sticker-room-meta-sub {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    margin-bottom: 2px;
    flex-wrap: nowrap;
}

.sticker-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f1f5f9;
    border: 0.8px solid #cbd5e1;
    border-radius: 3px;
    padding: 0 4px;
    height: 15px;
    line-height: 1;
    flex-shrink: 0;
}

.sticker-code-label {
    font-size: 6.5px;
    font-weight: 700;
    color: #ea580c; /* SUT brand orange */
}

.sticker-code-val {
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 8.5px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.2px;
}

.room-sticker-card.standard .sticker-code-badge {
    height: 17px;
    padding: 0 5px;
}

.room-sticker-card.standard .sticker-code-val {
    font-size: 9.5px;
}

.sticker-room-location {
    font-size: 7px;
    color: #64748b;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Barcode SVG Container */
.sticker-barcode-box {
    margin-top: 2px;
    line-height: 1;
}

.sticker-barcode-svg {
    max-width: 100%;
    height: 24px;
    display: block;
}

.room-sticker-card.standard .sticker-barcode-svg {
    height: 28px;
}

/* Right Column: QR Code */
.sticker-right-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-left: 2px;
}

.sticker-qr-canvas-box {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 0.8px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px;
    box-sizing: border-box;
}

.room-sticker-card.standard .sticker-qr-canvas-box {
    width: 68px;
    height: 68px;
}

.sticker-qr-canvas-box img,
.sticker-qr-canvas-box canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.sticker-qr-note {
    font-size: 5.5px;
    font-weight: 800;
    color: #ea580c;
    letter-spacing: 0.3px;
    text-align: center;
    margin-top: 2px;
    text-transform: uppercase;
}

/* Modal Preview Container */
.sticker-preview-scroll-area {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    max-height: 480px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: flex-start;
}

/* Print Portal Root (Hidden on screen) */
#sticker-print-portal {
    display: none;
}

/* Print Media Rules */
@media print {
    #sticker-print-portal {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        z-index: 999999 !important;
    }

    #sticker-print-portal.thermal .room-sticker-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: always !important;
        break-after: page !important;
        margin: 0 auto !important;
    }

    #sticker-print-portal.sheet .sticker-print-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4mm !important;
        padding: 6mm !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    #sticker-print-portal.sheet .room-sticker-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin: 0 !important;
        border: 1px dashed #94a3b8 !important; /* Dotted cut line for sheet printing */
    }

    /* Print sizes in mm */
    #sticker-print-portal .room-sticker-card.compact {
        width: 56mm !important;
        height: 33mm !important;
    }

    #sticker-print-portal .room-sticker-card.standard {
        width: 66mm !important;
        height: 39mm !important;
    }
}