/* Autovion Admin — Day / Light Glass */
:root {
  --ah-primary: #d21f26;
  --ah-primary-dark: #9a151a;
  --ah-chrome: #6b7280;
  --ah-bg: #f4f5f7;
  --ah-surface: #ffffff;
  --ah-elevated: #ffffff;
  --ah-border: rgba(18, 20, 26, 0.1);
  --ah-text: #12141a;
  --ah-muted: #5f6775;
  --ah-success: #1f9d4d;
  --ah-warning: #c79100;
  --ah-info: #0a7ea4;
  --ah-sidebar: 280px;
  --ah-radius: 18px;
  --ah-font: "IBM Plex Sans Arabic", "Outfit", system-ui, sans-serif;
  --ah-display: "Outfit", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --ah-watermark: url("/images/branding/autovion-watermark.png");
  --ah-watermark-opacity: 0.05;
  --ah-watermark-blend: multiply;
}

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

html, body {
  min-height: 100%;
  margin: 0;
  background: var(--ah-bg);
  color: var(--ah-text);
  font-family: var(--ah-font);
}

body.ah-admin {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 60% 40% at 0% 0%, rgba(210, 31, 38, 0.1), transparent 55%),
    radial-gradient(ellipse 45% 35% at 100% 100%, rgba(107, 114, 128, 0.08), transparent 50%),
    var(--ah-bg);
}

body.ah-admin::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--ah-watermark);
  background-repeat: no-repeat;
  background-position: center 48%;
  background-size: min(980px, 80vw) auto;
  opacity: var(--ah-watermark-opacity);
  mix-blend-mode: var(--ah-watermark-blend);
  mask-image: radial-gradient(ellipse 65% 50% at 55% 48%, #000 15%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 65% 50% at 55% 48%, #000 15%, transparent 75%);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--ah-chrome); }

.ah-shell {
  display: grid;
  grid-template-columns: var(--ah-sidebar) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.ah-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem 1rem;
  border-inline-end: 1px solid var(--ah-border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 10px 30px rgba(18, 20, 26, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  z-index: 30;
}

.ah-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.65rem;
}

.ah-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(210, 31, 38, 0.35));
}

.ah-brand__text strong {
  display: block;
  font-family: var(--ah-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.ah-brand__text span {
  color: var(--ah-muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ah-nav-label {
  color: var(--ah-muted);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem 0.35rem;
}

.ah-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  color: var(--ah-muted);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ah-nav a:hover {
  background: rgba(18, 20, 26, 0.04);
  color: var(--ah-text);
  transform: translateX(2px);
}

[dir="rtl"] .ah-nav a:hover { transform: translateX(-2px); }

.ah-nav a.active {
  background: linear-gradient(135deg, rgba(210, 31, 38, 0.16), rgba(210, 31, 38, 0.06));
  color: var(--ah-primary);
  box-shadow: inset 0 0 0 1px rgba(210, 31, 38, 0.28);
}

.ah-nav a .ah-ico {
  width: 1.35rem;
  text-align: center;
  opacity: 0.9;
}

.ah-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ah-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ah-border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 6px 20px rgba(18, 20, 26, 0.05);
}

.ah-topbar h1 {
  margin: 0;
  font-family: var(--ah-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.ah-topbar p {
  margin: 0.15rem 0 0;
  color: var(--ah-muted);
  font-size: 0.85rem;
}

.ah-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ah-content {
  padding: 1.5rem;
}

.ah-glass {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(18, 20, 26, 0.08);
}

.ah-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ah-kpi {
  padding: 1.15rem 1.2rem;
  position: relative;
  overflow: hidden;
  animation: ah-rise 0.55s ease both;
}

.ah-kpi:nth-child(2) { animation-delay: 0.05s; }
.ah-kpi:nth-child(3) { animation-delay: 0.1s; }
.ah-kpi:nth-child(4) { animation-delay: 0.15s; }

.ah-kpi::after {
  content: "";
  position: absolute;
  inset-inline-end: -20px;
  top: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(210, 31, 38, 0.2), transparent 70%);
  pointer-events: none;
}

.ah-kpi__label {
  color: var(--ah-muted);
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}

.ah-kpi__value {
  font-family: var(--ah-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ah-kpi__hint {
  margin-top: 0.35rem;
  color: var(--ah-chrome);
  font-size: 0.78rem;
}

.ah-panel {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
  animation: ah-rise 0.6s ease both;
}

.ah-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ah-panel__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--ah-display);
}

.ah-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 12px;
  padding: 0.55rem 0.95rem;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ah-btn:hover { transform: translateY(-1px); }

.ah-btn-primary {
  background: linear-gradient(135deg, var(--ah-primary), var(--ah-primary-dark));
  color: #fff;
  box-shadow: 0 8px 22px rgba(210, 31, 38, 0.35);
}

.ah-btn-ghost {
  background: rgba(18, 20, 26, 0.04);
  color: var(--ah-chrome);
  border: 1px solid var(--ah-border);
}

.ah-table-wrap { overflow-x: auto; }

.ah-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ah-table th,
.ah-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--ah-border);
  text-align: start;
  white-space: nowrap;
}

.ah-table th {
  color: var(--ah-muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ah-table tbody tr {
  transition: background 0.15s ease;
}

.ah-table tbody tr:hover {
  background: rgba(18, 20, 26, 0.03);
}

.ah-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ah-badge-success { background: rgba(48, 209, 88, 0.15); color: var(--ah-success); }
.ah-badge-warning { background: rgba(255, 214, 10, 0.15); color: var(--ah-warning); }
.ah-badge-danger { background: rgba(210, 31, 38, 0.12); color: var(--ah-primary); }
.ah-badge-info { background: rgba(10, 126, 164, 0.12); color: var(--ah-info); }
.ah-badge-muted { background: rgba(95, 103, 117, 0.12); color: var(--ah-muted); }

.ah-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--ah-border);
  background: rgba(18, 20, 26, 0.04);
}

.ah-lang-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  color: var(--ah-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.ah-lang-switch__btn:hover {
  color: var(--ah-text);
}

.ah-lang-switch__btn.is-active {
  background: linear-gradient(135deg, var(--ah-primary), var(--ah-primary-dark, #9a151a));
  color: #fff;
}

.ah-theme-switch .ah-lang-switch__btn {
  min-width: 2.2rem;
  min-height: 2.2rem;
  padding: 0.35rem;
}

.ah-theme-switch .ah-lang-switch__btn svg {
  display: block;
}

.ah-chart-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.ah-chart-box {
  position: relative;
  min-height: 280px;
}

.ah-empty {
  color: var(--ah-muted);
  text-align: center;
  padding: 2rem 1rem;
}

.ah-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ah-filters .form-control,
.ah-filters .form-select {
  background: #fff;
  border: 1px solid var(--ah-border);
  color: var(--ah-text);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
}

.ah-filters .form-control:focus,
.ah-filters .form-select:focus {
  background: #fff;
  border-color: rgba(210, 31, 38, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(210, 31, 38, 0.12);
  color: var(--ah-text);
}

.ah-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ah-border);
  color: var(--ah-text);
  border-radius: 10px;
  width: 42px;
  height: 42px;
}

@keyframes ah-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .ah-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ah-chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .ah-shell { grid-template-columns: 1fr; }
  .ah-sidebar {
    position: fixed;
    inset-inline-start: 0;
    transform: translateX(-105%);
    width: min(86vw, 300px);
    transition: transform 0.25s ease;
  }
  [dir="rtl"] .ah-sidebar { transform: translateX(105%); }
  body.ah-sidebar-open .ah-sidebar { transform: translateX(0); }
  .ah-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
}

/* Night / Dark theme */
html[data-theme="dark"] {
  --ah-chrome: #c0c0c0;
  --ah-bg: #070708;
  --ah-surface: #121216;
  --ah-elevated: #1a1a20;
  --ah-border: rgba(192, 192, 192, 0.12);
  --ah-text: #f5f5f7;
  --ah-muted: #8e8e93;
  --ah-success: #30d158;
  --ah-warning: #ffd60a;
  --ah-info: #64d2ff;
  --ah-watermark-opacity: 0.14;
  --ah-watermark-blend: screen;
}

html[data-theme="dark"] body.ah-admin {
  background:
    radial-gradient(ellipse 60% 40% at 0% 0%, rgba(210, 31, 38, 0.18), transparent 55%),
    radial-gradient(ellipse 45% 35% at 100% 100%, rgba(192, 192, 192, 0.06), transparent 50%),
    var(--ah-bg);
}

html[data-theme="dark"] body.ah-admin::before {
  filter: saturate(1.08) brightness(1.08);
}

html[data-theme="dark"] .ah-sidebar {
  background: rgba(12, 12, 16, 0.88);
  box-shadow: none;
}

html[data-theme="dark"] .ah-nav a:hover {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .ah-nav a.active {
  background: linear-gradient(135deg, rgba(210, 31, 38, 0.28), rgba(210, 31, 38, 0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(210, 31, 38, 0.35);
}

html[data-theme="dark"] .ah-topbar {
  background: rgba(10, 10, 12, 0.72);
  box-shadow: none;
}

html[data-theme="dark"] .ah-glass {
  background: rgba(26, 26, 32, 0.72);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .ah-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .ah-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .ah-lang-switch {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .ah-filters .form-control,
html[data-theme="dark"] .ah-filters .form-select {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .ah-filters .form-control:focus,
html[data-theme="dark"] .ah-filters .form-select:focus {
  background: rgba(255, 255, 255, 0.05);
}

/* HR forms & modals */
.ah-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.ah-form-grid .ah-span-2 { grid-column: span 2; }

.ah-form-grid label {
  display: block;
  font-size: 0.78rem;
  color: var(--ah-muted);
  margin-bottom: 0.3rem;
}

.ah-form-grid .form-control,
.ah-form-grid .form-select {
  border-radius: 10px;
  border: 1px solid var(--ah-border);
  background: #fff;
  color: var(--ah-text);
}

.ah-modal-xl .modal-dialog { max-width: 920px; }

/* Keep Bootstrap modals above admin shell/sidebar stacking contexts */
body.ah-admin .modal {
  z-index: 1085;
}
body.ah-admin .modal-backdrop {
  z-index: 1080;
}
body.ah-admin .modal .modal-content {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

/* Vehicle create modal — structured intake form */
.ah-vcreate-dialog {
  max-width: 980px;
}

.ah-vcreate {
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(18, 20, 26, 0.22);
}

.ah-vcreate__header {
  align-items: flex-start;
  padding: 1.35rem 1.5rem 1.1rem;
  border-bottom: 1px solid rgba(18, 20, 26, 0.08);
  background:
    linear-gradient(135deg, rgba(210, 31, 38, 0.06), transparent 55%),
    #fff;
}

.ah-vcreate__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ah-primary);
  font-weight: 600;
}

.ah-vcreate__header .modal-title {
  font-family: var(--ah-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.ah-vcreate__body {
  padding: 1.15rem 1.5rem 0.5rem;
  background: #f7f8fa;
}

.ah-vcreate__section {
  background: #fff;
  border: 1px solid rgba(18, 20, 26, 0.08);
  border-radius: 16px;
  padding: 1.1rem 1.15rem 1.2rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 8px 24px rgba(18, 20, 26, 0.04);
}

.ah-vcreate__section--last {
  margin-bottom: 0.35rem;
}

.ah-vcreate__section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ah-vcreate__step {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(210, 31, 38, 0.1);
  color: var(--ah-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.ah-vcreate__section-head h6 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.ah-vcreate__section-head p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ah-muted);
}

.ah-vcreate__grid {
  display: grid;
  gap: 0.85rem 1rem;
}

.ah-vcreate__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ah-vcreate__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ah-vcreate__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.ah-vcreate__grid .ah-span-2 { grid-column: span 2; }

.ah-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #3d4450;
  margin-bottom: 0.35rem;
}

.ah-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ah-field__label-row label { margin-bottom: 0; }

.ah-field .form-control,
.ah-field .form-select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(18, 20, 26, 0.12);
  background: #fff;
  box-shadow: none;
  font-size: 0.92rem;
}

.ah-field .form-control:focus,
.ah-field .form-select:focus {
  border-color: rgba(210, 31, 38, 0.45);
  box-shadow: 0 0 0 3px rgba(210, 31, 38, 0.12);
}

.ah-input-affix {
  position: relative;
}

.ah-input-affix input {
  padding-inline-end: 3.4rem;
}

.ah-input-affix span {
  position: absolute;
  inset-inline-end: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ah-muted);
  pointer-events: none;
  transition: top 0.15s ease, transform 0.15s ease, font-size 0.15s ease;
}

/* When price/amount is entered, move currency label above the field */
.ah-input-affix.is-filled input {
  padding-inline-end: 0.9rem;
}

.ah-input-affix.is-filled span {
  top: -1.35rem;
  transform: none;
  inset-inline-end: 0;
  font-size: 0.72rem;
}

.ah-link-btn {
  border: 0;
  background: transparent;
  color: var(--ah-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.ah-link-btn:hover { color: var(--ah-primary-dark); }

.ah-inline-panel {
  margin-top: 0.65rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px dashed rgba(18, 20, 26, 0.16);
  background: #fafbfc;
}

.ah-brand-preview {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
  min-height: 1.25rem;
}

.ah-brand-preview img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(18, 20, 26, 0.1);
  border-radius: 8px;
  padding: 2px;
}

.ah-vcreate__footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid rgba(18, 20, 26, 0.08);
  background: #fff;
  gap: 0.65rem;
}

.ah-vcreate__next {
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

html[dir="rtl"] .ah-vcreate__next span {
  transform: scaleX(-1);
}

.ah-wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ah-wizard-step {
  flex: 1;
  min-width: 5.5rem;
  text-align: center;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
}

.ah-wizard-step.is-active {
  color: #111827;
  background: #dbeafe;
}

@media (max-width: 992px) {
  .ah-vcreate__grid--3,
  .ah-vcreate__grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ah-vcreate__grid--2,
  .ah-vcreate__grid--3,
  .ah-vcreate__grid--4 {
    grid-template-columns: 1fr;
  }

  .ah-vcreate__grid .ah-span-2 { grid-column: span 1; }

  .ah-vcreate__body,
  .ah-vcreate__header,
  .ah-vcreate__footer {
    padding-inline: 1rem;
  }
}

.ah-emp-photo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(210, 31, 38, 0.08);
}

.ah-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ah-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ah-subnav a {
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--ah-border);
  color: var(--ah-text);
  font-size: 0.85rem;
  background: rgba(255,255,255,0.55);
}

.ah-subnav a.active,
.ah-subnav a:hover {
  border-color: rgba(210, 31, 38, 0.45);
  color: #d21f26;
}

.ah-print {
  max-width: 800px;
  margin: 1.5rem auto;
  background: #fff;
  color: #111;
  padding: 2rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.ah-print h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.ah-print table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.ah-print th, .ah-print td { border: 1px solid #ddd; padding: 0.5rem; text-align: start; }

@media (max-width: 768px) {
  .ah-form-grid { grid-template-columns: 1fr; }
  .ah-form-grid .ah-span-2 { grid-column: span 1; }
}

/* Vehicle File (lifecycle) */
.ah-vfile-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.ah-vfile-hero__media {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--ah-border);
  background: rgba(0,0,0,0.2);
  min-height: 160px;
}

.ah-vfile-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 160px;
}

.ah-vfile-hero__media--empty {
  display: grid;
  place-items: center;
  color: var(--ah-muted, #8a8f98);
  font-size: 0.85rem;
}

.ah-vfile-hero__meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

.ah-vfile-hero__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.ah-vfile-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.ah-vfile-kpi {
  border: 1px solid var(--ah-border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(255,255,255,0.04);
}

.ah-vfile-kpi span {
  display: block;
  font-size: 0.72rem;
  color: var(--ah-muted, #8a8f98);
  margin-bottom: 0.2rem;
}

.ah-vfile-kpi strong {
  font-size: 0.95rem;
}

.ah-vfile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ah-vfile-tabs.nav-tabs {
  border-bottom-color: var(--ah-border);
  gap: 0.15rem;
  flex-wrap: wrap;
}

.ah-vfile-tabs .nav-link {
  border: 0;
  border-radius: 10px 10px 0 0;
  color: var(--ah-muted, #8a8f98);
  font-size: 0.84rem;
  padding: 0.55rem 0.8rem;
}

.ah-vfile-tabs .nav-link.active {
  background: rgba(210, 31, 38, 0.12);
  color: #d21f26;
  font-weight: 600;
}

.ah-ledger {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ah-ledger__item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--ah-border);
}

.ah-ledger__item.is-cancelled {
  opacity: 0.55;
  text-decoration: line-through;
}

.ah-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 768px) {
  .ah-vfile-hero { grid-template-columns: 1fr; }
  .ah-ledger__item { grid-template-columns: 1fr; }
}
