:root {
    --pft-radius: 1rem;
}

body {
    min-height: 100vh;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    color: #fff;
    box-shadow: 0 12px 28px rgba(13, 110, 253, .22);
    flex: 0 0 auto;
}

.brand-mark-sm {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.brand-mark-lg {
    width: 88px;
    height: 88px;
    border-radius: 26px;
}

.brand-mark-lg .material-icons-outlined {
    font-size: 46px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.status-row:last-child {
    border-bottom: 0;
}

.theme-inline-selector {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.theme-inline-selector [data-theme-value].active {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.avatar-initials {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    color: #fff;
    font-weight: 700;
    letter-spacing: .03em;
    border: 3px solid rgba(255, 255, 255, .55);
}

.dashboard-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-choice {
    display: grid;
    grid-template-columns: 62px 1fr auto;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: .9rem;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: 1rem;
    text-align: left;
}

.theme-choice:hover,
.theme-choice.active {
    border-color: var(--bs-primary);
}

.theme-choice small {
    display: block;
    color: var(--bs-secondary-color);
    margin-top: .15rem;
}

.theme-choice .theme-check {
    color: var(--bs-primary);
    opacity: 0;
}

.theme-choice.active .theme-check {
    opacity: 1;
}

.theme-preview {
    width: 62px;
    height: 42px;
    border-radius: .65rem;
    border: 1px solid rgba(128, 128, 128, .3);
    display: block;
}

.theme-preview-light {
    background: linear-gradient(90deg, #f8f9fa 0 28%, #fff 28% 100%);
}

.theme-preview-dark {
    background: linear-gradient(90deg, #111827 0 28%, #1f2937 28% 100%);
}

.theme-preview-semi {
    background: linear-gradient(90deg, #111827 0 28%, #fff 28% 100%);
}

.kiosk-body {
    background: radial-gradient(circle at top, rgba(13, 110, 253, .18), transparent 44%), var(--bs-body-bg);
}

.kiosk-placeholder {
    max-width: 720px;
}

@media (max-width: 575.98px) {
    .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .theme-choice {
        grid-template-columns: 52px 1fr auto;
    }

    .theme-preview {
        width: 52px;
    }
}


/* Sidebar alignment hardening
   Keeps every menu icon in a fixed column and prevents unsupported/long
   icon ligatures from pushing or clipping menu labels. */
.sidebar-wrapper .sidebar-nav .metismenu > li > a {
    min-height: 40px;
    gap: 10px;
    padding: 7px 14px;
}

.sidebar-wrapper .sidebar-nav .metismenu a .parent-icon {
    width: 24px;
    min-width: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
}

.sidebar-wrapper .sidebar-nav .metismenu a .parent-icon .material-icons-outlined {
    display: block;
    width: 24px;
    min-width: 24px;
    font-size: 21px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.sidebar-wrapper .sidebar-nav .metismenu a .menu-title {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-wrapper .sidebar-nav .metismenu a.has-arrow {
    padding-right: 38px;
}

.sidebar-wrapper .sidebar-nav .metismenu ul a {
    min-height: 36px;
    align-items: center;
}

/* Preserve centered icons when the desktop mini-sidebar is collapsed. */
@media screen and (min-width: 1199px) {
    body.toggled:not(.sidebar-hovered) .sidebar-wrapper .metismenu > li > a {
        gap: 0;
        padding-left: 0;
        padding-right: 0;
    }
}

/* Administration foundation ------------------------------------------------ */
.page-heading h4 {
    font-weight: 650;
    letter-spacing: -.02em;
}

.admin-stat-card {
    border: 1px solid var(--bs-border-color-translucent);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--bs-primary-rgb), .28);
    box-shadow: 0 14px 34px rgba(20, 35, 60, .08);
}

.min-width-0 {
    min-width: 0;
}

.worker-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(13, 110, 253, .16), rgba(111, 66, 193, .2));
    color: var(--bs-primary);
    font-weight: 700;
    letter-spacing: .035em;
    border: 1px solid rgba(var(--bs-primary-rgb), .14);
}

.worker-avatar-sm {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 12px;
    font-size: .8rem;
}

.worker-cell {
    min-width: 230px;
    max-width: 330px;
}

.role-badge {
    color: var(--bs-body-color) !important;
    background: var(--bs-tertiary-bg) !important;
}

.admin-table > :not(caption) > * > * {
    padding: .9rem .8rem;
    border-bottom-color: var(--bs-border-color-translucent);
}

.admin-table thead th {
    color: var(--bs-secondary-color);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .055em;
    font-weight: 650;
    white-space: nowrap;
    border-top: 0;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover > * {
    background-color: rgba(var(--bs-primary-rgb), .025);
}

.workers-table-filters .input-group-text {
    background: var(--bs-tertiary-bg);
}

.dataTables_wrapper .dataTables_length select {
    width: auto;
    display: inline-block;
}

.dataTables_wrapper .dataTables_info {
    color: var(--bs-secondary-color);
    font-size: .875rem;
    padding-top: .5rem !important;
}

.dataTables_wrapper .pagination {
    justify-content: flex-end;
    margin-bottom: 0;
}

.dataTables_wrapper .page-link {
    color: var(--bs-body-color);
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

.dataTables_wrapper .page-item.active .page-link {
    color: #fff;
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.form-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.form-section-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .1);
}

.worker-form-side-card {
    top: 92px;
}

.dashboard-list-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.dashboard-list-row:last-child {
    border-bottom: 0;
}

.empty-state {
    text-align: center;
}

.empty-state > .material-icons-outlined {
    font-size: 42px;
    color: var(--bs-secondary-color);
    opacity: .65;
    margin-bottom: .75rem;
}

.readiness-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.readiness-row:last-child {
    border-bottom: 0;
}

.activity-timeline {
    position: relative;
}

.activity-item {
    position: relative;
    display: grid;
    grid-template-columns: 13px minmax(0, 1fr);
    gap: .85rem;
    padding: .15rem 0 1rem;
}

.activity-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: -2px;
    width: 2px;
    background: var(--bs-border-color);
}

.activity-dot {
    width: 12px;
    height: 12px;
    margin-top: .35rem;
    border-radius: 50%;
    background: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .12);
    position: relative;
    z-index: 1;
}

.sidebar-wrapper [data-coming-soon] .menu-title::after {
    content: 'Soon';
    float: right;
    margin-left: .65rem;
    padding: .08rem .38rem;
    border-radius: 999px;
    font-size: .58rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    background: rgba(128, 128, 128, .12);
}

.sidebar-wrapper .metismenu ul [data-coming-soon]::after {
    content: 'Soon';
    margin-left: auto;
    font-size: .58rem;
    opacity: .65;
    text-transform: uppercase;
}

@media (max-width: 1199.98px) {
    .worker-form-side-card {
        position: static !important;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .page-heading .btn {
        width: 100%;
        justify-content: center;
    }

    .admin-table {
        min-width: 820px;
    }

    .dataTables_wrapper .pagination {
        justify-content: flex-start;
    }
}

/* Global application notifications */
.pft-swal-toast {
    border: 1px solid var(--bs-border-color-translucent) !important;
    border-radius: 1rem !important;
    box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .16) !important;
    background: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

.pft-swal-toast .swal2-title,
.pft-swal-toast .swal2-html-container,
.pft-swal-modal .swal2-title,
.pft-swal-modal .swal2-html-container {
    color: var(--bs-body-color) !important;
}

.pft-swal-toast .swal2-close,
.pft-swal-modal .swal2-close {
    color: var(--bs-secondary-color) !important;
}

.pft-swal-modal {
    border: 1px solid var(--bs-border-color-translucent) !important;
    border-radius: 1.25rem !important;
    background: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

.swal2-container {
    z-index: 20000 !important;
}
