.btn.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* Sidebar User Section */
.sidebar-user-section {
    padding-top: var(--spacing-4);
    border-top: 1px solid var(--border);
    margin-top: var(--spacing-4);
}

.user-account-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.user-account-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.user-account-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    flex: 1;
    padding: 0;
    background: none;
    border: none;
    text-align: left;
    cursor: default;
    transition: opacity 0.2s ease;
}

.user-account-btn.clickable {
    cursor: pointer;
}

.user-account-btn.clickable:hover {
    opacity: 0.8;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.user-info-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.user-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: var(--font-size-xs);
    color: var(--muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.logout-btn:active {
    transform: translateY(0);
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.top-nav-user-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.top-nav-user-card .user-account-card {
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius-xl);
    box-shadow: none;
    min-width: 220px;
}

.top-nav-user-card .user-avatar {
    width: 34px;
    height: 34px;
}

.top-nav-user-card .user-info-content {
    gap: 2px;
}

.top-nav-user-card .user-name {
    font-size: 0.85rem;
}

.top-nav-guest-actions {
    display: flex;
    gap: var(--spacing-2);
}

.top-nav-guest-actions .btn {
    border-radius: var(--radius-full);
}

@media (max-width: 768px) {
    .top-nav-actions {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-2);
    }
    .top-nav-user-card {
        width: 100%;
        justify-content: space-between;
    }
    .top-nav-user-card .user-account-card {
        flex: 1;
    }
    .top-nav-guest-actions {
        width: 100%;
        justify-content: space-between;
    }
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

/* Admin Login Form */
.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.admin-login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.admin-login-form label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
}

.admin-login-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.admin-login-form .password-wrapper {
    position: relative;
}

.admin-login-form .form-control {
    width: 100%;
    padding: var(--spacing-3);
    font-size: var(--font-size-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: all 0.2s ease;
}

.admin-login-form .password-wrapper .form-control {
    padding-right: 44px;
}

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

.admin-login-form .form-control::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.password-toggle {
    position: absolute;
    right: var(--spacing-2);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: var(--spacing-2);
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    z-index: 1;
    width: 32px;
    height: 32px;
}

.password-toggle:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle .eye-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle .eye-open {
    display: block;
}

.form-hint {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-1);
    font-size: var(--font-size-xs);
    color: var(--muted);
    line-height: 1.5;
    margin-top: var(--spacing-1);
}

.form-hint svg {
    flex-shrink: 0;
    margin-top: 2px;
    width: 14px;
    height: 14px;
}

.admin-login-form .form-actions {
    display: flex;
    gap: var(--spacing-2);
    justify-content: flex-end;
    padding-top: var(--spacing-2);
    border-top: 1px solid var(--border);
    margin-top: var(--spacing-2);
}

.admin-login-form .form-actions .btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.admin-login-form .form-actions .btn-outline {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.admin-login-form .form-actions .btn-outline:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.admin-login-form .form-actions .btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.admin-login-form .form-actions .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.admin-login-form .form-actions .btn-primary:active {
    transform: translateY(0);
}

.admin-login-form .form-actions .btn svg {
    width: 16px;
    height: 16px;
}

/* Staff Tabs */
.staff-tabs {
    display: flex;
    gap: var(--spacing-2);
    border-bottom: 1px solid var(--border);
    padding: 0;
    margin: 0;
}

.staff-tab {
    padding: var(--spacing-3) var(--spacing-4);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: -1px;
}

.staff-tab:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.staff-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-right: 4px;
    white-space: nowrap;
}

/* Legacy account-btn support */
.account-btn {
    padding: var(--spacing-2) var(--spacing-3);
    width: auto;
    height: auto;
    justify-content: flex-start;
    gap: var(--spacing-2);
}

.account-btn:hover {
    background: var(--surface-hover);
}

/* Sidebar - Modern & Minimalist */
.sidebar {
    background: rgba(255, 255, 255, 0.82);
    background-image: linear-gradient(180deg, rgba(59,130,246,0.05) 0%, rgba(99,102,241,0.03) 35%, rgba(255,255,255,0.1) 100%);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-5) var(--spacing-4);
    min-height: 100vh;
    border-right: 1px solid rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(14px);
}

body[data-theme="dark"] .sidebar {
    background: rgba(15, 23, 42, 0.7);
    border-right-color: rgba(255, 255, 255, 0.08);
}

.sidebar .brand {
    margin-bottom: var(--spacing-6);
    padding-bottom: var(--spacing-4);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.sidebar .brand svg {
    color: var(--primary);
    flex-shrink: 0;
}

.sidebar .brand > div {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.sidebar .brand > div > div:first-child {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--text);
}

.sidebar .brand > div > div:last-child {
    font-size: var(--font-size-xs);
    color: var(--muted);
}

.sidebar .tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    padding-right: 2px;
}

.sidebar .tab {
    width: 100%;
    text-align: left;
    padding: var(--spacing-2) var(--spacing-3);
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-sm);
    font-weight: 500;
    position: relative;
    min-height: 42px;
}

.sidebar .tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

.sidebar .tab:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(59,130,246,0.15);
}

.sidebar .tab:hover svg {
    opacity: 1;
    color: inherit;
}

.sidebar .tab[aria-current="page"] {
    background: linear-gradient(90deg, rgba(59,130,246,0.18) 0%, rgba(59,130,246,0.08) 100%);
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(59,130,246,0.25);
}

.sidebar .tab[aria-current="page"]::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: 0 8px 20px rgba(59,130,246,0.3);
}

.sidebar .tab[aria-current="page"] svg {
    opacity: 1;
    color: var(--primary);
}

/* Navbar (legacy, for compatibility) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--surface);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-4);
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    font-weight: 600;
}

.tabs {
    display: flex;
    gap: var(--spacing-2);
}

.tab {
    padding: var(--spacing-2) var(--spacing-3);
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.tab[aria-current="page"] {
    background: var(--primary);
    color: var(--primary-contrast);
}

/* Top navigation tabs for non-admin roles */
.top-nav {
    display: flex;
    justify-content: center;
    padding: var(--spacing-2) var(--spacing-4);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.9);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .top-nav {
    background: rgba(30, 41, 59, 0.85);
}

.top-nav.top-nav-scrolled {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

.top-nav-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-4);
}

.top-nav-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.top-nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.top-nav-tabs {
    display: flex;
    gap: var(--spacing-2);
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    padding: 0 var(--spacing-1);
    scrollbar-width: none;
    position: relative;
}

.top-nav-tabs::-webkit-scrollbar {
    display: none;
}

.top-nav-tabs::before,
.top-nav-tabs::after {
    content: '';
    position: sticky;
    top: 0;
    width: 18px;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.top-nav-tabs::before {
    left: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0));
}

.top-nav-tabs::after {
    right: 0;
    background: linear-gradient(270deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0));
}

[data-theme="dark"] .top-nav-tabs::before {
    background: linear-gradient(90deg, rgba(30,41,59,0.85) 0%, rgba(30,41,59,0));
}

[data-theme="dark"] .top-nav-tabs::after {
    background: linear-gradient(270deg, rgba(30,41,59,0.85) 0%, rgba(30,41,59,0));
}

.top-nav-tabs.has-left-shadow::before {
    opacity: 1;
}

.top-nav-tabs.has-right-shadow::after {
    opacity: 1;
}

.top-nav-tabs .tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    white-space: nowrap;
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: rgba(148, 163, 184, 0.14);
    color: var(--muted);
    min-height: 38px;
}

.top-nav-tabs .tab:hover {
    background: rgba(59, 130, 246, 0.12);
    color: var(--text);
    border-color: rgba(59, 130, 246, 0.15);
}

.top-nav-tabs .tab[aria-current="page"] {
    background: var(--primary);
    color: var(--primary-contrast);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .top-nav-inner {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-3);
    }
    .top-nav-actions {
        width: 100%;
        justify-content: space-between;
    }
}

.theme-switcher {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: var(--spacing-2);
}

.theme-switcher .btn {
    flex: 1;
    justify-content: center;
    padding: var(--spacing-2);
    border-radius: var(--radius);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-icon-only {
    font-size: 1.3rem;
    line-height: 1;
}

.theme-btn.theme-active {
    background: var(--primary);
    color: var(--primary-contrast);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

/* Buttons - Flat Design, Modern Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    user-select: none;
}

.btn:hover:not(:disabled) {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-primary {
    background: var(--primary);
    color: var(--primary-contrast);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--primary-contrast);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
    border-color: #DC2626;
    color: white;
}

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

.btn-outline:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon {
    padding: var(--spacing-2);
    border-radius: var(--radius);
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

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

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* CRUD Icon Buttons */
.crud-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

tr:hover .crud-actions {
    opacity: 1;
}

.btn-edit-icon,
.btn-delete-icon,
.btn-transfer-icon,
.btn-add-icon {
    padding: var(--spacing-1);
    border-radius: var(--radius);
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-edit-icon {
    color: var(--primary);
}

.btn-edit-icon:hover {
    background: var(--primary);
    color: var(--primary-contrast);
}

.btn-transfer-icon {
    color: var(--warning, #F59E0B);
}

.btn-transfer-icon:hover {
    background: var(--warning, #F59E0B);
    color: white;
    transform: scale(1.05);
}

.btn-delete-icon {
    color: var(--danger);
}

.btn-delete-icon:hover {
    background: var(--danger);
    color: var(--danger-contrast);
}

.btn-add-icon {
    background: var(--primary);
    color: var(--primary-contrast);
}

.btn-add-icon:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.btn-add-icon svg,
.btn-edit-icon svg,
.btn-delete-icon svg,
.btn-transfer-icon svg {
    width: 16px;
    height: 16px;
}

.btn-sm {
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-xs);
}

/* Cards - Flat Design, Modern */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-4);
    border: 1px solid var(--border);
    transition: all 0.2s ease-in-out;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    padding: var(--spacing-3);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--muted);
    background: var(--bg);
}

.table-striped tbody tr {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.table-striped tbody tr:hover {
    background: var(--bg);
    transform: translateX(2px);
}

/* Session row clickable */
.session-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    position: relative;
}

.session-row-clickable:hover {
    background: var(--bg) !important;
    transform: translateX(2px);
}

.session-row-clickable:active {
    transform: translateX(0);
    background: var(--surface) !important;
}

.session-row-clickable.row-selected {
    background: rgba(59, 130, 246, 0.1) !important;
    border-left: 3px solid var(--primary);
}

.session-row-clickable.row-selected:hover {
    background: rgba(59, 130, 246, 0.15) !important;
}

/* Status dropdown */
.status-dropdown {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.status-cell {
    position: relative;
    overflow: visible;
}

.table-striped tbody {
    position: relative;
    overflow: visible;
}

.table-striped tbody td {
    position: relative;
    overflow: visible;
}

.status-badge {
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--radius);
    border: none;
    cursor: default;
    font-size: var(--font-size-sm);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    position: relative;
    user-select: none;
}

.status-badge.badge-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #047857;
}

.status-badge.badge-danger {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: #b91c1c;
}

.status-badge.badge-purple {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: #7c3aed;
}

[data-theme="dark"] .status-badge.badge-success {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.35);
    color: #34d399;
}

[data-theme="dark"] .status-badge.badge-danger {
    background: rgba(244, 63, 94, 0.18);
    border-color: rgba(244, 63, 94, 0.35);
    color: #f87171;
}

[data-theme="dark"] .status-badge.badge-purple {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    color: #c4b5fd;
}

.status-dropdown-menu,
.status-menu-header,
.status-option,
.status-option:hover,
.status-option:active,
.status-option .badge,
.status-option span:not(.badge),
.status-option-active,
.status-check {
    display: none;
}

/* Sessions table checkbox */
.sessions-table input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.sessions-table th:first-child,
.sessions-table td:first-child {
    text-align: center;
    width: 40px;
}

.status-cell {
    position: relative;
}

.session-actions-header {
    width: 48px;
}

.session-actions {
    text-align: right;
}

.session-actions .btn-delete-icon {
    min-width: 32px;
    min-height: 32px;
}

/* Edit icon in table row */
.table-striped tbody tr .row-edit-icon {
    position: absolute;
    right: var(--spacing-3);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.table-striped tbody tr:hover .row-edit-icon {
    opacity: 1;
    pointer-events: auto;
}

.table-striped tbody tr .row-edit-icon button {
    padding: var(--spacing-1) var(--spacing-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--muted);
}

.table-striped tbody tr .row-edit-icon button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-contrast);
    transform: scale(1.05);
}

.table-striped tbody tr .row-delete-icon {
    position: absolute;
    right: var(--spacing-3);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.table-striped tbody tr:hover .row-delete-icon {
    opacity: 1;
    pointer-events: auto;
}

.table-striped tbody tr .row-delete-icon button {
    padding: var(--spacing-1) var(--spacing-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--danger);
    width: 32px;
    height: 32px;
}

.table-striped tbody tr .row-delete-icon button:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    transform: scale(1.05);
}

.table-striped tbody tr .row-delete-icon button svg {
    width: 16px;
    height: 16px;
}

/* Link icon style */
.link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all 0.2s ease;
    padding: var(--spacing-1);
    border-radius: var(--radius);
}

.link-icon:hover {
    background: var(--bg);
    color: var(--primary);
    transform: scale(1.1);
}

.link-icon svg {
    width: 16px;
    height: 16px;
}

.link-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.link-actions .btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    transition: all 0.2s ease;
}

.link-actions .btn-icon:hover {
    background: var(--bg-muted);
    color: var(--primary);
}

.table-striped tbody tr.selected {
    background: rgba(37, 99, 235, 0.1);
    border-left: 3px solid var(--primary);
}

.table-striped tbody tr:nth-child(even) {
    background: var(--bg);
}

.table-striped tbody tr:nth-child(even).selected {
    background: rgba(37, 99, 235, 0.1);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: var(--success);
    color: white;
    font-weight: 500;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-purple {
    background: #9333EA;
    color: white;
}

[data-theme="dark"] .badge-purple {
    background: #A855F7;
    color: white;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-4);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

/* Đảm bảo modal backdrop luôn hiển thị đúng background khi ở landing mode */
body.home-landing-mode .modal-backdrop {
    background: rgba(0,0,0,0.6);
    z-index: 10000;
}

/* Ẩn hoàn toàn sidebar và layout admin khi modal mở ở landing mode */
body.home-landing-mode .modal-backdrop ~ * .sidebar,
body.home-landing-mode .modal-backdrop ~ * aside,
body.home-landing-mode .modal-backdrop ~ * .layout:not(.layout-landing) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-body {
    padding: var(--spacing-4);
}

/* Forms */
/* Enhanced Form Styles */
.staff-form-enhanced {
    max-width: 100%;
}

.form-section {
    margin-bottom: var(--spacing-6);
    padding: var(--spacing-5);
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-4);
    padding-bottom: var(--spacing-3);
    border-bottom: 2px solid var(--border);
}

.form-section-header svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.form-section-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.form-section-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.form-group {
    margin-bottom: var(--spacing-4);
}

.form-group-enhanced {
    margin-bottom: var(--spacing-4);
}

.form-label-with-icon {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-2);
}

.form-label-with-icon svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

label {
    display: block;
    margin-bottom: var(--spacing-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
}

input, select, textarea {
    width: 100%;
    padding: var(--spacing-2) var(--spacing-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Responsive sidebar */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        overflow-x: auto;
        padding: var(--spacing-2);
    }
    .sidebar .brand {
        margin-bottom: 0;
        margin-right: var(--spacing-4);
        padding-bottom: 0;
        border-bottom: none;
        border-right: 1px solid rgba(0,0,0,0.1);
        padding-right: var(--spacing-4);
    }
    .sidebar .tabs {
        flex-direction: row;
        gap: var(--spacing-2);
    }
    .sidebar .tab {
        white-space: nowrap;
        margin-bottom: 0;
    }
    .sidebar .actions {
        margin-top: 0;
        margin-left: auto;
    }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-4);
        font-size: 0.875rem;
    }
.breadcrumb-item a {
    color: var(--muted);
    text-decoration: none;
}
.breadcrumb-item a:hover {
    color: var(--primary);
}
.breadcrumb-current {
    color: var(--text);
    font-weight: 500;
}
.breadcrumb-separator {
    color: var(--muted);
}

/* Loading states - Enhanced */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-8);
    min-height: 200px;
    gap: var(--spacing-3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 4px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: spin 1.2s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    color: var(--primary-contrast);
}

.btn-outline.btn-loading::after {
    color: var(--primary);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        var(--bg) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(
        90deg,
        var(--surface) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        var(--surface) 100%
    );
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--spacing-2);
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    padding: var(--spacing-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.skeleton-table-row {
    display: flex;
    gap: var(--spacing-3);
    padding: var(--spacing-3);
    align-items: center;
}

.skeleton-table-row .skeleton-text {
    flex: 1;
    margin: 0;
}

.skeleton-table-row .skeleton-avatar {
    flex-shrink: 0;
}

/* Data Loading Indicator & Sync Badge */
.data-loading-indicator {
    margin-bottom: var(--spacing-4);
}

.loading-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4);
    background: var(--primary);
    color: var(--primary-contrast);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    box-shadow: var(--shadow);
}

.loading-spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.data-sync-badge {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    transition: opacity 0.3s ease;
}

.data-sync-badge .sync-icon {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

[data-theme="dark"] .data-sync-badge {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Responsive: Hide sync badge on mobile */
@media (max-width: 768px) {
    .data-sync-badge {
        top: 60px;
        right: 10px;
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Form errors - Enhanced */
.form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.success {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-error {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    color: var(--danger);
    font-size: var(--font-size-xs);
    margin-top: var(--spacing-1);
    font-weight: 500;
}

.form-error::before {
    content: '⚠';
    font-size: 14px;
}

.form-success {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    color: var(--success);
    font-size: var(--font-size-xs);
    margin-top: var(--spacing-1);
    font-weight: 500;
}

.form-success::before {
    content: '✓';
    font-size: 14px;
}

.form-hint {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-1);
    font-size: var(--font-size-xs);
    color: var(--muted);
    margin-top: var(--spacing-1);
    line-height: 1.5;
}

/* Toast notifications - Enhanced */
.toast-container {
    position: fixed;
    right: var(--spacing-4);
    bottom: var(--spacing-4);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    z-index: 200;
    max-width: 400px;
    width: calc(100% - var(--spacing-8));
}

@media (max-width: 640px) {
    .toast-container {
        right: var(--spacing-2);
        bottom: var(--spacing-2);
        left: var(--spacing-2);
        width: auto;
        max-width: none;
    }
}

.toast {
    background: var(--surface);
    color: var(--text);
    padding: var(--spacing-3) var(--spacing-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    font-size: var(--font-size-sm);
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-2);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    animation: toastProgress 3s linear forwards;
}

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

.toast.success::before {
    background: var(--success);
}

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

.toast.error::before {
    background: var(--danger);
}

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

.toast.warning::before {
    background: var(--warning);
}

.toast.info {
    border-left-color: var(--primary);
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: var(--spacing-1);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: var(--bg);
    color: var(--text);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(calc(100% + var(--spacing-4)));
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastProgress {
    to {
        transform: scaleX(1);
    }
}

.toast.exiting {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(calc(100% + var(--spacing-4)));
        opacity: 0;
    }
}
/* Search highlight */
mark {
    background: #fef08a;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Teachers page specific styles (purple accent) */
.teachers-page {
    --teacher-primary: var(--secondary, #9333ea);
}

/* Class detail inline animation - Subtle */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.class-detail-inline {
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}

/* Edit icon in class detail page */
.class-edit-icon {
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: var(--spacing-1);
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.class-edit-icon:hover {
    opacity: 1;
    transform: scale(1.1);
    color: var(--primary);
}

.teachers-page .btn-primary {
    background: var(--secondary);
    color: var(--primary-contrast);
}

.teachers-page .btn-primary:hover {
    background: var(--secondary);
    opacity: 0.9;
}

.teachers-page .btn {
    border-color: rgba(147, 51, 234, 0.1);
}

.teachers-page .btn-sm {
    padding: 6px 8px;
    font-size: 0.8125rem;
}

.teachers-page .badge-teacher {
    background: var(--secondary);
    color: #fff;
}

/* Collapsible Sections - Modern Style */
.collapsible-section {
    border-radius: var(--radius-lg);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-3) var(--spacing-4);
    user-select: none;
    transition: background-color 0.2s ease-in-out;
    border-radius: var(--radius-lg);
}

.section-header:hover {
    background: var(--bg);
}

.section-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
}

.section-header-main {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.toggle-icon {
    font-size: var(--font-size-sm);
    color: var(--muted);
    transition: transform 0.3s ease-in-out, color 0.2s ease-in-out;
    user-select: none;
}

.section-header:hover .toggle-icon {
    color: var(--primary);
}

.section-content {
    padding: var(--spacing-4);
    overflow: visible;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out;
    max-height: 5000px;
    opacity: 1;
}

.section-content[style*="max-height: 0"] {
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

/* Space utility for sections */
.space-y-3 > * + * {
    margin-top: var(--spacing-3);
}

/* Form row for side-by-side inputs */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-4);
}

/* Form actions */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-2);
    margin-top: var(--spacing-4);
    padding-top: var(--spacing-4);
    border-top: 1px solid var(--border);
}

/* Add to Topic Form Styles */
.add-to-topic-form .topic-selection-list {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.add-to-topic-form .topic-selection-list::-webkit-scrollbar {
    width: 6px;
}

.add-to-topic-form .topic-selection-list::-webkit-scrollbar-track {
    background: transparent;
}

.add-to-topic-form .topic-selection-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.add-to-topic-form .topic-selection-list::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.topic-option-item {
    user-select: none;
}

.topic-option-item:hover {
    background: var(--bg) !important;
    border-color: var(--primary) !important;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.topic-option-item .topic-checkbox:checked + .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.topic-option-item .topic-checkbox:checked + .custom-checkbox svg {
    display: block;
}

.topic-option-item .topic-checkbox:checked ~ div {
    color: var(--primary);
}

.topic-option-item .topic-checkbox:checked ~ div svg {
    color: var(--primary);
}

.topic-option-item .custom-checkbox {
    position: relative;
}

.topic-option-item .custom-checkbox::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.topic-option-item:hover .custom-checkbox::after {
    opacity: 1;
}

.topic-option-item .topic-checkbox:focus + .custom-checkbox {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Exercise Detail Modal Styles */
.exercise-detail-modal {
    max-width: 100%;
}

.exercise-detail-modal .detail-info-item {
    padding: var(--spacing-3);
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.exercise-detail-modal .detail-info-item:hover {
    border-color: var(--border-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.exercise-detail-modal .detail-section {
    padding: var(--spacing-4);
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

[data-theme="dark"] .exercise-detail-modal .detail-info-item,
[data-theme="dark"] .exercise-detail-modal .detail-section {
    background: var(--surface-dark);
    border-color: var(--border-dark);
}

@media (max-width: 768px) {
    .exercise-detail-modal .detail-info-item {
        padding: var(--spacing-2);
    }
    
    .exercise-detail-modal .detail-section {
        padding: var(--spacing-3);
    }
}

/* Tag Multi-Select Styles */
.tag-select-container {
    position: relative;
}

.tag-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-1);
    padding: var(--spacing-2) var(--spacing-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 42px;
    cursor: text;
    transition: all 0.2s ease;
}

.tag-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .tag-input-wrapper {
    background: var(--surface-dark);
    border-color: var(--border-dark);
}

.tag-search-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    font-size: var(--font-size-sm);
    color: var(--text);
}

.tag-search-input::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.tag-dropdown {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    animation: slideDown 0.2s ease;
    max-height: 400px;
    overflow-y: auto;
}

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

.tag-level-group {
    border-bottom: 2px solid var(--border);
}

.tag-level-group:last-child {
    border-bottom: none;
}

.tag-level-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.tag-dropdown-empty {
    animation: fadeIn 0.3s ease;
}

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

.tag-suggestion-chip {
    animation: fadeIn 0.2s ease;
}

.tag-suggestion-chip:hover {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.tag-dropdown::-webkit-scrollbar {
    width: 6px;
}

.tag-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.tag-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.tag-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.tag-dropdown-item {
    transition: all 0.2s ease;
}

.tag-dropdown-item:hover {
    background: var(--bg) !important;
}

.tag-dropdown-item:last-child {
    border-bottom: none !important;
}

.selected-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-1);
    flex: 1;
}

.tag-badge-selected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: var(--font-size-xs);
    background: linear-gradient(135deg, var(--primary) 0%, rgba(59, 130, 246, 0.9) 100%);
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.tag-badge-selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.tag-badge-selected:hover::before {
    left: 100%;
}

.tag-badge-selected:hover {
    background: linear-gradient(135deg, var(--danger) 0%, rgba(244, 63, 94, 0.9) 100%);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

.tag-badge-selected svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.tag-badge-selected:hover svg {
    transform: rotate(90deg);
}

.tag-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: var(--font-size-xs);
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    animation: fadeIn 0.2s ease;
}

[data-theme="dark"] .tag-badge-selected {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .tag-badge-selected {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .tag-dropdown {
        max-height: 300px;
    }
    
    .tag-level-group {
        font-size: var(--font-size-xs);
    }
}

/* Table Checkbox Styles */
.table-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    transition: all 0.2s ease;
}

.table-checkbox:hover {
    transform: scale(1.1);
}

.table-checkbox:checked {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Bulk Actions Styles */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-3);
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    animation: slideIn 0.3s ease;
}

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

.bulk-actions .selected-count {
    font-size: var(--font-size-sm);
    color: var(--muted);
    font-weight: 500;
    padding-right: var(--spacing-2);
    border-right: 1px solid var(--border);
}

.bulk-actions button {
    transition: all 0.2s ease;
}

.bulk-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Table Row Hover with Checkbox */
.table-striped tbody tr:hover {
    background: var(--bg);
}

.table-striped tbody tr:has(.table-checkbox:checked) {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--primary);
}

.table-striped tbody tr:has(.table-checkbox:checked):hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Fixed table layout to prevent column shrinking */
#outputsTable {
    table-layout: fixed;
    width: 100%;
}

#outputsTable th,
#outputsTable td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#outputsTable td:has(strong) {
    white-space: normal;
    word-break: break-word;
}

#outputsTable td:has(.badge) {
    white-space: normal;
}

/* Delete icon button styles */
.btn-delete-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--radius);
    opacity: 0.7;
}

.btn-delete-icon:hover {
    background: rgba(239, 68, 68, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

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

/* Status Modal Buttons */
[data-status] {
    transition: all 0.2s ease;
}

[data-status]:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Badge muted */
.badge-muted {
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
}

/* Improved modal transitions - Enhanced */
.modal-backdrop {
    animation: fadeIn 0.2s ease-in-out;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal {
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
}

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

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

/* Modal exit animation */
.modal-backdrop.exiting {
    animation: fadeOut 0.2s ease-in-out forwards;
}

.modal.exiting {
    animation: modalSlideDown 0.2s ease-in-out forwards;
}

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

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

/* Improved input styles */
.form-control {
    width: 100%;
    padding: var(--spacing-2) var(--spacing-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: var(--font-size-sm);
    transition: all 0.2s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .form-control:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* Enhanced Form Styles */
.staff-form-enhanced {
    max-width: 100%;
}

.form-section {
    margin-bottom: var(--spacing-6);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-4) var(--spacing-5);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-bottom: 1px solid var(--border);
}

.form-section-header svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.form-section-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
}

.form-section-content {
    padding: var(--spacing-5);
}

.form-group-enhanced {
    margin-bottom: var(--spacing-4);
}

.form-group-enhanced:last-child {
    margin-bottom: 0;
}

.form-label-with-icon {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-2);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
}

.form-label-with-icon svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.form-control-enhanced {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: var(--font-size-sm);
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
}

.form-control-enhanced:hover {
    border-color: var(--primary);
}

.form-control-enhanced:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--surface);
}

.form-control-enhanced::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.form-control-enhanced:disabled {
    background: var(--bg);
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-row-enhanced {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-4);
}

.form-hint {
    display: block;
    margin-top: var(--spacing-1);
    font-size: var(--font-size-xs);
    color: var(--muted);
    line-height: 1.4;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle-btn-enhanced {
    position: absolute;
    right: var(--spacing-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
    z-index: 10;
}

.password-toggle-btn-enhanced:hover {
    background: var(--bg);
    color: var(--text);
}

.password-toggle-btn-enhanced:active {
    transform: translateY(-50%) scale(0.95);
}

.password-eye-icon,
.password-eye-off-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.staff-roles-checkboxes-enhanced {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    margin-top: var(--spacing-2);
}

.role-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    cursor: pointer;
    padding: var(--spacing-3);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all 0.2s ease;
    user-select: none;
}

.role-checkbox-label:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateX(4px);
}

.role-checkbox-label input[type="checkbox"] {
    display: none;
}

.role-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.role-checkbox-label:hover .role-checkbox-custom {
    border-color: var(--primary);
}

.role-checkbox-label input[type="checkbox"]:checked + .role-checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.role-checkbox-label input[type="checkbox"]:checked + .role-checkbox-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
}

.role-checkbox-text {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text);
    flex: 1;
}

.role-checkbox-label input[type="checkbox"]:checked ~ .role-checkbox-text {
    color: var(--primary);
    font-weight: 600;
}

.form-actions-enhanced {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-3);
    padding-top: var(--spacing-5);
    margin-top: var(--spacing-5);
    border-top: 1px solid var(--border);
}

.form-actions-enhanced .btn {
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
}

/* Responsive form styles */
@media (max-width: 768px) {
    .form-row-enhanced {
        grid-template-columns: 1fr;
        gap: var(--spacing-3);
    }
    
    .form-section-content {
        padding: var(--spacing-4);
    }
    
    .form-section-header {
        padding: var(--spacing-3) var(--spacing-4);
    }
    
    .form-actions-enhanced {
        flex-direction: column-reverse;
    }
    
    .form-actions-enhanced .btn {
        width: 100%;
    }
}

.currency-input {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.currency-input-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.currency-hint {
    color: var(--muted);
}

.currency-hint-line + .currency-hint-line {
    margin-top: 2px;
}

.currency-hint-error {
    color: var(--danger);
    margin-top: 4px;
    font-weight: 500;
}

.session-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-3);
}

.session-toolbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.session-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex: 1;
    position: relative;
}

.session-month-btn {
    padding: 4px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--text);
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.session-month-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.session-month-label-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.session-month-label-btn:hover {
    background: var(--bg);
}

.session-month-label {
    font-weight: 500;
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.session-month-popup {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 6px 8px 8px;
    z-index: 30;
    min-width: 200px;
}

.session-month-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: var(--font-size-xs);
}

.session-month-year-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: var(--radius);
}

.session-month-year-btn:hover {
    background: var(--bg);
}

.session-month-year-label {
    font-weight: 500;
}

.session-month-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.session-month-cell {
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    padding: 3px 0;
    font-size: var(--font-size-xs);
}

.session-month-cell:hover {
    background: var(--bg);
}

.session-month-cell.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.session-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.session-icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

.session-icon-btn.session-icon-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-contrast);
}

.session-icon-btn.session-icon-btn-primary:hover {
    filter: brightness(0.95);
    color: var(--primary-contrast);
}

.session-time-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-time-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-time-label {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.session-time-field .form-control {
    flex: 1;
    min-width: 0;
}

.session-time-separator {
    font-size: 18px;
    color: var(--muted);
}

.stacked-list {
    display: grid;
    gap: 8px;
}

.stacked-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-radius: 10px;
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stacked-list-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.stacked-list-item .btn-delete-icon {
    opacity: 0.8;
}

.stacked-list-item .btn-delete-icon:hover {
    opacity: 1;
}

.search-dropdown {
    position: relative;
    margin-top: 6px;
    display: none;
}

.search-dropdown.visible {
    display: block;
}

.search-dropdown::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--divider);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.search-dropdown .search-item,
.search-dropdown .search-empty {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.search-dropdown .search-item + .search-item {
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.search-dropdown .search-item:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
}

.search-dropdown .search-empty {
    cursor: default;
    color: var(--muted);
}

.search-item-title {
    font-weight: 600;
}

.search-item-sub {
    display: block;
    margin-top: 2px;
}

.session-meta-header {
    width: 140px;
}

.session-notes-header {
    min-width: 220px;
}

.session-notes-cell {
    min-width: 220px;
    max-width: 360px;
}

.session-notes-cell span {
    display: block;
    white-space: normal;
}

/* Ensure all session table cells have consistent alignment and borders */
.sessions-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: auto;
}

.sessions-table tbody tr {
    height: auto;
}

/* Base styling for all table cells - must be consistent */
.sessions-table tbody td {
    vertical-align: middle;
    padding: var(--spacing-3) var(--spacing-4);
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
    position: relative;
    height: auto;
    min-height: 48px;
}

.sessions-table tbody tr:last-child td {
    border-bottom: none;
}

.sessions-table thead th {
    vertical-align: middle;
    padding: var(--spacing-3) var(--spacing-4);
    border-bottom: 2px solid var(--border);
    box-sizing: border-box;
    position: relative;
}

/* Session meta cell - must align with other cells */
.session-meta-cell {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    vertical-align: middle;
    padding: var(--spacing-3) var(--spacing-4) !important;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border) !important;
    position: relative;
    height: auto;
    min-height: 48px;
}

/* Override any conflicting styles */
.sessions-table tbody tr td.session-meta-cell {
    border-bottom: 1px solid var(--border) !important;
    padding: var(--spacing-3) var(--spacing-4) !important;
    vertical-align: middle !important;
}

.sessions-table tbody tr:last-child td.session-meta-cell {
    border-bottom: none !important;
}

/* Ensure all cells in a row have the same height */
.sessions-table tbody tr {
    display: table-row;
}

.sessions-table tbody tr td {
    display: table-cell;
}

/* Force consistent border alignment */
.sessions-table tbody tr td,
.sessions-table tbody tr td.session-meta-cell,
.sessions-table tbody tr td.session-notes-cell,
.sessions-table tbody tr td.status-cell {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: var(--border);
}

.sessions-table tbody tr:last-child td,
.sessions-table tbody tr:last-child td.session-meta-cell,
.sessions-table tbody tr:last-child td.session-notes-cell,
.sessions-table tbody tr:last-child td.status-cell {
    border-bottom: none;
}

.session-meta-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.session-meta-icon svg {
    width: 14px;
    height: 14px;
}

.session-allowance-preview {
    font-weight: 600;
}

/* Teacher actions menu */
.teacher-actions-menu {
    position: relative;
    display: inline-block;
}

.menu-trigger {
    background: transparent;
    border: none;
    padding: var(--spacing-1);
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-trigger:hover {
    color: var(--text);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--spacing-1);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 140px;
    z-index: 1000;
    overflow: hidden;
}

.menu-item {
    width: 100%;
    padding: var(--spacing-2) var(--spacing-3);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    color: var(--text);
    font-size: var(--font-size-sm);
    transition: background-color 0.2s ease-in-out;
}

.menu-item:hover {
    background: var(--bg);
}

.menu-item-danger {
    color: var(--danger);
}

.menu-item-danger:hover {
    background: var(--danger);
    color: var(--danger-contrast);
}

.menu-item svg {
    flex-shrink: 0;
}

.teacher-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
}

.teacher-row-clickable:hover {
    background: var(--bg) !important;
    transform: translateX(2px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.teacher-row-clickable:active {
    transform: translateX(0);
    background: var(--surface) !important;
    box-shadow: none;
}

.teacher-row-clickable td {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Re-enable pointer events for interactive elements only */
.teacher-row-clickable .teacher-actions-menu,
.teacher-row-clickable .teacher-actions-menu * {
    pointer-events: all;
    cursor: default;
}

/* Ensure smooth interaction on mobile */
@media (hover: none) {
    .teacher-row-clickable:active {
        background: var(--bg) !important;
    }
}

/* Teacher class row in teacher detail page */
.teacher-class-row {
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

.teacher-class-row:hover {
    background: var(--bg) !important;
    transform: translateX(2px);
}

.teacher-class-row:active {
    transform: translateX(0);
    background: var(--surface) !important;
}

.btn-allowance-edit:hover {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
}

/* Class status badges in teacher detail */
.class-status-badge {
    font-size: var(--font-size-xs);
    font-weight: 600;
    margin-left: var(--spacing-2);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.class-status-active {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.class-status-inactive {
    color: #DC2626;
    background: rgba(220, 38, 38, 0.1);
}

[data-theme="dark"] .class-status-active {
    color: #34D399;
    background: rgba(52, 211, 153, 0.15);
}

[data-theme="dark"] .class-status-inactive {
    color: #F87171;
    background: rgba(248, 113, 113, 0.15);
}

.teacher-class-row.class-inactive {
    opacity: 0.7;
}

.teacher-class-row.class-inactive:hover {
    background: var(--bg) !important;
    transform: none;
}

/* QR Icon Button */
.qr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

.qr-icon-btn-large {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.qr-icon-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qr-icon-btn:active {
    transform: translateY(0);
}

.qr-icon-btn-active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(var(--primary-rgb, 0, 122, 255), 0.1);
}

.qr-icon-btn-active:hover {
    background: var(--primary);
    color: var(--primary-contrast);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb, 0, 122, 255), 0.3);
}

.qr-icon-btn-inactive {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.qr-icon-btn-inactive:hover {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

.qr-icon-btn-upload {
    color: var(--muted);
}

.qr-icon-btn-upload:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
}

.qr-link-form {
    max-width: 500px;
}

/* Account Icon Button */
.account-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

.account-icon-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.account-icon-btn:active {
    transform: translateY(0);
}

/* Account icon on the left of teacher name */
.account-icon-btn-left {
    width: 36px;
    height: 36px;
    margin-right: var(--spacing-1);
}

.account-icon-btn-left svg {
    width: 18px;
    height: 18px;
}

/* Teacher Info Panel */
.teacher-info-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.teacher-info-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

[data-theme="dark"] .teacher-info-backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.teacher-info-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    background: var(--bg);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
}

.teacher-info-panel.active {
    transform: translateX(0);
}

.teacher-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-4);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}

.teacher-info-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.btn-icon-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-icon-close:hover {
    background: var(--surface);
    color: var(--primary);
}

.teacher-info-content {
    padding: var(--spacing-4);
    flex: 1;
}

.teacher-info-view .info-item {
    margin-bottom: var(--spacing-4);
    padding: var(--spacing-3);
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.teacher-info-view .info-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.teacher-info-view .info-item label {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--muted);
    margin-bottom: var(--spacing-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.teacher-info-view .info-item .info-value {
    font-size: var(--font-size-base);
    color: var(--text);
    word-break: break-word;
    font-weight: 500;
    line-height: 1.6;
}

.teacher-info-view .info-item .qr-link {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
}

.teacher-info-view .info-item .qr-link:hover {
    text-decoration: underline;
}

.info-actions {
    margin-top: var(--spacing-6);
    padding-top: var(--spacing-4);
    border-top: 2px solid var(--border);
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding-bottom: var(--spacing-4);
}

.info-actions .btn {
    width: 100%;
    min-height: 44px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    transition: all 0.2s ease;
}

.info-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.teacher-info-edit .form-group {
    margin-bottom: var(--spacing-4);
}

.teacher-info-edit .form-actions {
    display: flex;
    gap: var(--spacing-2);
    margin-top: var(--spacing-6);
    padding-top: var(--spacing-4);
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .teacher-info-panel {
        max-width: 100%;
    }
    
    .account-icon-btn,
    .account-icon-btn-left {
        width: 32px;
        height: 32px;
    }
    
    .account-icon-btn svg,
    .account-icon-btn-left svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 768px) {
    .qr-icon-btn {
        width: 28px;
        height: 28px;
    }
    
    .qr-icon-btn-large {
        width: 36px;
        height: 36px;
    }
    
    .qr-icon-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .qr-icon-btn-large svg {
        width: 18px;
        height: 18px;
    }
}

/* Pagination - Minimal Style */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-2);
    padding: var(--spacing-2) 0;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg);
    border-color: var(--border);
    color: var(--muted);
}

.pagination-page-number {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text);
    min-width: 24px;
    text-align: center;
    padding: 0 var(--spacing-2);
}

.pagination-page-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text);
    padding: 0 var(--spacing-2);
}

.pagination-current {
    font-weight: 600;
    color: var(--primary);
}

.pagination-separator {
    color: var(--muted);
    margin: 0 2px;
}

.pagination-total {
    color: var(--muted);
}

@media (max-width: 768px) {
    .pagination-btn {
        width: 28px;
        height: 28px;
    }
    
    .pagination-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .pagination-page-number {
        font-size: var(--font-size-sm);
    }
}

/* Date input styling - ensure entire area is clickable */
input[type="date"].date-input,
input.date-input[type="date"] {
    cursor: pointer;
    position: relative;
    user-select: none;
}

input[type="date"].date-input::-webkit-calendar-picker-indicator,
input.date-input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    position: absolute;
    right: var(--spacing-2);
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
}

input[type="date"].date-input:hover,
input.date-input[type="date"]:hover {
    border-color: var(--primary);
}

input[type="date"].date-input:focus,
input.date-input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] input[type="date"].date-input:focus,
[data-theme="dark"] input.date-input[type="date"]:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* Select multiple styling */
select[multiple] {
    min-height: 120px;
    padding: var(--spacing-2);
}

select[multiple] option {
    padding: var(--spacing-2);
    border-radius: var(--radius-sm);
    margin: var(--spacing-1) 0;
}

select[multiple] option:checked {
    background: var(--primary);
    color: var(--primary-contrast);
}

/* Attendance styles */
.attendance-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
    user-select: none;
}

.attendance-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.attendance-status {
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

/* Text color utilities */
.text-success {
    color: var(--success);
    font-weight: 500;
}

.text-danger {
    color: var(--danger);
    font-weight: 500;
}

/* Attendance table in modal */
#attendanceTableBody tr {
    transition: background-color 0.15s ease-in-out;
}

#attendanceTableBody tr:hover {
    background: var(--bg);
}

#attendanceTableBody td {
    padding: var(--spacing-2);
    border-bottom: 1px solid var(--border);
}

#attendanceTableBody th {
    padding: var(--spacing-2);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--muted);
    background: var(--bg);
}

/* Teacher card in class detail - Minimalist Design */
.teacher-card {
    position: relative;
}

.teacher-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.teacher-list-basic .teacher-row {
    grid-template-columns: 1fr;
    gap: var(--spacing-1);
}

.teacher-list-basic .teacher-col-info {
    color: var(--muted);
    font-size: var(--font-size-sm);
}

.teacher-row {
    display: grid;
    grid-template-columns: 1fr 140px 160px;
    gap: var(--spacing-3);
    align-items: center;
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius);
    transition: background-color 0.2s ease-in-out;
    cursor: pointer;
}

.teacher-row:hover {
    background: var(--bg);
}

.teacher-row-header {
    cursor: default;
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0;
    padding-bottom: var(--spacing-1);
    background: transparent;
}

.teacher-row-header:hover {
    background: transparent;
}

.teacher-name-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out, text-decoration 0.2s ease-in-out;
}

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

.teacher-allowance {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-1) var(--spacing-2);
    font-size: var(--font-size-sm);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    justify-self: start;
    text-align: left;
    width: 100%;
    max-width: 120px;
}

.teacher-allowance:hover {
    background: var(--primary);
    color: var(--primary-contrast);
    border-color: var(--primary);
}

.teacher-col-allowance {
    text-align: left;
}

.teacher-row-header .teacher-col-allowance {
    text-align: left;
}

.teacher-col-total {
    justify-self: end;
    font-weight: 500;
    text-align: right;
}

.teacher-row-header .teacher-col-total {
    text-align: right;
}

.teacher-col-name {
    font-weight: 500;
}

.teacher-row-header .teacher-col-name,
.teacher-row-header .teacher-col-allowance,
.teacher-row-header .teacher-col-total {
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-3);
}

.stat-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-3);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.stat-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
}

.teacher-row-header .teacher-col-allowance,
.teacher-row-header .teacher-col-total {
    font-weight: 600;
}

/* Schedule card - show edit button on hover */
.schedule-card {
    position: relative;
}

.schedule-card:hover .schedule-edit-btn {
    opacity: 1 !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .modal-backdrop {
        padding: 0;
    }
    
    .modal.modal-mobile-fullscreen {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .modal-header {
        padding: var(--spacing-3);
        flex-shrink: 0;
    }
    
    .modal-body {
        padding: var(--spacing-3);
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ensure modal is scrollable on mobile */
    .modal.modal-mobile-fullscreen .modal-body {
        min-height: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        padding: var(--spacing-2) var(--spacing-3);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-2);
    }
    
    .section-content {
        padding: var(--spacing-3);
    }
    
    .section-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: var(--spacing-1);
    }

    #attendanceTableBody {
        font-size: var(--font-size-xs);
    }

    .teacher-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-1);
        padding: var(--spacing-2);
    }

    .teacher-allowance,
    .teacher-col-total {
        justify-self: start;
    }

    .menu-dropdown {
        right: auto;
        left: 0;
    }
}

/* Student class table */
.student-class-row {
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.student-class-row-hover,
.student-class-row:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.student-class-link {
    padding: 0;
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.student-class-link:hover {
    text-decoration: underline;
}

.student-class-fee {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.student-class-actions {
    display: flex;
    gap: var(--spacing-2);
    margin-top: var(--spacing-1);
}

.student-class-actions .btn.btn-xs {
    padding: 2px var(--spacing-2);
    font-size: var(--font-size-xs);
}

/* Student Detail Page - Modern UI/UX */
.student-account-icon-btn:hover {
    background: var(--primary-dark) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.student-info-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
    transform: translateY(-2px);
}

.student-account-card .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.student-class-row:hover {
    background: var(--bg-hover) !important;
}

.student-class-link:hover {
    color: var(--primary-dark) !important;
    text-decoration: underline;
}

.student-classes-table .btn-delete-icon:hover {
    background: var(--danger) !important;
    color: white !important;
    transform: scale(1.1);
}

.student-classes-table .btn.btn-xs:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.student-classes-table .btn.btn-link:hover {
    color: var(--primary-dark) !important;
    text-decoration: underline;
}

.student-login-icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
    opacity: 0.9;
}

/* Responsive adjustments for student detail */
@media (max-width: 768px) {
    .student-detail-header {
        flex-direction: column !important;
        gap: var(--spacing-3) !important;
        align-items: flex-start !important;
    }
    
    .student-info-card {
        min-width: 100% !important;
    }
    
    .student-classes-table {
        font-size: 0.875rem;
    }
    
    .student-classes-table th,
    .student-classes-table td {
        padding: var(--spacing-2) var(--spacing-2) !important;
    }
}

/* Empty States - Enhanced */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-8) var(--spacing-4);
    text-align: center;
    min-height: 300px;
    gap: var(--spacing-4);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: var(--spacing-2);
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
    opacity: 0.6;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.empty-state-description {
    font-size: var(--font-size-sm);
    color: var(--muted);
    max-width: 400px;
    line-height: 1.6;
    margin: 0;
}

.empty-state-action {
    margin-top: var(--spacing-2);
}

/* Error States */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-8) var(--spacing-4);
    text-align: center;
    min-height: 300px;
    gap: var(--spacing-4);
}

.error-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
}

.error-state-icon svg {
    width: 40px;
    height: 40px;
}

.error-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.error-state-description {
    font-size: var(--font-size-sm);
    color: var(--muted);
    max-width: 400px;
    line-height: 1.6;
    margin: 0;
}

.error-state-action {
    margin-top: var(--spacing-2);
}

/* Success States */
.success-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-8) var(--spacing-4);
    text-align: center;
    min-height: 200px;
    gap: var(--spacing-4);
}

.success-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    animation: successPulse 0.6s ease-out;
}

.success-state-icon svg {
    width: 32px;
    height: 32px;
}

@keyframes successPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.success-state-description {
    font-size: var(--font-size-sm);
    color: var(--muted);
    max-width: 400px;
    line-height: 1.6;
    margin: 0;
}

/* Page Transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(10px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-transition-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible improvements */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.btn:focus-visible {
    outline-offset: 3px;
}

/* Improved button disabled state */
.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.3);
}

/* Touch-friendly improvements for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: var(--spacing-3) var(--spacing-4);
    }
    
    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .tab {
        min-height: 44px;
        padding: var(--spacing-3) var(--spacing-4);
    }
}

/* Improved hover states for touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn:hover:not(:active) {
        transform: none;
    }
    
    .table-striped tbody tr:hover {
        background: transparent;
        transform: none;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--primary-contrast);
    padding: var(--spacing-2) var(--spacing-4);
    text-decoration: none;
    z-index: 1000;
    border-radius: 0 0 var(--radius) 0;
}

.skip-to-main:focus {
    top: 0;
}

/* Enhanced Form Styles for Staff Form */
.staff-form-enhanced {
    max-width: 100%;
    animation: formFadeIn 0.3s ease-out;
}

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

.form-section {
    margin-bottom: var(--spacing-6);
    padding: var(--spacing-5);
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-4);
    padding-bottom: var(--spacing-3);
    border-bottom: 2px solid var(--border);
}

.form-section-header svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.form-section-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.form-section-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.form-group-enhanced {
    margin-bottom: var(--spacing-4);
}

.form-label-with-icon {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-2);
}

.form-label-with-icon svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.form-control-enhanced {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: var(--font-size-base);
    color: var(--text);
    transition: all 0.2s ease;
    min-height: 44px;
    box-sizing: border-box;
}

.form-control-enhanced:hover {
    border-color: var(--primary);
}

.form-control-enhanced:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--surface);
}

.form-control-enhanced::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.form-control-enhanced:disabled {
    background: var(--bg);
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-row-enhanced {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
}

@media (max-width: 768px) {
    .form-row-enhanced {
        grid-template-columns: 1fr;
    }
    
    .form-section {
        padding: var(--spacing-4);
    }
}

.form-hint {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--muted);
    margin-top: var(--spacing-1);
    line-height: 1.5;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control-enhanced {
    padding-right: 48px;
}

.password-toggle-btn-enhanced {
    position: absolute;
    right: var(--spacing-2);
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--spacing-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all 0.2s ease;
    border-radius: var(--radius);
    min-width: 36px;
    min-height: 36px;
    z-index: 1;
}

.password-toggle-btn-enhanced:hover {
    background: var(--bg);
    color: var(--text);
}

.password-toggle-btn-enhanced:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle-btn-enhanced svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.password-eye-icon,
.password-eye-off-icon {
    transition: opacity 0.2s ease;
}

.staff-roles-checkboxes-enhanced {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    margin-top: var(--spacing-2);
}

.role-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    cursor: pointer;
    padding: var(--spacing-3);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all 0.2s ease;
    user-select: none;
}

.role-checkbox-label:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateX(4px);
}

.role-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.role-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.role-checkbox-label input[type="checkbox"]:checked + .role-checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.role-checkbox-label input[type="checkbox"]:checked + .role-checkbox-custom::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 2px;
}

.role-checkbox-label input[type="checkbox"]:focus + .role-checkbox-custom {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.role-checkbox-text {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text);
    flex: 1;
}

.role-checkbox-label:hover .role-checkbox-text {
    color: var(--primary);
}

.form-actions-enhanced {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-3);
    margin-top: var(--spacing-6);
    padding-top: var(--spacing-4);
    border-top: 2px solid var(--border);
}

.form-actions-enhanced .btn {
    min-height: 44px;
    padding: var(--spacing-3) var(--spacing-5);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    transition: all 0.2s ease;
}

.form-actions-enhanced .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.form-actions-enhanced .btn:active {
    transform: translateY(0);
}

.form-actions-enhanced .btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Responsive form improvements */
@media (max-width: 768px) {
    .form-section {
        padding: var(--spacing-4);
    }
    
    .form-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-2);
    }
    
    .form-actions-enhanced {
        flex-direction: column-reverse;
        gap: var(--spacing-2);
    }
    
    .form-actions-enhanced .btn {
        width: 100%;
        justify-content: center;
    }
}