:root {
    /* Backgrounds */
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #242734;
    --bg-hover: #2a2e3d;

    /* Text */
    --text-primary: #e8eaed;
    --text-secondary: #9aa0ab;
    --text-tertiary: #6b7280;

    /* Accent (SWITCHED TO BLUE) */
    --accent-primary: #3b82f6;
    /* Blue-500 */
    --accent-primary-hover: #60a5fa;
    /* Blue-400 */
    --accent-secondary: #0ea5e9;
    /* Sky-500 */

    /* Status Colors */
    --status-success: #22c55e;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;
    --status-info: #3b82f6;
    --status-neutral: #6b7280;

    /* Borders & Shadows */
    --border-primary: #2a2e3d;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.6);

    /* Dimensions */
    --sidebar-width: 250px;
    --topbar-height: 60px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-layout {
    display: flex;
    height: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Sidebar */
.logo-area {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-primary);
}

.logo-icon {
    color: var(--accent-primary);
    font-size: 24px;
    margin-right: 10px;
}

.nav-menu {
    padding: 20px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--bg-hover);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

.nav-item i {
    font-size: 20px;
    margin-right: 12px;
}

.nav-badge {
    background: var(--status-danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}


/* Topbar & Breadcrumbs */
.topbar {
    height: var(--topbar-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.breadcrumbs ol {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
    color: var(--text-secondary);
}

.breadcrumbs li+li::before {
    content: "/";
    margin: 0 8px;
    color: var(--text-tertiary);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent-primary);
}

.breadcrumbs li:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.toggle-sidebar {
    display: none;
    cursor: pointer;
    font-size: 24px;
    margin-right: 15px;
}

/* Notification bell (topbar) */
.notif-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
}
.notif-bell:hover {
    background: var(--bg-hover);
}
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--status-danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-modal);
    z-index: 1100;
    display: none;
}
.notif-bell.notif-open .notif-dropdown {
    display: block;
}
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--bg-tertiary);
    gap: 12px;
}
.notif-dropdown-header .notif-action {
    padding: 6px 0;
}
.notif-dropdown-header .notif-view-all {
    margin-left: auto;
}
.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    gap: 12px;
    cursor: pointer;
    align-items: flex-start;
}
.notif-item:hover {
    background: var(--bg-hover);
}
.notif-item.unread {
    background: rgba(59, 130, 246, 0.05);
}
.notif-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.notif-message {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.35;
}
.notif-time {
    font-size: 11px;
    color: var(--text-tertiary);
}
.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 6px;
}
.notif-action {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--accent-primary);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}
.notif-action:hover {
    background: var(--bg-hover);
}
.notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* Notifications full page */
.notif-page-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.notif-page-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}
.notif-page-card .notif-page-list {
    padding: 0;
}
.notif-page-card .notif-item {
    border-bottom: 1px solid var(--bg-tertiary);
}
.notif-page-card .notif-item:last-child {
    border-bottom: none;
}
.notif-page-card .notif-type-icon {
    font-size: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    position: relative;
}

.user-profile-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 6px 12px;
    margin: -6px -12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile-inner:hover {
    background: var(--bg-hover);
}

/* Bridge the gap between profile and dropdown */
.user-profile-inner::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-modal);
    display: none;
    flex-direction: column;
    z-index: 1100;
    overflow: hidden;
    padding: 4px 0;
}

/* Show dropdown on hover of profile container */
.user-profile-inner:hover .user-dropdown {
    display: flex;
    animation: slideUp 0.2s ease;
}

.dropdown-item {
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    font-size: 14px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-item i {
    font-size: 18px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 4px 0;
}

.dropdown-item.text-danger {
    color: var(--status-danger);
}
    
.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Role Switcher */
.role-switcher {
    position: relative;
    display: flex;
    align-items: center;
}

/* Bridge the gap between button and dropdown so hover is not lost when moving cursor down */
.role-switcher::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
}

.role-switcher-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    max-width: 200px;
}

.role-switcher-btn .role-org-name {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-switcher-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.role-switcher-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 260px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-modal);
    display: none;
    flex-direction: column;
    z-index: 1100;
    overflow: hidden;
    padding: 4px 0;
}

.role-switcher:hover .role-switcher-dropdown {
    display: flex;
    animation: slideUp 0.2s ease;
}

.role-switcher-item {
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s;
    font-size: 13px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.role-switcher-item-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-switcher-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.role-switcher-item .role-org-name {
    font-weight: 500;
}

.role-switcher-item .role-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.role-switcher-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.role-switcher-item.active {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-primary);
}

.role-switcher-item.active .role-label {
    color: var(--accent-primary);
}

.role-icon {
    font-size: 16px;
}

/* Main Content */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}

.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 8px;
}

.placeholder-page .placeholder-message {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Typography & Utilities */
h1,
h2,
h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 16px;
}

p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.text-sm {
    font-size: 12px;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-danger {
    color: var(--status-danger);
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

.flex {
    display: flex;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.wrap {
    flex-wrap: wrap;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-success {
    background: var(--status-success, #16a34a);
    color: white;
    border: 1px solid var(--status-success, #16a34a);
}

.btn-success:hover {
    background: var(--status-success-hover, #15803d);
    border-color: var(--status-success-hover, #15803d);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--accent-primary);
}

.btn-link:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

/* Organization profile contact/website links – readable on blue theme */
.td-org-profile-link {
    color: var(--text-primary);
    text-decoration: none;
    /* text-decoration: underline; */
    /* text-underline-offset: 2px; */
}
.td-org-profile-link:hover {
    color: var(--accent-primary-hover);
}

.event-website-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #fff;
    color: #fff;
    background: transparent;
    border-radius: 999px;
    text-decoration: none;
}

.event-website-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.td-org-contact-sep {
    margin: 0 0.5em;
    color: var(--text-secondary);
    font-weight: 400;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.icon-button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.icon-button .ph {
    font-size: 18px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.table-actions .btn,
.table-actions .icon-button {
    flex-shrink: 0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Group (For Filters) */
.btn-group {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 2px;
}

.btn-group .btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 6px 12px;
}

.btn-group .btn:hover {
    color: var(--text-primary);
}

.btn-group .btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Inputs */
.form-group {
    margin-bottom: 16px;
}

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

.form-control,
select,
input[type="text"],
input[type="date"] {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.form-control:focus,
select:focus,
input:focus {
    border-color: var(--accent-primary);
}

/* Cards & Grid */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.grid-events {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Stat Card */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-primary);
}

.stat-info .label {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
}

.stat-info .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--status-success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-info);
}

.badge-neutral {
    background: rgba(107, 114, 128, 0.15);
    color: var(--status-neutral);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert i { flex-shrink: 0; margin-top: 2px; }
.alert-info {
    background: rgba(59, 130, 246, 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    border-bottom: 1px solid var(--border-primary);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-tertiary);
    color: var(--text-primary);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--bg-hover);
}

/* Spinner & Toast */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-hover);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid var(--accent-primary);
    box-shadow: var(--shadow-modal);
    min-width: 300px;
    display: flex;
    justify-content: space-between;
    animation: slideInRight 0.3s ease;
}

.toast.success {
    border-left-color: var(--status-success);
}

.toast.error {
    border-left-color: var(--status-danger);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Modals */
.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-overlay-stack {
    z-index: 1050;
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    border-radius: 8px;
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border-primary);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-content.modal-wide {
    max-width: 960px;
}

/* Modal body scrolls when content is taller than viewport */
.modal-content .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Conversation (message thread) modal – roomy but not fullscreen */
.modal-content.modal-conversation {
    max-width: 640px;
    min-height: 420px;
}
.modal-content.modal-conversation .modal-body {
    min-height: 320px;
    display: flex;
    flex-direction: column;
}
.modal-content.modal-conversation .td-thread-messages {
    flex: 1;
    min-height: 240px;
    max-height: 50vh;
    overflow-y: auto;
}

/* Full viewport modal (e.g. View Broadcast) */
.modal-overlay.modal-full-viewport {
    align-items: stretch;
    padding: 0;
}
.modal-content.modal-full-viewport {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}
.modal-content.modal-full-viewport .modal-body {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.modal-content.modal-full-viewport .view-broadcast-grid {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 24px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}
.modal-content.modal-full-viewport .view-broadcast-left {
    min-height: 0;
    overflow: auto;
}
.modal-content.modal-full-viewport .view-broadcast-right {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-content.modal-full-viewport .view-broadcast-right .table-container {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* Waitlist modal: action buttons in a row */
.waitlist-actions-cell {
    white-space: nowrap;
}
.waitlist-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Toggle switch (checkbox styled as toggle) */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-primary);
}
.toggle-row:last-child {
    border-bottom: none;
}
.toggle-row label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}
.toggle-switch-wrap {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.toggle-switch-wrap input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.toggle-switch-wrap .toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
}
.toggle-switch-wrap .toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.2s ease, background 0.2s ease;
}
.toggle-switch-wrap input:checked ~ .toggle-slider::after {
    transform: translateX(20px);
    background: var(--accent-primary);
}

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

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

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
}

/* Filter Bar Specifics */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    position: relative;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.page-header h1 {
    margin: 0;
}

/* Tab navigation (e.g. TD Event Detail) */
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 20px;
    gap: 0;
}

.tab-btn {
    padding: 12px 20px;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Request Roster Changes (modal overlay 2 body content) */
.request-changes-summary {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.request-changes-summary strong {
    color: var(--text-primary);
}

/* TD Registration modal — roster reminder (not submitted / overdue) */
.td-reg-roster-reminder {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.03) 100%);
    border: 1px solid var(--status-warning);
    border-radius: 12px;
}

.td-reg-roster-reminder-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    color: var(--status-warning);
}

.td-reg-roster-reminder-icon .ph {
    font-size: 24px;
}

.td-reg-roster-reminder-content {
    flex: 1;
    min-width: 0;
}

.td-reg-roster-reminder-title {
    margin: 0 0 6px 0;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.td-reg-roster-reminder-desc {
    margin: 0 0 14px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.td-reg-roster-reminder-content .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.td-reg-roster-reminder-content .btn .ph {
    font-size: 16px;
}

/* ==========================================================================
   TD Check-In (Section 8.4) — touch-friendly, tablet-ready
   ========================================================================== */
.td-checkin-page {
    padding-bottom: 24px;
}

.td-checkin-summary-bar {
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
}

.td-checkin-summary-text {
    color: var(--text-primary);
}

.td-checkin-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 24px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.td-checkin-filters-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.td-checkin-filter-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.td-checkin-filter-input,
.td-checkin-filter-select {
    min-height: 40px;
    padding: 8px 12px;
}

.td-checkin-filter-select {
    min-width: 160px;
}

.td-checkin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.td-checkin-card {
    padding: 0;
    overflow: hidden;
}

.td-checkin-card-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 18px;
    min-height: 72px;
}

.td-checkin-card-main {
    flex: 1;
    min-width: 0;
}

.td-checkin-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.td-checkin-card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.td-checkin-card-indicators {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
}

.td-checkin-indicator {
    color: var(--text-secondary);
}

.td-checkin-timestamp {
    color: var(--status-success);
    font-size: 0.8125rem;
}

.td-checkin-card-action {
    flex-shrink: 0;
}

/* Minimum 48px touch target for check-in toggle (accessibility + tablet) */
.td-checkin-toggle {
    min-height: 48px;
    min-width: 120px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.td-checkin-toggle.btn-success {
    background-color: var(--status-success);
    color: #fff;
    border-color: var(--status-success);
}

.td-checkin-toggle.btn-success:hover {
    filter: brightness(1.1);
}

.td-checkin-toggle.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.td-checkin-toggle.btn-secondary:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -250px;
        z-index: 999;
        height: 100%;
    }

    .sidebar.open {
        transform: translateX(250px);
        left: 0;
    }

    .toggle-sidebar {
        display: block;
    }

    .td-checkin-card-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .td-checkin-card-action {
        width: 100%;
    }

    .td-checkin-toggle {
        width: 100%;
        min-width: 0;
    }
}

/* TD Registration Import modal (Section 5.4) */
.td-import-cell-error {
    background-color: rgba(var(--status-danger-rgb, 220, 53, 69), 0.15) !important;
    border-color: var(--status-danger, #dc3545) !important;
}
.td-import-drop-zone-active {
    border-color: var(--accent-primary) !important;
    background: rgba(var(--accent-primary-rgb, 13, 110, 253), 0.08) !important;
}