@font-face {
  font-family: "Estedad";
  src: url("../fonts/Estedad-FD.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #059669;
  --accent-strong: #047857;
  --accent-strong-hover: #065f46;
  --accent-soft: #ecfdf5;
  --background: #f8fafc;
  --surface: #ffffff;
  --foreground: #0f172a;
  --muted: #64748b;
  --muted-bg: #f1f5f9;
  --border: #e2e8f0;
  --danger: #dc2626;
  --warning: #d97706;
  --sidebar: #0f172a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; color: var(--foreground); background: var(--background);
  font-family: "Estedad", Tahoma, "Segoe UI", sans-serif; line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, transform .18s ease; }
button, .btn, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 2px; }
.app-sidebar {
  position: fixed; inset: 0 0 0 auto; width: 248px; z-index: 1030;
  display: flex; flex-direction: column; padding: 20px 14px;
  background: var(--sidebar); color: #e2e8f0;
}
.brand { display: flex; align-items: center; gap: 11px; min-height: 52px; padding: 6px 8px; color: white; }
.brand:hover { color: white; }
.brand-mark {
  display: block; width: 38px; height: 38px; flex: 0 0 38px; padding: 3px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: #eff6ff;
  object-fit: contain;
}
.login-brand-logo { width: 88px; height: 88px; padding: 8px; border-color: #dbeafe; border-radius: 22px; }
.brand strong { display: block; font-size: 1rem; }
.brand small { display: block; color: #94a3b8; font-size: .72rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 22px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 9px 12px;
  border-radius: 10px; color: #cbd5e1; font-size: .9rem; font-weight: 600;
}
.sidebar-nav a:hover, .sidebar-nav a:focus-visible, .sidebar-nav a.active { color: white; background: rgba(255,255,255,.09); }
.nav-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-separator { margin: 18px 12px 6px; color: #64748b; font-size: .72rem; font-weight: 700; }
.sidebar-user {
  display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 12px 8px 0;
  border-top: 1px solid rgba(255,255,255,.1); font-size: .75rem;
}
.user-avatar {
  display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px; background: rgba(37,99,235,.3); color: white; font-weight: 700;
}
.icon-button {
  display: grid; place-items: center; min-width: 44px; min-height: 44px;
  border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer;
}
.icon-button:hover { background: rgba(255,255,255,.09); }
.app-shell { min-height: 100vh; margin-right: 248px; }
.impersonation-banner {
  position: sticky; top: 0; z-index: 1025; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px; padding: 9px 30px; border-bottom: 1px solid #fcd34d;
  background: #fffbeb; color: #78350f; box-shadow: 0 4px 14px rgba(120,53,15,.08);
}
.impersonation-banner strong, .impersonation-banner span { display: block; }
.impersonation-banner strong { font-size: .84rem; }
.impersonation-banner span { margin-top: 1px; color: #92400e; font-size: .7rem; }
.impersonation-banner form { flex: 0 0 auto; }
.app-main { width: min(100%, 1280px); margin: 0 auto; padding: 28px 30px 60px; }
.mobile-header, .mobile-bottom-nav { display: none; }
.page-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px;
}
.page-title { margin: 0; font-size: clamp(1.35rem, 2vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; }
.page-subtitle { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.btn { min-height: 44px; border-radius: 10px; padding: .52rem 1rem; font-weight: 700; cursor: pointer; }
.btn-sm { min-height: 44px; padding: .35rem .75rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background: var(--accent); border-color: var(--accent); }
.btn-soft { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.btn-soft:hover { background: #dbeafe; color: #1e40af; }
.btn-danger-soft { background: #fef2f2; color: var(--danger); border: 1px solid #fee2e2; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.card-header { padding: 16px 18px; background: transparent; border-color: var(--border); font-weight: 800; }
.card-body { padding: 18px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px;
}
.stat-card { position: relative; overflow: hidden; padding: 17px; }
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary); }
.stat-label { color: var(--muted); font-size: .79rem; font-weight: 600; }
.stat-value { margin-top: 4px; font-size: 1.55rem; line-height: 1.3; font-weight: 800; }
.stat-hint { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.toolbar .search-field { flex: 1; min-width: 180px; }
.workorder-filter-shell {
  margin-bottom: 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.workorder-quick-search {
  display: flex; align-items: center; gap: 9px; padding: 10px;
}
.workorder-search-input { position: relative; flex: 1 1 360px; min-width: 180px; }
.workorder-search-input svg {
  position: absolute; z-index: 1; top: 50%; right: 13px; width: 20px; height: 20px;
  transform: translateY(-50%); fill: none; stroke: #64748b; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.workorder-search-input .form-control { padding-right: 42px; }
.btn-link-filter {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .45rem .65rem;
  border: 0; background: transparent; color: var(--muted); font-size: .76rem; font-weight: 800;
}
.btn-link-filter:hover { background: var(--muted-bg); color: #334155; }
.workorder-advanced-filters { border-top: 1px solid var(--border); }
.workorder-advanced-filters > summary {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 12px;
  color: #334155; list-style: none; user-select: none;
}
.workorder-advanced-filters > summary::-webkit-details-marker { display: none; }
.workorder-advanced-filters > summary:hover { background: #f8fbff; }
.advanced-filter-summary-icon {
  display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 9px; background: #eff6ff; color: #1d4ed8;
}
.advanced-filter-summary-icon svg, .advanced-filter-chevron {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.advanced-filter-summary-copy { min-width: 0; }
.advanced-filter-summary-copy strong { display: block; font-size: .8rem; font-weight: 850; }
.advanced-filter-summary-copy small { display: block; margin-top: 1px; color: var(--muted); font-size: .68rem; }
.advanced-filter-count {
  display: inline-flex; align-items: center; min-height: 28px; margin-right: auto; padding: 3px 9px;
  border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff;
  color: #1d4ed8; font-size: .67rem; font-weight: 850; white-space: nowrap;
}
.advanced-filter-chevron { flex: 0 0 20px; margin-right: auto; color: var(--muted); transition: transform .2s ease; }
.advanced-filter-count + .advanced-filter-chevron { margin-right: 0; }
.workorder-advanced-filters[open] .advanced-filter-chevron { transform: rotate(180deg); }
.workorder-advanced-filter-body { padding: 14px; border-top: 1px solid var(--border); background: #fbfdff; }
.workorder-advanced-filter-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.workorder-advanced-filter-grid .filter-field { min-width: 0; }
.workorder-filter-actions {
  display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--border);
}
@media (max-width: 900px) {
  .workorder-advanced-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .workorder-quick-search { flex-wrap: wrap; padding: 9px; }
  .workorder-search-input { flex-basis: 100%; }
  .workorder-quick-search > .btn-soft { flex: 1; }
  .workorder-advanced-filters > summary { padding-inline: 10px; }
  .advanced-filter-summary-copy small { display: none; }
  .workorder-advanced-filter-body { padding: 11px; }
  .workorder-advanced-filter-grid { grid-template-columns: 1fr; gap: 10px; }
  .workorder-filter-actions { display: grid; grid-template-columns: 1fr; }
  .workorder-filter-actions .btn { width: 100%; }
}
.form-control, .form-select {
  min-height: 46px; border-color: #cbd5e1; border-radius: 10px; background-color: white;
}
textarea.form-control { min-height: 108px; }
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.13);
}
.form-label { margin-bottom: 6px; color: #334155; font-size: .82rem; font-weight: 700; }
.form-hint { color: var(--muted); font-size: .74rem; }
.customer-lookup-status[data-state="found"] { color: var(--accent); }
.customer-lookup-status[data-state="error"] { color: var(--danger); }
.field-validation-error { display: block; margin-top: 5px; color: var(--danger); font-size: .76rem; }
.validation-summary-errors {
  padding: 12px 16px; border: 1px solid #fecaca; border-radius: 10px; background: #fef2f2; color: #991b1b;
}
.validation-summary-errors ul { margin: 0; padding-right: 18px; }
.form-card { max-width: 900px; margin: 0 auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.table-card { overflow: hidden; }
.table { margin: 0; vertical-align: middle; }
.table th {
  padding: 12px 16px; border-bottom-color: var(--border); background: var(--muted-bg);
  color: #475569; font-size: .76rem; font-weight: 800; white-space: nowrap;
}
.table th.sortable-column { padding: 0 8px; }
.sort-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px;
  padding: 0 8px; border-radius: 8px; color: inherit; font-weight: inherit; text-decoration: none;
}
.sort-link:hover, .sort-link:focus-visible { background: #eaf2ff; color: var(--primary-dark); }
.sort-link.is-active { color: var(--primary-dark); }
.sort-icon {
  width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.sort-link:not(.is-active) .sort-icon path { opacity: .45; }
.sort-link.is-active:not(.is-descending) .sort-down,
.sort-link.is-active.is-descending .sort-up { opacity: .18; }
.workorder-mobile-sort { display: none; }
.table td { padding: 13px 16px; border-bottom-color: var(--border); font-size: .85rem; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fbff; }
.status-pill {
  display: inline-flex; align-items: center; min-height: 28px; padding: 3px 9px;
  border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap;
}
.status-new { background: #eff6ff; color: #1d4ed8; }
.status-waiting { background: #fff7ed; color: #c2410c; }
.status-progress { background: #f5f3ff; color: #6d28d9; }
.status-payment { background: #fffbeb; color: #b45309; }
.status-done { background: #ecfdf5; color: #047857; }
.status-cancelled { background: #f1f5f9; color: #64748b; }
.priority-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; margin-top: 4px; padding: 3px 9px;
  border: 1px solid transparent; border-radius: 8px; font-size: .68rem; font-weight: 850; white-space: nowrap;
}
.priority-pill > span, .priority-diamond {
  width: 7px; height: 7px; flex: 0 0 7px; border-radius: 2px; background: currentColor; transform: rotate(45deg);
}
.priority-pill.priority-normal { border-color: #e2e8f0; background: #f8fafc; color: #475569; }
.priority-pill.priority-important { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
.priority-pill.priority-very-important { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.priority-pill.priority-critical { border-color: #7f1d1d; background: #991b1b; color: #fff; }
.priority-row.priority-important > td:first-child, .priority-row.priority-important.unassigned-item { box-shadow: inset -3px 0 #ea580c; }
.priority-row.priority-very-important > td:first-child, .priority-row.priority-very-important.unassigned-item { box-shadow: inset -4px 0 #e11d48; }
.priority-row.priority-critical > td:first-child, .priority-row.priority-critical.unassigned-item { box-shadow: inset -5px 0 #991b1b; }
.priority-selector { margin: 0; padding: 0 12px; border: 0; }
.priority-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.priority-option {
  position: relative; display: grid; grid-template-columns: auto 5px minmax(0, 1fr); align-items: center; gap: 9px;
  min-height: 66px; padding: 10px; border: 1px solid #d7e0ec; border-radius: 11px; background: #fff;
  cursor: pointer; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.priority-option:hover { border-color: #94a3b8; background: #f8fafc; }
.priority-option:has(input:checked) { border-color: currentColor; background: color-mix(in srgb, currentColor 6%, white); box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent); }
.priority-option:has(input:focus-visible) { outline: 3px solid rgba(37, 99, 235, .24); outline-offset: 2px; }
.priority-option input { width: 18px; height: 18px; margin: 0; accent-color: currentColor; cursor: pointer; }
.priority-option-mark { width: 5px; height: 34px; border-radius: 999px; background: currentColor; opacity: .72; }
.priority-option > span:last-child { min-width: 0; }
.priority-option strong, .priority-option small { display: block; }
.priority-option strong { font-size: .78rem; }
.priority-option small { margin-top: 2px; color: #64748b; font-size: .63rem; line-height: 1.55; }
.priority-option.priority-normal { color: #475569; }
.priority-option.priority-important { color: #9a3412; }
.priority-option.priority-very-important { color: #be123c; }
.priority-option.priority-critical { color: #991b1b; }
.priority-callout {
  display: flex; align-items: center; gap: 11px; margin-bottom: 16px; padding: 12px 14px;
  border: 1px solid; border-radius: 11px;
}
.priority-callout svg { width: 27px; height: 27px; flex: 0 0 27px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.priority-callout strong, .priority-callout span { display: block; }
.priority-callout strong { font-size: .86rem; }
.priority-callout span { margin-top: 2px; font-size: .72rem; }
.priority-callout.priority-very-important { border-color: #fda4af; background: #fff1f2; color: #9f1239; }
.priority-callout.priority-critical { border-color: #991b1b; background: #7f1d1d; color: #fff; }
@media (max-width: 900px) { .priority-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .priority-options { grid-template-columns: 1fr; } }
.workorder-cancel-reason {
  display: inline-block; max-width: 200px; margin-top: 4px;
  padding: 3px 8px; border-radius: 8px; background: #f1f5f9;
  color: #64748b; font-size: .66rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.table .td-craftsman-link, td[data-label="استادکار"] a[href*="Profile"], td[data-label="استادکار"] > a {
  color: var(--primary-dark); font-weight: 700; text-decoration: none; border-radius: 6px;
}
td[data-label="استادکار"] > a:hover, td[data-label="استادکار"] > a:focus-visible {
  color: #1e40af; text-decoration: underline; text-underline-offset: 3px; background: #eff6ff;
}
.timeline-item a[asp-route*="Profile"], .timeline-item a[href*="Profile"] {
  color: var(--primary-dark); font-weight: 700;
}
.timeline-item a[href*="Profile"]:hover, .timeline-item a[href*="Profile"]:focus-visible {
  color: #1e40af; text-decoration: underline; text-underline-offset: 3px;
}
.workorder-filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.workorder-filter-card {
  position: relative; display: block; overflow: hidden; padding: 13px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
.workorder-filter-card:hover { border-color: #93c5fd; box-shadow: 0 4px 14px rgba(37,99,235,.12); }
.workorder-filter-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.workorder-filter-label { display: block; color: var(--muted); font-size: .78rem; font-weight: 600; }
.workorder-filter-value { display: block; margin-top: 3px; font-size: 1.5rem; line-height: 1.2; font-weight: 800; }
.workorder-filter-status {
  position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary);
}
.workorder-filter-card .workorder-filter-status.status-new { background: #1d4ed8; }
.workorder-filter-card .workorder-filter-status.status-waiting { background: #c2410c; }
.workorder-filter-card .workorder-filter-status.status-progress { background: #6d28d9; }
.workorder-filter-card .workorder-filter-status.status-payment { background: #b45309; }
.workorder-filter-card .workorder-filter-status.status-done { background: #047857; }
.workorder-filter-card .workorder-filter-status.status-cancelled { background: #64748b; }
.workorder-filter-card.is-active .workorder-filter-status { width: 6px; }
.aging-attention-panel {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 16px;
  margin-bottom: 16px; padding: 20px 16px 16px; border: 2px solid #ef4444; border-radius: var(--radius);
  background: #fff7f7; box-shadow: 0 10px 34px rgba(185, 28, 28, .22);
}
.aging-attention-panel.is-employee-alarm {
  position: sticky; top: 12px; z-index: 25;
  animation: aging-panel-alarm 1.25s ease-in-out infinite;
}
.aging-attention-panel.is-employee-alarm::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: -35%;
  width: 42%; height: 6px; border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #991b1b, #ef4444 45%, #fecaca 50%, #ef4444 55%, #991b1b);
  box-shadow: 0 2px 12px rgba(220, 38, 38, .7);
  animation: aging-siren-sweep 1.05s ease-in-out infinite alternate;
}
@keyframes aging-panel-alarm {
  0%, 100% { background: #fff7f7; box-shadow: 0 10px 30px rgba(185, 28, 28, .18); }
  50% { background: #fee2e2; box-shadow: 0 12px 42px rgba(185, 28, 28, .38), 0 0 0 4px rgba(239, 68, 68, .10); }
}
@keyframes aging-siren-sweep {
  from { transform: translateX(0); }
  to { transform: translateX(330%); }
}
.aging-attention-heading { display: flex; align-items: center; gap: 13px; min-width: 0; }
.aging-attention-icon {
  display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px;
  border-radius: 13px; background: #b91c1c; color: white;
}
.aging-attention-icon svg {
  width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.aging-attention-heading .priority-kicker {
  color: #b91c1c; font-size: .68rem; font-weight: 900; letter-spacing: .01em;
}
.aging-attention-heading h2 { margin: 1px 0 2px; color: #7f1d1d; font-size: 1rem; font-weight: 900; }
.aging-attention-heading p { margin: 0; color: #991b1b; font-size: .71rem; line-height: 1.75; }
.aging-attention-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.aging-attention-action {
  position: relative; display: grid; align-content: center; min-height: 94px; padding: 10px 13px;
  border: 1px solid #fecaca; border-radius: 11px; background: white; color: #7f1d1d;
}
.aging-attention-action:hover, .aging-attention-action:focus-visible { border-color: #ef4444; background: #fef2f2; color: #7f1d1d; }
.aging-attention-action.is-active { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .14); }
.aging-attention-action span, .aging-attention-action small { font-size: .67rem; font-weight: 700; }
.aging-attention-action strong { font-size: 1.55rem; line-height: 1.25; font-weight: 900; font-variant-numeric: tabular-nums; }
.aging-attention-action small { color: #b91c1c; }
.workorder-aging-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 3px 7px;
  border-radius: 999px; background: #fee2e2; color: #991b1b; font-size: .65rem; font-weight: 900;
}
.workorder-aging-badge > span { width: 7px; height: 7px; border-radius: 50%; background: #dc2626; }
.attention-age { color: #b91c1c; font-size: .78rem; white-space: nowrap; }
@media (max-width: 900px) {
  .aging-attention-panel { position: relative; top: auto; grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .aging-attention-panel { padding: 13px; }
  .aging-attention-heading { align-items: flex-start; }
  .aging-attention-actions { grid-template-columns: 1fr; }
  .aging-attention-action { min-height: 76px; }
}
.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 5px; color: #334155; }
.details-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .8fr); gap: 16px; align-items: start; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.info-item small { display: block; color: var(--muted); font-size: .72rem; }
.info-item strong { display: block; margin-top: 3px; font-size: .9rem; }
.cancellation-summary {
  padding: 12px 14px; border: 1px solid #fecaca; border-radius: 11px; background: #fff7f7;
}
.cancellation-summary small, .cancellation-summary strong, .cancellation-summary span, .cancellation-summary time { display: block; }
.cancellation-summary small, .cancellation-summary time { color: var(--muted); font-size: .72rem; }
.cancellation-summary strong { margin-top: 2px; color: #991b1b; font-size: .88rem; }
.cancellation-summary span { margin-top: 4px; color: #475569; font-size: .8rem; white-space: pre-line; }
.cancellation-summary time { margin-top: 6px; }
.action-stack { display: grid; gap: 12px; }
.action-card { border-right: 4px solid var(--primary); }
.action-card h3 { margin: 0 0 12px; font-size: .96rem; font-weight: 800; }
.share-request-mobile { display: none; }
.share-request-desktop { display: contents; }
.share-request-card { border-right-color: var(--accent); }
.share-request-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.share-request-heading h3 { margin-bottom: 1px; }
.share-request-recipient { margin: 0; color: #475569; font-size: .78rem; font-weight: 700; }
.share-request-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong);
}
.share-request-icon svg, .btn-share svg {
  width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn-share {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; border-color: var(--accent-strong); background: var(--accent-strong); color: white;
}
.btn-share:hover, .btn-share:focus-visible, .btn-share:active {
  border-color: var(--accent-strong-hover); background: var(--accent-strong-hover); color: white;
}
.timeline { position: relative; margin: 0; padding: 0 21px 0 0; list-style: none; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; right: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 0 12px 18px 0; }
.timeline-item::before {
  content: ""; position: absolute; top: 6px; right: -19px; width: 10px; height: 10px;
  border: 2px solid white; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px #bfdbfe;
}
.timeline-meta { color: var(--muted); font-size: .7rem; }
.candidate-list { display: grid; gap: 8px; }
.candidate {
  display: flex; align-items: center; gap: 10px; padding: 11px;
  border: 1px solid var(--border); border-radius: 11px; background: white;
}
.candidate-info { flex: 1; min-width: 0; }
.candidate-info strong, .candidate-info small { display: block; }
.candidate-info small { color: var(--muted); }
.candidate-info .candidate-cities { margin: 3px 0; color: var(--muted); line-height: 1.55; }
.candidate-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 7px; }
.candidate-stat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; background: #f1f5f9;
  color: #475569; font-size: .68rem; font-weight: 700; white-space: nowrap;
}
.candidate-stat svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.candidate-stat-success { background: #ecfdf5; color: #047857; }
.candidate-stat-cancelled { background: #fef2f2; color: #b91c1c; }
.candidate-rate {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: .68rem; font-weight: 900; white-space: nowrap;
}
.candidate-rate.rate-high { background: #d1fae5; color: #065f46; }
.candidate-rate.rate-mid { background: #fef3c7; color: #92400e; }
.candidate-rate.rate-low { background: #fee2e2; color: #991b1b; }
.candidate-rate.rate-none { background: #e2e8f0; color: #475569; }
.candidate-notice { margin-bottom: 10px; font-size: .78rem; line-height: 1.7; }
.reference-list { max-height: 520px; overflow: auto; padding-inline-end: 3px; }
.check-group-title { grid-column: 1 / -1; margin-top: 8px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.autocomplete { position: relative; }
.autocomplete-results {
  position: absolute; top: calc(100% + 5px); inset-inline: 0; z-index: 1050;
  overflow: hidden; border: 1px solid var(--border); border-radius: 12px;
  background: white; box-shadow: 0 14px 35px rgba(15,23,42,.14);
}
.autocomplete-item {
  display: block; width: 100%; min-height: 52px; padding: 8px 12px; border: 0;
  border-bottom: 1px solid var(--border); background: white; text-align: right; cursor: pointer;
}
.autocomplete-item:last-child { border-bottom: 0; }
.autocomplete-item:hover, .autocomplete-item:focus { background: #eff6ff; }
.autocomplete-item small { display: block; color: var(--muted); direction: ltr; text-align: right; }
.money { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.app-alert { position: relative; margin-bottom: 16px; border-radius: 11px; }
.pagination-row { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.multi-checks { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.check-tile {
  display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
}
.check-tile:has(input:checked) { border-color: #93c5fd; background: #eff6ff; }
.guest-card { width: min(92vw, 420px); margin: 10vh auto 0; }
.app-guest { background: radial-gradient(circle at top right, #dbeafe 0, var(--background) 42%); }
.mobile-only { display: none; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .details-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
  .share-request-mobile { display: block; }
  .share-request-desktop { display: none; }
  body.app-authenticated { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .app-sidebar { display: none; }
  .app-shell { margin-right: 0; }
  .impersonation-banner { top: 62px; padding: 8px 12px; }
  .mobile-header {
    position: sticky; top: 0; z-index: 1020; display: flex; align-items: center;
    justify-content: space-between; min-height: 62px; padding: 8px 14px;
    border-bottom: 1px solid var(--border); background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  }
  .brand.compact { min-height: 44px; padding: 0; color: var(--foreground); }
  .brand.compact:hover { color: var(--foreground); }
  .brand.compact .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .mobile-management-menu { position: relative; }
  .mobile-management-menu summary { display: flex; align-items: center; gap: 5px; list-style: none; }
  .mobile-management-menu summary::-webkit-details-marker { display: none; }
  .mobile-management-menu summary svg {
    width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2;
    transition: transform .18s ease;
  }
  .mobile-management-menu[open] summary svg { transform: rotate(180deg); }
  .mobile-management-menu nav {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 1060;
    display: grid; width: min(270px, calc(100vw - 28px)); padding: 7px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 38px rgba(15,23,42,.18);
  }
  .mobile-management-menu nav a {
    display: flex; align-items: center; min-height: 46px; padding: 9px 11px;
    border-radius: 8px; color: #334155; font-size: .8rem; font-weight: 700;
  }
  .mobile-management-menu nav a:hover, .mobile-management-menu nav a:focus-visible { background: var(--muted-bg); color: var(--primary-dark); }
  .app-main { padding: 18px 12px 26px; }
  .mobile-bottom-nav {
    position: fixed; inset: auto 0 0; z-index: 1040; display: grid; grid-template-columns: repeat(5, 1fr);
    min-height: calc(66px + env(safe-area-inset-bottom)); padding: 6px 5px env(safe-area-inset-bottom);
    border-top: 1px solid var(--border); background: rgba(255,255,255,.97); box-shadow: 0 -8px 24px rgba(15,23,42,.06);
  }
  .mobile-bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 44px; min-height: 52px; color: #64748b; font-size: 1.1rem;
  }
  .mobile-bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-bottom-nav small { font-size: .62rem; font-weight: 700; }
  .mobile-bottom-nav .mobile-add { transform: translateY(-18px); }
  .mobile-add span {
    display: grid; place-items: center; width: 52px; height: 52px; border: 5px solid var(--background);
    border-radius: 50%; background: var(--primary); color: white; box-shadow: 0 5px 14px rgba(37,99,235,.28);
  }
  .page-header { align-items: flex-start; margin-bottom: 16px; }
  .page-header .desktop-action { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-value { font-size: 1.25rem; }
  .toolbar { flex-wrap: wrap; padding: 9px; }
  .toolbar > * { flex: 1 1 140px; }
  .toolbar .btn { flex: 0 0 auto; }
  .card-body { padding: 14px; }
  .workorder-mobile-sort {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; padding: 10px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
  }
  .workorder-mobile-sort > span { width: 100%; color: var(--muted); font-size: .72rem; font-weight: 800; }
  .workorder-mobile-sort .sort-link {
    flex: 1 1 140px; border: 1px solid var(--border); background: var(--surface); font-size: .76rem;
  }
  .workorder-mobile-sort .sort-link.is-active { border-color: #93c5fd; background: #eff6ff; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tbody { display: grid; gap: 9px; }
  .data-table tr { padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; background: white; }
  .data-table td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 700; }
  .table-card { overflow: visible; border: 0; box-shadow: none; background: transparent; }
  .info-grid { grid-template-columns: 1fr; }
  .multi-checks { grid-template-columns: repeat(2, 1fr); }
  .reference-list { max-height: none; overflow: visible; }
  .form-actions { position: sticky; bottom: 73px; z-index: 10; margin: 0 -14px -14px; padding: 10px 14px; background: white; }
  .form-actions .btn { flex: 1; }
  .mobile-only { display: inline-flex; }
}
@media (max-width: 390px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .multi-checks { grid-template-columns: 1fr; }
  .page-title { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .aging-attention-panel.is-employee-alarm,
  .aging-attention-panel.is-employee-alarm::before { animation: none !important; transform: none !important; }
  .aging-attention-panel.is-employee-alarm::before { left: 0; width: 100%; }
}

.cursor-pointer, summary { cursor: pointer; }
.mobile-add span svg { width: 24px; height: 24px; stroke: white; }

.skip-link { position: fixed; top: -80px; right: 16px; z-index: 2000; padding: 10px 14px; border-radius: 8px; background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.mobile-bottom-nav a.active { color: var(--primary); }
.btn:disabled, button:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* The Jalali date-time picker is a touch-friendly bottom sheet on small screens. */
.persian-datetime-trigger { min-width: 104px; gap: 7px; border-color: var(--border); }
.persian-datetime-trigger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.persian-datetime-field > .form-control { min-width: 0; }
jdp-container {
  --jdp-day-size: 52px; --jdp-primary: var(--primary); --jdp-red: var(--danger);
  z-index: 1200; max-height: calc(100dvh - 16px); overflow-y: auto;
  border-radius: 12px; font-family: inherit;
}
jdp-overlay { z-index: 1199; }
jdp-container .jdp-day, jdp-container .jdp-day-name { min-height: 44px; line-height: 44px; }
jdp-container .jdp-icon-plus, jdp-container .jdp-icon-minus,
jdp-container .jdp-btn-today, jdp-container .jdp-btn-empty, jdp-container .jdp-btn-close,
jdp-container .jdp-time-container .jdp-time select { min-height: 44px; }
jdp-container .jdp-year select, jdp-container .jdp-month select { min-height: 44px; font-family: inherit; }
jdp-container .jdp-day:not(.disabled-day):hover { transform: none; }
@media (max-width: 481px) {
  jdp-overlay { background: rgba(15,23,42,.45); }
  jdp-container {
    --jdp-day-size: 50px; max-height: calc(100dvh - env(safe-area-inset-top) - 8px);
    padding-bottom: max(8px, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0;
  }
  jdp-container .jdp-footer { gap: 8px; margin: 4px 0; padding: 8px 12px 0; }
  jdp-container .jdp-btn-today, jdp-container .jdp-btn-empty, jdp-container .jdp-btn-close {
    display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 14px;
  }
  jdp-container .jdp-time-container .jdp-time select { font-size: 1rem; }
}
@media (max-width: 380px) {
  jdp-container { --jdp-day-size: 46px; }
  .persian-datetime-trigger { min-width: 52px; padding-inline: 12px; }
  .persian-datetime-trigger span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  jdp-container { animation: none !important; }
}
/* Select2 follows the application's RTL form controls and remains usable on touch screens. */
.select2-container { width: 100% !important; max-width: 100%; font-family: inherit; }
.select2-container--default .select2-selection--single {
  min-height: 46px; border: 1px solid #cbd5e1; border-radius: 10px; background: white;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 9px 12px 9px 38px; color: var(--foreground); line-height: 26px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--muted); }
.select2-container--default .select2-selection--single .select2-selection__arrow {
  right: auto; left: 10px; height: 44px;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
  float: left; min-width: 32px; min-height: 32px; margin: -3px 0 0 22px; color: var(--muted);
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.13);
}
.select2-container--default .select2-selection--multiple {
  min-height: 46px; padding: 3px 7px; border: 1px solid #cbd5e1; border-radius: 10px; background: white;
}
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.13);
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  min-height: 32px; margin-top: 3px; border-color: #bfdbfe; border-radius: 8px;
  background: #eff6ff; color: #1e3a8a; line-height: 30px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  min-height: 30px; color: #1d4ed8;
}
.select2-container .select2-search--inline .select2-search__field {
  min-height: 36px; margin: 0; font-family: inherit; line-height: 36px;
}
.select2-dropdown {
  overflow: hidden; border-color: #cbd5e1; border-radius: 10px; box-shadow: 0 14px 35px rgba(15,23,42,.14);
  font-family: inherit;
}
.select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field {
  min-height: 44px; padding: 8px 10px; border-color: #cbd5e1; border-radius: 8px; font-family: inherit;
}
.select2-container--default .select2-results__option {
  min-height: 44px; padding: 10px 12px;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--primary); color: white;
}
.select2-container--default .select2-results__option--selected { background: #dbeafe; color: #1e3a8a; }
.select2-results__message { color: var(--muted); }
.service-create-result { display: flex; align-items: center; gap: 6px; }
.service-create-result strong { color: #166534; }
.select2-results__option--highlighted .service-create-result strong { color: inherit; }
.service-category-status { min-height: 1.5em; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.service-category-status.is-loading { color: #1d4ed8; }
.service-category-status.is-success { color: #166534; }
.service-category-status.is-error { color: #b91c1c; }
/* General-manager work-order event log */
.log-count, .event-type {
  padding: 4px 8px; border-radius: 8px; background: #f1f5f9;
  color: #475569; font-size: .68rem; font-weight: 700;
}
.event-type { flex: 0 0 auto; }
.event-timeline::before { top: 12px; bottom: 20px; }
.event-timeline .event-item {
  margin-bottom: 8px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px;
}
.event-timeline .event-item:last-child { margin-bottom: 0; }
.event-timeline .event-item::before { content: none; }
.event-marker {
  position: absolute; top: 10px; right: -25px; z-index: 1;
  display: grid; place-items: center; width: 24px; height: 24px;
  border: 2px solid white; color: white; box-shadow: 0 0 0 2px #bfdbfe;
}
.event-marker svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.event-item--action {
  border-color: #dbeafe; border-inline-start: 3px solid #3b82f6; background: #f8fbff;
}
.event-item--action .event-marker { border-radius: 7px; background: #2563eb; }
.event-item--view { color: #475569; }
.event-item--view .event-marker {
  width: 22px; height: 22px; top: 11px; right: -24px;
  border-radius: 50%; background: #64748b; box-shadow: 0 0 0 2px #e2e8f0;
}
.event-item--view .event-marker svg { width: 13px; height: 13px; }
.event-type--action { background: #dbeafe; color: #1e40af; }
.event-type--view { background: #f1f5f9; color: #475569; }
.log-description {
  margin-top: 4px; color: #475569; font-size: .77rem; line-height: 1.75; white-space: pre-line;
}
.status-transition {
  display: flex; align-items: center; gap: 4px; margin-top: 7px; color: var(--muted); font-size: .68rem;
}
.status-transition svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transform: rotate(180deg);
}

.sidebar-nav .nav-link-label { min-width: 0; }
.nav-alert-badge {
  display: inline-grid; place-items: center; min-width: 27px; min-height: 25px; margin-inline-start: auto; padding: 2px 7px;
  border: 1px solid rgba(254, 243, 199, .35); border-radius: 999px;
  background: #f59e0b; color: #451a03; font-size: .68rem; font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mobile-bottom-nav a { position: relative; }
.mobile-nav-badge {
  position: absolute; top: 2px; inset-inline-start: calc(50% + 7px);
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border: 2px solid white; border-radius: 999px; background: #b45309; color: white;
  font-size: .58rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums;
}
.live-update-notice {
  position: fixed; z-index: 1100; top: 18px; inset-inline-end: 18px;
  display: flex; align-items: center; gap: 10px; max-width: min(410px, calc(100vw - 32px));
  padding: 12px 15px; border: 1px solid #93c5fd; border-radius: 13px;
  background: #eff6ff; color: #1e3a8a; box-shadow: 0 14px 35px rgba(15, 23, 42, .18);
  font-size: .78rem; line-height: 1.7; opacity: 0; pointer-events: none;
  transform: translateY(-10px); transition: opacity 180ms ease-out, transform 220ms ease-out;
}
.live-update-notice.is-visible { opacity: 1; transform: translateY(0); }
.live-update-notice svg {
  width: 24px; height: 24px; flex: 0 0 24px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
@media (max-width: 767.98px) {
  .live-update-notice { top: 12px; inset-inline: 12px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .live-update-notice { transition: none; transform: none; }
}
