html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

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

    .btn-oxford-red:hover {
        background-color: var(--oxford-red-dark);
        border-color: var(--oxford-red-dark);
        color: white;
    }

.btn-outline-oxford-red {
    color: var(--oxford-red);
    border-color: var(--oxford-red);
}

    .btn-outline-oxford-red:hover {
        background-color: var(--oxford-red);
        border-color: var(--oxford-red);
        color: white;
    }

.border-left-oxford {
    border-left: 4px solid var(--oxford-red);
}

.border-left-info {
    border-left: 4px solid #17a2b8;
}

.border-left-primary {
    border-left: 4px solid #007bff;
}

.border-left-warning {
    border-left: 4px solid #ffc107;
}

.camera-container {
    position: relative;
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    min-height: 300px;
}

.camera-preview {
    width: 100%;
    min-height: 300px;
    background: #1a1a2e;
    object-fit: cover;
}

.camera-status {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 10;
}

.face-detection-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 2px solid #00ff88;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        border-color: #00ff88;
        opacity: 0.8;
    }

    50% {
        border-color: #00ccff;
        opacity: 1;
    }

    100% {
        border-color: #00ff88;
        opacity: 0.8;
    }
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

#viewDeviceModal .device-view-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--divider-color);
}

    #viewDeviceModal .device-view-row:last-child {
        border-bottom: none;
    }

    #viewDeviceModal .device-view-row .label {
        color: var(--text-faint);
    }

    #viewDeviceModal .device-view-row .value {
        font-weight: 600;
        color: var(--text-primary);
        text-align: right;
    }

/* ===== EXPORT MENU (Attendance + Timesheet) ===== */
.att-export-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.att-export-menu {
    min-width: 252px;
    padding: 6px;
    border: 1px solid var(--border-clr);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.att-export-menu-label {
    display: block;
    padding: 6px 10px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.att-export-menu .att-export-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 9px;
    color: var(--text-main);
    white-space: normal;
}

    .att-export-menu .att-export-item:hover,
    .att-export-menu .att-export-item:focus {
        background: var(--brand-tint);
        color: var(--text-main);
    }

.att-export-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

    .att-export-icon.is-excel {
        background: var(--success-bg);
        color: var(--success);
    }

    .att-export-icon.is-pdf {
        background: var(--danger-bg);
        color: var(--danger);
    }

    .att-export-icon.is-csv {
        background: var(--info-bg);
        color: var(--info);
    }

.att-export-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

    .att-export-text strong {
        font-size: 13px;
        font-weight: 600;
    }

    .att-export-text small {
        font-size: 11.5px;
        color: var(--text-muted);
    }

@media (max-width: 768px) {
    .att-toolbar-actions .att-export,
    .ts-toolbar-actions .att-export {
        flex: 1 1 auto;
    }

        .att-toolbar-actions .att-export .btn,
        .ts-toolbar-actions .att-export .btn {
            width: 100%;
        }
}

/* ===== SKELETON LOADERS ===== */
.skel-bone {
    display: block;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(128, 128, 128, .2);
    background: color-mix(in srgb, var(--text-muted) 22%, transparent);
}

.skel-pulse {
    animation: skel-pulse 1.5s ease-in-out infinite;
}

@keyframes skel-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .45;
    }
}

/* sizes */
.skel-text {
    width: 100%;
    height: 12px;
    border-radius: 6px;
}

.skel-text-sm {
    width: 100%;
    height: 10px;
    border-radius: 5px;
}

.skel-title {
    height: 16px;
    border-radius: 6px;
}

.skel-value {
    width: 56px;
    height: 28px;
    border-radius: 8px;
}

.skel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skel-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.skel-pill {
    width: 84px;
    max-width: 100%;
    height: 26px;
    border-radius: 100px;
}

.skel-square {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.skel-btn {
    width: 110px;
    height: 34px;
    border-radius: 10px;
}

.skel-progress {
    width: 100%;
    height: 8px;
    border-radius: 100px;
}

.skel-input {
    height: 44px;
    border-radius: 10px;
}

.skel-input-sm {
    width: 96px;
}

.skel-input-md {
    width: 180px;
}

.skel-input-lg {
    width: 340px;
}

.skel-input-flex {
    flex: 1;
    min-width: 160px;
}

.skel-w-20 {
    width: 20%;
}

.skel-w-30 {
    width: 30%;
}

.skel-w-40 {
    width: 40%;
}

.skel-w-50 {
    width: 50%;
}

.skel-w-60 {
    width: 60%;
}

.skel-w-80 {
    width: 80%;
}

/* layout */
.skel-page {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    gap: 20px;
    width: 100%;
    text-align: left;
}

.skel-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.skel-grow {
    flex: 1;
}

.skel-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skel-box {
    padding: 16px 18px;
    border: 1px solid var(--border-clr);
    border-radius: 14px;
}

.skel-banner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.skel-kpis {
    display: grid;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-clr);
}

.skel-kpis-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.skel-kpis-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skel-kpis-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.skel-kpis-boxed {
    padding-bottom: 0;
    border-bottom: 0;
}

    .skel-kpis-boxed .skel-kpi {
        padding: 16px 18px;
        border: 1px solid var(--border-clr);
        border-radius: 14px;
    }

.skel-kpi {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* table */
.skel-table {
    overflow: hidden;
    border: 1px solid var(--border-clr);
    border-radius: 14px;
}

.skel-tr {
    display: grid;
    align-items: center;
    gap: 16px;
    min-height: 74px;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-clr);
}

    .skel-tr:last-child {
        border-bottom: 0;
    }

.skel-thead {
    min-height: 46px;
    background: var(--surface-alt);
}

.skel-cols-attendance .skel-tr {
    grid-template-columns: 2.4fr 1.4fr 1.2fr 1.1fr .8fr .8fr .7fr 1fr .9fr;
}

.skel-cols-face .skel-tr {
    grid-template-columns: 2.4fr 1.4fr 1.1fr 1.2fr .8fr;
}

.skel-cols-devices .skel-tr {
    grid-template-columns: 1.8fr 1.6fr 1.6fr 1.1fr 1.2fr;
}

.skel-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.skel-cell-person .skel-stack {
    flex: 1;
}

.skel-cell-actions {
    gap: 8px;
}

.skel-tr:nth-child(odd) .skel-cell-text .skel-bone {
    width: 70%;
}

.skel-tr:nth-child(even) .skel-cell-text .skel-bone {
    width: 85%;
}

.skel-tr .skel-cell-short .skel-bone {
    width: 55%;
}

.skel-tr:nth-child(3n) .skel-cell-person .skel-w-80 {
    width: 60%;
}

/* small helpers used inside existing tables, lists and grids */
.skel-row td {
    vertical-align: middle;
}

.skel-row:nth-child(odd) td:nth-child(even) .skel-bone,
.skel-row:nth-child(even) td:nth-child(odd) .skel-bone {
    width: 70%;
}

.skel-block {
    gap: 12px;
    padding: 8px 0;
}

    .skel-block .skel-bone:nth-child(3n) {
        width: 65%;
    }

    .skel-block .skel-bone:nth-child(3n+1) {
        width: 85%;
    }

.skel-list {
    gap: 0;
}

.skel-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-clr);
}

    .skel-list-item:last-child {
        border-bottom: 0;
    }

.skel-tile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border-clr);
    border-radius: 10px;
}

/* overlay on top of existing content */
.skel-host {
    position: relative;
}

.skel-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow: hidden;
    background: var(--surface);
    border-radius: inherit;
}

    .skel-overlay .skel-table {
        border: 0;
        border-radius: 0;
    }

    .skel-overlay > .skel-page > .skel-block {
        padding: 20px;
    }

/* audit details, calendar, chat */
.skel-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 24px;
}

.skel-cols-changes .skel-tr {
    grid-template-columns: 1fr 1.5fr 1.5fr;
    min-height: 48px;
}

.skel-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(84px, 1fr);
    gap: 6px;
    height: 100%;
}

.skel-cal-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border-clr);
    border-radius: 10px;
}

.skel-cal-day {
    width: 18px;
}

.skel-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px;
}

.skel-chat-header,
.skel-chat-composer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
}

.skel-chat-header {
    border-bottom: 1px solid var(--border-clr);
}

.skel-chat-composer {
    border-top: 1px solid var(--border-clr);
}

.skel-bubbles {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
    padding: 20px 18px;
}

.skel-bubble {
    width: 42%;
    height: 38px;
    border-radius: 18px;
}

.skel-bubble-in {
    align-self: flex-start;
}

.skel-bubble-out {
    align-self: flex-end;
    width: 30%;
}

.skel-bubble:nth-child(4n+1) {
    width: 55%;
}

.skel-bubble:nth-child(4n+2) {
    width: 34%;
}

.skel-overlay > .skel-page {
    height: 100%;
}

.skel-host-calendar {
    min-height: 460px;
}

.skel-host-chat {
    min-height: 420px;
}

@media (max-width: 767.98px) {
    .skel-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .skel-cal {
        grid-auto-rows: minmax(52px, 1fr);
        gap: 4px;
    }

    .skel-host-calendar {
        min-height: 300px;
    }

    .skel-cal-cell .skel-bone:not(.skel-cal-day) {
        display: none;
    }

    .skel-bubble {
        width: 60%;
    }
}

@media (max-width: 991.98px) {
    .skel-kpis-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .skel-input-lg {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .skel-kpis-3, .skel-kpis-4, .skel-kpis-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .skel-table .skel-tr {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .skel-tr > .skel-cell:nth-child(n+4) {
        display: none;
    }

    .skel-banner .skel-btn {
        display: none;
    }
}

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