:root {
    --sidebar-width: 272px;
    --sidebar-collapsed-width: 88px;
    --ink: #182230;
    --muted: #667085;
    --line: #e4e7ec;
    --line-strong: #d0d5dd;
    --surface: #f4f6fa;
    --surface-soft: #f9fafb;
    --brand: #1f6feb;
    --brand-dark: #175cd3;
    --accent: #0f766e;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 12px 28px rgba(16, 24, 40, .07);
}

body {
    background: linear-gradient(180deg, rgba(31, 111, 235, .05), rgba(15, 118, 110, .03) 42%, transparent 72%), var(--surface);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .95rem;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: #ffffff;
    border-right: 1px solid var(--line);
    padding: 20px;
    position: fixed;
    inset: 0 auto 0 0;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    margin-bottom: 22px;
}

.brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #344054;
    text-decoration: none;
    font-weight: 600;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus {
    background: #eef4ff;
    color: var(--brand-dark);
}

.main-panel {
    width: 100%;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    min-height: 76px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 750;
}

.topbar p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-wrap {
    padding: 24px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    height: 100%;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .04);
}

.metric-card .icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: #eef4ff;
    color: var(--brand);
    margin-bottom: 12px;
}

.metric-card h2 {
    font-size: 1.8rem;
    margin: 0;
}

.metric-card p {
    margin: 0;
    color: var(--muted);
}

.panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .04);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #dbeafe 100%);
}

.login-card {
    width: min(100%, 430px);
    background: #ffffff;
    border-radius: 8px;
    padding: 28px;
    border: 1px solid var(--line);
    box-shadow: 0 18px 45px rgba(16, 24, 40, .12);
}

.login-card img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 8px;
}

.required::after {
    content: " *";
    color: #dc3545;
}

.filter-bar {
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.form-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
}

.form-tabs .nav-link {
    white-space: nowrap;
}

.image-preview {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.avatar-sm {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.avatar-xs {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line);
    vertical-align: -6px;
}

.empty-state {
    min-height: 260px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
}

.empty-state i {
    font-size: 2.2rem;
    color: var(--brand);
}

.empty-state h3 {
    margin: 10px 0 2px;
    font-size: 1.1rem;
    color: var(--ink);
}

.quick-card {
    min-height: 116px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .04);
}

.quick-card:hover {
    color: var(--brand-dark);
    background: #eef4ff;
}

.quick-card i {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: #eef4ff;
    color: var(--brand);
    font-size: 1.25rem;
}

.profile-head {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .04);
}

.profile-head img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.profile-head h2 {
    margin: 0;
    font-size: 1.35rem;
}

.profile-head p {
    margin: 4px 0 0;
    color: var(--muted);
}

.print-body {
    background: #ffffff;
}

.print-sheet {
    width: min(100%, 920px);
    margin: 0 auto;
    padding: 28px;
}

.print-header {
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 16px;
}

.print-header img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.print-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.print-header p {
    margin: 2px 0 0;
}

.print-photo {
    width: 130px;
    height: 150px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.signature-row {
    display: flex;
    justify-content: space-between;
    margin-top: 70px;
}

.signature-row span {
    border-top: 1px solid var(--ink);
    padding-top: 8px;
    min-width: 220px;
    text-align: center;
}

.camera-box {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #111827;
    object-fit: cover;
}

.bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.salary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fafb;
}

.salary-total span {
    color: var(--muted);
    font-weight: 650;
}

.salary-total strong {
    font-size: 1.2rem;
}

.report-card {
    min-height: 132px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .04);
}

.report-card:hover {
    border-color: #b2ccff;
    color: var(--brand-dark);
}

.report-card i {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: #eef4ff;
    color: var(--brand);
    font-size: 1.2rem;
}

.report-card span,
.activity-item,
.notification-item span {
    min-width: 0;
}

.report-card strong,
.report-card em,
.report-card small,
.activity-item strong,
.activity-item span,
.activity-item small,
.notification-item strong,
.notification-item em,
.notification-item small {
    display: block;
}

.report-card strong {
    font-size: 1.45rem;
    line-height: 1.2;
}

.report-card em {
    font-style: normal;
    font-weight: 700;
    margin-top: 4px;
}

.report-card small,
.activity-item small,
.notification-item small {
    color: var(--muted);
}

.activity-list,
.notification-list {
    display: grid;
    gap: 10px;
}

.activity-item,
.notification-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.activity-item span,
.notification-item em {
    color: #344054;
    font-style: normal;
    margin: 2px 0;
}

.notification-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item i {
    color: var(--brand);
}

.notification-item.unread {
    background: #eef4ff;
    border-color: #b2ccff;
}

@media (max-width: 767.98px) {
    .attendance-status {
        min-width: 132px;
    }
}

@media (max-width: 991.98px) {
    .main-panel {
        margin-left: 0;
    }

    .topbar {
        padding: 12px 16px;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .topbar h1 {
        font-size: 1rem;
    }

    .content-wrap {
        padding: 16px;
    }
}

@media (max-width: 575.98px) {
    .topbar-actions .dropdown-toggle {
        max-width: 128px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-head .ms-auto {
        margin-left: 0 !important;
        width: 100%;
        flex-wrap: wrap;
    }
}

@media print {
    .sidebar,
    .topbar,
    .d-print-none {
        display: none !important;
    }

    .main-panel {
        margin-left: 0 !important;
    }

    .content-wrap {
        padding: 0;
    }

    .print-sheet {
        width: 100%;
        padding: 0;
    }
}

/* Refined admin shell */
* {
    scrollbar-width: thin;
    scrollbar-color: #98a2b3 transparent;
}

.btn {
    border-radius: 8px;
    font-weight: 650;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 8px 18px rgba(31, 111, 235, .16);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-light,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-dark {
    border-color: var(--line);
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: var(--line-strong);
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 .22rem rgba(31, 111, 235, .12);
}

.form-label {
    color: #344054;
    font-weight: 700;
    margin-bottom: 6px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: #475467;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom-color: var(--line);
}

.table tbody td,
.table tbody th {
    padding-top: 12px;
    padding-bottom: 12px;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    --bs-table-hover-bg: #f8fbff;
}

.sidebar {
    background: rgba(255, 255, 255, .96);
    padding: 18px 16px;
    z-index: 20;
    box-shadow: 16px 0 36px rgba(16, 24, 40, .04);
    transition: width .18s ease, padding .18s ease;
}

.brand {
    min-height: 48px;
}

.brand span {
    line-height: 1.2;
}

.sidebar-nav {
    gap: 5px;
    overflow-y: auto;
    padding-right: 2px;
}

.sidebar-nav a {
    min-height: 44px;
    padding: 10px 12px;
    position: relative;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.sidebar-nav a i {
    width: 22px;
    font-size: 1.08rem;
    text-align: center;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus,
.sidebar-nav a.active {
    background: #eef4ff;
    color: var(--brand-dark);
}

.sidebar-nav a.active::before {
    content: "";
    width: 3px;
    border-radius: 99px;
    background: var(--brand);
    position: absolute;
    inset: 10px auto 10px 0;
}

.main-panel {
    transition: margin-left .18s ease;
}

.topbar {
    min-height: 74px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(14px);
    justify-content: flex-start;
}

.topbar h1 {
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: 0;
}

.topbar-actions {
    margin-left: auto;
}

.sidebar-toggle {
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
}

.content-wrap {
    padding: 28px;
}

.panel,
.metric-card,
.quick-card,
.profile-head,
.report-card {
    box-shadow: var(--shadow-sm);
}

.panel {
    padding: 22px;
}

.panel h2,
.panel h3 {
    font-weight: 800;
}

.metric-card,
.quick-card,
.report-card {
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.metric-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.metric-card:hover,
.quick-card:hover,
.report-card:hover {
    border-color: #b2ccff;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-card .icon,
.quick-card i,
.report-card i {
    background: #eaf2ff;
}

.filter-bar,
.salary-total {
    background: var(--surface-soft);
}

.form-tabs .nav-link {
    color: #475467;
    font-weight: 700;
    white-space: nowrap;
}

.form-tabs .nav-link.active {
    color: var(--brand-dark);
    border-color: var(--line) var(--line) #ffffff;
}

.empty-state {
    min-height: 240px;
    padding: 28px;
    background: #fbfcfe;
    border: 1px dashed #d0d5dd;
    border-radius: 8px;
}

.activity-item,
.notification-item {
    box-shadow: 0 1px 1px rgba(16, 24, 40, .02);
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    padding-left: 14px;
    padding-right: 14px;
}

.sidebar-collapsed .brand {
    justify-content: center;
}

.sidebar-collapsed .brand span,
.sidebar-collapsed .sidebar-nav span {
    display: none;
}

.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-collapsed .sidebar-nav a.active::before {
    inset-left: -5px;
}

.sidebar-collapsed .main-panel {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-toggle i::before {
    content: "\f473";
}

@media (max-width: 991.98px) {
    .content-wrap {
        padding: 16px;
    }

    .panel {
        padding: 16px;
    }
}
