:root {
    --sidebar-width: 252px;
    --sidebar-width-collapsed: 84px;
    --blue-900: #1b2440;
    --blue-800: #22305a;
    --blue-700: #2c7dfa;
    --blue-100: #edf4ff;
    --font-body: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-display: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --text-strong: #101828;
    --text-body: #344054;
    --text-muted-strong: #667085;
    --surface-page: #f5f8fa;
    --surface-card: #ffffff;
    --surface-border: #e4e7ec;
}

body {
    background: var(--surface-page);
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.42;
    letter-spacing: 0;
    color: var(--text-body);
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.card-title,
.modal-title,
.sidebar-brand,
.hero-tile h3 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-strong);
}

.text-muted,
.form-text {
    font-weight: 500;
    color: var(--text-muted-strong) !important;
}

.btn {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0;
    border-radius: 0.5rem;
}

.btn-sm {
    font-size: 0.76rem;
    padding: 0.36rem 0.65rem;
}

.btn-primary {
    background-color: var(--blue-700);
    border-color: var(--blue-700);
    box-shadow: none;
}

.btn-primary:hover {
    background-color: #1d6eea;
    border-color: #1d6eea;
    box-shadow: none;
}

.form-label {
    font-family: var(--font-display);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475467;
}

.form-control,
.form-select {
    font-family: var(--font-body);
    font-weight: 500;
    border-radius: 0.45rem;
    border-color: #d0d5dd;
    color: #101828;
    background: #ffffff;
}

.form-control::placeholder {
    color: #98a2b3;
    opacity: 1;
}

.form-control:focus,
.form-select:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 0.2rem rgba(44, 125, 250, 0.14);
}

.day-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.day-chip-item {
    position: relative;
}

.day-chip-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.day-chip-label {
    min-width: 2.2rem;
    text-align: center;
    padding: 0.32rem 0.62rem;
}

.class-form-sections {
    display: grid;
    gap: 0.75rem;
}

.class-form-section {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 0.75rem;
}

.class-form-section-title {
    font-size: 0.79rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-muted);
}

.class-form-subsection {
    border: 1px dashed var(--c-border-strong);
    border-radius: calc(var(--radius-md) - 2px);
    background: #fff;
    padding: 0.7rem;
}

@media (max-width: 767.98px) {
    .class-form-section {
        padding: 0.65rem;
    }

    .class-form-section .form-label {
        margin-bottom: 0.3rem;
        font-size: 0.76rem;
    }

    .class-form-section .form-control,
    .class-form-section .form-select {
        min-height: 34px;
        font-size: 0.82rem;
    }

    .class-form-section .day-chip-group {
        gap: 0.3rem;
    }

    .class-form-section .day-chip-label {
        min-width: 38px;
        padding: 0.24rem 0.45rem;
        font-size: 0.72rem;
    }
}
.day-chip-label {
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #ffffff;
    color: #344054;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.day-chip-label:hover {
    border-color: #98a2b3;
    color: #101828;
}

.day-chip-input:checked + .day-chip-label {
    background: #2c7dfa;
    border-color: #2c7dfa;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(44, 125, 250, 0.28);
}

.day-chip-input:focus-visible + .day-chip-label {
    outline: 2px solid rgba(44, 125, 250, 0.35);
    outline-offset: 2px;
}

.table th {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    color: #475467;
    font-weight: 700;
}

.table td {
    font-weight: 500;
    color: #344054;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
    margin-bottom: 0;
}

.btn-flat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 2.25rem;
    padding: 0.35rem 0.45rem;
    border-radius: 0.5rem;
    line-height: 1;
}

.btn-flat-icon .svg-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.btn-flat-icon,
.session-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 2.25rem;
    padding: 0.35rem 0.45rem;
    line-height: 1;
    border-color: #cfd4db !important;
    background: #fff;
    color: #6b7280;
}

.btn-flat-icon .svg-icon,
.session-toolbar .btn .svg-icon {
    color: currentColor;
    fill: currentColor;
}

.btn-flat-icon.btn-outline-primary,
.session-toolbar .btn-outline-primary {
    color: #0d6efd;
}

.btn-flat-icon.btn-outline-secondary,
.session-toolbar .btn-outline-secondary {
    color: #6c757d;
}

.btn-flat-icon.btn-outline-success,
.session-toolbar .btn-outline-success {
    color: #198754;
}

.btn-flat-icon.btn-outline-info,
.session-toolbar .btn-outline-info {
    color: #0dcaf0;
}

.btn-flat-icon.btn-outline-warning,
.session-toolbar .btn-outline-warning,
.session-toolbar .btn-holiday-active {
    color: #f0ad4e;
}

.btn-flat-icon.btn-outline-danger,
.session-toolbar .btn-outline-danger {
    color: #dc3545;
}

.action-icon-group .btn-flat-icon,
.session-toolbar .btn {
    border-radius: 0;
}

.action-icon-group .btn-flat-icon:first-child,
.session-toolbar .btn:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.action-icon-group .btn-flat-icon:last-child,
.session-toolbar .btn:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.btn-flat-icon-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.action-icon-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1c2744 0%, #1b2440 100%);
    color: #fff;
    padding: 0.9rem 0.75rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
}

.sidebar-brand-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.system-brand-logo {
    display: block;
    max-width: 110px;
    max-height: 28px;
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.mobile-brand-logo {
    max-width: 96px;
    max-height: 24px;
}

.sidebar-brand:hover {
    color: #fff;
}

.setting-image-preview {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 64px;
    padding: 0.5rem 0.65rem;
    border: 1px dashed #cfd8e3;
    border-radius: 0.7rem;
    background: #f8fbff;
}

.setting-image-preview img {
    display: block;
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
}

.setting-favicon-preview img {
    max-height: 32px;
}

.svg-icon {
    display: inline-flex;
    width: 1.1rem;
    height: 1.1rem;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.svg-icon svg {
    width: 100%;
    height: 100%;
}

.sidebar-toggle {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 0.15rem 0.5rem;
}

.sidebar-user {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.55rem;
    padding: 0.55rem 0.6rem;
    margin-bottom: 0.9rem;
}

.sidebar-user .fw-semibold,
.sidebar-user .small,
.sidebar-user .opacity-75,
.sidebar .small {
    color: rgba(239, 246, 255, 0.88) !important;
}

.sidebar-nav .nav-link {
    color: rgba(231, 239, 255, 0.82);
    border-radius: 0.45rem;
    margin-bottom: 0.2rem;
    padding: 0.44rem 0.62rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: #2c7dfa;
}

.content-wrap {
    width: calc(100% - var(--sidebar-width));
    transition: width 0.25s ease;
}

main.container-fluid {
    padding-top: 0.8rem !important;
}

.mobile-topbar {
    background: #fff;
    border-bottom: 1px solid #eaecf0;
    padding: 0.7rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-footer {
    margin-top: auto;
}

.sidebar-footer .btn {
    border-color: rgba(227, 234, 250, 0.3);
    color: #eaf1ff;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-footer .btn:hover {
    border-color: rgba(227, 234, 250, 0.55);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.11);
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-width-collapsed);
}

body.sidebar-collapsed .content-wrap {
    width: calc(100% - var(--sidebar-width-collapsed));
}

body.sidebar-collapsed .brand-label,
body.sidebar-collapsed .sidebar-user,
body.sidebar-collapsed .nav-label {
    display: none;
}

body.sidebar-collapsed .sidebar-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

body.sidebar-collapsed .sidebar-footer .btn {
    font-size: 0;
}

body.sidebar-collapsed .sidebar-footer .btn .svg-icon {
    margin-right: 0 !important;
}

.card {
    border: 1px solid var(--surface-border);
    background: var(--surface-card);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.card .card-body {
    padding: 0.95rem 1rem;
}

.hero-tile {
    background: linear-gradient(150deg, #2c7dfa, #56a4ff);
    color: #fff;
    border-radius: 0.75rem;
    padding: 1rem 1.05rem;
    box-shadow: 0 8px 20px rgba(44, 125, 250, 0.24);
}

.admin-dashboard-hero {
    position: relative;
    overflow: hidden;
}

.admin-dashboard-hero::after {
    content: '';
    position: absolute;
    right: -2rem;
    top: -2rem;
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.admin-dashboard-subtitle {
    max-width: 48rem;
    color: rgba(255, 255, 255, 0.9);
}

.admin-dashboard-hero-action {
    border: 0;
    color: #1d4ed8;
    box-shadow: 0 10px 20px rgba(12, 38, 84, 0.12);
}

.admin-stat-link {
    display: block;
    height: 100%;
}

.admin-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 160px;
    border-width: 1px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(16, 24, 40, 0.08);
}

.admin-stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(44, 125, 250, 0.08), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.admin-stat-card .card-body {
    position: relative;
    z-index: 1;
    padding: 1rem 1rem 0.95rem;
}

.admin-stat-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.8rem;
    margin-bottom: 0.75rem;
    color: #1d4ed8;
    background: rgba(29, 78, 216, 0.08);
}

.admin-stat-card.tone-success .admin-stat-icon-wrap {
    color: #128744;
    background: rgba(18, 135, 68, 0.08);
}

.admin-stat-card.tone-warning .admin-stat-icon-wrap {
    color: #b7791f;
    background: rgba(183, 121, 31, 0.1);
}

.admin-stat-card.tone-info .admin-stat-icon-wrap {
    color: #087ea4;
    background: rgba(8, 126, 164, 0.08);
}

.admin-stat-card.tone-neutral .admin-stat-icon-wrap {
    color: #475467;
    background: rgba(71, 84, 103, 0.08);
}

.admin-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted-strong);
}

.admin-stat-value {
    margin-top: 0.35rem;
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-strong);
}

.admin-stat-detail {
    margin-top: 0.85rem;
    color: var(--text-muted-strong);
    font-size: 0.88rem;
}

.admin-stat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475467;
    background: #f2f4f7;
    white-space: nowrap;
}

.admin-stat-card.tone-primary {
    border-color: #b9d7ff;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.admin-stat-card.tone-success {
    border-color: #bfe8cd;
    background: linear-gradient(180deg, #ffffff, #f6fff9);
}

.admin-stat-card.tone-warning {
    border-color: #f1d59a;
    background: linear-gradient(180deg, #ffffff, #fffdf7);
}

.admin-stat-card.tone-info {
    border-color: #b8e1ef;
    background: linear-gradient(180deg, #ffffff, #f7fcff);
}

.admin-stat-card.tone-neutral {
    border-color: #d9dee7;
    background: linear-gradient(180deg, #ffffff, #fcfcfd);
}

.admin-quick-link-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.admin-quick-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.7rem;
    flex-shrink: 0;
    background: rgba(44, 125, 250, 0.1);
    color: #1d4ed8;
}

.admin-quick-link-icon.tone-success {
    background: rgba(18, 135, 68, 0.1);
    color: #128744;
}

.admin-quick-link-icon.tone-warning {
    background: rgba(183, 121, 31, 0.12);
    color: #b7791f;
}

.student-id-card-preview-shell {
    width: 100%;
    min-height: min(82vh, 900px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef3f8;
    border: 0;
    border-radius: 0;
    overflow: hidden;
}

.student-id-card-preview-frame {
    width: 100%;
    height: min(82vh, 900px);
    display: block;
    background: #fff;
}

@media (max-width: 991.98px) {
    .student-id-card-preview-shell,
    .student-id-card-preview-frame {
        min-height: 70vh;
        height: 70vh;
    }
}

.table td,
.table th {
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    border-bottom-color: #eaecf0;
}

.qr-box {
    background: #fff;
    padding: 0.75rem;
    border: 1px solid #dde5ee;
    border-radius: 0.5rem;
    display: inline-block;
}

#reader {
    width: 100%;
    max-width: 420px;
    border: 1px solid #ced7e1;
    border-radius: 0.5rem;
    overflow: hidden;
}

.form-label {
    font-weight: 600;
}

.sidebar-offcanvas {
    background: #f5f9ff;
}

.sidebar-offcanvas .sidebar-nav .nav-link {
    color: #0d3d82;
}

.sidebar-offcanvas .sidebar-nav .nav-link.active,
.sidebar-offcanvas .sidebar-nav .nav-link:hover {
    background: var(--blue-100);
    color: #0b2f63;
}

@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }

    .content-wrap {
        width: 100%;
    }
}

/* Notifications.js style popups */
.notify-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    width: min(380px, calc(100vw - 1.5rem));
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.notify-item {
    border-radius: 0.65rem;
    color: #fff;
    padding: 0.75rem 2.25rem 0.75rem 0.85rem;
    position: relative;
    box-shadow: 0 8px 20px rgba(10, 25, 55, 0.22);
    transform: translateY(-8px);
    opacity: 0;
    transition: all 0.2s ease;
}

.notify-item.show {
    transform: translateY(0);
    opacity: 1;
}

.notify-success {
    background: linear-gradient(135deg, #18a957, #128744);
}

.notify-error {
    background: linear-gradient(135deg, #dc3545, #b81f2d);
}

.notify-warning {
    background: linear-gradient(135deg, #f0ad2c, #d99110);
    color: #1f1600;
}

.notify-info {
    background: linear-gradient(135deg, #2176d2, #1659a8);
}

.notify-message {
    font-size: 0.92rem;
    line-height: 1.35;
    word-break: break-word;
}

.notify-close {
    position: absolute;
    top: 0.35rem;
    right: 0.45rem;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.2rem;
    opacity: 0.8;
    cursor: pointer;
}

.notify-actions {
    margin-top: 0.65rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

/* Modern breadcrumb */
.page-breadcrumb {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0.1rem 0;
    margin-bottom: 0.6rem;
    box-shadow: none;
}

.page-breadcrumb .breadcrumb {
    --bs-breadcrumb-divider: '/';
    align-items: center;
}

.page-breadcrumb .breadcrumb-item,
.page-breadcrumb .breadcrumb-item a {
    font-size: 0.73rem;
    color: #98a2b3;
    text-decoration: none;
}

.page-breadcrumb .breadcrumb-item a:hover {
    color: #667085;
    text-decoration: underline;
}

.page-breadcrumb .breadcrumb-item.active {
    color: #667085;
    font-weight: 600;
}

/* Mobile-first instructor + student enhancements */
.mobile-stat {
    font-size: clamp(1.45rem, 7vw, 2.3rem);
}

.mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mobile-actions .btn {
    min-height: 36px;
}

.mobile-cards td .profile-thumb,
.mobile-cards td .qr-box {
    max-width: 100%;
}

.mobile-cards td .profile-thumb {
    height: auto;
}

.mobile-cards td .qr-box img {
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 767.98px) {
    .btn:not(.btn-close) {
        min-height: 44px;
        padding: 0.55rem 1rem;
        font-size: 1rem;
        line-height: 1.2;
    }

    .btn-sm:not(.btn-close) {
        min-height: 44px;
        padding: 0.55rem 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    .hero-tile {
        padding: 1rem;
        border-radius: 0.8rem;
    }

    .admin-dashboard-hero-action {
        width: 100%;
    }

    .admin-stat-card {
        min-height: 144px;
    }

    .admin-stat-value {
        font-size: 1.95rem;
    }

    .hero-tile h3 {
        font-size: 1.2rem;
    }

    .hero-tile p {
        font-size: 0.9rem;
    }

    .page-breadcrumb {
        margin-bottom: 0.75rem;
        padding: 0.45rem 0.7rem;
    }

    .card .card-body {
        padding: 0.9rem;
    }

    .mobile-actions {
        flex-direction: column;
        width: 100%;
    }

    .mobile-actions .btn,
    .w-md-auto {
        width: 100% !important;
    }

    .mobile-actions .btn-group,
    .mobile-cards td .btn-group {
        width: 100%;
    }

    .mobile-cards td .btn-group .btn {
        flex: 1 1 4.5rem;
    }

    .input-group-lg-mobile .form-control,
    .input-group-lg-mobile .btn {
        min-height: 44px;
        font-size: 1rem;
    }

    .mobile-cards thead {
        display: none;
    }

    .mobile-cards,
    .mobile-cards tbody,
    .mobile-cards tr,
    .mobile-cards td {
        display: block;
        width: 100%;
    }

    .mobile-cards tr {
        background: #fff;
        border: 1px solid #dbe7fb;
        border-radius: 0.85rem;
        box-shadow: 0 6px 16px rgba(20, 58, 120, 0.08);
        padding: 0.2rem 0.7rem;
        margin-bottom: 0.8rem;
        overflow: hidden;
    }

    .mobile-cards td {
        border: 0;
        border-bottom: 1px solid #eef2f6;
        padding: 0.65rem 0;
        text-align: right;
        position: relative;
        white-space: normal;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.85rem;
    }

    .mobile-cards td:not([data-label])::before,
    .mobile-cards td[data-label=""]::before {
        content: '';
        flex-basis: 0;
    }

    .mobile-cards td:last-child {
        border-bottom: 0;
    }

    .mobile-cards td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        font-weight: 700;
        color: #184b8f;
        text-align: left;
        word-break: break-word;
    }

    .mobile-cards td > * {
        max-width: 58%;
    }

    .mobile-cards td .btn-group {
        max-width: 100%;
    }

    .mobile-cards td.mobile-actions > * {
        max-width: 100%;
    }

    .mobile-cards .badge {
        font-size: 0.72rem;
    }

    .mobile-cards td.mobile-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-cards td.mobile-actions .btn {
        width: 100%;
        margin-right: 0;
    }

    .mobile-cards td .btn {
        white-space: normal;
    }

    .mobile-cards td .profile-thumb {
        margin-left: auto;
    }

    .mobile-cards td.text-nowrap {
        white-space: normal !important;
    }

    .mobile-cards td .qr-box {
        width: auto;
        display: inline-flex;
        justify-content: flex-end;
    }

    .mobile-cards td .profile-thumb {
        width: 48px;
        height: 48px;
        object-fit: cover;
        border-radius: 0.5rem;
    }

    .mobile-cards td .qr-box {
        padding: 0.45rem;
    }

    .mobile-cards td .qr-box img {
        width: 76px;
    }

    .mobile-cards td .btn-group {
        justify-content: flex-end;
    }

    .mobile-cards td[data-label="Actions"] .btn,
    .mobile-cards td.mobile-actions .btn {
        width: 100%;
    }

    .mobile-cards td[data-label="Actions"] .btn-group .btn,
    .mobile-cards td.mobile-actions .btn-group .btn {
        width: auto;
    }

    .mobile-cards td.mobile-actions .action-icon-group {
        width: 100%;
        justify-content: flex-end;
    }

    .dataTables_wrapper .row {
        --bs-gutter-x: 0.5rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        float: none;
        text-align: left;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_paginate {
        margin-top: 0.5rem;
    }

    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label {
        display: block;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        max-width: 100%;
    }

    .dataTables_wrapper .dataTables_info {
        text-align: center;
        margin-top: 0.25rem;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .table-responsive {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Select2 dropdown styling */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    border-color: #c8d8f2;
    border-radius: 0.68rem;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 1.9;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #c8d8f2;
}

/* ── Login page ── */
body.login-body {
    background: linear-gradient(135deg, var(--blue-900) 0%, #1d63c9 50%, #667eea 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

body.login-body .page-breadcrumb {
    display: none !important;
}

.login-page {
    width: 100%;
    max-width: 360px;
}

.login-card {
    background: #fff;
    border-radius: 1.1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 1.65rem 1.45rem 1.4rem;
}

.login-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    background: transparent;
    border-radius: 0;
    color: inherit;
    margin-bottom: 0.75rem;
}

.login-logo-img {
    display: block;
    max-width: 100%;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.login-title {
    font-weight: 700;
    color: var(--blue-900);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: #6b7280;
    font-size: 0.92rem;
    margin-bottom: 0;
}

.input-icon-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.input-icon-wrap .form-control {
    padding-left: 2.5rem;
}

.login-btn {
    background: linear-gradient(135deg, var(--blue-800), var(--blue-700));
    border: none;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(17, 77, 160, 0.35);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.login-credentials {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.82rem;
    color: #6b7280;
}

@media (max-width: 480px) {
    .login-page {
        max-width: 100%;
    }

    .login-card {
        padding: 1.45rem 1rem 1.2rem;
    }
}

.profile-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 0.4rem;
    border: 1px solid #d0d5dd;
    background: #f8fafc;
}

.profile-preview {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 0.6rem;
    border: 1px solid #d0d5dd;
    background: #f8fafc;
}

.profile-edit-photo {
    width: 132px;
    height: 132px;
}

.profile-edit-photo img {
    object-fit: cover;
}

.camera-capture-panel {
    border: 1px solid #d0d5dd;
    border-radius: 0.6rem;
    padding: 0.6rem;
    background: #f8fafc;
}

.camera-capture-panel video {
    width: 100%;
    max-height: 260px;
    border-radius: 0.45rem;
    background: #111827;
}

.camera-capture-actions {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.5rem;
}
