:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --info: #0284c7;
    --info-soft: #e0f2fe;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --muted: var(--text-muted);
    --line: var(--border);
    --green: var(--success);
    --red: var(--danger);
    --blue: var(--primary);
    --orange: var(--warning);
    --shadow: var(--shadow-sm);
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.employees-filter-form {
    grid-template-columns: minmax(220px, 320px) auto;
    justify-content: start;
}

.holidays-filter-form {
    grid-template-columns: minmax(180px, 260px);
    justify-content: start;
}

.telegram-users-filter-grid {
    grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) auto;
    align-items: end;
}

.telegram-users-filter-grid.has-company-filter {
    grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 0.9fr) minmax(280px, 1.8fr) auto;
}

.telegram-users-filter-actions {
    justify-self: end;
    flex-wrap: nowrap;
}

@media (max-width: 900px) {
    .employees-filter-form,
    .holidays-filter-form,
    .telegram-users-filter-grid,
    .telegram-users-filter-grid.has-company-filter {
        grid-template-columns: 1fr;
    }

    .telegram-users-filter-actions {
        justify-self: stretch;
        flex-wrap: wrap;
    }
}

.form-grid-span-3 {
    grid-column: 1 / -1;
}

.inner-title-row {
    margin-top: 18px;
}

.qr-print-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 18px;
    align-items: start;
}

.qr-info-card,
.qr-preview-card,
.qr-instruction-card {
    overflow: hidden;
}

.qr-help {
    margin: 18px 0;
    color: var(--text-muted);
    max-width: 760px;
}

.qr-download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.qr-print-preview {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
    box-shadow: var(--shadow-md);
}

.qr-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.qr-steps div {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.qr-steps span {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: white;
    font-weight: 800;
    flex: 0 0 28px;
}

.qr-steps p {
    margin: 0;
    color: var(--text);
}

@media print {
    .sidebar,
    .topbar,
    .page-actions,
    .qr-info-card,
    .qr-instruction-card {
        display: none !important;
    }

    .main,
    .content {
        padding: 0 !important;
        margin: 0 !important;
    }

    .qr-print-page {
        display: block;
    }

    .qr-preview-card {
        border: none;
        box-shadow: none;
    }

    .qr-print-preview {
        max-width: 100%;
        box-shadow: none;
        border: none;
    }
}

@media (max-width: 920px) {
    .qr-print-page {
        grid-template-columns: 1fr;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    background: #f4f6f8;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 14px 12px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 16px;
    color: #111827;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
}

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

.brand-name {
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-logo span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #fff;
    background: #2563eb;
    font-weight: 800;
}

.sidebar-logo strong {
    font-size: 15px;
}

.sidebar-menu {
    display: grid;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 9px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 700;
}

.sidebar-link span {
    width: 20px;
    text-align: center;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #2563eb;
    background: #eff6ff;
}

.main {
    min-width: 0;
    display: grid;
    grid-template-rows: 56px minmax(0, 1fr);
}

.content {
    padding: 18px;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    padding: 0 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar strong {
    display: block;
    font-size: 16px;
    color: #111827;
}

.topbar span {
    color: #6b7280;
    font-size: 12px;
}

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

.topbar-account-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.topbar-account-link:hover,
.topbar-account-link.active {
    color: var(--primary);
    border-color: #bfdbfe;
    background: var(--primary-soft);
}

.topbar-account-link svg {
    width: 16px;
    height: 16px;
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
}

.language-switch button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.language-switch button.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.language-switch span {
    color: var(--text-soft);
    font-size: 11px;
}

.public-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    font-weight: 700;
    font-size: 18px;
}

.topbar nav,
.public-topbar nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar nav a,
.public-topbar nav a {
    padding: 8px 10px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.topbar nav a:hover,
.topbar nav a.active,
.public-topbar nav a:hover,
.public-topbar nav a.active {
    background: #eef4ff;
    color: var(--blue);
}

.container {
    width: min(1280px, calc(100% - 28px));
    margin: 18px auto 42px;
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 700;
    border: 1px solid transparent;
}

.alert.success {
    color: #075b30;
    background: #e8f7ef;
    border-color: #bfe7cf;
}

.alert.error {
    color: #8a1f1f;
    background: #fdecec;
    border-color: #f3bbbb;
}

.alert.warning {
    color: #7a3d00;
    background: #fff4df;
    border-color: #f0b45a;
}

.toast-container {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 10px;
    padding: 13px 12px 13px 14px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(17, 24, 39, 0.14);
    color: #111827;
    animation: toastSlideIn 0.2s ease-out;
    pointer-events: auto;
}

.toast-success {
    border-left-color: var(--green);
}

.toast-error {
    border-left-color: var(--red);
}

.toast-warning {
    border-left-color: var(--orange);
}

.toast-info {
    border-left-color: var(--blue);
}

.toast-icon {
    line-height: 1.2;
    font-size: 15px;
}

.toast-message {
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
}

.toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.toast-hide {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.kiosk {
    min-height: 68vh;
    display: grid;
    grid-template-columns: 1fr minmax(320px, 480px);
    align-items: center;
    gap: 42px;
}

.eyebrow {
    color: var(--blue);
    font-weight: 700;
    margin: 0 0 10px;
}

h1 {
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1.05;
    margin: 0;
}

h2 {
    margin: 0 0 18px;
}

.clock {
    font-size: 42px;
    font-weight: 700;
    margin: 24px 0 0;
    color: var(--muted);
}

.kiosk-form,
.panel,
.card,
.auth-panel,
.summary-grid > div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.kiosk-form {
    padding: 28px;
    display: grid;
    gap: 18px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

textarea {
    resize: vertical;
}

.kiosk-form input {
    min-height: 62px;
    font-size: 26px;
    text-align: center;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.btn-in {
    min-height: 82px;
    font-size: 24px;
    color: #fff;
    background: var(--green);
}

.btn-out {
    min-height: 82px;
    font-size: 24px;
    color: #fff;
    background: var(--red);
}

.btn.primary {
    color: #fff;
    background: var(--blue);
}

.btn.neutral {
    color: var(--text);
    background: #e8eef7;
}

.btn-primary,
.btn.primary {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.btn-danger {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

.btn-success {
    color: #fff;
    background: var(--green);
    border-color: var(--green);
}

.btn-warning {
    color: #7a3d00;
    background: #fff4df;
    border-color: #f0b45a;
}

.btn-muted,
.btn.neutral {
    color: #344054;
    background: #eef2f6;
    border-color: #d9e1ec;
}

.btn-sm {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 13px;
}

.page-head,
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 14px;
}

.page-head h1,
.page-header h1 {
    font-size: 30px;
}

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

.panel,
.card {
    padding: 18px;
    margin-bottom: 14px;
}

.auth-panel {
    width: min(460px, 100%);
    margin: 64px auto;
    padding: 28px;
}

.auth-panel h1 {
    font-size: 32px;
    margin-bottom: 22px;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: end;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

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

.form-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    padding: 12px 0;
    background: linear-gradient(180deg, rgba(243, 245, 247, 0), var(--bg) 28%);
}

.field-help {
    color: var(--muted);
    font-weight: 400;
    font-size: 12px;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.card-title-row h2 {
    margin: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.info-tile {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.info-tile span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.info-tile p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.form-section-title {
    grid-column: 1 / -1;
    font-size: 22px;
    margin: 4px 0 0;
}

.form-section {
    display: grid;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.form-section:last-child {
    border-bottom: 0;
}

.form-section h3 {
    margin: 0;
    font-size: 15px;
}

.form-wide {
    grid-column: 1 / -1;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.compact-check {
    display: inline-flex;
    width: auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 14px;
}

.check span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.check input {
    width: 18px;
    min-height: 18px;
}

.form-actions {
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
}

.filters {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    align-items: end;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

.table {
    min-width: 980px;
    background: var(--surface);
}

.data-table {
    font-size: 13px;
}

.compact-table th,
.compact-table td {
    padding: 10px 10px;
}

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

tbody tr:hover {
    background: #f8fbff;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1e4fc2;
    font-weight: 700;
    white-space: nowrap;
}

.badge.warning {
    color: #7a3d00;
    background: #fff4df;
}

.badge.danger {
    color: #8a1f1f;
    background: #fdecec;
}

.badge.ok {
    color: #075b30;
    background: #e8f7ef;
}

.badge.muted {
    color: #5f6673;
    background: #edf0f4;
}

.row-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.action-buttons form {
    margin: 0;
}

.actions-col {
    width: 132px;
    text-align: right;
}

.icon-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    width: 100%;
}

.icon-actions form {
    display: inline-flex;
    margin: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    background: #fff;
    color: #344054;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

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

.icon-btn.primary {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.icon-btn.success {
    color: #15803d;
    background: #ecfdf3;
    border-color: #bbf7d0;
}

.icon-btn.warning {
    color: #b45309;
    background: #fffbeb;
    border-color: #fed7aa;
}

.icon-btn.danger {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}

.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal {
    width: min(620px, 100%);
    max-height: min(86vh, 820px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.modal-lg {
    width: min(900px, 100%);
}

.modal-confirm {
    width: min(460px, 100%);
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal > form {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.modal-body {
    padding: 16px;
    overflow: auto;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: #eef2f6;
    color: #344054;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.tiny {
    font-size: 12px;
}

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

.map-search {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto minmax(220px, 1fr);
    gap: 10px;
    align-items: end;
}

.branch-map {
    width: 100%;
    height: 420px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #e5e7eb;
}

.map-message {
    align-self: center;
    color: var(--muted);
    font-size: 13px;
}

.map-message.error {
    color: var(--red);
    font-weight: 700;
}

.row-actions form {
    margin: 0;
}

.small-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--blue);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.small-link.danger {
    color: var(--red);
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 30px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.summary-grid > div {
    padding: 18px;
}

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

.metric-card {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.metric-card span {
    display: block;
    color: #111827;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.metric-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.summary-grid span {
    display: block;
    font-size: 24px;
    font-weight: 800;
}

.summary-grid p {
    margin: 8px 0 0;
    color: var(--muted);
}

.formula {
    padding: 12px 14px;
    border-radius: 8px;
    background: #f1f5fb;
    font-family: Consolas, monospace;
    color: #1f2a44;
    overflow-wrap: anywhere;
}

.json-box {
    max-width: 320px;
    max-height: 220px;
    margin: 0;
    padding: 10px;
    overflow: auto;
    border-radius: 8px;
    background: #f8fafc;
    color: #1f2937;
    font: 12px/1.45 Consolas, monospace;
    white-space: pre-wrap;
}

.audit-table {
    min-width: 900px;
}

.audit-summary {
    display: grid;
    gap: 3px;
    max-width: 520px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
}

.audit-summary span:first-child {
    font-weight: 800;
}

.audit-modal {
    max-width: 820px;
}

.audit-modal .modal-header p {
    margin: 4px 0 0;
}

.audit-detail-table-wrap {
    max-height: min(62vh, 560px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.audit-detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.audit-detail-table th,
.audit-detail-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.audit-detail-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
}

.audit-detail-table tr:last-child td {
    border-bottom: 0;
}

.audit-detail-table tr.changed td {
    background: #fffdf5;
}

.audit-detail-table td:first-child {
    width: 28%;
    color: var(--text-muted);
    font-weight: 700;
}

.audit-detail-table td:nth-child(2),
.audit-detail-table td:nth-child(3) {
    font-variant-numeric: tabular-nums;
}

.muted {
    color: var(--muted);
}

.qr-panel {
    display: grid;
    justify-items: center;
    gap: 16px;
    text-align: center;
}

.qr-image {
    width: min(360px, 90vw);
    height: auto;
}

.mobile-body {
    background: #eef3f8;
}

.mobile-shell {
    width: min(520px, calc(100% - 24px));
    margin: 16px auto 32px;
    display: grid;
    gap: 14px;
}

.mobile-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.mobile-card h1 {
    font-size: 30px;
    line-height: 1.1;
}

.mobile-card input {
    min-height: 58px;
    font-size: 24px;
    text-align: center;
}

.mobile-result {
    margin-top: 14px;
    padding: 14px;
    border-radius: 8px;
    background: #eef4ff;
    font-weight: 700;
}

.mobile-result.success {
    color: #075b30;
    background: #e8f7ef;
}

.mobile-result.error {
    color: #8a1f1f;
    background: #fdecec;
}

.tg-body {
    min-height: 100vh;
    background: #f4f6f8;
}

.tg-shell {
    width: min(520px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 12px;
    display: grid;
    gap: 12px;
    align-content: start;
}

.tg-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.tg-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2563eb;
    font-weight: 800;
    font-size: 18px;
    line-height: 1.1;
    margin-bottom: 10px;
}

.brand-tile {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    font-weight: 800;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.sidebar-logo .brand-tile,
.admin-body .sidebar-logo .brand-tile {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.sidebar-logo .brand-name,
.auth-brand .brand-name {
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
}

.sidebar-logo .brand-subtitle,
.auth-brand .brand-subtitle {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 22px;
}

.auth-brand-tile {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 12px;
    font-size: 21px;
}

.tg-brand .tg-brand-tile {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 8px;
    font-size: 15px;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

.tg-language-toggle {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 8px;
}

.tg-language-toggle button {
    min-width: 42px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.tg-language-toggle button.active {
    border-color: var(--blue);
    background: #eff6ff;
    color: var(--blue);
}

.tg-card[hidden],
.scanner-fullscreen[hidden],
.tg-alert[hidden] {
    display: none;
}

.tg-title {
    margin: 4px 0 14px;
    font-size: 28px;
    line-height: 1.1;
}

.tg-muted {
    color: var(--muted);
    margin: 0;
    font-size: 13px;
}

.tg-profile-grid,
.tg-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.tg-profile-grid div,
.tg-report-grid div,
.tg-today-row {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px;
    background: #f9fafb;
}

.tg-profile-grid div:last-child {
    grid-column: 1 / -1;
}

.tg-profile-grid span,
.tg-report-grid p,
.tg-today-row span {
    display: block;
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 12px;
}

.tg-profile-grid strong,
.tg-report-grid span,
.tg-today-row strong {
    font-size: 16px;
    color: #111827;
}

.tg-report-warning {
    grid-column: 1 / -1;
    border-color: #fed7aa !important;
    background: #fff7ed !important;
}

.tg-report-warning span {
    color: #9a3412 !important;
}

.tg-report-warning p {
    color: #9a3412 !important;
}

.tg-today {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.tg-actions {
    display: grid;
    gap: 10px;
}

.tg-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.tg-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.tg-btn-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.tg-btn-success {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.tg-btn-danger {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.tg-btn-small {
    min-height: 36px;
    width: auto;
    padding: 0 12px;
}

.tg-alert {
    padding: 13px 14px;
    border-radius: 12px;
    background: #eef4ff;
    color: #1f3f7a;
    font-weight: 700;
}

.tg-alert-success {
    color: #075b30;
    background: #e8f7ef;
}

.tg-alert-error {
    color: #8a1f1f;
    background: #fdecec;
}

.tg-alert-warning {
    color: #9a3412;
    background: #fff7ed;
}

.confirm-branch-card {
    display: grid;
    gap: 6px;
    margin: 12px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f9fafb;
}

.confirm-branch-card strong {
    font-size: 18px;
}

.confirm-branch-card span {
    color: var(--muted);
    font-size: 13px;
}

.tg-gps-status {
    margin: 12px 0;
    padding: 12px;
    border-radius: 12px;
    background: #eef4ff;
    color: #1f3f7a;
    font-weight: 800;
}

.tg-gps-status[data-status="success"] {
    background: #e8f7ef;
    color: #075b30;
}

.tg-gps-status[data-status="denied"],
.tg-gps-status[data-status="inaccurate"],
.tg-gps-status[data-status="unavailable"],
.tg-gps-status[data-status="outside_radius"] {
    background: #fdecec;
    color: #8a1f1f;
}

.tg-result-card {
    display: grid;
    gap: 10px;
    margin: 12px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f9fafb;
}

.tg-result-card[hidden] {
    display: none;
}

.tg-result-card.success {
    border-color: #bbf7d0;
    background: #ecfdf3;
    color: #075b30;
}

.tg-result-card.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.tg-result-card.warning {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.tg-result-card.info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.tg-result-card h3 {
    margin: 0;
    font-size: 18px;
}

.tg-result-card p {
    margin: 0;
    color: inherit;
    font-size: 14px;
    line-height: 1.45;
}

.tg-result-card ol,
.tg-result-card ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.55;
}

.tg-result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tg-check-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.tg-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tg-section-head h2 {
    margin: 2px 0 0;
}

.tg-recent-list {
    display: grid;
    gap: 8px;
}

.tg-recent-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.tg-recent-row small {
    grid-column: 1 / -1;
    color: var(--muted);
}

.scanner-open {
    overflow: hidden;
}

.scanner-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    grid-template-rows: auto minmax(70vh, 1fr) auto;
    gap: 12px;
    padding: 14px;
    background: #050816;
    color: #fff;
}

.scanner-topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
}

.scanner-close {
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 800;
    padding: 0 14px;
}

.scanner-camera-wrap {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    border-radius: 18px;
    background: #111827;
}

#tgQrReader,
#tgQrReader video {
    width: 100% !important;
    min-height: 70vh;
    object-fit: cover;
}

.scanner-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(72vw, 300px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 3px solid #fff;
    border-radius: 18px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

#tgScannerMessage {
    margin: 0 0 4px;
    text-align: center;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.tg-summary {
    margin-bottom: 12px;
}

.tg-summary span {
    font-size: 19px;
}

/* Premium cabinet UI layer */
h1 {
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: 0;
}

h2 {
    color: var(--text);
    font-size: 18px;
    letter-spacing: 0;
}

.app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
    background: var(--bg);
}

.sidebar {
    padding: 16px 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.sidebar-logo {
    gap: 12px;
    padding: 8px 10px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.sidebar-logo span {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.22);
    font-size: 14px;
}

.sidebar-logo strong {
    display: grid;
    gap: 1px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.1;
}

.sidebar-logo small {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
}

.sidebar-menu {
    gap: 3px;
}

.sidebar-link {
    min-height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar-link:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.sidebar-link.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-link span {
    width: 22px;
    opacity: 0.92;
}

.main {
    grid-template-rows: 60px minmax(0, 1fr);
}

.topbar {
    min-height: 60px;
    padding: 0 22px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.topbar strong {
    color: var(--text);
    font-size: 16px;
    letter-spacing: 0;
}

.topbar span {
    color: var(--text-soft);
}

.content {
    padding: 22px;
}

.container {
    width: min(1280px, calc(100% - 32px));
}

.page-head,
.page-header {
    align-items: flex-start;
    margin-bottom: 18px;
}

.page-head h1,
.page-header h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0;
}

.page-head p,
.page-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

.panel,
.card,
.auth-panel,
.kiosk-form,
.mobile-card,
.summary-grid > div {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel,
.card {
    padding: 18px;
    margin-bottom: 16px;
}

.card:hover,
.panel:hover {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.card-title-row {
    margin-bottom: 14px;
}

.card-title-row h2 {
    font-size: 17px;
    font-weight: 800;
}

label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    min-height: 40px;
    border: 1px solid #dbe1ea;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input[readonly] {
    color: var(--text-muted);
    background: var(--surface-soft);
}

.form-grid,
.grid-form {
    gap: 14px;
}

.field-help {
    color: var(--text-soft);
    font-size: 12px;
}

.check input {
    accent-color: var(--primary);
}

.btn {
    min-height: 38px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

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

.btn-primary,
.btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

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

.btn-muted,
.btn.neutral,
.btn-secondary,
.btn-outline {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.btn-muted:hover,
.btn.neutral:hover,
.btn-secondary:hover,
.btn-outline:hover {
    background: var(--surface-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-warning {
    background: var(--warning-soft);
    border-color: #fcd34d;
    color: #92400e;
}

.btn-in,
.btn-out {
    border-radius: 14px;
}

.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

table,
.table,
.data-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    color: var(--text-muted);
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

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

tbody tr:hover {
    background: var(--surface-soft);
}

.badge {
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge.ok,
.badge-success {
    color: #166534;
    background: var(--success-soft);
}

.badge.warning,
.badge-warning {
    color: #92400e;
    background: var(--warning-soft);
}

.badge.danger,
.badge-danger {
    color: #991b1b;
    background: var(--danger-soft);
}

.badge.muted,
.badge-muted {
    color: var(--text-muted);
    background: #eef2f7;
}

.badge-info {
    color: #075985;
    background: var(--info-soft);
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border-color: var(--border);
    color: var(--text-muted);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
    border-color: var(--border-strong);
    background: var(--surface-soft);
}

.icon-btn.primary {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #bfdbfe;
}

.icon-btn.success {
    color: var(--success);
    background: var(--success-soft);
    border-color: #bbf7d0;
}

.icon-btn.warning {
    color: #b45309;
    background: var(--warning-soft);
    border-color: #fde68a;
}

.icon-btn.danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #fecaca;
}

.dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 92px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.metric-card span {
    color: var(--text);
    font-size: 26px;
}

.metric-card p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 7px;
}

.metric-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--primary-soft);
    font-style: normal;
}

.summary-grid {
    gap: 14px;
}

.summary-grid > div {
    padding: 16px;
}

.summary-grid span {
    color: var(--text);
}

.modal-backdrop {
    background: rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(4px);
}

.modal {
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: var(--radius-lg);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.modal-header,
.modal-footer {
    padding: 15px 18px;
    background: var(--surface);
    border-color: var(--border);
}

.modal-footer {
    position: sticky;
    bottom: 0;
}

.modal-body {
    padding: 18px;
    background: #fbfdff;
}

.modal-close {
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-muted);
}

.branch-map {
    height: 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.formula,
.json-box,
.info-tile {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.toast {
    border-color: var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

.kiosk {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 500px);
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    box-shadow: var(--shadow-sm);
}

.kiosk h1 {
    font-size: 34px;
}

.clock {
    color: var(--primary);
    font-size: 38px;
}

/* Compact admin tables */
.content-inner {
    max-width: 1600px;
    margin: 0 auto;
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.impersonation-banner strong {
    display: block;
    font-size: 14px;
}

.impersonation-banner span {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.table-wrap {
    width: 100%;
}

.data-table,
.compact-table,
.table {
    font-size: 13px;
    line-height: 1.35;
}

.data-table th,
.compact-table th,
.table th {
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
}

.data-table td,
.compact-table td,
.table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.data-table tr,
.compact-table tr {
    min-height: 42px;
}

.data-table .muted-small,
.compact-table .muted-small,
.subtext {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}

.text-right {
    text-align: right;
}

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

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

.text-strong {
    color: var(--text);
    font-weight: 700;
}

.nowrap {
    white-space: nowrap;
}

.compact-cell {
    max-width: 260px;
}

.money {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

td.money,
th.money {
    text-align: right;
}

.money-total {
    color: var(--text);
    font-weight: 800;
}

.money-danger {
    color: var(--danger);
    font-weight: 700;
}

.money-success {
    color: var(--success);
    font-weight: 700;
}

.cell-stack {
    display: grid;
    gap: 2px;
}

.cell-title {
    color: var(--text);
    font-weight: 700;
}

.cell-code {
    font-variant-numeric: tabular-nums;
}

.code-badge {
    min-width: 46px;
    justify-content: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.salary-warning {
    white-space: nowrap;
}

.data-table .badge,
.compact-table .badge {
    min-height: 21px;
    padding: 3px 7px;
    font-size: 11px;
}

.icon-actions {
    gap: 4px;
    flex-wrap: nowrap;
}

.icon-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    font-size: 15px;
    text-decoration: none;
}

.actions-col {
    width: 1%;
    white-space: nowrap;
}

.filters {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.filters label {
    font-size: 12px;
}

.filters input,
.filters select {
    min-height: 38px;
}

.payroll-summary {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    margin-bottom: 14px;
}

.payroll-summary > div {
    padding: 14px;
}

.payroll-summary span {
    font-size: 19px;
    font-variant-numeric: tabular-nums;
}

.payroll-table th,
.payroll-table td {
    vertical-align: top;
}

.payroll-kpi-cell {
    min-width: 210px;
}

.payroll-inline-line {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 3px 0;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.payroll-percent-input,
.payroll-money-input {
    height: 30px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.payroll-percent-input {
    width: 64px;
    padding: 0 8px;
}

.payroll-money-input {
    width: 104px;
    padding: 0 10px;
}

.payroll-percent-input:focus,
.payroll-money-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.payroll-inline-form {
    display: inline-flex;
    justify-content: center;
}

.payroll-save-cell {
    width: 46px;
}

.payroll-modal,
.payroll-modal * {
    box-sizing: border-box;
}

.payroll-modal {
    max-width: 820px;
    width: calc(100vw - 32px);
    overflow-x: hidden;
}

.payroll-modal .modal-body {
    overflow-x: hidden;
}

.payroll-modal input,
.payroll-modal textarea,
.payroll-modal .form-row,
.payroll-modal .form-grid {
    max-width: 100%;
    min-width: 0;
}

.payroll-modal .modal-footer {
    width: 100%;
    box-sizing: border-box;
}

.payroll-edit-modal {
    width: min(820px, 100%);
    max-height: min(92vh, 700px);
}

.payroll-edit-modal .modal-header,
.payroll-edit-modal .modal-footer {
    padding: 10px 16px;
}

.payroll-edit-modal .modal-header h2 {
    font-size: 18px;
}

.payroll-edit-modal .modal-body {
    padding: 12px 14px;
}

.payroll-edit-modal .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.payroll-compact-card {
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.payroll-employee-card {
    min-height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.payroll-employee-card strong {
    font-size: 15px;
    line-height: 1.25;
}

.payroll-employee-card span,
.payroll-discipline-line {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.3;
}

.payroll-compact-title {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.payroll-compact-title span,
.payroll-advance-row label span {
    color: var(--text-soft);
    cursor: help;
}

.payroll-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 140px 110px;
    gap: 8px 12px;
    align-items: center;
    width: 100%;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.payroll-kpi-grid > * {
    min-width: 0;
}

.payroll-kpi-head {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.payroll-kpi-grid strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.payroll-kpi-grid label {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.payroll-kpi-grid input {
    width: 100%;
    min-width: 0;
}

.payroll-kpi-grid small {
    display: block;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payroll-edit-modal .payroll-percent-input {
    width: 100%;
    height: 34px;
    font-size: 14px;
}

.payroll-edit-modal .payroll-money-input {
    width: 180px;
    height: 34px;
    font-size: 14px;
}

.payroll-advance-row {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 10px;
    align-items: end;
}

.payroll-advance-row label {
    display: grid;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

.payroll-advance-row input[type="text"] {
    height: 34px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
}

.payroll-total-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    font-size: 13px;
    color: var(--text-muted);
}

.payroll-total-bar strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.payroll-total-bar span:last-child strong {
    font-size: 15px;
    color: var(--primary);
}

@media (max-width: 560px) {
    .payroll-kpi-grid {
        grid-template-columns: minmax(0, 1fr) minmax(90px, 120px) minmax(80px, 100px);
        gap: 7px;
    }

    .payroll-advance-row {
        grid-template-columns: 1fr;
    }

    .payroll-edit-modal .payroll-money-input {
        width: 100%;
    }
}

/* Unified SVG icon system */
.ui-icon,
.sidebar-icon,
.action-icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.action-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.sidebar {
    width: 236px;
}

.sidebar-logo {
    min-height: 58px;
}

.sidebar-logo span {
    border-radius: 12px;
    letter-spacing: 0;
}

.sidebar-link {
    position: relative;
    gap: 11px;
    border: 1px solid transparent;
}

.sidebar-link:hover {
    color: var(--primary);
    background: var(--surface-soft);
}

.sidebar-link.active {
    border-color: #dbeafe;
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-link svg {
    color: currentColor;
}

.icon-btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    line-height: 1;
}

.icon-btn.primary,
.icon-btn.success,
.icon-btn.warning,
.icon-btn.danger,
.icon-btn.muted {
    background: var(--surface);
    border-color: var(--border);
}

.icon-btn.primary {
    color: var(--primary);
}

.icon-btn.success {
    color: var(--success);
}

.icon-btn.warning {
    color: #b45309;
}

.icon-btn.danger {
    color: var(--danger);
}

.icon-btn:hover,
.icon-btn.primary:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.icon-btn.success:hover {
    color: var(--success);
    background: var(--success-soft);
    border-color: #bbf7d0;
}

.icon-btn.warning:hover {
    color: #b45309;
    background: var(--warning-soft);
    border-color: #fde68a;
}

.icon-btn.danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #fecaca;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-variant-numeric: tabular-nums;
}

.modal-section {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.modal-section + .modal-section {
    margin-top: 14px;
}

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

.modal-section-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.modal-section-head p {
    max-width: 520px;
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: right;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-1 {
    grid-template-columns: minmax(0, 1fr);
}

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

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

.coordinate-grid {
    margin-top: 12px;
}

.readonly-input,
input[readonly].readonly-input {
    background: var(--surface-soft);
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.branch-map {
    height: 400px;
}

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

.field-note-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text);
}

.field-note-card strong {
    font-size: 12px;
    font-weight: 800;
}

.field-note-card span,
.field-hint {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}

.field-hint {
    display: block;
    margin-top: 4px;
}

.shift-money-layout {
    display: grid;
    gap: 14px;
}

.shift-money-subsection {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.shift-money-subsection h4 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.money-input {
    font-variant-numeric: tabular-nums;
}

.shift-summary {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    color: var(--text);
}

.shift-summary strong {
    font-size: 13px;
    font-weight: 800;
}

.shift-summary span {
    color: var(--text-muted);
    font-size: 12px;
}

.settings-links {
    display: grid;
    gap: 8px;
}

.settings-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    transition: 0.16s ease;
}

.settings-links a:hover {
    border-color: #bfdbfe;
    background: var(--primary-soft);
}

.settings-links strong {
    font-size: 14px;
}

.settings-links span {
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
}

.settings-note {
    margin-top: 12px;
}

.access-denied-card {
    max-width: 680px;
}

.empty-state {
    display: grid;
    gap: 12px;
    justify-items: start;
}

.empty-state h1 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
}

.empty-state p {
    margin: 0 0 8px;
    color: var(--text-muted);
}

@media print {
    .topbar,
    .sidebar,
    .page-head .btn {
        display: none;
    }

    body {
        background: #fff;
    }

    .panel {
        box-shadow: none;
        border: 0;
    }
}

@media (max-width: 900px) {
    .impersonation-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-logo {
        margin-bottom: 10px;
        padding-bottom: 12px;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        gap: 6px;
    }

    .sidebar-link {
        white-space: nowrap;
    }

    .main {
        display: block;
    }

    .content {
        padding: 14px;
    }

    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .topbar,
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .kiosk,
    .grid-form,
    .form-grid,
    .info-grid,
    .filters,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .map-search {
        grid-template-columns: 1fr;
    }

    .branch-map {
        height: 340px;
    }

    .modal-backdrop {
        align-items: start;
        padding: 10px;
    }

    .modal,
    .modal-lg,
    .modal-confirm {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .icon-actions {
        justify-content: flex-start;
    }

    .tg-actions {
        grid-template-columns: 1fr;
    }

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

    .form-footer {
        position: static;
        justify-content: stretch;
        flex-direction: column;
    }
}

.telegram-bulk-toolbar {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 10px 12px;
}

.bulk-select-label {
    align-items: center;
    color: var(--text-muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    white-space: nowrap;
}

.bulk-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.copy-row {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 16px;
}

.table-detail-btn {
    align-self: flex-start;
    background: transparent;
    border: 0;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 0 0;
}

.table-detail-btn:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.details-modal {
    max-width: 560px;
}

.details-list {
    display: grid;
    gap: 0;
}

.details-row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 8px 0;
}

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

.details-row span {
    color: var(--text-muted);
    font-size: 13px;
}

.details-row strong {
    color: var(--text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.attendance-detail-btn {
    font-size: 14px;
}

@media (max-width: 768px) {
    .telegram-bulk-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .bulk-action-buttons {
        justify-content: flex-start;
    }

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

/* Final pilot UI polish: mDokon-style compact admin shell */
.admin-body {
    background: var(--bg);
}

.admin-body .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
    background: var(--bg);
}

.admin-body .sidebar {
    width: 220px;
    padding: 14px 10px;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.admin-body .sidebar-logo {
    min-height: 60px;
    margin: 0 2px 12px;
    padding: 8px 8px 14px;
    border-bottom: 1px solid var(--border);
}

.admin-body .sidebar-logo span {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--primary);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.admin-body .sidebar-logo strong {
    font-size: 15px;
    line-height: 1.08;
}

.admin-body .sidebar-logo small {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
}

.admin-body .sidebar-menu {
    display: grid;
    gap: 3px;
}

.admin-body .sidebar-link {
    min-height: 38px;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

.admin-body .sidebar-link span {
    width: auto;
    min-width: 0;
    text-align: left;
}

.admin-body .sidebar-link:hover {
    color: var(--primary);
    background: var(--surface-soft);
}

.admin-body .sidebar-link.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #dbeafe;
    box-shadow: inset 3px 0 0 var(--primary);
}

.admin-body .sidebar-icon {
    width: 18px;
    height: 18px;
}

.admin-body .main {
    grid-template-rows: 58px minmax(0, 1fr);
}

.admin-body .topbar {
    min-height: 58px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.admin-body .topbar strong {
    font-size: 15px;
    font-weight: 800;
}

.admin-body .topbar-user {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-body .topbar-account-link,
.admin-body .topbar .btn-sm {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 10px;
}

.admin-body .content {
    padding: 22px;
}

.admin-body .content-inner {
    width: min(100%, 1600px);
    margin: 0 auto;
}

.admin-body .page-header,
.admin-body .page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-body .page-header h1,
.admin-body .page-head h1 {
    margin: 0;
    font-size: 29px;
    line-height: 1.12;
    font-weight: 850;
}

.admin-body .page-header p,
.admin-body .page-head p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.admin-body .card,
.admin-body .panel {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.admin-body .card-title-row {
    margin-bottom: 12px;
}

.admin-body .card-title-row h2 {
    font-size: 17px;
    font-weight: 850;
}

.admin-body .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.admin-body .metric-card {
    min-height: 88px;
    padding: 16px;
    border-radius: 14px;
}

.admin-body .metric-card span {
    font-size: 27px;
    line-height: 1;
    font-weight: 850;
}

.admin-body .metric-card p {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.admin-body .metric-card i {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 0;
}

.admin-body .metric-icon-svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-body .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.admin-body .table,
.admin-body .data-table {
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.admin-body .data-table th {
    padding: 8px 10px;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-body .data-table td {
    height: 44px;
    padding: 8px 10px;
    vertical-align: middle;
}

.admin-body .data-table tbody tr:hover {
    background: #f8fbff;
}

.admin-body .table-wrap .data-table thead th,
.admin-body .table-wrap .compact-table thead th,
.admin-body .table-wrap .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-soft);
}

.admin-body .cell-title {
    font-weight: 850;
}

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

.employee-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe 52%, #93c5fd);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.employee-avatar img,
.employee-avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.employee-avatar img {
    display: block;
    object-fit: cover;
}

.employee-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.employee-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.employee-name {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}

.employee-name-link {
    text-decoration: none;
}

.employee-meta {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}

.employee-main .badge {
    justify-self: start;
    margin-top: 3px;
}

.dashboard-status-badge {
    padding: 4px 8px;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.admin-body .subtext,
.admin-body .muted,
.admin-body .text-muted {
    color: var(--text-muted);
}

.admin-body .subtext {
    font-size: 11px;
    line-height: 1.35;
}

.admin-body .money,
.admin-body .text-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.admin-body .nowrap {
    white-space: nowrap;
}

.admin-body .actions-col {
    width: 118px;
    text-align: right;
}

.admin-body .icon-actions {
    gap: 5px;
}

.admin-body .icon-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.admin-body .icon-btn:hover,
.admin-body .icon-btn.primary:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #bfdbfe;
}

.admin-body .action-icon {
    width: 15px;
    height: 15px;
}

.admin-body .filters,
.admin-body .filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    align-items: end;
}

.admin-body label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 850;
}

.admin-body input,
.admin-body select,
.admin-body textarea {
    min-height: 40px;
    border-color: #d9e1ec;
    border-radius: 10px;
    font-size: 14px;
}

.admin-body textarea {
    min-height: 78px;
}

.admin-body .btn {
    min-height: 38px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 850;
}

.admin-body .modal-backdrop {
    background: rgba(15, 23, 42, 0.46);
    backdrop-filter: blur(2px);
}

.admin-body .modal {
    border-radius: 16px;
    border-color: var(--border);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.admin-body .modal-header,
.admin-body .modal-footer {
    padding: 13px 16px;
    background: var(--surface);
}

.admin-body .modal-header h2 {
    font-size: 18px;
    font-weight: 850;
}

.admin-body .modal-body {
    padding: 14px 16px;
}

.admin-body .modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-muted);
}

.admin-body .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-top: 1px solid var(--border);
}

.admin-body .modal-section {
    padding: 13px;
    border-radius: 13px;
}

.admin-body .modal-section + .modal-section {
    margin-top: 10px;
}

.admin-body .modal-section-head {
    margin-bottom: 10px;
}

.admin-body .modal-section-head h3 {
    font-size: 14px;
}

.admin-body .modal-section-head p {
    font-size: 11px;
}

.admin-body .branch-map {
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
}

.admin-body .audit-table {
    min-width: 920px;
}

.admin-body .audit-summary {
    gap: 3px;
    font-size: 12px;
}

@media (max-width: 900px) {
    .admin-body .app-shell {
        display: block;
    }

    .admin-body .sidebar {
        width: 100%;
        height: auto;
    }

    .admin-body .sidebar-menu {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .admin-body .sidebar-link {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .admin-body .topbar,
    .admin-body .page-header,
    .admin-body .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-body .topbar-user {
        justify-content: flex-start;
    }

    .admin-body .content {
        padding: 14px;
    }
}

.hr-report-table {
    min-width: 0;
}

.hr-report-table th:nth-child(1) {
    min-width: 220px;
}

.hr-report-table th:nth-child(2) {
    min-width: 180px;
}

.hr-report-table th:nth-child(3) {
    min-width: 170px;
}

.hr-report-table th:nth-child(9),
.hr-report-table td:nth-child(9),
.hr-report-table th:nth-child(10),
.hr-report-table td:nth-child(10) {
    white-space: nowrap;
}

.hr-report-employee-cell {
    gap: 6px;
}

.hr-report-employee-cell .badge {
    align-self: flex-start;
}

.hr-report-main-row td {
    vertical-align: top;
}

.hr-report-detail-row[hidden] {
    display: none;
}

.hr-report-detail-row td {
    background: var(--surface-soft);
    padding: 0;
}

.hr-report-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 16px;
}

.hr-report-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.hr-report-detail-item span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.hr-report-detail-item strong {
    color: var(--text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .hr-report-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .hr-report-detail-grid {
        grid-template-columns: 1fr;
    }
}
