@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400..800&family=Tajawal:wght@400;500;700;800&display=swap");

:root {
  --font-en: Inter, "Segoe UI", sans-serif;
  --font-ar: Tajawal, Tahoma, "Segoe UI", sans-serif;
  color: #17343b;
  background: #f3f8f8;
  font-synthesis: none;
  --forest: #103c45;
  --mint: #74e5a0;
  --muted: #4c656b;
  --line: #d7e6e7;
}
[lang|="en"] { font-family: var(--font-en); }
[lang|="ar"] { font-family: var(--font-ar); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
.preview-access { width: min(100% - 32px, 360px); margin: 12vh auto 0; }
.preview-access form { display: grid; gap: 16px; }
.preview-access input { display: block; width: 100%; margin-top: 6px; }
.remember-login { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.remember-login input[type="checkbox"] { width: auto; margin: 0; }
:is(.workspace-login, .employee-portal) {
  color-scheme: dark;
  color: #e8f4f4;
  --portal-background: #101c21;
  --portal-surface: #192b32;
  --portal-control: #122329;
  --portal-accent: #73c9a6;
  --portal-accent-hover: #8ad7b7;
  --line: #39545c;
  --muted: #acc4c8;
}
.workspace-login {
  display: flex; flex-direction: column; min-height: 100dvh;
  background: radial-gradient(ellipse at 85% 10%, #183b3b, transparent 65%), var(--portal-background);
}
.workspace-login-header { display: flex; justify-content: flex-end; padding: 20px 28px; }
.workspace-login-header button {
  border: 1px solid #ffffff66; border-radius: 8px; background: transparent;
  color: #fff; padding: 6px 12px;
}
.workspace-login-main {
  width: min(484px, calc(100% - 36px)); margin: auto;
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid var(--line); border-radius: 18px; background: var(--portal-surface);
  box-shadow: 0 18px 45px #07141866;
}
.workspace-login-brand { display: flex; align-items: center; gap: 12px; margin-block-end: 26px; }
.workspace-login-brand h1 { margin: 0; font-size: 32px; color: inherit; }
.workspace-login-main form { gap: 16px; }
.workspace-login-main #search-submit { width: 100%; }
.workspace-login-main #search-status:empty { display: none; }
.workspace-login-main #search-status { margin-block: 16px 8px; }
.workspace-login-main #search-results { display: grid; gap: 8px; }
.workspace-login-main #search-results a { text-decoration: none; }
.workspace-login::after { content: ""; flex: 0 0 32px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #388478; outline-offset: 3px; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: 228px; padding: 28px 18px;
  display: flex; flex-direction: column; gap: 26px; background: var(--forest); color: #f2fbfa;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; font-size: 23px; padding: 0 8px; }
.mark {
  flex: 0 0 40px; height: 40px; border-radius: 11px;
  background: #fff url("/brand-reference.png") -136px -71px / 252px 168px no-repeat;
}
.workspace { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid #406157; border-radius: 10px; overflow-wrap: anywhere; font-size: 14px; }
.workspace-icon { color: var(--mint); }
nav { display: grid; gap: 5px; }
nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; color: #d2e5da; font-size: 15px; }
nav a span { width: 20px; text-align: center; font-size: 20px; line-height: 1; }
nav a:hover, nav a[aria-current] { background: #20535d; color: #fff; }
nav a[aria-current] span { color: var(--mint); }
.sidebar-foot { margin-top: auto; color: #c4d9ce; font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; background: var(--mint); border-radius: 50%; margin-inline-end: 6px; }
.shell { margin-inline-start: 228px; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 13px 32px; font-weight: 650; }
.topbar:has(#logout-form:not([hidden])) { gap: 8px; flex-wrap: wrap; }
:root[dir="ltr"] #logout-form { order: -1; }
.employee-portal { min-height: 100dvh; background: linear-gradient(#142b30, var(--portal-background) 340px); }
.employee-topbar {
  position: sticky; inset-block-start: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: #17353c; border-bottom: 1px solid var(--line);
}
@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .employee-topbar {
    background: rgb(23 53 60 / 86%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
.employee-topbar .brand, .company-access .brand { padding: 0; }
.employee-topbar .brand { flex-shrink: 0; white-space: nowrap; }
.employee-topbar-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.request-filters { display: flex; gap: 16px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-block: 12px 14px; }
.request-filters button { min-height: 42px; padding: 0 2px; white-space: nowrap; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; }
.request-filters button[aria-pressed="true"] { border-color: currentColor; color: inherit; font-weight: 700; }
.table-wrap:has(> .requests-overview) { border: 1px solid var(--line); border-radius: 14px; }
.requests-overview { min-width: 690px; background: var(--dark-surface, #fff); }
.requests-overview td { padding-block: 9px; }
.requests-overview small { display: block; margin-block-start: 4px; color: var(--muted); }
.request-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.request-chips span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--dark-surface-2, #f0f3f5); font-size: 12px; }
[data-theme="dark"] .request-chips span { background: #263c44; }
.requests-overview :is(th, td):last-child { width: 1%; }
.request-action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.request-row-actions { display: flex; gap: 4px; direction: rtl; }
.request-row-actions .button { display: grid; place-items: center; width: 30px; min-height: 30px; padding: 0; line-height: 1; border-radius: 8px; }
.employee-content {
  width: auto; max-width: 560px; margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.employee-heading { margin-block-end: 16px; }
.employee-home-toolbar { display: flex; justify-content: flex-end; }
.employee-icon-button { display: inline-grid; place-items: center; width: 44px; padding: 0; font-size: 25px; line-height: 1; }
.employee-greeting { font-size: clamp(24px, 6.5vw, 34px); text-align: center; margin: 15px 0 22px; }
.employee-portal .employee-attendance-card { display: grid; gap: 15px; text-align: center; padding: clamp(20px, 6vw, 30px); background: linear-gradient(145deg, #1e3b40, var(--portal-surface)); }
.employee-shift { color: var(--muted); font-size: 16px; font-weight: 650; }
.employee-timer { display: block; font-family: var(--font-en); font-size: clamp(48px, 14vw, 76px); line-height: 1.1; font-variant-numeric: tabular-nums; color: #cae3dc; }
#employee-punch { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; }
.employee-punch-icon { flex: none; object-fit: contain; filter: brightness(0); }
#employee-punch[data-punch-kind="out"] .employee-punch-icon { filter: brightness(0) invert(1); }
.employee-scheduled-periods { list-style: none; margin: 0; padding: 10px 0 2px; border-block-start: 1px solid var(--line); }
.employee-scheduled-periods li { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 12px; }
.employee-scheduled-periods li + li { margin-block-start: 8px; }
.employee-scheduled-periods bdi { color: var(--muted); font-size: 0.875rem; }
.employee-quick-actions { margin-block: 22px; }
.employee-quick-actions header { display: flex; align-items: center; justify-content: space-between; margin-block-end: 12px; }
.employee-quick-actions header h2 { margin: 0; }
.employee-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.employee-quick-grid .button { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 88px; padding: 8px 4px; border-radius: 13px; font-size: clamp(12px, 3.55vw, 15px); }
.employee-quick-grid svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.employee-quick-grid .employee-quick-accent { stroke: #78dfb4; }
.employee-sheet { width: min(100%, 500px); max-height: calc(100dvh - 20px); padding: 18px; background: var(--portal-surface); color: inherit; border: 1px solid var(--line); border-radius: 16px; }
.employee-sheet::backdrop { background: #081216b8; }
:is(.employee-sheet header, .employee-back-header) { display: flex; gap: 12px; align-items: center; margin-block-end: 16px; padding-block-end: 12px; border-bottom: 1px solid var(--line); }
:is(.employee-sheet header, .employee-back-header) h2 { margin: 0; }
.employee-back-header { direction: rtl; }
.employee-back-header .employee-icon-button { flex: 0 0 44px; min-height: 44px; }
.employee-sheet .employee-upload { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.employee-sheet, .employee-sheet form, .employee-sheet label, .employee-sheet input, .employee-sheet select, .employee-sheet textarea { min-inline-size: 0; max-inline-size: 100%; }
.employee-sheet form { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.employee-sheet input[type="date"] { display: block; inline-size: 100%; appearance: none; }
.employee-sheet input[type="date"]::-webkit-date-and-time-value { text-align: start; min-height: 1.2em; }
#employee-leave-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: 14px; color: var(--muted); }
.employee-sheet input[type="file"] { font-size: 14px; }
.employee-profile-summary, .employee-profile-options { display: grid; gap: 12px; }
.employee-profile-summary :is(h2, p), .employee-profile-options dl { margin: 0; }
.employee-profile-summary p { color: var(--muted); font-size: 14px; }
.employee-profile-options summary { cursor: pointer; margin-block: 8px; }
.employee-portal { display: flex; flex-direction: column; }
.employee-content { width: 100%; flex: 1; display: flex; flex-direction: column; }
#employee-dashboard { flex: 1; display: flex; flex-direction: column; }
.employee-bottom-nav { margin-block-start: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); background: #14282e; border-top: 1px solid var(--line); }
.employee-bottom-nav::before { content: none; }
.employee-correction-times { min-inline-size: 0; display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.employee-correction-times legend { margin-block-end: 8px; }
.employee-correction-option { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.employee-correction-option label { display: flex; align-items: center; gap: 8px; }
.employee-correction-option input[type="checkbox"] { width: 19px; min-height: 19px; margin: 0; }
.employee-correction-option input[type="time"] { margin-block-start: 8px; }
.employee-correction-option p { color: var(--muted); }
.employee-bottom-nav button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 55px; padding: 3px; border: 0; border-radius: 12px; background: transparent; color: inherit; font-size: 13px; }
.employee-bottom-nav svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.employee-bottom-nav .employee-nav-accent { stroke: #78dfb4; }
.employee-bottom-nav button[aria-current="page"] { background: #284b50; color: #d2f5e7; }
.employee-bell { width: 14px; height: 15px; display: inline-block; border: 2px solid currentColor; border-radius: 8px 8px 3px 3px; position: relative; }
.employee-bell::after { position: absolute; content: ''; inset-block-end: -5px; inset-inline-start: 3px; width: 4px; height: 3px; border-radius: 50%; background: currentColor; }
#employee-toast { position: fixed; z-index: 10; inset-block-start: max(10px, env(safe-area-inset-top)); inset-inline: 12px; width: fit-content; max-width: calc(100% - 24px); margin-inline: auto; padding: 12px 18px; border-radius: 12px; color: #d7fae7; background: #245341; box-shadow: 0 8px 22px #08121680; animation: employee-toast-in 200ms ease-out; }
@keyframes employee-toast-in { from { opacity: 0; transform: translateY(-18px); } }
#employee-toast[data-tone="error"] { background: #7b302c; color: #fff2ef; }
#employee-toast[data-leaving] { animation: employee-toast-in 200ms ease-in reverse both; }
@media (prefers-reduced-motion: reduce) { #employee-toast { animation: none; } }
#employee-attendance-history p, #employee-requests-history p { padding-block: 10px; border-bottom: 1px solid var(--line); }
#employee-requests-history { margin-block-end: 14px; }
.employee-home-requests { margin-block: 16px; min-inline-size: 0; }
.employee-home-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-block: 14px 18px; }
.employee-home-tabs .button { background: transparent; border-color: var(--line); color: inherit; }
.employee-home-tabs .button[aria-pressed="true"] { background: var(--portal-accent); border-color: var(--portal-accent); color: #092b26; }
#employee-team-home section + section { margin-block-start: 20px; }
#employee-team-home h2 { margin: 0 0 10px; font-size: 20px; }
#employee-team-home ul { display: flex; gap: 9px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0; padding: 0 0 6px; list-style: none; }
.employee-team-card { display: grid; gap: 8px; flex: 0 0 min(340px, 91%); min-width: 0; scroll-snap-align: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--portal-surface); overflow-wrap: anywhere; }
.employee-team-card-header, .employee-team-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.employee-team-card p, .employee-team-card small { margin: 0; color: var(--muted); }
.employee-team-actions { border-block-start: 1px solid var(--line); padding-block-start: 10px; }
.employee-team-actions .button:first-child { flex: 1; border-color: var(--portal-accent); }
.employee-team-actions .button:last-child { border-color: #ff8b81; color: #ffaaa3; }
#employee-team-status:empty { display: none; }
.employee-home-requests h2 { margin-block: 0 12px; }
#employee-home-requests-empty { margin: 0; color: var(--muted); }
#employee-home-requests-list { display: flex; overflow-x: auto; scroll-snap-type: x proximity; gap: 10px; margin: 0; padding: 0 0 6px; list-style: none; }
#employee-home-requests-list li { display: grid; justify-items: start; align-content: start; gap: 7px; flex: 0 0 min(220px, 80%); scroll-snap-align: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
#employee-home-requests-list small { color: var(--muted); }
#employee-home-requests-list [data-status] { padding: 2px 8px; border-radius: 12px; font-size: 12px; background: #544422; color: #ffe7a7; }
#employee-home-requests-list [data-status="Approved"] { background: #245341; color: #d7fae7; }
#employee-message-list p { border-bottom: 1px solid var(--line); padding-block: 10px; }
.request-attachment { display: inline-block; text-decoration: underline; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .employee-sheet { margin: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; overflow-y: auto; border: 0; border-radius: 0; padding-block: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-bottom)); }
}
.employee-heading h1 { font-size: clamp(26px, 7vw, 34px); letter-spacing: normal; }
.employee-content :is(p, dd) { overflow-wrap: anywhere; }
.employee-content p { margin-block-end: 0; }
.employee-content :is(.card, form) > :not([hidden]) + p:not(:empty) { margin-block-start: 10px; }
.employee-content p:empty { display: none; }
.employee-content > form { padding: clamp(16px, 4vw, 24px); border: 1px solid var(--line); border-radius: 14px; }
.employee-content > form, .employee-portal .card { background: var(--portal-surface); }
.employee-content .card { padding: clamp(16px, 5vw, 22px); margin-block-end: 14px; }
.employee-content .card h2 { margin-block-end: 12px; }
.employee-content .button.primary, #employee-refresh { width: 100%; }
.employee-topbar .button, .employee-content .button, .workspace-login-main .button { min-height: 44px; }
.employee-topbar .employee-admin-switch { padding: 6px 9px; font-size: 13px; white-space: nowrap; }
@media (max-width: 750px), (hover: none) and (pointer: coarse) {
  .employee-topbar .employee-admin-switch, .topbar #switch { display: none; }
}
:is(.employee-content, .workspace-login-main) :is(input, select, textarea) { min-height: 44px; font-size: 16px; }
.employee-content textarea { min-height: 92px; resize: vertical; }
.employee-password-rules ul { margin-block: 5px 0; padding-inline-start: 20px; }
.employee-content input { margin-top: 0; }
.employee-content .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.employee-content input[type="date"] { min-inline-size: 0; }
.employee-content dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0 0 14px; }
.employee-content dd { margin: 0; }
#employee-device-list { display: grid; gap: 10px; }
#employee-device-list .actions { align-items: center; }
#employee-device-list strong { flex: 1 1 100%; }
@media (max-width: 359px) {
  .employee-content .fields { grid-template-columns: 1fr; }
}
:is(.workspace-login, .employee-portal) .primary { background: var(--portal-accent); color: #092b26; }
:is(.workspace-login, .employee-portal) .primary:hover:not(:disabled) { background: var(--portal-accent-hover); }
:is(.workspace-login, .employee-portal) .secondary { background: #243e46; border-color: var(--line); color: inherit; }
:is(.workspace-login, .employee-portal) .secondary:hover { background: #2d4d56; }
:is(.workspace-login, .employee-portal) :is(input, select, textarea) { background: var(--portal-control); border-color: var(--line); }
.company-access { padding: 24px 0 0; }
.company-access main { margin: auto; width: min(484px, calc(100% - 36px)); padding: clamp(22px, 5vw, 36px); }
main { max-width: 1300px; margin: auto; padding: 32px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 43px); letter-spacing: -.045em; margin-bottom: 8px; }
h2 { font-size: 19px; margin-bottom: 16px; letter-spacing: -.02em; }
p { line-height: 1.5; }
.intro { margin-bottom: 25px; }
.intro p, .hint, .empty { color: var(--muted); }
.hero {
  background: radial-gradient(ellipse at 93% 10%, #286e70, transparent 60%), var(--forest);
  color: white; padding: 29px; border-radius: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
}
.hero p:last-child { margin-bottom: 0; color: #dbece3; }
.eyebrow { font-size: 11px; letter-spacing: .14em; font-weight: 750; color: var(--mint); margin-bottom: 10px; text-transform: uppercase; }
.hero > span { border: 1px solid #729382; border-radius: 20px; padding: 7px 12px; font-size: 13px; }
.hero h2 { font-size: 28px; margin-bottom: 5px; }
.punch { margin-bottom: 20px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.metric, .card { background: white; border: 1px solid var(--line); border-radius: 14px; }
.metric { padding: 18px; display: grid; gap: 7px; }
.metric:hover { border-color: #709784; }
.metric span { font-size: 14px; color: var(--muted); }
.metric strong { font-size: 30px; }
.card { padding: 22px; margin-bottom: 18px; min-width: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 380px)); gap: 16px; }
#organization-form { display: grid; gap: 16px; }
#organization-form > .button { justify-self: start; }
.organization-logo-editor { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.organization-logo-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.organization-logo-editor .actions { margin-block: 8px; }
.organization-logo-preview { display: grid; place-items: center; width: 120px; height: 82px; border: 1px solid var(--line); border-radius: 10px; }
.organization-logo { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.workspace-logo { display: block; max-width: 44px; max-height: 26px; object-fit: contain; }
.logo-upload { position: relative; overflow: hidden; cursor: pointer; }
.logo-upload:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
.logo-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.logo-remove { background: transparent; border: 0; color: #c44343; cursor: pointer; }
.settings-tile { display: flex; align-items: flex-start; gap: 12px; min-height: 92px; padding: 16px; background: white; border: 1px solid #a2afa7; border-radius: 8px; }
.settings-tile:hover { border-color: var(--forest); background: #f9fcfa; }
.settings-tile .hint { display: block; margin-top: 4px; }
.settings-icon { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 50%; background: #e0f5ee; color: var(--forest); }
.settings-back { display: inline-block; margin-bottom: 12px; text-decoration: underline; }
.schedule-days { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.schedule-days label { display: flex; align-items: center; gap: 6px; }
.schedule-days input { width: auto; margin: 0; }
.schedule-tabs { display: flex; gap: 16px; border-block-end: 1px solid var(--line); margin-block-end: 18px; }
.schedule-tabs button { border: 0; border-block-end: 2px solid transparent; background: none; padding: 10px 4px; color: var(--muted); }
.schedule-tabs button[aria-pressed="true"] { border-block-end-color: var(--forest); color: var(--forest); font-weight: 700; }
.period-toolbar { display: flex; justify-content: flex-end; margin-block-end: 14px; }
.catalog-toolbar { display: flex; margin-block-end: 10px; }
.catalog-toolbar .button { min-height: 28px; padding: 4px 10px; background: #121519; color: #fff; }
.catalog-dialog form { display: grid; gap: 12px; }
.partners-table :is(th, td):is(:nth-child(5), :nth-child(6)) { text-align: center; }
:is(.partners-table, .staff-directory table) :is(th, td):last-child { text-align: start; width: 1%; }
.activation-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.staff-edit { min-width: 32px; font-size: 16px; line-height: 1; }
@media (min-width: 1100px) {
  :is(.partners-card, .staff-directory):has(:is([data-partner-link], [data-staff-link])) { margin-inline-end: 160px; }
  :is(.partners-card, .staff-directory) > .table-wrap { overflow: visible; }
  .activation-actions { position: relative; }
  .activation-actions :is([data-partner-link], [data-staff-link]) { position: absolute; inset-inline-start: calc(100% + 44px); }
}
.partners-table .badge.green { background: #c8f5d8; color: #174b2b; }
#staff-dialog { width: min(1200px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 14px; padding: clamp(12px, 2vw, 20px); color: inherit; }
#staff-dialog::backdrop { background: #103c4566; }
#staff-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-block-end: 16px; }
#staff-dialog h2 { margin: 0; }
#staff-form > section { border-block-start: 1px solid var(--line); padding-block-start: 14px; }
#staff-form h3 { margin: 0 0 12px; }
#staff-form .fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: end; gap: 10px 14px; }
#staff-form :is(input, select) { min-height: 42px; }
#staff-form input[type="date"] { color-scheme: light; }
[data-theme="dark"] #staff-form input[type="date"] { color-scheme: dark; }
:is(#role-dialog, .catalog-dialog) { width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 14px; padding: 20px; color: inherit; }
:is(#role-dialog, .catalog-dialog)::backdrop { background: #103c4566; }
:is(#role-dialog, .catalog-dialog) header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-block-end: 16px; }
:is(#role-dialog, .catalog-dialog) h2 { margin: 0; }
.role-member { display: flex; align-items: center; gap: 8px; }
.role-member input { width: auto; }
:is([data-staff-role], tr:has([data-job-title])) { cursor: pointer; }
:is([data-staff-role], tr:has([data-job-title])):is(:hover, :focus-within) { background: #e0f5e5; }
[data-theme="dark"] :is([data-staff-role], tr:has([data-job-title])):is(:hover, :focus-within) { background: #285344; }
#period-dialog { inset: 0; margin: 0; margin-inline-start: auto; width: min(100%, 540px); max-width: 100%; height: 100%; max-height: 100%; border: 0; padding: 20px; color: inherit; }
#period-dialog::backdrop { background: #103c4566; }
#period-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#period-dialog h2 { margin: 0; }
.period-flexible-option { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.period-flexible-option input { width: auto; }
#timed-period-settings { display: grid; gap: 15px; min-inline-size: 0; padding: 0; margin: 0; border: 0; }
.period-window { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.period-window summary { cursor: pointer; font-weight: 700; }
.period-times, .period-fields { display: grid; gap: 10px; }
.period-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.period-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block-start: 12px; }
:is(.period-times, .period-fields) label { grid-template-rows: 1fr auto; min-width: 0; }
:is(.period-times, .period-fields) input { width: 100%; min-width: 0; height: 44px; }
.period-times input { cursor: pointer; }
.period-times input:is(:hover, :focus-visible) { border-color: var(--forest); background: #edf7f1; }
[data-theme="dark"] .period-times input:is(:hover, :focus-visible) { background: #25454b; }
[data-theme="dark"] .period-times input { color-scheme: dark; }
@media (max-width: 360px) {
  .period-fields { grid-template-columns: 1fr; }
}
.table-wrap { overflow-x: auto; }
.daily-attendance-table { min-width: 740px; }
.attendance-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
[dir="ltr"] .attendance-toolbar { flex-direction: row-reverse; }
#attendance-search { width: min(100%, 220px); min-width: 0; }
.attendance-date-controls { display: flex; direction: ltr; align-items: center; gap: 8px; flex-shrink: 0; }
.attendance-date-controls button { border: 0; background: transparent; color: inherit; width: 30px; height: 36px; cursor: pointer; }
.attendance-calendar { position: relative; display: grid; place-items: center; width: 38px; height: 36px; border: 1px solid var(--line); border-radius: 8px; }
.attendance-calendar span { position: relative; width: 13px; height: 12px; border: 1px solid currentColor; border-radius: 3px; }
.attendance-calendar span::before { content: ''; position: absolute; inset: 3px 0 auto; border-top: 1px solid currentColor; }
.attendance-calendar span::after { content: ''; position: absolute; top: -3px; left: 2px; right: 2px; height: 4px; border-inline: 1px solid currentColor; }
.attendance-calendar:focus-within { outline: 2px solid var(--forest); }
.attendance-calendar input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.attendance-calendar input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.daily-attendance-table :is(th, td):nth-child(n+4) { text-align: center; white-space: nowrap; }
.attendance-shift { width: fit-content; max-width: 100%; padding: 8px 10px; }
.attendance-shift + .attendance-shift { margin-block-start: 6px; }
.leave-types-table :is(th, td):nth-child(2) { width: 12rem; text-align: center; }
.leave-types-table :is(th, td):last-child { width: 5rem; text-align: center; }
.leave-switch { display: inline-flex; align-items: center; width: 34px; height: 20px; padding: 2px; border: 1px solid var(--muted); border-radius: 999px; background: transparent; }
.leave-switch span { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
.leave-switch[aria-checked="true"] { justify-content: flex-end; background: var(--forest); border-color: var(--forest); }
.leave-switch[aria-checked="true"] span { background: white; }
#leave-type-form { margin-top: 18px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { background: #eff5f0; color: #405c4f; font-size: 12px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.staff-roles-table :is(th, td):nth-child(2) { width: 30%; text-align: center; }
.staff-roles-table :is(th, td):last-child { width: 1%; white-space: nowrap; text-align: center; }
td small { display: block; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 20px; white-space: nowrap; background: #edf0ed; color: #44564d; font-size: 12px; font-weight: 650; }
.green { background: #e0f3e5; color: #205337; }
.amber { background: #fff0cc; color: #65460d; }
.red { background: #fde9e4; color: #8a382e; }
.button { min-height: 40px; border-radius: 8px; padding: 8px 13px; border: 1px solid transparent; font-weight: 650; }
.primary { background: #165663; color: white; }
.hero .primary { background: var(--mint); color: var(--forest); }
.secondary { background: #fff; border-color: var(--line); color: var(--forest); }
.secondary:hover { background: #edf5ef; }
.compact { min-height: 33px; padding: 5px 9px; font-size: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
form, .fields { display: grid; gap: 15px; }
.fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); }
form h2, form p { margin-bottom: 0; }
form > .button { justify-self: start; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 650; }
input, select, textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #c2d1c7; border-radius: 8px; background: white; color: inherit; }
textarea { min-height: 86px; resize: vertical; }
.suffix { display: flex; align-items: center; gap: 5px; }
.suffix, input[type="email"] { direction: ltr; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] .eyebrow { letter-spacing: normal; }
.filter { max-width: 185px; margin-bottom: 15px; }
.empty { margin-bottom: 0; }
#add-location { margin-block-start: 14px; }
#location-form { margin-block-start: 20px; }
#location-form h3 { margin: 0; }
.location-assignees { min-inline-size: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.location-assignee-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; max-height: 16rem; overflow-y: auto; }
.location-table tbody tr { cursor: pointer; }
.location-table tbody tr:is(:hover, :focus-within) { background: #e0f5e5; }
[data-theme="dark"] .location-table tbody tr:is(:hover, :focus-within) { background: #285344; }
#location-map { position: relative; overflow: hidden; height: clamp(270px, 42vh, 460px); border: 1px solid var(--line); border-radius: 10px; isolation: isolate; }
.toast { position: fixed; bottom: 16px; right: 16px; max-width: min(400px, calc(100vw - 32px)); padding: 13px 17px; border-radius: 9px; background: #173d33; color: white; box-shadow: 0 4px 20px #0003; }
.toast.error { background: #893629; }
@media (max-width: 750px) {
  .sidebar { position: static; width: 100%; gap: 12px; padding: 13px; }
  .workspace, .sidebar-foot { display: none; }
  nav { display: flex; overflow-x: auto; }
  nav a { white-space: nowrap; padding: 8px; font-size: 13px; gap: 5px; }
  .shell { margin-inline-start: 0; }
  main, .topbar { padding: 15px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .hero, .card { padding: 16px; }
}

.schedule-week { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-block-end: 14px; }
.schedule-week h2 { margin: 0; }
.weekly-schedule table { min-width: 1050px; }
.schedule-cell { display: grid; gap: 6px; min-width: 120px; }
.schedule-add { min-height: 52px; border: 1px solid transparent; border-radius: 8px; background: #f2f6f6; color: var(--muted); font-size: 22px; }
[data-theme="dark"] .schedule-add { background: #20383e; }
.schedule-add.has-periods { min-height: 32px; }
.schedule-add:is(:hover, :focus-visible) { border-color: var(--forest); color: var(--forest); }
[data-theme="dark"] .schedule-add:is(:hover, :focus-visible) { border-color: var(--mint); color: var(--mint); }
:is(.schedule-period, .attendance-shift) { display: grid; gap: 3px; border-radius: 8px; border-inline-start: 4px solid #9879ad; background: #eee6f1; color: #352544; }
:is(.schedule-period, .attendance-shift):nth-child(even) { border-inline-start-color: #a88b42; background: #fbf1d9; color: #423519; }
:is(.schedule-period, .attendance-shift) small { color: inherit; }
.schedule-period { position: relative; min-height: 64px; padding: 8px; }
.schedule-period-actions .secondary { border-color: currentColor; }
[data-theme="dark"] .schedule-period { --dark-surface: #f8f3fa; --dark-raised: #ffffff; --line: #806d89; }
.schedule-period-actions { display: flex; justify-content: end; align-items: center; gap: 5px; }
.schedule-period-actions .button { min-width: 32px; min-height: 30px; padding: 4px; }
@media (hover: hover) and (pointer: fine) {
  .schedule-period-actions { position: absolute; inset: 0; padding: 6px; border-radius: inherit; background: inherit; opacity: 0; pointer-events: none; }
  .schedule-period:is(:hover, :focus-within) .schedule-period-actions { opacity: 1; pointer-events: auto; }
}
.schedule-options { display: grid; gap: 8px; max-height: 55dvh; overflow: auto; }
.schedule-options label { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.schedule-options input { width: auto; }
.schedule-options small { display: block; }
.staff-default-periods { min-width: 0; margin: 12px 0 0; border: 1px solid var(--line); border-radius: 8px; }
#schedule-assignment-error:empty { display: none; }
.period-name, .period-duration { font-size: 16px; }
.period-name { color: inherit; border: 0; background: none; padding: 4px 0; text-decoration: underline; font-weight: 700; text-align: start; }

:root[data-theme="dark"] {
  color-scheme: dark;
  color: #e8f4f4;
  background: #101c21;
  --muted: #acc4c8;
  --line: #39545c;
  --dark-surface: #192b32;
  --dark-raised: #25414a;
}
[data-theme="dark"] :is(.topbar, .metric, .card, .settings-tile, .secondary, input, select, textarea, #period-dialog, #staff-dialog, #role-dialog, .catalog-dialog) {
  background: var(--dark-surface);
  color: inherit;
  border-color: var(--line);
}
[data-theme="dark"] :is(th, .settings-icon, .secondary:hover, .settings-tile:hover) {
  background: var(--dark-raised);
  color: inherit;
}
[data-theme="dark"] :is(.schedule-tabs button[aria-pressed="true"], .period-name) { color: var(--mint); }
[data-theme="dark"] .schedule-tabs button[aria-pressed="true"] { border-block-end-color: var(--mint); }
[data-theme="dark"] .primary:not(.hero .primary) { background: #206876; }
[data-theme="dark"] .badge { background: #34454b; color: #e2ecee; }
[data-theme="dark"] .badge.green { background: #204b3d; color: #b6f1d1; }
[data-theme="dark"] .partners-table .badge.green { background: #c8f5d8; color: #174b2b; }
[data-theme="dark"] .badge.amber { background: #51401f; color: #ffe0a1; }
[data-theme="dark"] .badge.red { background: #553136; color: #ffd2cf; }
[data-theme="dark"] .logo-remove { color: #ffaaa3; }
[data-theme="dark"] :is(input, textarea)::placeholder { color: #a9c2c9; opacity: 1; }
