:root {
    --brand: #5b5bd6;
    --brand-dark: #4747bd;
    --brand-rgb: 91, 91, 214;
    --brand-soft: #eeeeff;
    --ink: #182230;
    --ink-soft: #344054;
    --muted: #667085;
    --line: #e5e9f0;
    --line-strong: #d7dce5;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --canvas: #f4f6fa;
    --sidebar: #121827;
    --sidebar-muted: #98a2b3;
    --success: #168a4a;
    --success-soft: #e7f8ee;
    --warning: #b86808;
    --warning-soft: #fff4dd;
    --danger: #c83b4d;
    --danger-soft: #ffebee;
    --info: #2770c7;
    --info-soft: #eaf3ff;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .04);
    --shadow-md: 0 12px 32px rgba(16, 24, 40, .08);
    --sidebar-width: 272px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
    scrollbar-color: var(--line-strong) transparent;
}

body,
.auth-body {
    min-height: 100vh;
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: .9375rem;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
}

a {
    color: var(--brand-dark);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--brand);
}

button,
input,
select,
textarea {
    font: inherit;
}

::selection {
    color: #fff;
    background: rgba(var(--brand-rgb), .85);
}

:focus-visible {
    outline: 3px solid rgba(var(--brand-rgb), .3);
    outline-offset: 2px;
}

.text-muted {
    color: var(--muted) !important;
}

.eyebrow {
    margin: 0;
    color: var(--brand);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

/* Buttons and inputs */
.btn {
    --bs-btn-border-radius: 10px;
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: var(--bs-btn-border-radius);
    font-weight: 650;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-sm {
    min-height: 34px;
    border-radius: 9px;
}

.btn-lg {
    min-height: 50px;
    border-radius: 12px;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 6px 16px rgba(var(--brand-rgb), .18);
}

.btn-light {
    --bs-btn-bg: var(--surface);
    --bs-btn-color: var(--ink-soft);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: var(--surface-subtle);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-border-color: var(--line-strong);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-dark);
    --bs-btn-border-color: rgba(var(--brand-rgb), .35);
    --bs-btn-hover-bg: var(--brand-soft);
    --bs-btn-hover-border-color: rgba(var(--brand-rgb), .5);
    --bs-btn-hover-color: var(--brand-dark);
}

.form-label {
    margin-bottom: .45rem;
    color: var(--ink-soft);
    font-size: .84rem;
    font-weight: 650;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: var(--line);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .02);
}

.form-control {
    padding: .68rem .85rem;
}

.form-select {
    padding-top: .68rem;
    padding-bottom: .68rem;
}

.form-control::placeholder {
    color: #98a2b3;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(var(--brand-rgb), .6);
    box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .11);
}

.form-check-input:checked {
    border-color: var(--brand);
    background-color: var(--brand);
}

.dropdown-menu {
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-color: var(--ink);
    --bs-dropdown-link-color: var(--ink-soft);
    --bs-dropdown-link-hover-color: var(--ink);
    --bs-dropdown-link-hover-bg: var(--surface-subtle);
    min-width: 205px;
    padding: .45rem;
    border-color: var(--line);
    border-radius: 13px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .75rem;
    border-radius: 8px;
    font-size: .88rem;
}

.dropdown-item i {
    width: 18px;
    color: var(--muted);
    text-align: center;
}

/* Application shell */
.sidebar {
    position: fixed;
    z-index: 1040;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 20px 16px 16px;
    overflow-y: auto;
    color: #fff;
    background:
        radial-gradient(circle at 0 0, rgba(var(--brand-rgb), .2), transparent 30%),
        linear-gradient(180deg, #151b2c 0%, #101522 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
    transition: transform .25s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    padding: 2px 8px;
    color: #fff;
    text-decoration: none;
}

.brand:hover {
    color: #fff;
}

.brand-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, #7373e8, var(--brand));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 20px rgba(var(--brand-rgb), .3);
    font-size: 1.05rem;
    font-weight: 800;
}

.brand-copy {
    display: grid;
    line-height: 1.15;
}

.brand-copy strong {
    color: #fff;
    font-size: 1.05rem;
    letter-spacing: -.02em;
}

.brand-copy small {
    margin-top: 4px;
    color: var(--sidebar-muted);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .035em;
}

.sidebar-close {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: #d0d5dd;
    background: rgba(255, 255, 255, .08);
}

.sidebar-nav {
    flex: 1;
}

.nav-group + .nav-group {
    margin-top: 18px;
}

.nav-label {
    display: block;
    padding: 0 13px 7px;
    color: #687386;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 3px 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #aeb7c7;
    font-size: .88rem;
    font-weight: 550;
    text-decoration: none;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}

.sidebar-nav a i {
    width: 20px;
    color: #8e99ad;
    font-size: 1rem;
    text-align: center;
    transition: color .16s ease;
}

.sidebar-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .055);
}

.sidebar-nav a:hover i {
    color: #cfd4ff;
}

.sidebar-nav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(var(--brand-rgb), .28), rgba(var(--brand-rgb), .13));
    border-color: rgba(154, 154, 245, .14);
    box-shadow: inset 3px 0 0 #8c8cec;
}

.sidebar-nav a.active i {
    color: #c7c7ff;
}

.sidebar-profile {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    color: #fff;
    background: rgba(255, 255, 255, .045);
}

.sidebar-profile-copy {
    display: grid;
    min-width: 0;
    flex: 1;
}

.sidebar-profile-copy strong,
.sidebar-profile-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile-copy strong {
    font-size: .82rem;
}

.sidebar-profile-copy small {
    margin-top: 2px;
    color: var(--sidebar-muted);
    font-size: .7rem;
}

.sidebar-profile > i {
    color: #667085;
}

.user-avatar {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid rgba(var(--brand-rgb), .13);
    border-radius: 11px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.sidebar-profile .user-avatar {
    border-color: rgba(255, 255, 255, .12);
    color: #fff;
    background: rgba(var(--brand-rgb), .45);
}

.sidebar-overlay {
    position: fixed;
    z-index: 1035;
    inset: 0;
    display: none;
    border: 0;
    background: rgba(10, 16, 28, .56);
    backdrop-filter: blur(3px);
}

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

.topbar {
    position: sticky;
    z-index: 1020;
    top: 0;
    display: flex;
    height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 30px;
    border-bottom: 1px solid rgba(222, 227, 235, .85);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px);
}

.topbar-context,
.topbar-actions {
    display: flex;
    align-items: center;
}

.topbar-context {
    min-width: 0;
    gap: 12px;
}

.topbar-context > div {
    display: grid;
    line-height: 1.15;
}

.topbar-context small {
    color: var(--muted);
    font-size: .67rem;
    font-weight: 650;
    letter-spacing: .04em;
}

.topbar-context strong {
    margin-top: 3px;
    color: var(--ink);
    font-size: .94rem;
}

.topbar-actions {
    gap: 8px;
}

.topbar-create {
    min-height: 38px;
    padding-inline: 14px;
}

.icon-button {
    display: inline-grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink-soft);
    background: var(--surface);
    text-decoration: none;
    transition: border-color .16s ease, color .16s ease, background-color .16s ease, transform .16s ease;
}

.icon-button:hover {
    color: var(--brand);
    border-color: rgba(var(--brand-rgb), .3);
    background: var(--brand-soft);
    transform: translateY(-1px);
}

.account-button {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    margin-left: 2px;
    padding: 3px 8px 3px 3px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--ink);
    background: transparent;
}

.account-button:hover,
.account-button[aria-expanded="true"] {
    border-color: var(--line);
    background: var(--surface-subtle);
}

.account-copy {
    max-width: 145px;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.account-copy strong,
.account-copy small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy strong {
    font-size: .78rem;
}

.account-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: .67rem;
}

.account-button.dropdown-toggle::after {
    margin-left: 1px;
    color: var(--muted);
}

.account-menu form {
    margin: 0;
}

.content {
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
    padding: 30px;
}

.app-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    border-radius: var(--radius-md);
}

/* Shared page components */
.page-heading {
    margin-bottom: 26px;
}

.page-heading h1 {
    color: var(--ink);
    font-size: clamp(1.6rem, 2.4vw, 2rem);
    font-weight: 720;
    letter-spacing: -.035em;
}

.page-heading p:not(.eyebrow) {
    max-width: 690px;
    color: var(--muted);
}

.panel,
.stat-card {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel {
    height: 100%;
    padding: 22px;
    border-radius: var(--radius-lg);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 720;
    letter-spacing: -.012em;
}

.panel-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .8rem;
}

.panel-head a,
.panel-head > span {
    color: var(--brand-dark);
    font-size: .78rem;
    font-weight: 650;
    text-decoration: none;
}

.stat-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border-radius: var(--radius-md);
}

.stat-card strong {
    margin-top: 14px;
    font-size: 1.65rem;
    letter-spacing: -.035em;
}

.stat-card small {
    color: var(--muted);
}

.stat-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 11px;
}

.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--muted);
    background: var(--surface);
    font-size: .82rem;
    font-weight: 600;
}

.date-chip i {
    color: var(--brand);
}

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.list-row:first-of-type {
    border-top: 0;
}

.list-row > div {
    min-width: 0;
    flex: 1;
}

.list-row strong,
.list-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-row strong {
    color: var(--ink);
    font-size: .87rem;
    font-weight: 650;
}

.list-row small,
.empty {
    margin-top: 3px;
    color: var(--muted);
    font-size: .79rem;
}

.activity-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 11px;
    color: var(--brand);
    background: var(--brand-soft);
}

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

.empty-state i {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
    place-items: center;
    border-radius: 15px;
    color: var(--brand);
    background: var(--brand-soft);
    font-size: 1.25rem;
}

.empty-state strong {
    color: var(--ink);
    font-size: .95rem;
}

.empty-state span {
    max-width: 350px;
    font-size: .82rem;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink-soft);
    --bs-table-border-color: var(--line);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: .9rem .8rem;
}

.table thead th {
    border-bottom-width: 1px;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .075em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table thead th:first-child {
    border-radius: 9px 0 0 9px;
}

.table thead th:last-child {
    border-radius: 0 9px 9px 0;
}

.table tbody td {
    vertical-align: middle;
    font-size: .85rem;
}

.table tbody tr {
    transition: background-color .15s ease;
}

.table tbody tr:hover {
    --bs-table-hover-bg: var(--surface-subtle);
    background: var(--surface-subtle);
}

.table a {
    color: var(--ink);
    text-decoration: none;
}

.table a:hover {
    color: var(--brand);
}

.progress {
    --bs-progress-height: 7px;
    --bs-progress-bg: #edf0f5;
    overflow: hidden;
    border-radius: 999px;
}

.progress-bar {
    border-radius: inherit;
    background: var(--brand);
}

.pagination {
    --bs-pagination-bg: var(--surface);
    --bs-pagination-color: var(--muted);
    --bs-pagination-border-color: var(--line);
    --bs-pagination-hover-bg: var(--brand-soft);
    --bs-pagination-hover-color: var(--brand);
    --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12);
    --bs-pagination-active-bg: var(--brand);
    --bs-pagination-active-border-color: var(--brand);
    gap: 4px;
}

.pagination-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.pagination-meta {
    color: var(--muted);
    font-size: .76rem;
}

.pagination-meta span {
    margin: 0 4px;
    color: var(--line-strong);
}

.page-link {
    border-radius: 8px !important;
}

/* Status and priority language */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #596273;
    background: #edf0f5;
    font-size: .69rem;
    font-weight: 750;
    letter-spacing: .01em;
    line-height: 1;
    white-space: nowrap;
}

.status-badge::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    content: "";
    opacity: .8;
}

.status-active,
.status-completed,
.status-approved,
.status-accepted {
    border-color: #cdeed9;
    color: #157441;
    background: var(--success-soft);
}

.status-in_progress,
.status-assigned,
.status-under_review,
.status-pending_manager,
.status-pending_hr {
    border-color: #d6e7fb;
    color: #2565a9;
    background: var(--info-soft);
}

.status-pending,
.status-planned,
.status-on_hold,
.status-awaiting,
.status-draft {
    border-color: #f4dfb8;
    color: #9a5a08;
    background: var(--warning-soft);
}

.status-blocked,
.status-rejected,
.status-cancelled,
.status-overdue,
.status-terminated {
    border-color: #f4cdd2;
    color: #ad3040;
    background: var(--danger-soft);
}

.status-inactive,
.status-resigned,
.status-archived,
.status-suspended,
.status-retired {
    border-color: var(--line);
    color: #596273;
    background: #eff1f5;
}

.status-on_leave,
.status-on-leave,
.status-revision {
    border-color: #e6daf8;
    color: #7041a5;
    background: #f2ebfc;
}

.priority {
    width: 7px;
    height: 38px;
    flex: 0 0 7px;
    border-radius: 8px;
}

.priority-low {
    background: #77b98d;
}

.priority-medium {
    background: #e4ac3d;
}

.priority-high {
    background: #e27a3f;
}

.priority-urgent {
    background: #cf4354;
}

.priority-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    font-size: .73rem;
    font-weight: 750;
    text-transform: capitalize;
}

.priority-text::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.priority-text.priority-low,
.priority-text.priority-medium,
.priority-text.priority-high,
.priority-text.priority-urgent {
    background: transparent;
}

.priority-text.priority-low {
    color: #398252;
}

.priority-text.priority-medium {
    color: #a86a08;
}

.priority-text.priority-high {
    color: #c45b22;
}

.priority-text.priority-urgent {
    color: #bd3345;
}

/* Dashboard */
.dashboard-hero {
    position: relative;
    display: flex;
    min-height: 148px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
    padding: 28px 30px;
    overflow: hidden;
    border: 1px solid rgba(var(--brand-rgb), .13);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 92% 5%, rgba(var(--brand-rgb), .17), transparent 35%),
        linear-gradient(135deg, #fff 0%, #f8f8ff 100%);
    box-shadow: var(--shadow-sm);
}

.dashboard-hero::after {
    position: absolute;
    width: 160px;
    height: 160px;
    right: -55px;
    bottom: -105px;
    border: 24px solid rgba(var(--brand-rgb), .07);
    border-radius: 50%;
    content: "";
}

.dashboard-intro,
.dashboard-actions {
    position: relative;
    z-index: 1;
}

.dashboard-intro h1 {
    margin: 5px 0 6px;
    color: var(--ink);
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    font-weight: 740;
    letter-spacing: -.045em;
}

.dashboard-intro p:last-child {
    margin: 0;
    color: var(--muted);
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.metric-card {
    --metric: var(--brand);
    --metric-soft: var(--brand-soft);
    position: relative;
    display: grid;
    min-height: 178px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    padding: 19px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.metric-card:hover {
    color: var(--ink);
    border-color: rgba(var(--brand-rgb), .25);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-card::after {
    position: absolute;
    width: 88px;
    height: 88px;
    right: -34px;
    top: -38px;
    border-radius: 50%;
    background: var(--metric-soft);
    content: "";
    opacity: .55;
}

.metric-card__label {
    align-self: center;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 650;
}

.metric-card__icon {
    position: relative;
    z-index: 1;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    color: var(--metric);
    background: var(--metric-soft);
    font-size: 1rem;
}

.metric-card > strong {
    grid-column: 1 / -1;
    align-self: end;
    color: var(--ink);
    font-size: 2rem;
    font-weight: 740;
    letter-spacing: -.05em;
    line-height: 1;
}

.metric-card__footer {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .72rem;
}

.metric-card__footer i {
    color: var(--metric);
}

.metric-card--green {
    --metric: #168a4a;
    --metric-soft: #e7f8ee;
}

.metric-card--blue {
    --metric: #2770c7;
    --metric-soft: #eaf3ff;
}

.metric-card--amber {
    --metric: #b86808;
    --metric-soft: #fff4dd;
}

.metric-card--red {
    --metric: #c83b4d;
    --metric-soft: #ffebee;
}

.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 24px;
}

.mini-metric {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.mini-metric:hover {
    color: var(--ink);
    border-color: rgba(var(--brand-rgb), .25);
}

.mini-metric > i {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 11px;
    color: var(--brand);
    background: var(--brand-soft);
}

.mini-metric > span {
    display: grid;
    flex: 1;
}

.mini-metric small {
    margin-top: 2px;
    color: var(--muted);
    font-size: .74rem;
}

.mini-metric strong {
    color: var(--ink);
    font-size: 1.18rem;
    letter-spacing: -.025em;
}

.mini-metric > .bi-arrow-up-right {
    display: inline;
    width: auto;
    height: auto;
    color: var(--muted);
    background: transparent;
}

.chart-wrap {
    position: relative;
    height: 310px;
}

.panel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: .68rem;
    font-weight: 750;
}

.deadline-list,
.activity-feed {
    display: grid;
}

.deadline-row,
.activity-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

.deadline-row:first-child,
.activity-row:first-child {
    border-top: 0;
}

.deadline-row:hover {
    color: var(--ink);
}

.deadline-date {
    display: grid;
    width: 45px;
    height: 48px;
    flex: 0 0 45px;
    place-items: center;
    align-content: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink);
    background: var(--surface-subtle);
    line-height: 1;
}

.deadline-date strong {
    font-size: 1rem;
}

.deadline-date small {
    margin-top: 4px;
    color: var(--muted);
    font-size: .58rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.deadline-body,
.activity-body {
    display: grid;
    min-width: 0;
    flex: 1;
}

.deadline-body strong,
.activity-body strong {
    overflow: hidden;
    color: var(--ink);
    font-size: .84rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deadline-body small,
.activity-body small {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-row {
    align-items: flex-start;
}

.activity-dot {
    position: relative;
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 11px;
    color: var(--brand);
    background: var(--brand-soft);
}

.activity-time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: .68rem;
    white-space: nowrap;
}

.panel-empty {
    display: grid;
    min-height: 210px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

.panel-empty i {
    display: grid;
    width: 46px;
    height: 46px;
    margin-bottom: 3px;
    place-items: center;
    border-radius: 14px;
    color: var(--brand);
    background: var(--brand-soft);
}

.panel-empty strong {
    color: var(--ink);
}

.panel-empty span {
    font-size: .78rem;
}

/* Authentication */
.auth-body {
    position: relative;
    background:
        radial-gradient(circle at 8% 10%, rgba(var(--brand-rgb), .14), transparent 28%),
        radial-gradient(circle at 92% 95%, rgba(39, 112, 199, .1), transparent 28%),
        var(--canvas);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
}

.login-card {
    display: grid;
    width: min(1080px, 100%);
    min-height: 650px;
    grid-template-columns: 1.03fr .97fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: 0 30px 90px rgba(28, 34, 62, .16);
}

.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 82% 15%, rgba(150, 150, 255, .34), transparent 27%),
        radial-gradient(circle at 12% 92%, rgba(59, 130, 246, .2), transparent 30%),
        linear-gradient(145deg, #171a3d 0%, #303076 52%, #4e4fc0 100%);
}

.login-visual::before,
.login-visual::after {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    content: "";
}

.login-visual::before {
    width: 390px;
    height: 390px;
    right: -175px;
    top: -150px;
    box-shadow: 0 0 0 42px rgba(255, 255, 255, .025), 0 0 0 84px rgba(255, 255, 255, .018);
}

.login-visual::after {
    width: 280px;
    height: 280px;
    left: -170px;
    bottom: -140px;
    box-shadow: 0 0 0 36px rgba(255, 255, 255, .025);
}

.login-visual > * {
    position: relative;
    z-index: 1;
}

.login-visual-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-weight: 750;
    letter-spacing: -.02em;
}

.login-visual-brand .brand-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
    backdrop-filter: blur(10px);
}

.login-copy {
    max-width: 470px;
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    color: rgba(255, 255, 255, .84);
    background: rgba(255, 255, 255, .08);
    font-size: .69rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.login-kicker::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ce5b8;
    box-shadow: 0 0 0 4px rgba(156, 229, 184, .12);
    content: "";
}

.login-copy h1 {
    max-width: 470px;
    margin: 0;
    color: #fff;
    font-size: clamp(2.45rem, 4vw, 3.45rem);
    font-weight: 720;
    letter-spacing: -.06em;
    line-height: 1.03;
}

.login-copy > p {
    max-width: 430px;
    margin: 20px 0 0;
    color: rgba(255, 255, 255, .7);
    font-size: 1rem;
    line-height: 1.65;
}

.login-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 28px;
    padding: 0;
    color: rgba(255, 255, 255, .78);
    font-size: .78rem;
    list-style: none;
}

.login-feature-list li {
    display: flex;
    align-items: center;
    gap: 7px;
}

.login-feature-list i {
    color: #b9f2ce;
}

.login-visual-footer {
    color: rgba(255, 255, 255, .5);
    font-size: .7rem;
    letter-spacing: .04em;
}

.login-form-panel {
    display: grid;
    place-items: center;
    padding: 48px 54px;
    background: var(--surface);
}

.login-form-wrap {
    width: min(390px, 100%);
}

.auth-brand-mobile {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 38px;
    color: var(--ink);
    font-weight: 750;
}

.login-form-wrap h2 {
    margin: 7px 0 7px;
    color: var(--ink);
    font-size: 1.85rem;
    font-weight: 730;
    letter-spacing: -.04em;
}

.login-form-wrap > p:not(.eyebrow) {
    margin-bottom: 28px;
    color: var(--muted);
}

.login-field {
    position: relative;
}

.login-field > i {
    position: absolute;
    z-index: 2;
    left: 14px;
    bottom: 14px;
    color: #98a2b3;
}

.login-field .form-control {
    padding-left: 42px;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 4px 0 24px;
    font-size: .82rem;
}

.login-options label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-soft);
}

.login-options a {
    font-weight: 650;
    text-decoration: none;
}

.login-footer {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: .72rem;
    text-align: center;
}

/* Dark theme */
[data-theme="dark"] {
    --brand: #8181ef;
    --brand-dark: #a3a3f6;
    --brand-rgb: 129, 129, 239;
    --brand-soft: #2b2b50;
    --ink: #f2f4f7;
    --ink-soft: #d0d5dd;
    --muted: #98a2b3;
    --line: #303747;
    --line-strong: #41495a;
    --surface: #1d2431;
    --surface-subtle: #242c3a;
    --canvas: #151b26;
    --success-soft: #153b29;
    --warning-soft: #3d301b;
    --danger-soft: #442329;
    --info-soft: #1b3048;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .12), 0 8px 22px rgba(0, 0, 0, .1);
    --shadow-md: 0 16px 38px rgba(0, 0, 0, .22);
}

[data-theme="dark"] .topbar {
    border-bottom-color: rgba(48, 55, 71, .9);
    background: rgba(29, 36, 49, .88);
}

[data-theme="dark"] .dashboard-hero {
    background:
        radial-gradient(circle at 92% 5%, rgba(var(--brand-rgb), .18), transparent 35%),
        linear-gradient(135deg, #202737 0%, #22243d 100%);
}

[data-theme="dark"] .metric-card--green {
    --metric: #64d38d;
    --metric-soft: #173927;
}

[data-theme="dark"] .metric-card--blue {
    --metric: #74b7ff;
    --metric-soft: #1b3048;
}

[data-theme="dark"] .metric-card--amber {
    --metric: #efbd61;
    --metric-soft: #3d301b;
}

[data-theme="dark"] .metric-card--red {
    --metric: #f0808d;
    --metric-soft: #442329;
}

[data-theme="dark"] .status-badge {
    border-color: var(--line);
}

[data-theme="dark"] .status-active,
[data-theme="dark"] .status-completed,
[data-theme="dark"] .status-approved,
[data-theme="dark"] .status-accepted {
    color: #73d99a;
    background: #153b29;
}

[data-theme="dark"] .status-in_progress,
[data-theme="dark"] .status-assigned,
[data-theme="dark"] .status-under_review,
[data-theme="dark"] .status-pending_manager,
[data-theme="dark"] .status-pending_hr {
    color: #83bdff;
    background: #1b3048;
}

[data-theme="dark"] .status-pending,
[data-theme="dark"] .status-planned,
[data-theme="dark"] .status-on_hold,
[data-theme="dark"] .status-awaiting,
[data-theme="dark"] .status-draft {
    color: #efbd61;
    background: #3d301b;
}

[data-theme="dark"] .status-blocked,
[data-theme="dark"] .status-rejected,
[data-theme="dark"] .status-cancelled,
[data-theme="dark"] .status-overdue,
[data-theme="dark"] .status-terminated {
    color: #f0808d;
    background: #442329;
}

[data-theme="dark"] .status-inactive,
[data-theme="dark"] .status-resigned,
[data-theme="dark"] .status-archived,
[data-theme="dark"] .status-suspended,
[data-theme="dark"] .status-retired {
    color: #b3bac7;
    background: #2a3240;
}

[data-theme="dark"] .progress {
    --bs-progress-bg: #2b3443;
}

[data-theme="dark"] .login-card {
    border-color: var(--line);
}

/* Responsive */
@media (max-width: 1199.98px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        width: min(var(--sidebar-width), calc(100vw - 48px));
        transform: translateX(-102%);
        box-shadow: 20px 0 50px rgba(9, 14, 24, .28);
    }

    .sidebar-open {
        overflow: hidden;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-open .sidebar-overlay {
        display: block;
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        padding: 0 20px;
    }

    .content {
        padding: 24px 20px;
    }

    .login-card {
        grid-template-columns: 1fr;
        min-height: auto;
        max-width: 620px;
    }

    .login-visual {
        display: none;
    }

    .auth-brand-mobile {
        display: flex;
    }
}

@media (max-width: 767.98px) {
    .dashboard-hero {
        min-height: auto;
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }

    .dashboard-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .dashboard-secondary-grid {
        grid-template-columns: 1fr;
    }

    .page-heading {
        align-items: stretch;
    }

    .page-heading > div:last-child:not(:first-child) {
        flex-wrap: wrap;
    }

    .panel {
        padding: 18px;
    }
}

@media (max-width: 575.98px) {
    .content {
        padding: 20px 14px;
    }

    .topbar {
        height: 68px;
        padding: 0 14px;
    }

    .topbar-context > div,
    .topbar-create {
        display: none;
    }

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

    .account-button {
        padding-right: 3px;
    }

    .account-button.dropdown-toggle::after {
        display: none;
    }

    .dashboard-kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .metric-card {
        min-height: 158px;
        padding: 15px;
    }

    .metric-card > strong {
        font-size: 1.7rem;
    }

    .metric-card__label {
        font-size: .74rem;
    }

    .metric-card__footer span {
        max-width: 105px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chart-wrap {
        height: 260px;
    }

    .auth-shell {
        padding: 12px;
    }

    .login-card {
        border-radius: 22px;
    }

    .login-form-panel {
        padding: 34px 24px;
    }

    .auth-brand-mobile {
        margin-bottom: 30px;
    }

    .login-options {
        align-items: flex-start;
    }

    .activity-time {
        display: none;
    }

    .pagination-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination {
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 3px;
    }
}

@media (max-width: 390px) {
    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }
}

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

.notification-button{position:relative}.notification-badge{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 5px;border-radius:10px;background:#d92d20;color:#fff;font-size:10px;font-weight:800;line-height:18px;text-align:center;border:2px solid var(--surface,#fff)}
.notification-toast-stack{position:fixed;right:24px;top:82px;z-index:1090;display:grid;gap:10px;width:min(390px,calc(100vw - 32px));pointer-events:none}.live-notification-toast{display:flex;gap:12px;align-items:flex-start;padding:15px 16px;border:1px solid var(--line);border-left:4px solid var(--primary,#5b5bd6);border-radius:12px;background:var(--surface,#fff);box-shadow:0 16px 40px rgba(16,24,40,.2);color:var(--text);text-decoration:none;pointer-events:auto;opacity:0;transform:translateX(28px);transition:.22s ease}.live-notification-toast.show{opacity:1;transform:none}.live-notification-toast>i{color:var(--primary,#5b5bd6);font-size:20px}.live-notification-toast span{display:grid;gap:3px}.live-notification-toast small{color:var(--muted)}
.notification-center{padding:0;overflow:hidden}.notification-row{display:grid;grid-template-columns:42px 1fr auto;gap:14px;align-items:center;padding:16px 20px;color:var(--text);text-decoration:none;border-bottom:1px solid var(--line);transition:background .15s ease}.notification-row:last-child{border-bottom:0}.notification-row:hover{background:var(--surface-muted,#f8f9fc)}.notification-row.is-unread{background:color-mix(in srgb,var(--primary,#5b5bd6) 7%,var(--surface,#fff))}.notification-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:color-mix(in srgb,var(--primary,#5b5bd6) 12%,transparent);color:var(--primary,#5b5bd6)}.notification-copy{display:grid;gap:3px;min-width:0}.notification-copy>span,.notification-copy small{color:var(--muted)}.notification-copy>span{overflow:hidden;text-overflow:ellipsis}.notification-dot{width:9px;height:9px;border-radius:50%;background:var(--primary,#5b5bd6);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary,#5b5bd6) 15%,transparent)}
@media(max-width:576px){.notification-toast-stack{right:16px;top:70px}.notification-row{padding:14px;grid-template-columns:38px 1fr auto}.notification-icon{width:38px;height:38px}}
