:root {
  color-scheme: light;
  --color-background: #f5f7fa;
  --color-surface: #fff;
  --color-text: #243047;
  --color-muted: #526174;
  --color-primary: #1769c2;
  --color-primary-hover: #125aab;
  --color-selection: #eef6ff;
  --color-border: #d8e0eb;
  --color-input-border: #8793a5;
  --color-success: #14733b;
  --color-error: #bf2525;
  --color-focus: #2776c6;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-control: 4px;
  --radius-surface: 8px;
  --sidebar-width: 208px;
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: var(--color-primary); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
h1 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.6; }
[hidden] { display: none !important; }
.skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 1300; padding: 8px 16px; background: var(--color-surface); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.button-primary, .button-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 16px; border-radius: var(--radius-control);
  border: 1px solid transparent; font-weight: 600; text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.button-primary { background: var(--color-primary); color: var(--color-surface); }
.button-primary:hover:not(:disabled) { background: var(--color-primary-hover); }
.button-secondary { background: var(--color-surface); color: var(--color-primary); border-color: var(--color-input-border); }
.button-secondary:hover { background: var(--color-selection); }
.shell-header { display: flex; align-items: center; gap: var(--space-2); min-height: 56px; margin-inline-start: var(--sidebar-width); padding: 6px 24px; background: var(--color-surface); border-block-end: 1px solid var(--color-border); }
.shell-context { min-width: 0; color: var(--color-muted); }
.shell-account { display: flex; align-items: center; gap: var(--space-3); margin-inline-start: auto; min-width: 0; }
.shell-account form { flex-shrink: 0; margin: 0; }
.shell-username { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-mobile-brand { display: none; color: var(--color-primary); font-weight: 600; }
.shell-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1100; width: var(--sidebar-width); overflow-y: auto; padding: 24px 12px; background: var(--color-surface); border-inline-end: 1px solid var(--color-border); }
.shell-brand { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0 12px 24px; }
.shell-brand #navigation-title { color: var(--color-primary); font-size: 24px; font-weight: 600; }
.shell-brand p { margin: 4px 0 0; font-size: 12px; color: var(--color-muted); }
.shell-sidebar nav { display: grid; gap: var(--space-2); }
.navigation-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-control); text-decoration: none; font-weight: 500; }
.navigation-item > i { width: 20px; text-align: center; }
.navigation-item.is-current { background: var(--color-selection); color: var(--color-primary); font-weight: 600; }
.navigation-item.is-current:hover { background: #e1efff; }
.navigation-item.is-planned { color: var(--color-muted); cursor: default; }
.navigation-item small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; }
.navigation-group-title { width: 100%; border: 0; background: transparent; color: var(--color-muted); font: inherit; font-weight: 500; text-align: start; }
.navigation-group-title .navigation-chevron { margin-inline-start: auto; font-size: 10px; }
.navigation-group-title[aria-expanded="true"] .navigation-chevron { transform: rotate(180deg); }
.navigation-child { margin-inline-start: 20px; font-size: 13px; flex-wrap: wrap; gap: 4px; }
.shell-menu-button { display: none; width: 44px; flex-shrink: 0; padding: 0; }
.shell-content { margin-inline-start: var(--sidebar-width); padding: var(--space-6); min-width: 0; }
.page-heading { margin-block-end: var(--space-4); }
.page-hint { margin: 4px 0 0; color: var(--color-muted); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgb(24 36 55 / 45%); }
.drawer-open { overflow: hidden; }
.login-page { display: grid; align-content: center; justify-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; }
.login-card { width: min(100%, 410px); min-width: 0; padding: 32px; border: 1px solid var(--color-border); border-radius: var(--radius-surface); background: var(--color-surface); }
.login-brand { margin: 0 0 8px; color: var(--color-primary); font-weight: 600; }
.login-card h1 { font-size: 24px; }
.login-card .page-hint { margin-bottom: 24px; }
.login-controls { display: grid; gap: 8px; --login-error-height: 0px; }
.login-field { display: grid; grid-template-rows: 24px 44px auto; gap: 8px; margin: 0; min-width: 0; }
.login-field label { display: block; margin: 0; font-weight: 500; }
.login-field-feedback { min-height: var(--login-error-height); }
.login-submit-slot { padding-block-start: 32px; }
.password-control { position: relative; min-width: 0; height: 44px; }
.password-control input { padding-right: 48px; height: 44px; }
.password-toggle { position: absolute; right: 0; top: 0; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-control); color: var(--color-muted); background: transparent; }
.password-toggle:hover { color: var(--color-primary); background: var(--color-selection); }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-field input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--color-input-border); border-radius: var(--radius-control); font-size: 16px; background: var(--color-surface); color: var(--color-text); direction: ltr; text-align: left; }
.login-field input[aria-invalid="true"] { border-color: var(--color-error); }
.login-field input:focus { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.login-submit { width: 100%; }
.field-errors { list-style: none; margin: 0; padding: 0; color: var(--color-error); }
.form-errors { margin-bottom: 16px; padding: 12px; border: 1px solid var(--color-error); border-radius: var(--radius-control); background: #fff4f2; color: var(--color-error); }
.form-errors p { margin: 0; }
.form-errors ul { margin: 8px 0 0; padding-inline-start: 20px; }
.form-errors a { color: inherit; }
@media (max-width: 1023px) {
  .shell-header { margin-inline-start: 0; padding-inline: 16px; }
  .shell-content { margin-inline-start: 0; padding: 16px; }
  .shell-context { display: none; }
  .shell-mobile-brand { display: inline; }
  .shell-menu-button { display: inline-flex; }
  .shell-account { gap: 8px; }
  .shell-username { max-width: 100px; }
  .shell-sidebar { width: min(280px, calc(100vw - 48px)); visibility: hidden; pointer-events: none; }
  .drawer-open .shell-sidebar { visibility: visible; pointer-events: auto; }
}
@media (max-width: 640px) { .login-card { padding: 24px; } }
@media (prefers-reduced-motion: reduce) { .button-primary, .button-secondary { transition: none; } }
