/* أوم المتحدة — تصميم فاتح · Minimal */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e4e9f0;
  --border-soft: #eef2f7;
  --text: #1a2b3c;
  --text-muted: #64748b;
  --primary: #3d7eb8;
  --primary-soft: #e8f2fa;
  --primary-hover: #2f6a9e;
  --accent: #c9a45c;
  --accent-soft: #faf6ed;
  --success: #0d9488;
  --success-soft: #e6f7f5;
  --warning: #d97706;
  --warning-soft: #fef3e2;
  --danger: #dc5c4a;
  --danger-soft: #fdeeed;
  --shadow-sm: 0 1px 3px rgba(26, 43, 60, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 43, 60, 0.08);
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 268px;
  --font: "Cairo", "Tajawal", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

body.lang-en {
  direction: ltr;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

body.lang-en .sidebar {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-bottom: 1.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.brand-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.brand-tagline {
  margin: 0.2rem 0 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

body.lang-en .nav-item.active {
  box-shadow: inset -3px 0 0 var(--primary);
}

.nav-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.9;
}

.nav-item-text {
  flex: 1;
  text-align: inherit;
}

.nav-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--danger, #dc2626);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}

.expiring-contracts-table .alert-mark-cell {
  width: 2rem;
  text-align: center;
}

.payment-alert-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--danger, #dc2626);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
  vertical-align: middle;
}

.data-table tr.row-payment-alert {
  background: rgba(220, 38, 38, 0.06);
}

.data-table tr.row-payment-alert td {
  border-color: rgba(220, 38, 38, 0.12);
}

body:not(.lang-en) .data-table tr.row-payment-alert td:first-child {
  box-shadow: inset 3px 0 0 var(--danger, #dc2626);
}

body.lang-en .data-table tr.row-payment-alert td:first-child {
  box-shadow: inset -3px 0 0 var(--danger, #dc2626);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

/* Main */
.main {
  flex: 1;
  margin-right: var(--sidebar-w);
  padding: 1.25rem 1.75rem 2.5rem;
  min-width: 0;
}

body.lang-en .main {
  margin-right: 0;
  margin-left: var(--sidebar-w);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.topbar-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.date-badge {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.view {
  display: none;
  animation: fadeIn 0.25s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.section-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.section-tab:active {
  transform: scale(0.98);
}

.section-tab.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary);
}

.badge-pending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-inline-start: -0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  border-radius: 999px;
}

.field-static {
  margin: 0;
  padding: 0.55rem 0;
  font-weight: 600;
  color: var(--text);
}

.approval-pending {
  color: var(--warning);
  font-weight: 600;
}
.approval-approved {
  color: var(--success);
  font-weight: 600;
}
.approval-rejected {
  color: var(--danger);
  font-weight: 600;
}

.rental-info-block {
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

.rental-info-block strong {
  color: var(--primary);
}

/* Stats & KPI dashboard */
.kpi-board {
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.kpi-board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.kpi-board-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.kpi-board-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kpi-board-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.kpi-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  border-radius: 999px;
}

.kpi-live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--success);
  animation: kpi-pulse 1.8s ease-in-out infinite;
}

@keyframes kpi-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

.kpi-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.kpi-section {
  margin-bottom: 1.15rem;
}

.kpi-section:last-child {
  margin-bottom: 0;
}

.kpi-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.stat-sub {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
}

.stat-card.kpi-alert {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  background: color-mix(in srgb, var(--danger) 4%, var(--surface));
}

.stat-card.kpi-alert .stat-value {
  color: var(--danger);
}

.ct-kind-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ct-kind-tabs .btn.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary);
}

.panel-head-split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ct-template-editor {
  width: 100%;
  min-height: 320px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.ct-simple-editor {
  white-space: pre-wrap;
}

.ct-token-toolbar {
  margin: 0.5rem 0 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ct-token-toolbar-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.ct-token-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ct-token-btn {
  font-size: 0.78rem !important;
  padding: 0.2rem 0.55rem !important;
}

.ct-preview-wrap {
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ct-preview-inner {
  direction: rtl;
  text-align: right;
  color: #000;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 5.25rem;
  padding: 1.1rem 1.15rem;
  text-align: inherit;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.stat-card.clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.stat-card.clickable:active {
  transform: translateY(0) scale(0.98);
}

.stat-card.clickable:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.stat-card.clickable::after {
  content: "↗";
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

body.lang-en .stat-card.clickable::after {
  left: auto;
  right: 0.75rem;
}

.stat-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-value {
  margin: 0.25rem 0 0;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.stat-card.accent-primary .stat-value {
  color: var(--primary);
}
.stat-card.accent-success .stat-value {
  color: var(--success);
}
.stat-card.accent-warning .stat-value {
  color: var(--warning);
}
.stat-card.accent-danger .stat-value {
  color: var(--danger);
}
.stat-card.accent-gold .stat-value {
  color: var(--accent);
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}

.panel-flat .panel-body,
.panel-flat {
  padding: 0;
}

.panel-head {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}

.panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.panel-body {
  padding: 1rem 1.15rem;
}

.panel-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.form-panel {
  padding: 1.25rem;
}

.panels-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-subhint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
}

.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.summary-chip {
  flex: 1;
  min-width: 120px;
  min-height: 4.5rem;
  padding: 0.85rem;
  text-align: center;
  font-family: inherit;
  color: inherit;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}

.summary-chip.clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.summary-chip.clickable:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.summary-chip strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.summary-chip span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.maint-analytics {
  margin-bottom: 1rem;
}

.maint-an-chips {
  margin-bottom: 1rem;
}

.maint-an-chip.warn strong {
  color: var(--warning, #b8860b);
}

.maint-an-chip.danger strong {
  color: var(--danger, #c0392b);
}

.maint-an-chip.gold strong {
  color: var(--gold, #c9a227);
}

.maint-an-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.maint-an-block {
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.maint-an-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.maint-an-steps {
  margin: 0;
  padding-inline-start: 1.2rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.maint-an-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.maint-an-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--border);
}

.maint-an-stat strong {
  font-size: 1.4rem;
  color: var(--primary, #2072b8);
}

.maint-an-subtitle {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.maint-an-table {
  font-size: 0.85rem;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
}

.search-input {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 0.95rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.filter-tab:active {
  transform: scale(0.98);
}

.filter-tab.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--primary-soft);
}

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-sm {
  min-height: 38px;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
}

.actions-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.actions-stack .btn {
  flex: 0 1 auto;
}

.btn-danger {
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
}

.panel-flat > .table-wrap {
  border: none;
  border-radius: 0;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 0.72rem 1rem;
  text-align: right;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

body.lang-en .data-table th,
body.lang-en .data-table td {
  text-align: left;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  background: var(--surface-2);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:nth-child(even):not(.empty-row) {
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
}

.data-table tbody tr:hover:not(.empty-row) {
  background: var(--surface-2);
}

.data-table tbody tr.row-open {
  cursor: pointer;
}

.data-table tbody tr.row-open:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.data-table tbody tr.row-open td:first-child {
  font-weight: 600;
}

.data-table tbody tr.row-open td:last-child::after {
  content: "‹";
  float: left;
  color: var(--text-muted);
  opacity: 0.45;
  font-size: 1.1rem;
  line-height: 1;
}

body.lang-en .data-table tbody tr.row-open td:last-child::after {
  content: "›";
  float: right;
}

.data-table .empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

.table-hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.profile-audit-meta {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  border: 1px solid var(--border-soft);
}

.profile-audit-meta h4 {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-toolbar,
.gen-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.modal-foot.profile-toolbar-foot {
  justify-content: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
}

.badge-available {
  color: var(--success);
  background: var(--success-soft);
}
.badge-rented {
  color: var(--primary);
  background: var(--primary-soft);
}
.badge-maintenance {
  color: var(--warning);
  background: var(--warning-soft);
}
.badge-disabled {
  color: var(--danger);
  background: var(--danger-soft);
}
.badge-sold {
  color: var(--text-muted);
  background: var(--border-soft);
}
.badge-periodic {
  color: var(--primary);
  background: var(--primary-soft);
}
.badge-emergency {
  color: var(--danger);
  background: var(--danger-soft);
}
.badge-in_use {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-select {
  min-width: 7rem;
  padding: 0.3rem 0.5rem;
  font-family: inherit;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.readonly-block {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--primary-soft);
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}

.info-box {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.rented-only.hidden {
  display: none;
}

.empty-msg {
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

/* Modal */
.modal {
  width: min(520px, 94vw);
  max-width: 94vw;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: transparent;
}

.modal.modal-wide,
.modal:has(> .modal-box-wide),
.modal:has(> .modal-box.modal-wide),
.modal:has(> form > .modal-box-wide) {
  width: min(96vw, 1100px);
  max-width: 1100px;
}

.modal.modal-md {
  width: min(720px, 94vw);
  max-width: 720px;
}

.modal.modal-sm,
.modal:has(> .modal-box-sm),
.modal:has(> form > .modal-box-sm) {
  width: min(440px, 94vw);
  max-width: 440px;
}

.modal.command-palette {
  width: min(560px, 94vw);
  max-width: 560px;
}

.modal .modal-box,
.modal form.modal-box {
  width: 100%;
}

.modal::backdrop {
  background: rgba(26, 43, 60, 0.35);
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}

.modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--surface-2);
}

.modal-body {
  padding: 1rem 1.25rem;
  max-height: 60vh;
  overflow: auto;
}

.modal.modal-wide .modal-body,
.modal:has(> .modal-box-wide) .modal-body,
.modal:has(> form > .modal-box-wide) .modal-body {
  max-height: min(85vh, 720px);
}

.modal.modal-md .modal-body {
  max-height: min(80vh, 640px);
}

.modal-form {
  padding: 1rem 1.25rem;
}

.modal-foot {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 300;
  padding: 0.75rem 1.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 110;
  width: 48px;
  height: 48px;
  font-size: 1.35rem;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  place-items: center;
}

body.lang-en .menu-toggle {
  left: auto;
  right: 1rem;
}

@media (max-width: 900px) {
  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .sidebar {
    transform: translateX(100%);
  }

  body.lang-en .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    width: 100%;
    max-width: 100%;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(26, 43, 60, 0.4);
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .main {
    margin: 0;
    padding: 4rem 1rem 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.badge-success {
  color: var(--success);
  background: var(--success-soft);
}

.badge-warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge-danger {
  color: var(--danger);
  background: rgba(229, 65, 37, 0.12);
}

.report-print-panel {
  margin-top: 1rem;
}

.report-sheet-wrap {
  overflow-x: auto;
}

.report-sheet-table {
  min-width: 1100px;
  font-size: 0.78rem;
}

.report-sheet-table th,
.report-sheet-table td {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  padding: 0.45rem 0.35rem;
}

.report-sheet-table th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.report-sheet-table tbody tr:nth-child(even) {
  background: var(--surface-alt, #f8fafc);
}

@media print {
  body * {
    visibility: hidden;
  }

  .report-print-panel,
  .report-print-panel * {
    visibility: visible;
  }

  .report-print-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .report-sheet-table {
    min-width: 0;
    width: 100%;
    font-size: 9pt;
  }
}

.form-section-title {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  border-right: 3px solid var(--primary);
  padding-right: 0.65rem;
}

.field-hint {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.formal-report-preview {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.formal-report-doc {
  direction: rtl;
  text-align: right;
  color: #111;
  background: #fff;
  max-width: 210mm;
  margin: 0 auto;
}

.formal-report-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 3px solid #2072b8;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.formal-report-header img {
  object-fit: contain;
  flex-shrink: 0;
}

.formal-report-header h1 {
  margin: 0;
  color: #2072b8;
  font-size: 1.35rem;
  font-weight: 700;
}

.formal-report-header p {
  margin: 4px 0 0;
  color: #666;
  font-size: 0.8rem;
}

.formal-report-title {
  text-align: center;
  color: #1a1a1a;
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 700;
  border: 2px solid #2072b8;
  padding: 10px;
  background: #f8fafc;
}

.formal-report-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  font-size: 0.75rem;
  color: #666;
  text-align: center;
}

.formal-report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 14px;
  direction: rtl;
}

.formal-report-table caption {
  caption-side: top;
  text-align: right;
  font-weight: 700;
  font-size: 0.9rem;
  color: #2072b8;
  padding: 8px 10px;
  background: #eef6fc;
  border: 1px solid #2072b8;
  border-bottom: none;
}

.formal-report-table th,
.formal-report-table td {
  border: 1px solid #bbb;
  padding: 8px 10px;
  text-align: right;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.55;
  font-size: 0.85rem;
}

.formal-report-table th {
  width: 30%;
  background: #f3f6f9;
  font-weight: 700;
  color: #1a2b3c;
}

.formal-report-table td {
  background: #fff;
}

@media print {
  .formal-report-preview {
    border: none;
    padding: 0;
    overflow: visible;
  }

  .formal-report-doc {
    width: 100%;
    max-width: none;
  }

  .formal-report-table th,
  .formal-report-table td {
    font-size: 10pt;
    page-break-inside: avoid;
  }
}

/* ERP login & navigation */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(145deg, #e8f2fa 0%, var(--bg) 45%, #faf6ed 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.75rem;
  text-align: center;
}

.login-logo {
  margin: 0 auto 1rem;
  object-fit: contain;
}

.login-title {
  margin: 0;
  font-size: 1.35rem;
  color: var(--primary);
}

.login-subtitle {
  margin: 0.35rem 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-form {
  text-align: right;
}

.login-form .field {
  margin-bottom: 0.85rem;
}

.login-error {
  min-height: 1.25rem;
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.login-hint {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.session-user {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.nav-group {
  margin-bottom: 0.75rem;
}

.nav-group-label {
  margin: 0.5rem 0.35rem 0.25rem;
  padding: 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.erp-loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

body.lang-en .login-form {
  text-align: left;
}

.hidden-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.session-role {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.command-trigger {
  font-family: inherit;
}

.command-palette::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.command-palette {
  border: none;
  padding: 0;
  max-width: min(520px, 92vw);
  width: 100%;
  background: transparent;
  margin: 12vh auto auto;
}

.command-palette-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.command-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.1rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.command-search:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary-soft);
}

.command-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: 50vh;
  overflow-y: auto;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  transition: background 0.12s;
}

.command-item:hover,
.command-item.active {
  background: var(--primary-soft);
}

.command-icon {
  width: 1.75rem;
  text-align: center;
  opacity: 0.85;
}

.command-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: right;
}

.command-text strong {
  font-weight: 600;
  font-size: 0.95rem;
}

.command-text small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.command-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
}

.command-footer {
  margin: 0;
  padding: 0.55rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  text-align: center;
}

.shortcuts-table kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  font-family: inherit;
}

.modal-box-sm {
  max-width: 420px;
}

body.lang-en .command-text {
  text-align: left;
}

.field-link-btn {
  margin-top: 0.35rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
}

.note-cell {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.customer-readonly-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}

.customer-readonly-block input[readonly] {
  background: transparent;
  border-color: transparent;
}

.equipment-line-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
}

.equipment-line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.eq-accessories-wrap label {
  display: block;
  margin-bottom: 0.35rem;
}

.accessory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.accessory-chips label {
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.contract-total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.gen-profile-body {
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.gen-profile-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.gen-profile-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.gen-profile-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.gen-profile-actions {
  margin: 0.5rem 0 0;
}

.data-table-compact th,
.data-table-compact td {
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
}

.contract-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.contract-detail-grid dt {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.contract-detail-grid dd {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.mo-lines-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.mo-line-row {
  display: grid;
  grid-template-columns: 1fr 5rem 6rem auto;
  gap: 0.35rem;
  align-items: center;
}

.mo-work-row.mo-line-row {
  grid-template-columns: 1fr auto;
}

.mo-labor-row.mo-line-row {
  grid-template-columns: 1fr 5rem 6rem auto;
}

.mo-alert-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mo-alert-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pm-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 1rem;
  margin-top: 0.35rem;
}

.pm-items-grid .pm-select-all {
  grid-column: 1 / -1;
  font-weight: 600;
}

#pmOtherText {
  margin-top: 0.5rem;
}

#pmOtherText.hidden {
  display: none;
}

.data-table tr.row-due-soon {
  background: color-mix(in srgb, var(--warning, #f59e0b) 12%, transparent);
}

.data-table-pm tbody tr {
  background: transparent;
}

.data-table-pm tbody tr:hover {
  background: color-mix(in srgb, var(--primary, #2563eb) 6%, transparent);
}

.data-table tr.row-clickable {
  cursor: pointer;
}

.badge-pm-overdue {
  background: #dc2626;
  color: #fff;
  font-weight: 600;
}

.input-readonly {
  background: color-mix(in srgb, var(--border, #e5e7eb) 35%, var(--surface, #fff));
  color: var(--text, #111);
  cursor: not-allowed;
}

.visit-extra-emp-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.visit-extra-emp-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.visit-extra-emp-row select {
  flex: 1;
}

.maint-activity-panel {
  margin-top: 1.25rem;
}

.maint-activity-more {
  margin-top: 0.75rem;
  text-align: center;
}

.visit-pm-previous {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary, #2563eb) 6%, transparent);
}

.pm-current-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.35rem 0 0.75rem;
}

.pm-current-type-grid .radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.reg-type-section.hidden {
  display: none;
}

.mo-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.mo-thumb {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.doc-photo-btn {
  position: relative;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: 8px;
  line-height: 0;
}

.doc-photo-btn:hover .mo-thumb,
.doc-photo-btn:focus-visible .mo-thumb {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 37, 99, 235), 0.25);
}

.doc-photo-open-hint {
  position: absolute;
  inset-inline-end: 4px;
  inset-block-end: 4px;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 4px;
  padding: 0.1rem 0.25rem;
  pointer-events: none;
}

.doc-file-preview {
  margin-top: 0.5rem;
}

.doc-photo-preview-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
}

.doc-photo-preview-card .doc-photo-delete {
  margin-bottom: 0.15rem;
}

.doc-photo-viewer-body {
  text-align: center;
  padding: 0.5rem 0 1rem;
  overflow: auto;
}

.doc-photo-viewer-body img {
  max-width: 100%;
  max-height: min(72vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.mo-reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

#maintSectionTabs {
  flex-wrap: wrap;
}

.nav-badge-warning {
  background: var(--warning);
  color: #fff;
}

.veh-doc-sub {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.9rem;
}

.veh-doc-panel + .veh-doc-panel {
  margin-top: 1rem;
}

.pm-alerts-panel {
  margin-top: 1rem;
}

.pm-alerts-panel .toolbar {
  margin-bottom: 0.35rem;
}

.pm-schedule-panel {
  margin-top: 1rem;
}

.pm-schedule-panel .toolbar {
  margin-bottom: 0.35rem;
}

.maint-export-toolbar {
  margin-bottom: 0.5rem;
  justify-content: flex-start;
  gap: 0.5rem;
}

.mo-photo-preview-grid {
  margin-top: 0.5rem;
}

.mo-photo-preview-grid:empty {
  display: none;
}

.visit-pm-due-block {
  padding: 0.75rem 1rem;
  border-radius: var(--radius, 8px);
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
}

.visit-site-access {
  padding: 0.75rem 1rem;
  border-radius: var(--radius, 8px);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
}

.link-external,
.link-tel {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.link-external:hover,
.link-tel:hover {
  color: var(--primary-dark, #1a5f9e);
}

.pm-board-chips .summary-chip-val {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.pm-board-chips .summary-chip-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.employee-vehicle-block {
  margin-top: 0.5rem;
}

.veh-history-wrap {
  margin-top: 0.35rem;
}

.veh-history-table th {
  font-size: 0.82rem;
}

.veh-history-table td {
  vertical-align: top;
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.veh-history-date,
.veh-history-by {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.veh-history-type {
  white-space: nowrap;
  width: 1%;
}

.veh-history-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2, rgba(0, 0, 0, 0.06));
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.veh-history-notes {
  min-width: 240px;
}

.veh-history-details {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.veh-history-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
}

.veh-history-label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.veh-history-label::after {
  content: ":";
  margin-inline-start: 0.1rem;
}

.veh-history-value {
  color: var(--text);
  font-size: 0.9rem;
  word-break: break-word;
}

.veh-history-empty {
  color: var(--text-muted);
}

.emp-form-body {
  max-height: min(62vh, 560px);
  overflow-y: auto;
  padding: 0.25rem 0;
}

.emp-form-tabs {
  margin: 0 1rem;
  flex-wrap: wrap;
}

.emp-form-panel .page-hint {
  margin: 0 0 0.75rem;
}

/* Users & permissions */
.perm-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt, var(--surface));
}

.perm-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.perm-check input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.perm-check-full {
  font-weight: 600;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.perm-hint {
  margin: 0;
  font-size: 0.78rem;
}

.perm-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.perm-group-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.35rem 0.75rem;
}

.perm-groups-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.alert-warning {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: var(--text);
}

#forcePasswordModal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.self-edit-mode input:disabled,
.self-edit-mode select:disabled,
.self-edit-mode textarea:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  background: var(--surface-alt, #f4f5f7);
}

.invoice-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
