:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 96px;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #0a4ca8;
    --ink: #1d1b2a;
    --muted: #6e7f98;
    --line: #e3ecf7;
    --primary: #1f2438;
    --primary-soft: #ecefff;
    --accent-a: #8fd2db;
    --accent-b: #f8ab7f;
    --accent-c: #b18dd1;
    --success: #2f9e73;
    --danger: #cf4c5f;
    --shadow: 0 14px 30px rgba(25, 22, 34, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--ink);
    background: var(--bg);
    transition: background-color 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3,
h4,
h5,
p {
    margin: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: #ffffff;
}

.app-shell {
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    z-index: 120;
    padding: 20px 16px;
    background: linear-gradient(180deg, #0b4fae 0%, #0959c1 55%, #0a64d5 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 100vh;
    transition: width 0.22s ease, transform 0.22s ease;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    padding: 6px 6px 2px;
}

.brand-text-wrap {
    display: block;
}

.brand h1 {
    font-family: "Playfair Display", serif;
    font-size: 1.65rem;
    color: #ffffff;
}

.brand p {
    color: #d9e9ff;
    font-size: 0.82rem;
    margin-top: 2px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
    background: #ffffff;
    padding: 3px;
    box-shadow: 0 8px 18px rgba(3, 22, 53, 0.28);
}

.brand-role {
    display: inline-block;
    color: #bcd9ff;
    font-size: 0.75rem;
    margin-top: 2px;
    font-weight: 600;
}

.sidebar-profile {
    text-align: center;
    padding: 10px 0 14px;
}

.sidebar-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 20px rgba(28, 21, 40, 0.15);
}

.sidebar-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(145deg, #053785, #2a80f2);
}

.sidebar-name {
    margin-top: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #f3f8ff;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.sidebar-nav a {
    color: #e8f2ff;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(1px);
}

.sidebar-nav a.active {
    background: #ffffff;
    color: #0a4ca8;
}

.menu-icon {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    flex: 0 0 18px;
}

.menu-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    margin: 12px 6px 0;
    font-size: 0.72rem;
    color: #d8e9ff;
    text-align: center;
    font-weight: 500;
    text-decoration: none;
    display: block;
}

.sidebar-footer:hover {
    color: #ffffff;
    text-decoration: underline;
}

.content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 22px;
    overflow-x: auto;
    transition: margin-left 0.22s ease;
}

.sidebar-overlay {
    display: none;
    border: 0;
    padding: 0;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 12px;
    z-index: 90;
}

.top-header-left {
    display: grid;
    gap: 3px;
}

.header-control-row {
    display: flex;
    gap: 8px;
    margin-bottom: 2px;
}

.header-icon-btn {
    min-width: 42px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.header-icon-btn i {
    font-size: 0.95rem;
}

.collapse-btn {
    width: 42px;
    padding: 0;
}

.theme-btn {
    padding-inline: 10px;
    min-width: 90px;
}

.live-label {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.live-clock {
    font-size: 0.92rem;
    font-weight: 700;
    color: #2f2740;
}

.top-user-menu {
    position: relative;
}

.top-user-trigger {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.top-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 8px 18px rgba(22, 19, 31, 0.15);
}

.top-user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(145deg, #2c385d, #8397cb);
}

.top-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 220px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 10px;
    display: none;
    z-index: 40;
}

.top-user-dropdown.open {
    display: block;
}

.top-user-name {
    font-size: 0.86rem;
    font-weight: 800;
    color: #2f2740;
    padding: 6px 8px 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}

.top-user-dropdown a {
    display: block;
    border-radius: 8px;
    padding: 8px 10px;
    color: #2f2740;
    font-weight: 600;
}

.top-user-dropdown a:hover {
    background: #f7f2ee;
}

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

.id-card-trigger {
    background: linear-gradient(145deg, #0a4ca8, #0b66da);
}

.id-card-wrap {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 80;
    padding: 20px;
}

.id-card-wrap.open {
    display: flex;
}

.id-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 22, 38, 0.55);
    backdrop-filter: blur(2px);
}

.id-card {
    position: relative;
    z-index: 1;
    width: min(380px, 92%);
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(16, 20, 34, 0.24);
}

.id-card::before {
    content: "";
    position: absolute;
    top: -45%;
    left: -35%;
    width: 170%;
    height: 65%;
    background: #1d1f2a;
    transform: rotate(-8deg);
}

.id-card::after {
    content: "";
    position: absolute;
    bottom: -45%;
    right: -35%;
    width: 170%;
    height: 65%;
    background: #d6242f;
    transform: rotate(-8deg);
}

.id-card-close {
    position: absolute;
    top: 10px;
    left: 12px;
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
    color: #ffffff;
    z-index: 3;
}

.id-card-content {
    position: relative;
    z-index: 2;
    padding: 22px 22px 20px;
    text-align: center;
}

.id-card-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.id-card-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
    padding: 4px;
}

.id-card-brand-text {
    display: grid;
    text-align: left;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.id-card-company {
    font-weight: 800;
    font-size: 0.82rem;
}

.id-card-tagline {
    opacity: 0.85;
}

.id-card-photo-wrap {
    margin: 14px auto 10px;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: #ffffff;
    display: grid;
    place-items: center;
    border: 4px solid #d6242f;
    box-shadow: 0 12px 24px rgba(16, 20, 34, 0.2);
}

.id-card-photo {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
}

.id-card-photo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 2rem;
    color: #1d1f2a;
    background: #f3f5f9;
}

.id-card-name {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #1d1f2a;
}

.id-card-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin: 4px 0 10px;
}

.id-card-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    text-align: left;
    background: #ffffff;
    padding: 12px;
    border-radius: 14px;
    box-shadow: 0 8px 16px rgba(16, 20, 34, 0.12);
}

.id-card-info div {
    display: grid;
    gap: 2px;
}

.id-card-info span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 700;
}

.id-card-info strong {
    font-size: 0.82rem;
    color: #1f2438;
    font-weight: 700;
    word-break: break-word;
}

.id-card-address {
    grid-column: 1 / -1;
}

.message-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.message {
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
}

.message.success {
    background: #dbf5ea;
    color: #1b6d4c;
}

.message.error {
    background: #ffe5e7;
    color: #9d273c;
}

.message.warning {
    background: #ffefcf;
    color: #8a5e16;
}

.page-head {
    margin-bottom: 16px;
}

.page-head h2 {
    font-family: "Playfair Display", serif;
    font-size: 1.95rem;
    color: #241d31;
}

.page-head p {
    margin-top: 6px;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card-link {
    display: block;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(25, 22, 34, 0.14);
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -20px -35px auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: 0.45;
}

.stats-grid .stat-card:nth-child(1)::after {
    background: var(--accent-c);
}

.stats-grid .stat-card:nth-child(2)::after {
    background: var(--accent-a);
}

.stats-grid .stat-card:nth-child(3)::after {
    background: #d3d8ff;
}

.stats-grid .stat-card:nth-child(4)::after {
    background: var(--accent-b);
}

.stats-grid .stat-card:nth-child(5)::after {
    background: #b9e4cb;
}

.stat-card h3 {
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 1.6rem;
    color: #231d31;
    font-weight: 800;
}

.stat-card small {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.77rem;
    font-weight: 700;
    color: #3f5070;
}

.tone-total {
    background: linear-gradient(145deg, #f0f5ff, #ffffff);
}

.tone-doc {
    background: linear-gradient(145deg, #edfcf6, #ffffff);
}

.tone-verify {
    background: linear-gradient(145deg, #fff6eb, #ffffff);
}

.tone-bank {
    background: linear-gradient(145deg, #eef6ff, #ffffff);
}

.tone-approved {
    background: linear-gradient(145deg, #effaf1, #ffffff);
}

.panel-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.panel-card h3 {
    margin-bottom: 12px;
    color: #261f34;
}

.panel-toolbar {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.panel-subtext {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
}

.panel-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.table-search {
    width: 260px;
    max-width: 100%;
}

.employee-create-wrap {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbf8f4;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
    padding: 0 12px;
}

.employee-create-wrap.open {
    max-height: 900px;
    opacity: 1;
    padding: 14px 12px;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.chart-grid canvas {
    width: 100%;
    max-height: 180px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
}

.form-grid {
    display: grid;
    gap: 10px;
}

.employee-form-grid,
.profile-form-grid,
.password-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.employee-form-grid .full-width,
.profile-form-grid .full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.9rem;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
    color: #352d45;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    font-family: inherit;
    font-size: 0.93rem;
    color: #2b2337;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(125, 116, 144, 0.16);
    border-color: #9f8fbe;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}

th {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: #2a2f53;
    font-size: 0.77rem;
    font-weight: 700;
}

.btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 700;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(145deg, #1f2438, #2e3350);
}

.btn.secondary {
    background: linear-gradient(145deg, #797083, #5f5768);
}

.btn.danger {
    background: linear-gradient(145deg, #de5f66, #c84357);
}

.btn.mini {
    font-size: 0.8rem;
    padding: 7px 10px;
}

.action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-row form {
    margin: 0;
}

.table-doc-actions {
    gap: 6px;
}

.table-doc-actions .btn {
    white-space: nowrap;
}

.doc-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fafcff;
}

.doc-item p {
    margin-bottom: 8px;
}

.form-error {
    margin-top: 5px;
    font-size: 0.82rem;
    color: #9f1d2d;
}

.table-avatar,
.detail-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.table-avatar-fallback,
.detail-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #7c6f97, #9bb0d8);
    color: #fff;
    font-weight: 800;
}

.detail-avatar {
    width: 180px;
    height: 180px;
}

.profile-summary {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.profile-summary p {
    margin-bottom: 8px;
}

.history-row {
    background: #faf7f3;
    font-size: 0.9rem;
    color: #4e425e;
}

.history-modal-wrap {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 95;
}

.history-modal-wrap.open {
    display: flex;
}

.history-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 24, 43, 0.56);
}

.history-modal {
    position: relative;
    z-index: 1;
    width: min(1040px, 96%);
    max-height: 90vh;
    overflow-y: auto;
    margin: 0;
    padding-top: 20px;
}

.history-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    background: #f4f4f6;
    color: #2e3350;
    font-size: 1.2rem;
    font-weight: 700;
}

.history-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.history-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #4f435f;
    font-size: 0.9rem;
}

.loan-form-container {
    padding: 20px;
}

.loan-form-grid {
    display: grid;
    gap: 14px;
}

.form-section-block {
    border: 1px solid var(--line);
    border-left: 4px solid #a899c0;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.form-section-block h4 {
    margin-bottom: 12px;
    font-size: 1.02rem;
    color: #2d2440;
}

.form-grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.form-grid-two .full-width {
    grid-column: 1 / -1;
}

.quick-agenda {
    display: grid;
    gap: 10px;
}

.agenda-item {
    border-left: 4px solid #d6c6e6;
    background: #faf6f2;
    border-radius: 10px;
    padding: 10px 12px;
}

.agenda-item strong {
    display: block;
    font-size: 0.95rem;
    color: #2c2340;
}

.agenda-item span {
    color: var(--muted);
    font-size: 0.84rem;
}

.doc-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.extra-doc-links {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.extra-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.doc-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef3ff;
    color: #334155;
    font-size: 0.7rem;
    font-weight: 700;
}

.extra-doc-cards {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.extra-doc-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    background: #ffffff;
}

.extra-doc-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: #2b2337;
    margin-bottom: 8px;
    gap: 8px;
}

.extra-docs-list {
    display: grid;
    gap: 12px;
    margin-bottom: 10px;
}

.extra-doc-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(200px, 1fr) auto;
    gap: 10px;
    align-items: end;
    border: 1px dashed var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #fbfbff;
}

.extra-doc-row .remove-doc-btn {
    white-space: nowrap;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    position: relative;
    padding: 20px;
    background-color: #1f3f61;
    background-image: url("../images/panel-bg.avif");
    background-size: cover;
    background-position: center;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(8, 29, 57, 0.4), rgba(5, 66, 107, 0.26));
}

.login-glass-card {
    width: min(430px, 92%);
    padding: 30px;
    border-radius: 16px;
    background: rgba(13, 16, 20, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 45px rgba(5, 24, 48, 0.35);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.login-glass-card h1 {
    text-align: center;
    color: #f7fbff;
    margin-bottom: 20px;
    font-family: "Playfair Display", serif;
    letter-spacing: 0.02em;
}

.login-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px;
    box-shadow: 0 12px 24px rgba(3, 22, 53, 0.35);
}

.login-form label {
    color: #eaf3ff;
}

.login-form input {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.34);
    color: #f7fbff;
}

.login-form input::placeholder {
    color: rgba(237, 243, 250, 0.78);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 86px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    padding: 6px 10px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    color: #f7fbff;
    background: rgba(255, 255, 255, 0.2);
}

.login-btn {
    margin-top: 10px;
    width: 100%;
    background: linear-gradient(145deg, #14b86c, #0f9f5a);
}

.forgot-link {
    display: inline-block;
    margin-top: 8px;
    color: #e7f2ff;
    text-decoration: underline;
    font-size: 0.9rem;
    font-weight: 600;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .content {
    margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .brand-text-wrap,
body.sidebar-collapsed .sidebar-name,
body.sidebar-collapsed .sidebar-footer {
    display: none;
}

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

body.sidebar-collapsed .sidebar-profile {
    padding-bottom: 6px;
}

body.sidebar-collapsed .sidebar-avatar {
    width: 58px;
    height: 58px;
}

body.sidebar-collapsed .sidebar-nav a {
    padding: 11px 8px;
    justify-content: center;
    gap: 0;
}

body.sidebar-collapsed .sidebar-nav a .menu-text {
    display: none;
}

body.sidebar-collapsed .sidebar-nav a .menu-icon {
    font-size: 1rem;
}

body.theme-dark {
    --bg: #0d1726;
    --surface: #132236;
    --surface-soft: #0f2745;
    --ink: #e7f0fd;
    --muted: #9bb2cd;
    --line: #2c415d;
    --primary: #d5e2ff;
    --primary-soft: #223750;
    --accent-a: #4ea7b4;
    --accent-b: #cc8662;
    --accent-c: #7f71b8;
    --success: #2ea97e;
    --danger: #e16878;
    --shadow: 0 14px 30px rgba(3, 10, 19, 0.42);
}

body.theme-dark .bg-layer {
    background: radial-gradient(circle at 20% 20%, #1d2f49 0%, #0b1320 55%, #060b13 100%);
}

body.theme-dark .sidebar {
    background: linear-gradient(180deg, #112f56 0%, #0d4174 55%, #0f4a81 100%);
}

body.theme-dark .top-header,
body.theme-dark .panel-card,
body.theme-dark .stat-card,
body.theme-dark .form-section-block,
body.theme-dark .history-modal,
body.theme-dark .extra-doc-card,
body.theme-dark .doc-item,
body.theme-dark .employee-create-wrap,
body.theme-dark .agenda-item,
body.theme-dark .id-card-info,
body.theme-dark .history-row {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
}

body.theme-dark input,
body.theme-dark textarea,
body.theme-dark select {
    background: #0f1a2d;
    color: var(--ink);
    border-color: var(--line);
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
    color: #88a0bb;
}

body.theme-dark .live-clock,
body.theme-dark .top-user-name,
body.theme-dark .stat-card p,
body.theme-dark .stat-card h3,
body.theme-dark .page-head h2,
body.theme-dark h3,
body.theme-dark h4,
body.theme-dark strong,
body.theme-dark label {
    color: var(--ink);
}

body.theme-dark .panel-subtext,
body.theme-dark .page-head p,
body.theme-dark .agenda-item span,
body.theme-dark th,
body.theme-dark td,
body.theme-dark p {
    color: #c6d6ec;
}

body.theme-dark .top-user-dropdown {
    background: #101d2f;
    border-color: var(--line);
}

body.theme-dark .top-user-dropdown a {
    color: var(--ink);
}

body.theme-dark .top-user-dropdown a:hover {
    background: #18304f;
}

body.theme-dark .sidebar-nav a {
    color: #d8e6f9;
}

body.theme-dark .sidebar-nav a.active {
    background: #d9e6f8;
    color: #123e77;
}

body.theme-dark .badge {
    background: #23405f;
    color: #dce9ff;
}

body.theme-dark .message.success {
    background: #1f4235;
    color: #9be0bf;
}

body.theme-dark .message.error {
    background: #4b2630;
    color: #f5b4bf;
}

body.theme-dark .message.warning {
    background: #4e3d24;
    color: #f2d298;
}

body.theme-dark .table-avatar-fallback,
body.theme-dark .detail-avatar-fallback,
body.theme-dark .top-user-avatar-fallback {
    background: linear-gradient(145deg, #304967, #5275a6);
}

@media (max-width: 980px) {
    .sidebar {
        width: min(82vw, 292px);
        transform: translateX(-110%);
        border-right: 1px solid rgba(255, 255, 255, 0.22);
    }

    .content {
        margin-left: 0;
    }

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

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 100;
        background: rgba(9, 18, 33, 0.52);
    }

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

    body.sidebar-collapsed .sidebar {
        width: min(82vw, 292px);
    }

    body.sidebar-collapsed .content {
        margin-left: 0;
    }
}

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

    .top-header {
        padding: 10px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .profile-summary {
        flex-direction: column;
    }

    .detail-avatar {
        width: 120px;
        height: 120px;
    }

    .table-search {
        width: 100%;
    }

    .id-card-info {
        grid-template-columns: 1fr;
    }

    .id-card-brand {
        flex-direction: column;
        text-align: center;
    }

    .id-card-brand-text {
        text-align: center;
    }

    .extra-doc-row {
        grid-template-columns: 1fr;
    }
}
