/**
 * ================================================
 * Custom CSS - NONGJONG Meeting System
 * ================================================
 * สไตล์เพิ่มเติมที่ Tailwind ไม่ครอบคลุม
 */

/* ================================================
   Global Font Family - Noto Sans Thai
   ================================================ */
html, body, button, input, select, textarea, optgroup, .font-sans, .font-thai {
    font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ================================================
   FullCalendar Customization
   ================================================ */
.fc {
    font-family: 'Noto Sans Thai', sans-serif !important;
}

.fc .fc-toolbar-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #2d2d2d !important;
}

.fc .fc-button {
    background-color: #0957d0 !important;
    border-color: #0957d0 !important;
    font-size: 0.8rem !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
}

.fc .fc-button:hover {
    background-color: #0052ff !important;
    border-color: #0052ff !important;
    box-shadow: 0 2px 8px rgba(9, 87, 208, 0.3) !important;
}

.fc .fc-button-active {
    background-color: #0052ff !important;
    border-color: #0052ff !important;
}

.fc .fc-button-primary:disabled {
    opacity: 0.5 !important;
}

.fc .fc-daygrid-day-number {
    color: #4e4e4e !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
}

.fc .fc-day-today {
    background-color: #edf4ff !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
    color: #0957d0 !important;
    font-weight: 700 !important;
}

.fc .fc-col-header-cell {
    background-color: #f8fafc !important;
    padding: 0.5rem 0 !important;
}

.fc .fc-col-header-cell-cushion {
    color: #4e4e4e !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    text-decoration: none !important;
}

.fc .fc-day-sun .fc-col-header-cell-cushion,
.fc .fc-day-sun .fc-daygrid-day-number {
    color: #ef4444 !important;
}

.fc .fc-day-sat .fc-col-header-cell-cushion,
.fc .fc-day-sat .fc-daygrid-day-number {
    color: #0957d0 !important;
}

.fc .fc-event {
    border-radius: 0.375rem !important;
    padding: 0.125rem 0.375rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.15s, box-shadow 0.15s !important;
}

.fc .fc-event:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Event colors by status */
.fc-event-approved {
    background-color: #10b981 !important;
}

.fc-event-pending {
    background-color: #f59e0b !important;
}

.fc-event-rejected {
    background-color: #ef4444 !important;
}

.fc-event-cancelled {
    background-color: #9ca3af !important;
    text-decoration: line-through !important;
}

.fc .fc-daygrid-more-link {
    color: #0957d0 !important;
    font-weight: 600 !important;
}

/* ================================================
   DataTables Modern & Beautiful Customization
   ================================================ */
.dataTables_wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-family: 'Noto Sans Thai', sans-serif !important;
    width: 100% !important;
    position: relative !important;
    clear: both !important;
}

.dataTables_wrapper::before,
.dataTables_wrapper::after {
    display: none !important;
}

/* --- TOP CONTROLS: Show rows (Left) & Search (Right) --- */
.dataTables_wrapper .dataTables_length {
    order: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 0 1rem 0 !important;
    float: none !important;
}

.dataTables_wrapper .dataTables_length label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 0.875rem !important;
    color: #4b5563 !important;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
    cursor: pointer !important;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d1d5db !important;
    border-radius: 0.625rem !important;
    padding: 0.45rem 2.25rem 0.45rem 0.875rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #1f2937 !important;
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.6rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.25em 1.25em !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    line-height: 1.25rem !important;
}

.dataTables_wrapper .dataTables_length select:hover {
    border-color: #9ca3af !important;
    background-color: #f9fafb !important;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: #0957d0 !important;
    box-shadow: 0 0 0 3px rgba(9, 87, 208, 0.15) !important;
    outline: none !important;
    background-color: #ffffff !important;
}

/* DT Buttons (e.g. Export in Reports page) */
.dataTables_wrapper .dt-buttons {
    order: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin: 0 0 1rem 0 !important;
    float: none !important;
}

/* Search input container */
.dataTables_wrapper .dataTables_filter {
    order: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 0 1rem auto !important;
    float: none !important;
    text-align: right !important;
}

.dataTables_wrapper .dataTables_filter label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.625rem !important;
    font-size: 0.875rem !important;
    color: #4b5563 !important;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d1d5db !important;
    border-radius: 0.625rem !important;
    padding: 0.45rem 1rem 0.45rem 2.25rem !important;
    font-size: 0.875rem !important;
    color: #1f2937 !important;
    background-color: #f9fafb !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 0.75rem center !important;
    background-size: 1rem 1rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    width: 260px !important;
    max-width: 100% !important;
    outline: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    line-height: 1.25rem !important;
}

.dataTables_wrapper .dataTables_filter input:hover {
    border-color: #9ca3af !important;
    background-color: #ffffff !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #0957d0 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(9, 87, 208, 0.15) !important;
    width: 290px !important;
}

/* --- THE TABLE & SCROLL WRAPPER --- */
.dataTables_wrapper table.dataTable {
    order: 4 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
    margin: 0.25rem 0 1rem 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    clear: both !important;
}

.dataTables_wrapper .dataTables_scroll {
    order: 4 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
    margin: 0.25rem 0 1rem 0 !important;
    clear: both !important;
}

/* --- TABLE HEADER & BODY STYLES --- */
table.dataTable thead th {
    background-color: #f8fafc !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.025em !important;
    border-top: 1px solid #e2e8f0 !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 0.875rem 1rem !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

table.dataTable thead th:first-child {
    border-top-left-radius: 0.5rem !important;
    border-bottom-left-radius: 0.5rem !important;
}

table.dataTable thead th:last-child {
    border-top-right-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
}

table.dataTable tbody td {
    font-size: 0.875rem !important;
    padding: 0.875rem 1rem !important;
    color: #334155 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

table.dataTable tbody tr {
    transition: background-color 0.15s ease !important;
}

table.dataTable tbody tr:hover {
    background-color: #f8fafc !important;
}

/* --- BOTTOM CONTROLS: Info (Left) & Paginate (Right) --- */
.dataTables_wrapper .dataTables_info {
    order: 5 !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
    float: none !important;
}

.dataTables_wrapper .dataTables_paginate {
    order: 6 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    margin: 0 0 0 auto !important;
    padding: 0.5rem 0 !important;
    float: none !important;
    text-align: right !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 2.25rem !important;
    height: 2.25rem !important;
    padding: 0 0.75rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #475569 !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    margin: 0 0.125rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: #f1f5f9 !important;
    color: #0957d0 !important;
    border-color: #cbd5e1 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #0957d0 !important;
    color: #ffffff !important;
    border-color: #0957d0 !important;
    box-shadow: 0 2px 4px 0 rgba(9, 87, 208, 0.25) !important;
    font-weight: 600 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #94a3b8 !important;
    border-color: #f1f5f9 !important;
    background: #f8fafc !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: 0.6 !important;
}

/* Responsive adjustment for small screens */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dt-buttons {
        width: 100% !important;
        margin: 0 0 0.75rem 0 !important;
        justify-content: space-between !important;
    }
    
    .dataTables_wrapper .dataTables_filter {
        text-align: left !important;
    }
    
    .dataTables_wrapper .dataTables_filter label {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
    }
    
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        margin: 0.25rem 0 !important;
    }
}

/* ================================================
   SweetAlert2 Customization
   ================================================ */
.swal2-popup {
    font-family: 'Noto Sans Thai', sans-serif !important;
    border-radius: 1rem !important;
}

.swal2-title {
    font-weight: 600 !important;
    font-size: 1.25rem !important;
}

.swal2-html-container {
    font-size: 0.9rem !important;
    color: #4e4e4e !important;
}

.swal2-confirm {
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
    padding: 0.5rem 1.5rem !important;
}

.swal2-cancel {
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
    padding: 0.5rem 1.5rem !important;
}

/* ================================================
   Hero Section
   ================================================ */
.hero-gradient {
    background: linear-gradient(135deg, #0957d0 0%, #0052ff 50%, #4a8fff 100%);
}

.hero-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(255,255,255,0.06) 0%, transparent 50%);
}

/* ================================================
   Room Status Card
   ================================================ */
.room-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* ================================================
   Animations
   ================================================ */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ================================================
   Print Styles
   ================================================ */
@media print {
    nav, aside, footer, .no-print {
        display: none !important;
    }
    body {
        font-size: 12pt !important;
    }
}

/* ================================================
   Sidebar Above Navbar & Deep Midnight Navy Rail System
   ================================================ */
.nj-sr-only {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.nj-sidebar {
    --nj-rail-bg-top: #0b1526;
    --nj-rail-bg-bottom: #0f1e36;
    --nj-rail-border: rgba(148, 163, 184, 0.14);
    --nj-rail-surface: rgba(255, 255, 255, 0.045);
    --nj-rail-surface-hover: rgba(148, 185, 255, 0.09);
    --nj-rail-ink: #f8fafc;
    --nj-rail-ink-secondary: #d8e4f6;
    --nj-rail-ink-muted: #8da9ce;
    --nj-rail-accent: #0957d0;
    --nj-rail-focus: #60a5fa;
    background: linear-gradient(180deg, var(--nj-rail-bg-top) 0%, var(--nj-rail-bg-bottom) 100%);
    border-inline-end: 1px solid var(--nj-rail-border);
    box-shadow: 4px 0 24px rgba(2, 8, 23, 0.18);
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nj-sidebar ::selection {
    background: rgba(96, 165, 250, 0.28);
    color: #ffffff;
}

.nj-sidebar-header {
    border-block-end: 1px solid var(--nj-rail-border);
    background: rgba(8, 16, 31, 0.35);
}

.nj-brand-mark {
    background: linear-gradient(145deg, #2575fc 0%, #0957d0 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(9, 87, 208, 0.38);
    transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 160ms ease;
}

.nj-sidebar-brand:hover .nj-brand-mark {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 117, 252, 0.45);
}

.nj-sidebar-brand:focus-visible,
.nj-sidebar-icon-btn:focus-visible,
.nj-user-card:focus-visible,
.nj-nav-link:focus-visible {
    outline: 2px solid var(--nj-rail-focus) !important;
    outline-offset: -2px !important;
}

.nj-sidebar-icon-btn {
    color: #93b4dc;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.12);
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, scale 150ms ease-out;
}

.nj-sidebar-icon-btn:hover {
    color: #ffffff;
    background: var(--nj-rail-surface-hover);
    border-color: rgba(148, 185, 255, 0.24);
}

.nj-sidebar-icon-btn:active {
    scale: 0.95;
}

#sidebarCollapseBtnIcon {
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Compact User Profile Card */
.nj-user-card {
    background: var(--nj-rail-surface);
    border: 1px solid rgba(148, 163, 184, 0.13);
    min-block-size: 56px;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, scale 150ms ease-out;
}

.nj-user-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(147, 197, 253, 0.28);
    box-shadow: 0 4px 14px rgba(2, 8, 23, 0.24);
}

.nj-user-card:active {
    scale: 0.985;
}

.nj-user-card[aria-current="page"] {
    background: rgba(9, 87, 208, 0.28);
    border-color: rgba(96, 165, 250, 0.45);
}

.nj-user-card .sidebar-user-avatar {
    border: 1.5px solid rgba(147, 197, 253, 0.45);
    box-shadow: 0 2px 8px rgba(2, 8, 23, 0.35);
    transition: border-color 160ms ease;
}

.nj-user-card:hover .sidebar-user-avatar {
    border-color: #93c5fd;
}

.nj-avatar-status {
    position: absolute;
    inset-block-end: 0;
    inset-inline-end: 0;
    inline-size: 10px;
    block-size: 10px;
    border-radius: 9999px;
    background: #10b981;
    border: 2px solid #0d182c;
}

.nj-user-card .sidebar-user-chevron {
    transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), color 160ms ease;
}

.nj-user-card:hover .sidebar-user-chevron {
    transform: translateX(2px);
    color: #dbeafe;
}

/* Grouped Navigation Rhythm (tight inside group, generous between groups) */
.nj-nav-group + .nj-nav-group {
    margin-block-start: 1.125rem;
}

.nj-nav-section-header {
    display: flex;
    align-items: center;
    padding: 0 0.625rem;
    margin-block-end: 0.375rem;
    min-block-size: 1.25rem;
}

.nj-nav-section-label {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--nj-rail-ink-muted);
    white-space: nowrap;
}

.nj-nav-section-divider {
    display: none;
    inline-size: 1.5rem;
    block-size: 1px;
    margin-inline: auto;
    background: rgba(148, 163, 184, 0.18);
}

.nj-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Override legacy @layer components .sidebar-menu-item inside .nj-sidebar */
.nj-sidebar .nj-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-block-size: 42px;
    padding: 0.5rem 0.65rem;
    border-radius: 0.75rem;
    color: var(--nj-rail-ink-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, scale 150ms ease-out;
}

@media (pointer: coarse) {
    .nj-sidebar .nj-nav-link {
        min-block-size: 44px;
    }
}

.nj-sidebar .nj-nav-link:hover {
    background: var(--nj-rail-surface-hover);
    color: #ffffff;
}

.nj-sidebar .nj-nav-link:active {
    scale: 0.985;
}

.nj-nav-icon-wrap {
    inline-size: 2rem;
    block-size: 2rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #93b4dc;
    font-size: 0.95rem;
    transition: background-color 160ms ease, color 160ms ease;
}

.nj-sidebar .nj-nav-link:hover .nj-nav-icon-wrap {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

/* Current Page Indicator (WCAG 1.4.1: filled pill + weight + icon container + Forced Colors safe) */
.nj-sidebar .nj-nav-link[aria-current="page"],
.nj-sidebar .nj-nav-link.is-active {
    background: var(--nj-rail-accent);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(3, 10, 24, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nj-sidebar .nj-nav-link[aria-current="page"]:focus-visible {
    outline: 2px solid #ffffff !important;
    outline-offset: -2px !important;
}

.nj-sidebar .nj-nav-link[aria-current="page"] .nj-nav-icon-wrap,
.nj-sidebar .nj-nav-link.is-active .nj-nav-icon-wrap {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
}

/* Single-line Overflow Label */
.nj-nav-label {
    flex: 1 1 auto;
    min-inline-size: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Live Pending Bookings Count Badge */
.nj-nav-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: 1.375rem;
    block-size: 1.25rem;
    padding-inline: 0.4rem;
    border-radius: 9999px;
    background: #fbbf24;
    color: #0f172a;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(2, 8, 23, 0.3);
}

/* Footer & Destructive Logout Action */
.nj-sidebar-footer {
    border-block-start: 1px solid var(--nj-rail-border);
    background: rgba(8, 16, 31, 0.32);
}

.nj-sidebar .nj-logout-link {
    color: #fecdd3;
}

.nj-sidebar .nj-logout-link .nj-nav-icon-wrap {
    color: #fda4af;
}

.nj-sidebar .nj-logout-link:hover {
    background: #be123c;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(159, 18, 57, 0.32);
}

.nj-sidebar .nj-logout-link:hover .nj-nav-icon-wrap {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
}

/* Floating Tooltip for Collapsed Desktop Rail */
.nj-rail-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    padding: 0.4rem 0.7rem;
    border-radius: 0.55rem;
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 8px 20px rgba(2, 8, 23, 0.32);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    opacity: 0;
    translate: -4px -50%;
    transition: opacity 140ms ease-out, translate 140ms ease-out;
}

.nj-rail-tooltip.is-visible {
    opacity: 1;
    translate: 0 -50%;
}

/* Mobile Backdrop */
.nj-sidebar-overlay {
    background: rgba(2, 8, 23, 0.55);
    backdrop-filter: blur(3px);
    transition: opacity 200ms ease;
}

body.has-sidebar {
    overflow-x: hidden;
}

body.has-sidebar div.flex.h-screen {
    height: calc(100vh - 4rem) !important;
    min-height: calc(100vh - 4rem) !important;
    overflow: hidden;
}

body.has-sidebar div.flex.h-screen > main,
body.has-sidebar main.content-wrapper {
    padding-bottom: 4rem !important;
}

/* Desktop Sidebar Positioning */
@media (min-width: 1024px) {
    /* Expanded State (Default) */
    body.has-sidebar #sidebar {
        width: 16rem; /* 256px */
        transform: translateX(0) !important;
    }
    body.has-sidebar #topNavbar {
        padding-left: 16rem;
    }
    body.has-sidebar div.flex.h-screen > main,
    body.has-sidebar main.content-wrapper {
        margin-left: 16rem;
    }
    body.has-sidebar #footerContent {
        padding-left: 16rem;
    }

    /* Collapsed State (80px Icon Rail) */
    body.has-sidebar.sidebar-collapsed #sidebar,
    html.sidebar-collapsed body.has-sidebar #sidebar {
        width: 5rem !important;
    }
    body.has-sidebar.sidebar-collapsed #topNavbar,
    html.sidebar-collapsed body.has-sidebar #topNavbar {
        padding-left: 5rem;
    }
    body.has-sidebar.sidebar-collapsed div.flex.h-screen > main,
    html.sidebar-collapsed body.has-sidebar div.flex.h-screen > main,
    body.has-sidebar.sidebar-collapsed main.content-wrapper,
    html.sidebar-collapsed body.has-sidebar main.content-wrapper {
        margin-left: 5rem;
    }
    body.has-sidebar.sidebar-collapsed #footerContent,
    html.sidebar-collapsed body.has-sidebar #footerContent {
        padding-left: 5rem;
    }

    /* Collapsed Content Adaptations (Preserve Accessible Names via Visually Hidden, NOT display:none) */
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .nj-sidebar-header {
        justify-content: center;
        padding-inline: 0.5rem;
        gap: 0.25rem;
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .sidebar-brand-text,
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .sidebar-user-info,
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .sidebar-group-label,
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .sidebar-menu-label {
        position: absolute !important;
        inline-size: 1px !important;
        block-size: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .nj-brand-mark {
        display: none;
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar #sidebarCollapseBtn {
        inline-size: 2.25rem;
        block-size: 2.25rem;
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar #sidebarCollapseBtnIcon {
        transform: rotate(180deg);
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .sidebar-user-chevron {
        display: none;
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .sidebar-user-card {
        justify-content: center !important;
        padding: 0.5rem !important;
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .nj-nav-section-header {
        padding-inline: 0;
        justify-content: center;
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .nj-nav-section-divider {
        display: block;
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .sidebar-menu-item {
        justify-content: center !important;
        padding-inline: 0.35rem !important;
    }
    :is(body.sidebar-collapsed, html.sidebar-collapsed) #sidebar .nj-nav-badge {
        position: absolute;
        inset-block-start: 4px;
        inset-inline-end: 4px;
        min-inline-size: 1.1rem;
        block-size: 1.1rem;
        padding-inline: 0.25rem;
        font-size: 0.625rem;
    }
}

/* Mobile Sidebar Drawer */
@media (max-width: 1023px) {
    #sidebar {
        transform: translateX(-100%);
        height: 100svh;
    }
    #sidebar.mobile-open {
        transform: translateX(0) !important;
    }
    #sidebarOverlay.mobile-open {
        display: block !important;
    }
    .nj-rail-tooltip {
        display: none !important;
    }
    body.has-sidebar #topNavbar {
        padding-left: 0 !important;
    }
    body.has-sidebar div.flex.h-screen > main,
    body.has-sidebar main.content-wrapper {
        margin-left: 0 !important;
    }
    body.has-sidebar #footerContent {
        padding-left: 0 !important;
    }
}

@media (forced-colors: active) {
    .nj-sidebar .nj-nav-link[aria-current="page"] {
        outline: 2px solid Highlight;
        outline-offset: -2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nj-sidebar,
    .nj-brand-mark,
    .nj-sidebar-icon-btn,
    #sidebarCollapseBtnIcon,
    .nj-user-card,
    .nj-user-card .sidebar-user-chevron,
    .nj-sidebar .nj-nav-link,
    .nj-nav-icon-wrap,
    .nj-rail-tooltip,
    body.has-sidebar div.flex.h-screen > main,
    body.has-sidebar main.content-wrapper,
    body.has-sidebar #topNavbar,
    body.has-sidebar #footerContent {
        transition: none !important;
    }
}

/* Custom Scrollbar for Sidebar */
.nj-sidebar .scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 185, 255, 0.22) transparent;
}
.scrollbar-thin::-webkit-scrollbar {
    width: 4px;
}
.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(148, 185, 255, 0.22);
    border-radius: 4px;
}
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 185, 255, 0.38);
}

/* Bell ringing animation */
@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-14deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
    85% { transform: rotate(-2deg); }
}
.bell-ring {
    animation: bellRing 0.85s ease-in-out;
    transform-origin: top center;
    color: #0957d0 !important;
}

/* Hide scrollbar utility */
.hide-scrollbar::-webkit-scrollbar {
    display: none !important;
}
.hide-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* ================================================
   Flatpickr Thai Date Picker Styling
   ================================================ */
.flatpickr-calendar {
    font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif !important;
    border-radius: 1rem !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06) !important;
    border: 1px solid #e2e8f0 !important;
    padding: 0.35rem !important;
}
.flatpickr-input[readonly] {
    background-color: #ffffff;
    cursor: pointer !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #0957d0 !important;
    border-color: #0957d0 !important;
}
.flatpickr-day.today {
    border-color: #0957d0 !important;
    color: #0957d0 !important;
    font-weight: 700 !important;
}
.flatpickr-day.today.selected {
    color: #ffffff !important;
}
.flatpickr-months .flatpickr-month {
    height: 38px !important;
}
.flatpickr-current-month {
    font-size: 110% !important;
    padding-top: 4px !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-weight: 600 !important;
}
.flatpickr-current-month input.cur-year {
    font-weight: 600 !important;
}

/* ================================================
   Native Dialog,Accessible Equipment Controls & Sticky Table Region
   ================================================ */
dialog.nj-dialog {
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    max-width: min(42rem, calc(100vw - 2rem));
    width: 100%;
    max-height: calc(100dvh - 2rem);
    color: inherit;
    background: #ffffff;
}

dialog.nj-dialog[open] {
    display: flex;
    flex-direction: column;
}

dialog:modal {
    overscroll-behavior: contain;
}

dialog::backdrop {
    overflow: hidden;
    overscroll-behavior: contain;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.equipment-checkbox-native {
    accent-color: #0957d0;
    inline-size: 1.2rem;
    aspect-ratio: 1;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.equipment-checkbox-native:focus-visible {
    outline: 2.5px solid #0957d0;
    outline-offset: 2px;
}

.equipment-checkbox-native:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.equipment-tap-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-block-size: 44px;
    cursor: pointer;
}

.equipment-tap-label.is-disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.table-region-scroll {
    overflow: auto;
    max-inline-size: 100%;
    max-block-size: min(560px, 78vh);
    container-type: inline-size;
}

.table-region-scroll:focus-visible {
    outline: 2px solid #0957d0;
    outline-offset: 2px;
    border-radius: 0.75rem;
}

.table-region-scroll thead {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
}

/* ================================================
   Room Equipment Operate Surface — Precision Tokens & Tabs
   ================================================ */
.nj-equip-surface {
    --nj-surface: #ffffff;
    --nj-canvas: #f8fafc;
    --nj-subtle: #f1f5f9;
    --nj-border: #e2e8f0;
    --nj-ink: #0f172a;
    --nj-ink-muted: #475569;
    --nj-accent: #0957d0;
    --nj-hours: #b45309;
    caret-color: var(--nj-accent);
}

.nj-equip-surface ::selection {
    background-color: rgba(9, 87, 208, 0.16);
    color: #0f172a;
}

.nj-tabular {
    font-variant-numeric: tabular-nums;
}

.nj-elevated-panel {
    background: var(--nj-surface);
    border: 1px solid var(--nj-border);
    border-radius: 0.875rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.025);
}

/* Accessible Underline Tablist (WCAG 1.4.1 shape + high-contrast) */
.nj-tablist {
    display: flex;
    overflow-x: auto;
    gap: 0.25rem;
    border-block-end: 1px solid var(--nj-border);
    scrollbar-width: none;
}

.nj-tablist::-webkit-scrollbar {
    display: none;
}

.nj-tablist [role="tab"] {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    min-block-size: 44px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--nj-ink-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nj-tablist [role="tab"]:hover {
    color: var(--nj-ink);
}

.nj-tablist [role="tab"]:focus-visible {
    outline: 2px solid var(--nj-accent);
    outline-offset: -2px;
    border-radius: 0.5rem;
}

.nj-tablist [role="tab"][aria-selected="true"] {
    color: var(--nj-accent);
}

.nj-tablist [role="tab"][aria-selected="true"]::after {
    content: "";
    position: absolute;
    inset: auto 0.5rem 0 0.5rem;
    border-block-end: 3px solid var(--nj-accent);
    border-radius: 3px 3px 0 0;
}

/* Interactive Status Filter Metric Strip */
.nj-metric-filter {
    position: relative;
    text-align: left;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--nj-border);
    background: var(--nj-surface);
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.nj-metric-filter:hover {
    border-color: #cbd5e1;
    background: #fcfdff;
}

.nj-metric-filter:focus-visible {
    outline: 2px solid var(--nj-accent);
    outline-offset: 2px;
}

.nj-metric-filter[aria-pressed="true"] {
    border-color: var(--nj-accent);
    background: #f5f9ff;
    box-shadow: 0 2px 8px rgba(9, 87, 208, 0.08);
}

.nj-metric-filter[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    inset: auto 0.75rem 0 0.75rem;
    border-block-end: 2.5px solid var(--nj-accent);
}

/* Skeleton Shimmer */
@keyframes njPulseSkeleton {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.45; }
}

.nj-skeleton {
    background-color: #e2e8f0;
    border-radius: 0.5rem;
    animation: njPulseSkeleton 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .nj-skeleton {
        animation: none;
    }
}

/* ================================================
   Master-Detail Linked Admin Surfaces & Form Validation
   ================================================ */
body {
    accent-color: #0957d0;
    caret-color: #0957d0;
}

::selection {
    background-color: rgba(9, 87, 208, 0.16);
    color: #0f172a;
}

.nj-master-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    text-align: left;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.nj-master-item:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.nj-master-item.is-selected {
    background-color: #f0f6ff;
    border-color: #0957d0;
    box-shadow: 0 2px 8px rgba(9, 87, 208, 0.08);
}

.nj-master-select-btn {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: inherit;
}

.nj-master-select-btn:focus-visible {
    outline: 2px solid #0957d0;
    outline-offset: 2px;
    border-radius: 0.375rem;
}

.nj-validated-form :is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) {
    border-color: #dc2626 !important;
    background-color: #fef2f2;
}

.nj-validated-form :is(input, select, textarea):focus-visible {
    outline: 2px solid #0957d0;
    outline-offset: 1px;
}






