:root {
	color-scheme: light;
	--ink: #293344;
	--muted: #718096;
	--line: #e1e8e4;
	--paper: #ffffff;
	--canvas: #f3f6f3;
	--pink: #d85b91;
	--pink-dark: #b53d73;
	--pink-soft: #e8f3ee;
	--blue: #168bda;
	--blue-dark: #0875b5;
	--blue-soft: #eaf2ee;
	--mint: var(--blue-soft);
	--amber: #a66418;
	--amber-bg: #fff4df;
	--red: #b44c43;
	--red-bg: #fff0ed;
	--green: #2d6d46;
	--shadow: 0 10px 30px rgba(74, 91, 125, .07);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 100vh; padding: 27px 17px 18px; background: #173d36; color: #f4faf7; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 31px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #173d36; background: #c7e3d4; }
.brand-mark i { width: 19px; height: 19px; }
.brand-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.brand-caption { margin-top: 3px; color: #aed0c2; font-size: 11px; }
.nav-label { padding: 0 12px; margin: 0 0 10px; color: #a2c1b5; font-size: 11px; }
.nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 7px; color: #d5e7df; background: transparent; text-align: right; transition: background .18s, color .18s; }
.nav-item i { width: 18px; height: 18px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active { color: #173d36; background: #c7e3d4; font-weight: 600; }
.nav-item.active i { color: var(--pink-dark); }
[hidden] { display: none !important; }
.section-view { display: grid; gap: 16px; padding-top: 25px; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-toolbar h1 { font-size: 24px; }
.section-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: var(--shadow); }
.section-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.section-panel-head h2 { margin: 0; font-size: 15px; }
.section-table-wrap { overflow-x: auto; }
.section-table { min-width: 620px; }
.section-table td { vertical-align: middle; }
.weekly-planning-controls { flex-wrap: wrap; }
.weekly-planning-controls p { margin: 4px 0 0; }
.weekly-schedule-group + .weekly-schedule-group { margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--line); }
.weekly-schedule-group h3 { margin: 0; padding: 12px 16px; color: var(--blue-dark); background: #f7f9fb; font-size: 13px; }
.week-picker { display: flex; align-items: center; gap: 7px; }
.week-picker input { min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: white; }
.weekly-schedule-table { width: max-content; min-width: max-content; border-collapse: separate; border-spacing: 0; font-size: 10px; }
.weekly-schedule-table th, .weekly-schedule-table td { min-width: 63px; padding: 3px; border-inline-start: 1px solid #dce5e9; border-bottom: 1px solid #dce5e9; }
.weekly-schedule-table thead th { border-top: 1px solid #dce5e9; color: var(--blue-dark); background: #edf4f7; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.weekly-schedule-table th:first-child, .weekly-schedule-table td:first-child { position: sticky; right: 0; z-index: 1; width: 150px; min-width: 150px; max-width: 150px; border-right: 1px solid #dce5e9; background: #f7f9fb; }
.weekly-schedule-table th:not(:first-child), .weekly-schedule-table td:not(:first-child) { width: 100px; min-width: 100px; max-width: 100px; }
.weekly-schedule-table td:first-child { color: var(--blue-dark); font-weight: 600; }
.weekly-schedule-table th:last-child, .weekly-schedule-table td:last-child { border-left: 1px solid #dce5e9; }
.weekly-schedule-table tbody tr:nth-child(even) td:not(:first-child) { background: #fbfcfd; }
.weekly-schedule-input { display: block; width: 100%; min-width: 0; height: 20px; min-height: 20px; padding: 1px 4px; border: 1px dashed #c9d5db; border-radius: 4px; color: var(--ink); background: white; font-size: 10px; }
.weekly-schedule-input:hover, .weekly-schedule-input:focus { border: 1px solid var(--blue); outline: none; background: #f8fbfd; box-shadow: 0 0 0 2px rgba(40,104,142,.1); }
.weekly-schedule-input::placeholder { color: #a3aca6; }
.weekly-schedule-input.schedule-off { background: #1d5e35; color: white; border: 1px solid #0d4620; font-weight: 600; }
.weekly-schedule-input.schedule-off:hover, .weekly-schedule-input.schedule-off:focus { background: #0d4620; border: 1px solid #0d4620; box-shadow: 0 0 0 2px rgba(29,94,53,.3); }
.section-note { padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.month-picker { position: relative; min-width: 220px; }
.month-picker summary { min-height: 39px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; cursor: pointer; }
.month-options { display: grid; max-height: 220px; overflow-y: auto; gap: 2px; min-width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; box-shadow: var(--shadow); }
.month-option { display: flex; align-items: center; gap: 8px; padding: 7px; border-radius: 4px; cursor: pointer; }
.month-option:hover { background: var(--canvas); }
.month-option input { width: 16px; height: 16px; accent-color: var(--blue); }
.action-button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; color: #405047; background: white; font-size: 11px; transition: all 0.2s ease; }
.action-button:hover { background: #f4f7f3; }
#saveButton { min-height: 36px; padding: 0 14px; border: 1px solid var(--pink); color: #fff; background: var(--pink); font-weight: 600; font-size: 12px; }
#saveButton:hover { background: var(--pink-dark); border-color: var(--pink-dark); box-shadow: 0 2px 8px rgba(23, 107, 87, 0.18); }
#saveButton:active { transform: scale(0.98); }
.action-button.approve { border-color: #c8deeb; color: var(--blue-dark); background: var(--blue-soft); }
.action-button.reject { border-color: #f1d9d5; color: #a64b42; background: #fff5f2; }
.edit-employee-button { min-height: 30px; padding: 0 9px; border: 1px solid #efbfd3; border-radius: 5px; color: var(--pink-dark); background: var(--pink-soft); font-size: 11px; }
.edit-employee-button:hover { background: #f7dce8; }
.delete-employee-button { min-height: 30px; padding: 0 9px; margin-right: 6px; border: 1px solid #f1d9d5; border-radius: 5px; color: #a64b42; background: #fff5f2; font-size: 11px; }
.delete-employee-button:hover { background: #ffe8e0; }
.delete-attendance-button { min-height: 28px; padding: 0 8px; border: 1px solid #f1d9d5; border-radius: 5px; color: #a64b42; background: #fff5f2; font-size: 11px; }
.delete-attendance-button:hover { background: #ffe8e0; }
.shortcut-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.shortcut-button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 70px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; text-align: right; }
.shortcut-button:hover { border-color: #c8deeb; background: #f8fbfd; }
.shortcut-button i { width: 19px; height: 19px; color: var(--pink); }
.shortcut-button span { font-weight: 600; }
main { min-width: 0; padding: 28px clamp(20px, 4vw, 58px) 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.breadcrumb i { width: 14px; height: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 7px; color: #53615a; background: var(--paper); }
.icon-button i { width: 17px; height: 17px; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #d77551; box-shadow: 0 0 0 2px white; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 29px 0 23px; }
h1 { margin: 0; font-size: 26px; line-height: 1.3; }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.heading-controls { display: flex; align-items: center; gap: 9px; }
.select-wrap { position: relative; }
.select-wrap i { position: absolute; top: 50%; right: 11px; width: 15px; height: 15px; color: #6f7a73; pointer-events: none; transform: translateY(-50%); }
select { min-height: 39px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 6px; outline: none; color: #33423b; background: var(--paper); }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 14px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; transition: background .18s, transform .18s; white-space: nowrap; }
.primary-button { color: white; background: var(--pink); }
.primary-button:hover { background: var(--pink-dark); transform: translateY(-1px); }
.secondary-button { border-color: var(--line); color: #405047; background: var(--paper); }
.secondary-button:hover { background: #f4f8fb; }
.primary-button i, .secondary-button i { width: 16px; height: 16px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.summary-card { position: relative; min-height: 126px; padding: 17px 18px 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: var(--shadow); }
.summary-card::after { position: absolute; top: 0; right: 0; width: 3px; height: 100%; background: var(--accent, #b6d5c3); content: ""; }
.summary-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.summary-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 7px; color: var(--blue); background: var(--blue-soft); }
.summary-icon i { width: 16px; height: 16px; }
.summary-value { margin-top: 12px; font-size: 23px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-note { margin-top: 5px; color: var(--muted); font-size: 11px; }
.summary-card[data-attendance-category="paid"], .attendance-status[data-attendance-status="paid"], .attendance-select[data-attendance-status="paid"] { border-color: #b8d9ca; background: #e8f3ee; color: #315c4e; }
.summary-card[data-attendance-category="review"], .attendance-status[data-attendance-status="review"], .attendance-select[data-attendance-status="review"] { border-color: #ebc5c1; background: #fff0ef; color: #a6443f; }
.summary-card[data-attendance-category="pending"], .attendance-status[data-attendance-status="pending"], .attendance-select[data-attendance-status="pending"] { border-color: #ead8ad; background: #fff5df; color: #8a601e; }
.attendance-status { display: inline-block; padding: 5px 10px; border: 1px solid; border-radius: 4px; font-weight: 600; }
.summary-card.card-green { --accent: #2d6d46; }
.summary-card.card-blue { --accent: var(--blue); }
.summary-card.card-orange { --accent: var(--amber); }
.summary-card.card-red { --accent: var(--red); }
.payroll-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 20px 15px; }
.schedule-holiday-header { background: var(--blue-soft); color: var(--blue-dark); }
.schedule-holiday-badge { display: block; margin-top: 2px; font-size: 10px; font-weight: 600; }
.schedule-holiday-cell { background: #f7fbfd; }
.holiday-grid-wrap { overflow-x: auto; max-height: 520px; }
table.holiday-grid { white-space: nowrap; }
table.holiday-grid th, table.holiday-grid td { height: 60px; padding: 6px 8px; text-align: center; }
table.holiday-grid th.holiday-grid-name, table.holiday-grid td.holiday-grid-name { position: sticky; right: 0; z-index: 2; background: var(--paper); text-align: right; min-width: 190px; border-left: 1px solid var(--line); }
table.holiday-grid thead th.holiday-grid-name { z-index: 3; background: #f7f9fb; }
table.holiday-grid thead th { position: sticky; top: 0; z-index: 1; background: #f7f9fb; }
.holiday-grid-col-date { display: block; color: var(--muted); font-size: 10px; font-weight: 400; }
.holiday-grid-col-annual { color: #a64b42; }
.holiday-grid-select { min-width: 92px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; background: #fff; }
.holiday-grid-annual-input { width: 120px; min-width: 100px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; background: #fff; }
td.holiday-grid-cell-work { background: #f1faf5; }
td.holiday-grid-cell-leave { background: #fff5f2; }
.panel-title { margin: 0; font-size: 16px; }
.panel-count { margin-right: 7px; color: var(--muted); font-size: 12px; font-weight: 400; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.search-box { position: relative; width: 220px; }
.search-box i { position: absolute; top: 50%; right: 11px; width: 15px; height: 15px; color: #839087; transform: translateY(-50%); pointer-events: none; }
.search-box input { width: 100%; height: 36px; padding: 0 34px 0 10px; border: 1px solid var(--line); border-radius: 6px; outline: none; color: var(--ink); background: white; }
.search-box input:focus, select:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(23,107,87,.11); }
.search-box input::placeholder { color: #9ba49e; }
.table-scroll { overflow-x: auto; width: 100%; }
.table-scroll table { table-layout: auto; }
.table-scroll th, .table-scroll td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table { width: 100%; border-collapse: collapse; text-align: right; white-space: nowrap; }
thead { background: #f0f4f8; position: sticky; top: 0; z-index: 10; }
thead th { font-weight: 600; color: var(--blue-dark); }
th { padding: 11px 17px; border-top: 1px solid #edf0eb; border-bottom: 1px solid #edf0eb; color: #748078; font-size: 11px; font-weight: 500; }
td { padding: 12px 17px; border-bottom: 1px solid #eff1ed; color: #39463f; font-size: 12px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fbfcfa; }
tbody tr:last-child td { border-bottom: 0; }
.employee { display: flex; align-items: center; gap: 10px; min-width: 175px; }
.employee-avatar { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; color: var(--blue-dark); background: var(--blue-soft); font-size: 11px; font-weight: 700; }
.employee-name { color: #26352d; font-weight: 600; }
.employee-email, .employee-phone { margin-top: 2px; color: #929b95; font-size: 10px; direction: ltr; text-align: right; }
.currency { color: #7e8982; font-size: 10px; }
.net { color: var(--blue-dark); font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status.paid { color: var(--blue-dark); background: var(--blue-soft); }
.status.pending { color: var(--amber); background: var(--amber-bg); }
.status.review { color: var(--red); background: var(--red-bg); }
.attendance-select { min-height: 33px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; color: #33423b; background: white; font-size: 11px; }
.attendance-input { width: 118px; min-height: 33px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: white; font-size: 11px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid #edf0eb; color: var(--muted); font-size: 11px; }
.pagination { display: flex; align-items: center; gap: 5px; }
.page-button { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid transparent; border-radius: 5px; color: #69766e; background: transparent; }
.page-button.current { border-color: #efbfd3; color: var(--pink-dark); background: var(--pink-soft); font-weight: 700; }
.page-button i { width: 14px; height: 14px; }
.page-button:disabled { opacity: .4; cursor: not-allowed; }
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.compact-mode td { padding-block: 7px; }
.payroll-table { min-width: 100%; width: auto; }
.payroll-table th { padding: 8px 7px; font-size: 12px; }
.payroll-table td { padding: 7px 6px; font-size: 12px; }
.payroll-input-wrap { display: flex; align-items: center; gap: 5px; }
.payroll-input { width: 70px; height: 28px; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; outline: none; color: var(--ink); background: white; font-size: 11px; }
.payroll-input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(193,60,119,.11); }
.payroll-input.days { width: 62px; }
.payroll-result { font-weight: 600; font-variant-numeric: tabular-nums; }
.payroll-result.net { color: var(--blue-dark); font-weight: 700; }
.calculation-note { margin: -10px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.empty-state { display: none; padding: 36px 15px; color: var(--muted); text-align: center; }
.empty-state i { display: block; width: 25px; height: 25px; margin: 0 auto 10px; color: #9aa89f; }
dialog { width: min(560px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); box-shadow: 0 24px 70px rgba(18,37,28,.22); }
dialog::backdrop { background: rgba(18,37,28,.38); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 17px; }
.close-button { display: grid; place-items: center; width: 31px; height: 31px; border: 0; border-radius: 5px; color: #65736b; background: transparent; }
.employee-form { display: grid; gap: 13px; padding: 19px 20px 21px; }
.form-field { display: grid; gap: 6px; color: #56635b; font-size: 12px; }
.form-field input, .form-field select { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; outline: none; color: var(--ink); background: white; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-preview { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fb; }
.form-preview output { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.toast { position: fixed; bottom: 22px; left: 22px; display: flex; align-items: center; gap: 9px; padding: 12px 16px; border: 1px solid #d5e8dc; border-radius: 7px; color: #1e5d42; background: #f4fbf6; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.security-alert { border-color: #e1b5b2; color: #9c3b34; background: #fff4f2; }
.toast i { width: 17px; height: 17px; }
@media (max-width: 1050px) {
	.app { grid-template-columns: 205px minmax(0, 1fr); }
	main { padding-inline: 24px; }
	.summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
	.app { display: block; }
	.sidebar { min-height: 0; padding: 12px 15px; }
	.nav { display: flex; gap: 4px; overflow-x: auto; }
	.nav-item { width: auto; flex: 0 0 auto; padding: 8px 11px; font-size: 11px; }
	main { padding: 0 15px 25px; }
	.summary-grid { grid-template-columns: 1fr 1fr; }
	.shortcut-grid { grid-template-columns: 1fr; }
}
@media print {
	.sidebar, .topbar, .top-actions, .heading-controls, .panel-actions, .table-footer, .toast, dialog { display: none !important; }
	main { padding: 0 !important; }
	.app { display: block !important; }
}
