@import url("/fonts/fonts.css?v=20261108");
:root {
    --bg: #f5f7f9;
    --text: #18212f;
    --muted: #64748b;
    --primary: #1f6f78;
    --surface: #ffffff;
    --line: #dce3ea;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body, button, input, select, textarea, table { font-family: Tahoma, Arial, "Segoe UI", sans-serif; letter-spacing: 0; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
aside { background: #102b35; color: white; padding: 20px; min-height: 100vh; }
aside strong { display: block; font-size: 24px; margin-bottom: 24px; }
aside a { display: block; color: #dce9ee; text-decoration: none; padding: 10px; border-radius: 6px; margin-bottom: 4px; }
aside a:hover { background: rgba(255,255,255,.12); }
aside a.active { background: rgba(255,255,255,.18); color: white; font-weight: 600; }
.no-salaries label:has(#basicSalary, #housingAllowance, #commissionAllowance, #otherAllowance, #totalSalary, #iban, #bank) { display: none; }
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dashboard-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-width: 0; }
.dashboard-title { display: block; font-weight: 700; color: inherit; text-decoration: none; margin-bottom: 8px; }
.dashboard-line { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.dashboard-line strong { font-size: 20px; }
.dashboard-attention { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.setup-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.setup-step { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.setup-step p { margin: 4px 0 0; }
.setup-step.done { opacity: .75; }
.setup-number { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: white; font-weight: 700; }
.setup-step.done .setup-number { background: #2e8b57; }
.setup-banner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.button-link { display: inline-block; padding: 8px 14px; border-radius: 6px; background: var(--primary); color: white; text-decoration: none; white-space: nowrap; }
.button-link.secondary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.aside-account { border-top: 1px solid rgba(255,255,255,.18); margin-top: 16px; padding-top: 12px; }
.aside-account span { display: block; color: #dce9ee; padding: 0 10px 8px; overflow-wrap: anywhere; }
.aside-account button { width: 100%; background: transparent; color: white; border: 1px solid rgba(255,255,255,.35); }
.page { padding: 24px; }
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
h1 { margin: 0; font-size: 26px; }
button { background: var(--primary); color: white; border: 0; min-height: 38px; padding: 0 16px; border-radius: 6px; cursor: pointer; }
input, select, textarea { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-top: 6px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cards article, .panel, .login-box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: 0 12px 28px rgba(24,33,47,.07); }
.cards span { color: var(--muted); }
.cards strong { display: block; margin-top: 8px; font-size: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 14px; }
.disabled-field { opacity: .52; }
.disabled-field input, .disabled-field textarea, .disabled-field select { cursor: not-allowed; background: #f3f6f8; }
.login-body { display: grid; place-items: center; grid-template-columns: 1fr; }
.login-box { width: min(420px, calc(100% - 32px)); }
.login-box h1 { margin-bottom: 8px; }
.login-box p, small { color: var(--muted); }
.login-box label { display: block; margin-top: 12px; }
.login-box button { width: 100%; margin-top: 16px; }
.muted { color: var(--muted); margin: 6px 0 0; }
.toolbar { display: grid; grid-template-columns: 1fr 220px; gap: 10px; margin-bottom: 14px; }
.advanced-filters { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; background: #fbfcfd; }
.advanced-filters summary { cursor: pointer; padding: 12px 14px; font-weight: 700; color: var(--text); }
.advanced-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; padding: 0 14px 14px; align-items: end; }
.filter-actions { display: flex; align-items: end; }
.filter-actions button { width: 100%; }
.result-count { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.employee-list-status { border: 1px solid #cfe4e7; background: #f1f8f9; color: var(--primary); border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; font-size: 13px; }
.recovery-banner { border: 1px solid #dc2626; background: #fee2e2; color: #7f1d1d; border-radius: 8px; padding: 12px 14px; margin: 12px 0; line-height: 1.8; }
.recovery-banner strong { display: block; margin-bottom: 4px; }
.recovery-banner .recovery-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.pagination-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.pagination-bar label { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.pagination-bar select { width: 86px; margin-top: 0; }
.pagination-bar button:disabled { opacity: .55; cursor: not-allowed; }
.export-panel { padding: 0 14px 14px; }
.export-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 12px; }
.export-columns label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: white; border-radius: 6px; padding: 8px 10px; }
.export-columns input { width: auto; min-height: auto; margin: 0; }
.export-actions { justify-content: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; font-size: 14px; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; }
small { color: var(--muted); }
.selected-row { background: #f1f8f9; }
.employee-main-row { cursor: pointer; }
.employee-main-row:hover { background: #f8fbfc; }
.employee-details-row td { padding: 0 10px 12px; background: #f1f8f9; }
.employee-inline-details { border: 1px solid #cfe4e7; border-top: 0; border-radius: 0 0 8px 8px; padding: 12px; background: #fbfeff; animation: details-open .16s ease-out; }
.employee-inline-details .details-grid { margin: 0; }
.employee-documents { margin-top: 14px; }
.employee-documents h3 { margin: 0 0 10px; font-size: 16px; }
.employee-name-cell { display: flex; align-items: center; gap: 10px; }
.employee-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: #eef3f6; flex: 0 0 auto; }
.employee-avatar.placeholder { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
.employee-details-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.employee-details-photo { width: 78px; height: 78px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: #eef3f6; }
.employee-file-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); background: #eef3f6; flex: 0 0 auto; }
.employee-file-photo.placeholder { display: inline-flex; align-items: center; justify-content: center; color: var(--primary); font-size: 26px; font-weight: 700; }
.employee-file-tabs { margin: 12px 0; }
.employee-file-panel h3 { margin: 14px 0 8px; font-size: 15px; }
.photo-preview-wrap { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.employee-photo-preview { width: 74px; height: 74px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.dual-date-control { display: grid; grid-template-columns: minmax(130px, 1fr) 92px minmax(120px, 1fr); gap: 6px; align-items: center; }
.dual-date-control .dual-date-hint { grid-column: 1 / -1; }
.dual-date-control input,
.dual-date-control select { min-width: 0; }
@keyframes details-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 280px; }
button.secondary { background: #eef3f6; color: var(--text); border: 1px solid var(--line); }
button.warning { background: #f6b84b; color: #231604; }
button.danger { background: #b8333b; color: white; }
button.success-button { background: #28784f; color: white; }
button:disabled, button.secondary:disabled, button.warning:disabled, button.danger:disabled, button.success-button:disabled { background: #e5e7eb; color: #9ca3af; border-color: #d1d5db; cursor: not-allowed; box-shadow: none; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 12px; }
.success { background: #eaf7ef; color: #28784f; }
.warning-badge { background: #fff4dd; color: #9a620d; }
.danger-badge { background: #fff0f1; color: #b8333b; }
.neutral-badge { background: #eef3f6; color: #475569; }
.details-panel { margin-top: 16px; }
.details-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 10px; }
.details-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fbfcfd; }
.details-grid span { color: var(--muted); display: block; font-size: 12px; margin-bottom: 6px; }
.details-grid strong { overflow-wrap: anywhere; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chips span { border: 1px solid var(--line); background: #eef3f6; border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.timeline { display: grid; gap: 8px; }
.timeline div { border-right: 3px solid var(--primary); background: #fbfcfd; border-radius: 6px; padding: 9px 12px; }
.timeline small { display: block; margin-top: 4px; }
.empty-state { color: var(--muted); }
.hidden { display: none !important; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .48); display: none; align-items: center; justify-content: center; padding: 18px; z-index: 50; }
.modal.show { display: flex; }
.modal-box { width: min(1050px, 100%); max-height: 92vh; overflow: auto; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: 0 18px 44px rgba(24,33,47,.18); }
.letterhead-modal-box { max-height: 86vh; overflow-y: auto; overscroll-behavior: contain; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.wide { grid-column: 1 / -1; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button.active { background: var(--primary); color: white; border-color: var(--primary); }
.contract-tabs { margin: 0 0 14px; }
.contract-tab-panel { margin-bottom: 16px; }
.contracts-advanced-actions { display: none; }
.summary-strip { border: 1px solid #cfe4e7; background: #f1f8f9; border-radius: 8px; padding: 10px 12px; margin: 12px 0; color: var(--text); }
.inline-actions { margin-top: 0; }
.more-menu { position: relative; display: inline-block; }
.more-menu summary { list-style: none; cursor: pointer; min-height: 38px; padding: 9px 14px; border-radius: 6px; border: 1px solid var(--line); background: #eef3f6; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu div { position: absolute; z-index: 5; left: 0; top: calc(100% + 6px); min-width: 170px; display: grid; gap: 6px; padding: 8px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 30px rgba(24,33,47,.14); }
.more-menu button { width: 100%; }
.letter-preview { margin-top: 14px; border: 1px solid var(--line); background: #fbfcfd; border-radius: 8px; padding: 14px; line-height: 1.9; }
.template-editor { min-height: 260px; line-height: 1.8; }
.preview-body-editor { min-height: 130px; margin-bottom: 12px; }
.visual-editor { min-height: 300px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: white; line-height: 1.8; outline: none; overflow: auto; }
.visual-editor:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,111,120,.12); }
.template-token { display: inline-flex; align-items: center; border: 1px solid #b7dadd; background: #eef8f9; color: #155963; border-radius: 999px; padding: 1px 8px; margin: 0 2px; font-size: 12px; white-space: nowrap; }
.doc-edit-table, .doc-body table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.doc-edit-table td, .doc-body td, .doc-body th { border: 1px solid var(--line); padding: 8px; min-width: 80px; }
.compact-color { display: inline-flex; align-items: center; gap: 6px; width: auto; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; background: #eef3f6; color: var(--text); }
.compact-color input { width: 34px; min-height: 26px; padding: 0; margin: 0; border: 0; background: transparent; }
.transfer-textarea { min-height: 150px; direction: ltr; text-align: left; font-family: Consolas, monospace; font-size: 12px; }
.attendance-toolbar { grid-template-columns: 180px 1fr 220px; align-items: end; }
.attendance-view-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.attendance-view-tabs button { width: auto; }
.attendance-table table { min-width: 1100px; }
.import-toolbar { grid-template-columns: minmax(260px, 1fr) auto; align-items: end; }
.attendance-step { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; margin: 14px 0; overflow: hidden; }
.attendance-step summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; padding: 14px 16px; background: #f3f7f9; border-bottom: 1px solid var(--line); }
.attendance-step summary strong { font-size: 16px; color: var(--text); }
.attendance-step summary span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.attendance-step:not([open]) summary { border-bottom: 0; }
.attendance-step.is-disabled { opacity: .72; }
.attendance-step.is-disabled summary { cursor: default; border-bottom: 0; }
.attendance-step.is-disabled .step-body { display: none; }
.step-body { padding: 16px; }
.relaxed-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 18px; }
.attendance-table th, .attendance-table td { vertical-align: top; line-height: 1.55; }
.selected-row { background: #f1f8f9; }
.clickable-metric { text-align: inherit; background: transparent; color: var(--text); border: 0; padding: 0; min-height: auto; cursor: pointer; }
.clickable-metric strong { color: var(--primary); }
.leave-toolbar { grid-template-columns: 1fr 220px 220px; align-items: end; }
.leave-table table { min-width: 1050px; }
.payroll-toolbar { grid-template-columns: 180px 1fr 180px 180px; align-items: end; }
.payroll-table table { min-width: 1450px; }
.compliance-toolbar { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.compliance-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.compliance-accordion-list { display: grid; gap: 10px; margin-bottom: 16px; }
.compliance-accordion { padding: 0; overflow: hidden; }
.compliance-accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.compliance-accordion summary::-webkit-details-marker { display: none; }
.compliance-accordion summary::after { content: "⌄"; font-size: 18px; color: var(--muted); transition: transform .18s ease; }
.compliance-accordion[open] summary::after { transform: rotate(180deg); }
.compliance-accordion summary span { font-weight: 700; color: var(--text); }
.compliance-accordion summary small { color: var(--muted); font-size: 13px; }
.compliance-accordion .accordion-body { border-top: 1px solid var(--line); padding: 16px; }
.reports-toolbar { grid-template-columns: 220px 160px 160px 1fr 240px; align-items: end; }
.reports-table table { min-width: 1200px; }
.contracts-toolbar { grid-template-columns: 1fr 240px 180px; }
.wide-modal { width: min(1280px, 100%); }
.template-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.template-list select { min-height: 360px; }
.compact-actions { justify-content: stretch; flex-wrap: wrap; }
.compact-actions button { flex: 1; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.editor-toolbar button, .link-button { background: #eef3f6; color: var(--text); border: 1px solid var(--line); min-height: 32px; padding: 0 10px; }
.token-picker { min-width: 280px; flex: 1 1 280px; }
.format-picker { min-width: 120px; flex: 0 1 150px; }
.notice { border: 1px solid #f2c46d; background: #fff8e8; color: #7a520d; border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.quick-document-panel { border-color: #b7dadd; background: #fbfefd; }
.quick-document-panel .template-editor { min-height: 220px; }
.quick-document-panel .document-paper { margin-top: 14px; border-radius: 8px; }
.sub-panel { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfcfd; margin: 12px 0; }
.custom-fields-list { display: grid; gap: 8px; }
.custom-field-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: end; }
.letterhead-preview { margin-top: 12px; border: 1px dashed var(--line); border-radius: 8px; padding: 12px; background: #fbfcfd; text-align: center; }
.letterhead-preview img { max-width: 100%; max-height: 180px; display: block; margin: 8px auto; }
.document-preview-modal { width: min(980px, 100%); }
.document-paper { background: #eef2f5; padding: 18px; overflow: auto; max-height: 72vh; }
.print-document { width: min(210mm, 100%); min-height: 297mm; margin: 0 auto; background: white; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(24,33,47,.10); padding: 10mm 12mm; line-height: 1.55; position: relative; overflow: visible; }
.doc-content { position: relative; z-index: 1; min-height: 277mm; padding-top: min(var(--doc-top-space, 0mm), 36mm); padding-bottom: min(var(--doc-bottom-space, 0mm), 26mm); }
.doc-full-page-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: 0; pointer-events: none; }
.doc-letterhead { margin: 0 0 5mm; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.doc-letterhead img { max-width: 100%; max-height: 28mm; width: auto; height: auto; display: block; margin: auto; object-fit: contain; } .doc-footer-image { margin-top: 5mm; text-align: center; break-inside: avoid; page-break-inside: avoid; } .doc-footer-image img { max-width: 100%; max-height: 18mm; width: auto; height: auto; display: block; margin: auto; object-fit: contain; }
.doc-preprinted-space { height: var(--preprinted-space, 45mm); }
.doc-body p { margin: 0 0 12px; }
.doc-footer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 32px; text-align: center; }
.doc-footer span { display: block; height: 52px; border: 1px dashed #9ca3af; margin-top: 10px; }
.doc-footer-text { text-align: center; color: var(--muted); border-top: 1px solid var(--line); margin-top: 5mm; padding-top: 2mm; font-size: 10px; break-inside: avoid; page-break-inside: avoid; }
.signature-options { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfcfd; }
.signature-options legend { padding: 0 6px; color: var(--muted); }
.signature-options label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.doc-signatures { display: grid; grid-template-columns: repeat(auto-fit, minmax(38mm, 1fr)); gap: 6mm; margin-top: 7mm; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.doc-signature-box { break-inside: avoid; page-break-inside: avoid; }
.doc-signature-box span { display: block; height: 12mm; border: 1px dashed #9ca3af; margin-top: 3mm; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); background: #eef3f6; color: var(--text); text-decoration: none; }
.page-break { break-after: page; page-break-after: always; border: 0; margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
@media (max-width: 900px) {
    body { grid-template-columns: 1fr; }
    aside { min-height: auto; }
    .cards, .form-grid, .details-grid, .toolbar, .compliance-grid, .template-layout, .doc-footer { grid-template-columns: 1fr; }
}

.template-token-panel { margin: 12px 0; border: 1px solid var(--line); background: #fbfcfd; border-radius: 8px; padding: 12px; }
.token-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.template-token-btn { padding: 7px 10px; font-size: 12px; }



.preview-note, .helper-text { display: block; }


/* ==== Theme: dark luxury (stage 5). Kept last so it sets the look without touching the layout rules above. ==== */
:root {
    --bg: #f3f1ec;
    --text: #22201c;
    --muted: #6b6458;
    --primary: #22201c;
    --surface: #ffffff;
    --line: #e4ded2;
    --gold: #b8892e;
    --gold-light: #e3b65c;
    --gold-pale: #f3d9a4;
    --ink: #1d1b18;
    --ink-2: #2e2a24;
    --soft: #f8f6f1;
}
html, body, button, input, select, textarea, table { font-family: var(--app-font, "IBM Plex Sans Arabic"), "Segoe UI", Tahoma, Arial, sans-serif; }
body { line-height: 1.6; }
.print-document { font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
a { color: var(--gold); }

/* Sidebar */
aside { background: var(--ink); color: #cfc8ba; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
aside .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
aside .brand img { width: 40px; height: 40px; }
aside .brand span { color: var(--gold-pale); font-size: 22px; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
aside a { display: flex; align-items: center; gap: 10px; color: #cfc8ba; padding: 9px 10px; border-radius: 8px; margin-bottom: 2px; border-right: 3px solid transparent; }
aside a svg { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
aside a:hover { background: rgba(255,255,255,.06); color: #f1ead9; }
aside a.active { background: var(--ink-2); color: var(--gold-pale); font-weight: 600; border-right-color: var(--gold-light); }
aside a.active svg { opacity: 1; stroke: var(--gold-light); }
.aside-account { border-top: 1px solid color-mix(in srgb, var(--gold-light) 22%, transparent); }
.aside-account > span { color: var(--gold-pale); font-weight: 600; }
.actions a.secondary, header a.secondary { display: inline-flex; font-size: 13px; white-space: nowrap; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border: 1px solid #d6cdb9; border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; }
.actions a.secondary:hover, header a.secondary:hover { background: var(--soft); }
.aside-account button { border-color: color-mix(in srgb, var(--gold-light) 45%, transparent); color: var(--gold-pale); }
.aside-account button:hover { background: color-mix(in srgb, var(--gold-light) 12%, transparent); }

/* Page: the content column may shrink, so a wide table scrolls inside it instead of widening the page */
body { grid-template-columns: 260px minmax(0, 1fr); }
.page { padding: 28px 30px; min-width: 0; }
h1 { font-size: 26px; color: var(--ink); }
header { border-bottom: 1px solid var(--line); padding-bottom: 14px; gap: 16px; }
header .actions { flex-wrap: wrap; margin-top: 0; }
header .actions button { white-space: nowrap; font-size: 13px; }

/* Buttons */
button { background: var(--ink); color: var(--gold-pale); border-radius: 8px; font-weight: 600; transition: background .15s ease; }
button:hover { background: var(--ink-2); }
button.secondary, .more-menu summary, .editor-toolbar button, .link-button, .compact-color { background: #fff; color: var(--ink); border: 1px solid #d6cdb9; }
button.secondary:hover { background: var(--soft); }
.button-link { background: var(--ink); color: var(--gold-pale); border-color: var(--ink); border-radius: 8px; font-weight: 600; }
.button-link.secondary { background: #fff; color: var(--ink); border: 1px solid #d6cdb9; }
.tabs button.active { background: var(--ink); color: var(--gold-pale); border-color: var(--ink); }

/* Surfaces */
.cards article, .panel, .login-box, .dashboard-card { border-color: var(--line); border-radius: 10px; box-shadow: 0 1px 2px rgba(29,27,24,.04), 0 8px 24px rgba(29,27,24,.05); }
.dashboard-card { border-top: 3px solid var(--gold-light); }
.dashboard-title { color: var(--ink); }
.dashboard-line strong { color: var(--ink); }
.dashboard-line:hover span { color: var(--gold); }
.setup-number { background: var(--ink); color: var(--gold-pale); }
.setup-step.done .setup-number { background: var(--gold); color: #fff; }
.setup-banner { border-right: 4px solid var(--gold-light); }

/* Tables and fields */
.table-wrap { border-color: var(--line); border-radius: 10px; }
th { background: var(--soft); color: var(--muted); }
tbody tr:hover td { background: #fcfbf8; }
input, select, textarea { border-color: #d9d1c1; border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 15%, transparent); }
.summary-strip, .employee-list-status { border-color: #eadbb8; background: #fbf6ea; color: var(--ink); }
.timeline div { border-right-color: var(--gold-light); }
.selected-row, .employee-details-row td { background: #fbf6ea; }
.employee-file-photo { border-color: var(--gold-light); }
.employee-file-photo.placeholder { color: var(--gold); }
.clickable-metric strong { color: var(--gold); }

/* Login */
.login-body { background: var(--ink); }
.login-box { border: 1px solid color-mix(in srgb, var(--gold-light) 35%, transparent); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.login-brand img { width: 52px; height: 52px; }
.login-brand span { font-size: 28px; font-weight: 700; letter-spacing: 0; color: var(--ink); }
.login-box h1 { text-align: center; font-size: 18px; color: var(--muted); font-weight: 500; }
.login-box > p { text-align: center; }

/* Phone: the sidebar becomes a top bar with a sliding row of sections */
@media (max-width: 900px) {
    aside { position: static; height: auto; display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 10px; align-items: center; }
    aside .brand { padding: 0 6px 0 10px; flex: 0 0 auto; }
    aside .brand span { font-size: 18px; }
    aside a { flex: 0 0 auto; margin: 0; white-space: nowrap; border-right: 0; border-bottom: 3px solid transparent; }
    aside a.active { border-bottom-color: var(--gold-light); }
    .aside-account { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; border-top: 0; margin: 0; padding: 0 0 0 4px; }
    .aside-account span { display: none; }
    .aside-account button { width: auto; }
    .page { padding: 18px 16px; }
    body { grid-template-columns: minmax(0, 1fr); }
    .toolbar, [class$="-toolbar"], [class*="-toolbar "], .form-grid, .details-grid, .compliance-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
    .cards article { padding: 12px; }
    .cards strong { font-size: 20px; }
    header { flex-wrap: wrap; gap: 10px; }
    .page table { display: block; overflow-x: auto; }
    .actions, .row-actions { flex-wrap: wrap; min-width: 0; }
    .dual-date-control { grid-template-columns: minmax(0, 1fr); }
}
@media print {
    aside { display: none; }
}

/* ==== English, left to right: mirror the few rules written for right to left. ==== */
html[dir="ltr"] th, html[dir="ltr"] td { text-align: left; }
html[dir="ltr"] aside a { border-right: 0; border-left: 3px solid transparent; }
html[dir="ltr"] aside a.active { border-left-color: var(--gold-light); }
html[dir="ltr"] .setup-banner { border-right: 0; border-left: 4px solid var(--gold-light); }
html[dir="ltr"] .timeline div { border-right: 0; border-left: 3px solid var(--gold-light); }
html[dir="ltr"] .more-menu div { left: auto; right: 0; }
.aside-account .language-switch { margin-bottom: 8px; }
@media (max-width: 900px) {
    html[dir="ltr"] aside a { border-left: 0; }
}
