:root {
  --bg: #07080c;
  --bg-elevated: #0f1118;
  --bg-card: #141820;
  --bg-card-hover: #1a1f2a;
  --bg-input: #1a1f2a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef1f6;
  --muted: #8b95a8;
  --primary: #f7931e;
  --primary-hover: #ff9f2e;
  --primary-glow: rgba(247, 147, 30, 0.35);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --sidebar-w: 300px;
  --header-h: 68px;
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

.app-root { min-height: 100vh; position: relative; z-index: 2; }

/* ── Temalı kaydırma çubukları ── */
.page-content,
.modal-body,
.support-sidebar,
.support-chat-log,
.table-wrap,
.sidebar-scroll,
.custom-select-dropdown {
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 147, 30, 0.42) rgba(255, 255, 255, 0.05);
}
.page-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.support-sidebar::-webkit-scrollbar,
.support-chat-log::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.sidebar-scroll::-webkit-scrollbar,
.custom-select-dropdown::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.page-content::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.support-sidebar::-webkit-scrollbar-track,
.support-chat-log::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.sidebar-scroll::-webkit-scrollbar-track,
.custom-select-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 99px;
}
.page-content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.support-sidebar::-webkit-scrollbar-thumb,
.support-chat-log::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.sidebar-scroll::-webkit-scrollbar-thumb,
.custom-select-dropdown::-webkit-scrollbar-thumb {
  background: rgba(247, 147, 30, 0.32);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.page-content::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.support-sidebar::-webkit-scrollbar-thumb:hover,
.support-chat-log::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.sidebar-scroll::-webkit-scrollbar-thumb:hover,
.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(247, 147, 30, 0.55);
  background-clip: padding-box;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  display: none;
}

.cursor-glow {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 147, 30, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  display: none;
}
body.login-active .bg-canvas { display: block; }
body.login-active .cursor-glow { display: block; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.login-glow {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 147, 30, 0.18), transparent 68%);
  top: -180px;
  left: -120px;
  pointer-events: none;
  z-index: 0;
}
.login-glow-2 {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 147, 30, 0.1), transparent 70%);
  bottom: -100px;
  right: -80px;
  pointer-events: none;
  z-index: 0;
}
.login-card {
  width: min(420px, 100%);
  background: rgba(20, 24, 32, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2.25rem;
  position: relative;
  z-index: 2;
  animation: fadeUp 0.5s ease;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
  background: linear-gradient(90deg, var(--primary), #ff9f2e, var(--primary));
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.login-brand img { width: 42px; height: 42px; }
.login-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}
.login-brand p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }
.login-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.license-saved {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(247, 147, 30, 0.08);
  border: 1px solid rgba(247, 147, 30, 0.22);
  border-radius: 10px;
}
.license-saved-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.license-saved-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.license-saved code {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  word-break: break-all;
}
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  flex-shrink: 0;
}
.btn-link:hover { color: var(--primary); }
.hidden { display: none !important; }

.login-card .sub { color: var(--muted); margin: 0 0 1.5rem; font-size: 0.9rem; }

/* ── Forms ── */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.field span { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.field input, .field select, .field textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.95rem;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(247, 147, 30, 0.15);
}
.form-error { color: var(--danger); font-size: 0.85rem; min-height: 1.2rem; margin-top: 0.25rem; }

/* ── Custom select (temalı açılır liste) ── */
.custom-select {
  position: relative;
  width: 100%;
}
.custom-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.95rem;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.15s;
}
.custom-select-trigger:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}
.custom-select.is-open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(247, 147, 30, 0.15);
  background: rgba(247, 147, 30, 0.04);
}
.custom-select-trigger:active:not(:disabled) { transform: scale(0.99); }
.custom-select.is-disabled .custom-select-trigger {
  opacity: 0.55;
  cursor: not-allowed;
}
.custom-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.25s ease, color 0.2s;
}
.custom-select-chevron svg { width: 100%; height: 100%; display: block; }
.custom-select.is-open .custom-select-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}
.custom-select-dropdown {
  position: fixed;
  z-index: 10060;
  background: linear-gradient(165deg, #161a24 0%, #10131b 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(247, 147, 30, 0.06) inset,
    0 16px 40px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(247, 147, 30, 0.05);
  padding: 0.4rem;
  max-height: min(280px, 45vh);
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.custom-select-dropdown.is-measuring {
  visibility: hidden;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: none !important;
}
.custom-select-dropdown.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.custom-select.opens-up .custom-select-dropdown:not(.is-measuring) {
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom center;
}
.custom-select.opens-up .custom-select-dropdown.is-open {
  transform: translateY(0) scale(1);
}
.custom-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.68rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.custom-select-dropdown.is-open .custom-select-option {
  animation: selectOptIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--opt-i, 0) * 0.03s);
}
.custom-select.opens-up .custom-select-dropdown.is-open .custom-select-option {
  animation-name: selectOptInUp;
}
.custom-select-option:hover,
.custom-select-option.is-focused {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.06);
}
.custom-select-option.is-selected {
  background: rgba(247, 147, 30, 0.14);
  border-color: rgba(247, 147, 30, 0.22);
  color: var(--primary);
  font-weight: 600;
}
.custom-select-option.is-selected::after {
  content: "✓";
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--primary);
}
.custom-select-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.custom-select-option:active:not(:disabled) { transform: scale(0.98); }
@keyframes selectOptIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes selectOptInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.field .custom-select { margin: 0; }
.modal-vehicle .custom-select-trigger:focus-visible,
.modal-vehicle .custom-select.is-open .custom-select-trigger {
  border-color: rgba(247, 147, 30, 0.5);
  box-shadow: 0 0 0 3px rgba(247, 147, 30, 0.12);
  background: rgba(247, 147, 30, 0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Shell ── */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #0c0e14;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}
.sidebar-brand {
  padding: 1.5rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand img { width: 44px; height: 44px; }
.sidebar-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
}
.sidebar-brand small {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
  display: block;
}
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  position: relative;
}
.sidebar-scroll::before,
.sidebar-scroll::after {
  content: "";
  position: sticky;
  left: 0;
  right: 0;
  height: 28px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.sidebar-scroll::before {
  top: 0;
  margin-bottom: -28px;
  background: linear-gradient(180deg, #0c0e14 0%, rgba(12, 14, 20, 0) 100%);
}
.sidebar-scroll::after {
  bottom: 0;
  margin-top: -28px;
  background: linear-gradient(0deg, #0c0e14 0%, rgba(12, 14, 20, 0) 100%);
  animation: sidebarScrollHint 2.4s ease-in-out infinite;
}
.sidebar-scroll.can-scroll:not(.at-top)::before { opacity: 1; }
.sidebar-scroll.can-scroll:not(.at-bottom)::after { opacity: 1; }
.sidebar-scroll.can-scroll:not(.at-bottom).at-top::after {
  animation: sidebarScrollHint 2.4s ease-in-out 0.5s infinite;
}
.sidebar-nav {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sidebar-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0 0.5rem 0.5rem;
  margin-bottom: 0.15rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  min-height: 50px;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.06);
}
.nav-item.active {
  background: rgba(247, 147, 30, 0.14);
  color: var(--primary);
  border-color: rgba(247, 147, 30, 0.22);
  box-shadow: inset 4px 0 0 var(--primary);
}
.nav-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.nav-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.nav-item.active .nav-icon {
  background: rgba(247, 147, 30, 0.2);
  border-color: rgba(247, 147, 30, 0.35);
  color: var(--primary);
  box-shadow: 0 0 16px rgba(247, 147, 30, 0.15);
}
.nav-item:hover .nav-icon {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.nav-item.active:hover .nav-icon {
  color: var(--primary);
}
.sidebar-footer {
  padding: 1.15rem 1rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: #0c0e14;
}
.sidebar-footer .btn {
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 600;
}

.main-area { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(7, 8, 12, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}
.topbar-meta { display: flex; align-items: center; gap: 1rem; }
.topbar-search input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 1rem 0.55rem 2.2rem;
  color: var(--text);
  font: inherit;
  width: min(280px, 40vw);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b95a8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
}
.user-chip-btn {
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.25s, transform 0.15s;
}
.user-chip-btn:hover,
.user-chip-btn.is-open {
  border-color: rgba(247, 147, 30, 0.35);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 1px rgba(247, 147, 30, 0.08), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.user-chip-btn:active { transform: scale(0.98); }
.user-chip-text strong { font-size: 0.85rem; display: block; }
.user-chip small,
.user-chip-text small { display: block; color: var(--muted); font-size: 0.72rem; }
.user-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted);
  margin-left: 0.1rem;
  transition: transform 0.25s ease, color 0.2s;
}
.user-chevron svg { width: 100%; height: 100%; display: block; }
.user-chip-btn.is-open .user-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}
.user-menu-wrap {
  position: relative;
}
.user-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  min-width: 240px;
  background: linear-gradient(165deg, #161a24 0%, #10131b 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(247, 147, 30, 0.06) inset,
    0 18px 48px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(247, 147, 30, 0.06);
  padding: 0.55rem;
  z-index: 50;
  transform-origin: top right;
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.user-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.user-menu-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
}
.user-menu-head strong {
  display: block;
  font-size: 0.92rem;
}
.user-menu-head small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 0.1rem;
}
.user-menu-username {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.2rem;
  opacity: 0.85;
}
.user-avatar-lg {
  width: 42px;
  height: 42px;
  font-size: 0.95rem;
}
.user-menu-divider {
  height: 1px;
  margin: 0.25rem 0.35rem 0.45rem;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.06);
}
.user-menu-item:active { transform: scale(0.98); }
.user-menu-item-danger { color: #f87171; }
.user-menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.user-menu-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #f87171;
  flex-shrink: 0;
}
.user-menu-icon svg { width: 18px; height: 18px; }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #ff9f2e);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
}

@keyframes sidebarScrollHint {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.page-content {
  padding: 1.5rem;
  flex: 1;
  animation: fadeIn 0.35s ease;
}

/* ── Cards & stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(247, 147, 30, 0.25);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}
.stat-card .label { color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card .value {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
}
.stat-card.accent .value { color: var(--primary); }
.stat-card.success .value { color: var(--success); }

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-head h3 { margin: 0; font-size: 0.95rem; font-weight: 700; }
.panel-body { padding: 0.85rem 1.15rem 1.15rem; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  text-align: left;
  padding: 0.75rem 0.85rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr {
  transition: background 0.15s;
  cursor: pointer;
}
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table .muted { color: var(--muted); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.badge-stock { color: #86efac; background: #1a3328; border-color: #2f6b4f; }
.badge-sold { color: #ffb366; background: #3d2a14; border-color: #8b5a24; }
.badge-reserve { color: #fcd34d; background: #3d3414; border-color: #8b7424; }
.badge-cancel { color: #fca5a5; background: #3d1a1a; border-color: #8b3a3a; }
.badge-default { color: var(--muted); background: rgba(255,255,255,0.05); border-color: var(--border); }

/* ── Tabs & filters ── */
.tabs { display: flex; gap: 0.35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.tab.active, .tab:hover {
  color: var(--primary);
  border-color: rgba(247, 147, 30, 0.35);
  background: rgba(247, 147, 30, 0.1);
}
.filters-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: end;
}
.filters-bar .field { margin: 0; min-width: 140px; }

/* ── Profit chart ── */
.panel-chart .panel-head {
  align-items: baseline;
  gap: 0.65rem;
}
.panel-sub {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}
.profit-chart-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.profit-chart-empty strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.profit-chart {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 0.35rem 0.65rem;
  min-height: 200px;
  padding-top: 0.25rem;
}
.profit-chart-y {
  font-size: 0.68rem;
  color: var(--muted);
  align-self: start;
  padding-top: 0.15rem;
}
.profit-chart-y-zero {
  grid-column: 2;
  align-self: end;
  padding-bottom: 1.35rem;
}
.profit-chart-main {
  position: relative;
  min-height: 168px;
}
.profit-chart-grid {
  position: absolute;
  inset: 0 0 1.35rem 0;
  pointer-events: none;
}
.profit-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}
.profit-chart-bars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  height: 100%;
  min-height: 168px;
  padding-bottom: 1.35rem;
}
.profit-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  position: relative;
}
.profit-bar-track {
  width: 100%;
  max-width: 42px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  --bar-h: 0px;
}
.profit-bar {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  height: 0;
  min-height: 0;
  transition:
    height 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
  transform-origin: bottom center;
  position: relative;
}
.profit-bar.pos {
  background: linear-gradient(180deg, #ffb347 0%, var(--primary) 45%, #c46f12 100%);
  box-shadow: 0 8px 20px rgba(247, 147, 30, 0.25);
}
.profit-bar.neg {
  background: linear-gradient(180deg, #f87171 0%, var(--danger) 100%);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
}
.profit-bar.zero {
  background: rgba(255, 255, 255, 0.08);
  min-height: 3px;
  height: 3px !important;
}
.profit-bar.animated.pos {
  animation: barGlow 2.4s ease-in-out infinite;
}
@keyframes barGlow {
  0%, 100% { box-shadow: 0 8px 20px rgba(247, 147, 30, 0.22); }
  50% { box-shadow: 0 10px 28px rgba(247, 147, 30, 0.42); }
}
.profit-bar-col.hovered .profit-bar.pos {
  transform: scaleX(1.08) translateY(-3px);
  filter: brightness(1.08);
}
.profit-bar-tip {
  position: absolute;
  bottom: calc(var(--bar-h) + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(20, 24, 32, 0.95);
  border: 1px solid rgba(247, 147, 30, 0.25);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2;
}
.profit-bar-col.hovered .profit-bar-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.profit-bar-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.45rem;
  transition: color 0.2s;
}
.profit-bar-col.hovered .profit-bar-label {
  color: var(--primary);
  font-weight: 600;
}

/* legacy bar chart (reports) */
.bar-chart { display: flex; align-items: flex-end; gap: 0.5rem; height: 160px; padding-top: 0.5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; min-width: 0; }
.bar {
  width: 100%;
  max-width: 36px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--primary), #c46f12);
  min-height: 4px;
  transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-col span { font-size: 0.68rem; color: var(--muted); text-align: center; }

/* ── Detail ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}
.detail-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.detail-item .k { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.detail-item .v { margin-top: 0.25rem; font-weight: 600; }

.detail-tabs { display: flex; gap: 0.35rem; margin: 1rem 0; flex-wrap: wrap; }
.detail-section { display: none; animation: fadeIn 0.3s ease; }
.detail-section.active { display: block; }

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty strong { display: block; color: var(--text); margin-bottom: 0.35rem; }

/* ── Toast ── */
.toast-root {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  left: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(20, 24, 32, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(247, 147, 30, 0.08);
  transform: translateY(-16px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  max-width: min(360px, calc(100vw - 2rem));
  font-size: 0.9rem;
  pointer-events: auto;
}
.toast.visible {
  transform: translateY(0);
  opacity: 1;
}
.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(247, 147, 30, 0.15);
  color: var(--primary);
}
.toast-success { border-top-color: var(--success); }
.toast-success .toast-icon { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.toast-error { border-top-color: var(--danger); }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.toast-msg { color: var(--text); line-height: 1.4; }

@media (max-width: 600px) {
  .toast-root {
    left: 1rem;
    right: 1rem;
    align-items: center;
  }
  .toast { width: 100%; max-width: none; }
}

/* ── Mobile ── */
.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: var(--sidebar-w);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle { display: inline-flex; }
  .panel-grid { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .user-chip-text { display: none; }
  .user-chevron { display: none; }
  .user-chip-btn { padding-right: 0.35rem; }
}

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

.reveal { animation: fadeUp 0.45s ease both; }
.reveal-d1 { animation-delay: 0.08s; }
.reveal-d2 { animation-delay: 0.16s; }

/* ── Page enter & stagger animations ── */
.page-enter { animation: pageSlide 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes pageSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-rise {
  opacity: 0;
  transform: translateY(14px);
  animation: riseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--stagger, 0s);
}
@keyframes riseIn {
  to { opacity: 1; transform: translateY(0); }
}
.anim-pulse { animation: pulse 1.2s ease infinite; }
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ── Ripple effect ── */
.btn, .nav-item, .tab { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%) scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: translate(-50%, -50%) scale(24); opacity: 0; }
}

/* ── Toolbar & pagination ── */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.page-toolbar .tabs { margin-bottom: 0; }
.toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.pagination-btns { display: flex; gap: 0.5rem; }

.nav-item-accent {
  margin-top: 0.75rem;
  background: linear-gradient(135deg, rgba(247, 147, 30, 0.18), rgba(247, 147, 30, 0.08)) !important;
  border: 1px solid rgba(247, 147, 30, 0.45) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
  min-height: 52px;
}
.nav-item-accent .nav-icon {
  background: rgba(247, 147, 30, 0.25) !important;
  border-color: rgba(247, 147, 30, 0.4) !important;
  color: var(--primary) !important;
  box-shadow: 0 0 12px rgba(247, 147, 30, 0.2);
}
.nav-item-accent .nav-icon svg {
  width: 22px;
  height: 22px;
}
.nav-item-accent:hover {
  background: rgba(247, 147, 30, 0.22) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(247, 147, 30, 0.2);
}

/* ── Modal root & body lock ── */
#modal-root {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
}
#modal-root .modal-backdrop {
  pointer-events: auto;
}
body.modal-open {
  overflow: hidden;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 9001;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  width: min(480px, calc(100vw - 2rem));
  max-height: min(90vh, 780px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  position: relative;
  z-index: 9002;
}
.modal-wide { width: min(760px, calc(100vw - 2rem)); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
}
.modal-text { margin: 0 0 0.5rem; color: var(--text); line-height: 1.5; }

.pdf-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 1rem 0 0.5rem;
}
.pdf-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.pdf-type-card:hover {
  border-color: rgba(247, 147, 30, 0.45);
  background: rgba(247, 147, 30, 0.06);
  transform: translateY(-1px);
}
.pdf-type-card strong { font-family: var(--font-display); font-size: 0.95rem; }
.pdf-type-card small { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.pdf-type-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: rgba(247, 147, 30, 0.15);
  border: 1px solid rgba(247, 147, 30, 0.35);
  position: relative;
}
.pdf-type-icon::after {
  content: "";
  position: absolute;
  inset: 0.45rem 0.55rem;
  border: 2px solid var(--primary);
  border-radius: 2px;
  box-shadow: 0 4px 0 -1px var(--primary);
}
.pdf-type-icon-alt::after {
  inset: 0.5rem;
  border-radius: 50%;
  box-shadow: none;
  border-width: 2px;
}
@media (max-width: 520px) {
  .pdf-type-grid { grid-template-columns: 1fr; }
}

.modal-loading {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.modal-loading strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.modal-loading::after {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  margin: 1rem auto 0;
  border: 3px solid rgba(247, 147, 30, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Forms in modal ── */
.form-grid {
  display: block;
}
.form-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.modal-body .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.modal-body:not(.modal-body-vehicle) .form-section {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.modal-body:not(.modal-body-vehicle) .form-section .field-check,
.modal-body:not(.modal-body-vehicle) .form-section .form-error,
.modal-body:not(.modal-body-vehicle) .form-section .modal-actions {
  grid-column: 1 / -1;
}
.modal-body .form-grid > .form-error,
.modal-body .form-grid > .modal-actions {
  grid-column: 1 / -1;
}
.modal-body .field {
  margin-bottom: 0.85rem;
}
.modal-body .field textarea {
  min-height: 72px;
  resize: vertical;
}
@media (max-width: 600px) {
  .modal-body:not(.modal-body-vehicle) .form-section,
  .modal-body .form-grid {
    grid-template-columns: 1fr;
  }
}
.form-section h4 {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.field-check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.6rem !important;
}
.field-check input { width: auto; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Detail header ── */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.detail-title {
  margin: 0.5rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}
.detail-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-danger-text { color: var(--danger) !important; border-color: rgba(239, 68, 68, 0.3) !important; }
.btn-danger-text:hover { background: rgba(239, 68, 68, 0.1) !important; }
.muted-block { color: var(--muted); margin: 0.5rem 0 0; white-space: pre-wrap; }

/* ── Photo grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
  align-items: start;
}
.photo-card {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0c12;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.photo-card:has(.photo-img-clickable) {
  aspect-ratio: auto;
  height: auto;
  min-height: 0;
  display: block;
}
.photo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(247, 147, 30, 0.25);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.photo-card-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4px;
  box-sizing: border-box;
}
.photo-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(50vh, 360px);
  margin: 0 auto;
}
.photo-img-clickable {
  cursor: zoom-in;
}
.photo-card:has(.photo-placeholder) {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-card.photo-uploading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.photo-card.photo-uploading .photo-card-frame {
  width: 100%;
  padding: 4px;
}
.photo-card.photo-uploading .photo-img-preview {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(40vh, 280px);
}
.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  width: 100%;
  padding: 1.5rem 0.5rem;
}
.photo-load-error {
  background: rgba(239, 68, 68, 0.06);
  color: #f87171;
}
.photo-load-error .photo-retry-btn {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
}
.photo-uploading {
  pointer-events: none;
  border-style: dashed;
  border-color: rgba(247, 147, 30, 0.4);
  background: rgba(247, 147, 30, 0.06);
  box-shadow: 0 0 0 1px rgba(247, 147, 30, 0.08) inset;
  animation: photoUploadPulse 1.6s ease-in-out infinite;
}
.photo-img-preview {
  object-fit: contain;
  opacity: 1;
  filter: none;
}
.photo-upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem;
  text-align: center;
  background: rgba(7, 8, 12, 0.45);
  backdrop-filter: blur(2px);
}
.photo-upload-overlay strong {
  font-size: 0.86rem;
  color: var(--text);
  font-weight: 600;
}
.photo-upload-overlay small {
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-upload-btn { margin-bottom: 0.5rem; cursor: pointer; }
.photo-upload-btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}
.photo-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(247, 147, 30, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes photoUploadPulse {
  0%, 100% { border-color: rgba(247, 147, 30, 0.28); background: rgba(247, 147, 30, 0.04); }
  50% { border-color: rgba(247, 147, 30, 0.55); background: rgba(247, 147, 30, 0.1); }
}

/* ── Fotoğraf lightbox ── */
body.photo-lightbox-open { overflow: hidden; }
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(4, 5, 8, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.photo-lightbox.open { opacity: 1; visibility: visible; }
.photo-lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(96vw, 1200px);
  min-height: 0;
}
.photo-lightbox-img {
  max-width: 100%;
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  user-select: none;
}
.photo-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.photo-lightbox-close:hover {
  background: rgba(247, 147, 30, 0.15);
  border-color: rgba(247, 147, 30, 0.4);
}
.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.photo-lightbox-nav:hover:not(:disabled) {
  background: rgba(247, 147, 30, 0.18);
  border-color: rgba(247, 147, 30, 0.45);
}
.photo-lightbox-nav:disabled { opacity: 0.35; cursor: default; }
.photo-lightbox-prev { left: 1rem; }
.photo-lightbox-next { right: 1rem; }
.photo-lightbox-footer {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
@media (max-width: 640px) {
  .photo-lightbox-prev { left: 0.35rem; }
  .photo-lightbox-next { right: 0.35rem; }
}

.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(0,0,0,0.6) !important;
}

/* ── Listing output ── */
.modal-body:has(.listing-modal) {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.listing-modal {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: min(52vh, 480px);
  gap: 0.75rem;
}
.listing-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.listing-output {
  width: 100%;
  flex: 1;
  min-height: 280px;
  box-sizing: border-box;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.65;
  resize: vertical;
  overflow-y: auto;
}
.listing-output:focus {
  outline: none;
  border-color: rgba(247, 147, 30, 0.45);
  box-shadow: 0 0 0 3px rgba(247, 147, 30, 0.12);
}
.listing-modal .modal-actions {
  margin-top: 0;
  flex-shrink: 0;
}

/* ── Enhanced card hover ── */
.panel {
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.panel:hover {
  border-color: rgba(247, 147, 30, 0.15);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
}
.table-row-hover { cursor: pointer; }
.table-row-hover:hover td { color: var(--text); }
.detail-item {
  transition: transform 0.2s, border-color 0.2s;
}
.detail-item:hover {
  transform: translateY(-2px);
  border-color: rgba(247, 147, 30, 0.2);
}

/* ── Vehicle form tabs ── */
.modal-vehicle {
  width: min(960px, calc(100vw - 1rem)) !important;
  max-height: min(92vh, 900px) !important;
}
.modal-vehicle .modal-header {
  padding: 1.1rem 1.35rem;
  background: linear-gradient(180deg, rgba(247, 147, 30, 0.06), transparent);
}
.modal-vehicle .modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.modal-vehicle .modal-body {
  overflow-y: auto;
  max-height: calc(92vh - 4.5rem);
  padding: 1rem 1.35rem 1.35rem;
}
.vehicle-form { display: flex; flex-direction: column; min-height: 0; gap: 0; }

/* Grid bug fix — başlık solda boşluk bırakmasın */
.modal-vehicle .modal-body .vehicle-form .form-section {
  display: block !important;
  grid-template-columns: unset !important;
  margin-bottom: 0.85rem;
  padding-bottom: 0;
  border-bottom: none;
}
.modal-vehicle .form-section-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem 0.35rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-vehicle .form-section-card:focus-within {
  border-color: rgba(247, 147, 30, 0.28);
  box-shadow: 0 0 0 1px rgba(247, 147, 30, 0.08);
}
.modal-vehicle .form-section-card h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.modal-vehicle .section-icon {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: rgba(247, 147, 30, 0.12);
  color: var(--primary);
  font-size: 0.72rem;
  flex-shrink: 0;
}
.modal-vehicle .form-section-card .field:last-child { margin-bottom: 0.65rem; }

/* Canlı önizleme */
.vehicle-form-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(247, 147, 30, 0.1), rgba(247, 147, 30, 0.03));
  border: 1px solid rgba(247, 147, 30, 0.22);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.vehicle-form-preview.vfp-ready {
  border-color: rgba(247, 147, 30, 0.45);
  box-shadow: 0 8px 28px rgba(247, 147, 30, 0.1);
}
.vfp-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  color: var(--primary);
  background: rgba(247, 147, 30, 0.15);
  border: 1px solid rgba(247, 147, 30, 0.3);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.vehicle-form-preview.vfp-ready .vfp-icon {
  transform: scale(1.05);
}
.vfp-body { min-width: 0; flex: 1; }
.vfp-plate {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.vfp-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vfp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.vfp-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.vfp-chip-accent {
  color: var(--primary);
  border-color: rgba(247, 147, 30, 0.35);
  background: rgba(247, 147, 30, 0.1);
}

.form-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.form-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
}
.form-tab.active {
  color: var(--primary);
  border-color: rgba(247, 147, 30, 0.4);
  background: rgba(247, 147, 30, 0.14);
  box-shadow: 0 4px 14px rgba(247, 147, 30, 0.12);
}
.form-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.form-tab-panel { display: none; }
.form-tab-panel.active {
  display: block;
  animation: tabPanelIn 0.28s ease;
}
.form-tab-panel.tab-enter {
  animation: tabPanelIn 0.28s ease;
}
@keyframes tabPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.vehicle-form .form-fields-grid,
.modal-vehicle .form-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  width: 100%;
}
.vehicle-form .form-fields-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.vehicle-form .form-fields-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.vehicle-form .field-span-2 { grid-column: span 2; }
.vehicle-form .field-span-3 { grid-column: span 3; }
.vehicle-form .field-span-4 { grid-column: span 4; }
.vehicle-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.vehicle-form-row .form-section-card { margin-bottom: 0; }
@media (max-width: 900px) {
  .vehicle-form .form-fields-grid,
  .vehicle-form .form-fields-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vehicle-form .field-span-3,
  .vehicle-form .field-span-4 { grid-column: span 2; }
  .vehicle-form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .vehicle-form .form-fields-grid,
  .vehicle-form .form-fields-grid-2,
  .vehicle-form .form-fields-grid-3 {
    grid-template-columns: 1fr;
  }
  .vehicle-form .field-span-2,
  .vehicle-form .field-span-3,
  .vehicle-form .field-span-4 { grid-column: span 1; }
  .vehicle-form-preview { flex-direction: column; align-items: flex-start; }
  .form-tabs { flex-direction: column; border-radius: 12px; }
  .form-tab { flex: none; width: 100%; }
}

.modal-vehicle .field input,
.modal-vehicle .field select,
.modal-vehicle .field textarea {
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.modal-vehicle .field input:focus,
.modal-vehicle .field select:focus,
.modal-vehicle .field textarea:focus {
  border-color: rgba(247, 147, 30, 0.5);
  box-shadow: 0 0 0 3px rgba(247, 147, 30, 0.12);
  outline: none;
  background: rgba(247, 147, 30, 0.04);
}

#carSchematicMount {
  width: 100%;
  display: flex;
  justify-content: center;
}
.form-section-schematic { padding-bottom: 0.75rem !important; }

.vehicle-form-actions {
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--bg-card) 24%);
  margin-left: -1.35rem;
  margin-right: -1.35rem;
  margin-bottom: -1.35rem;
  padding-left: 1.35rem;
  padding-right: 1.35rem;
  padding-bottom: 0.25rem;
}

/* ── Car schematic (Sahibinden) ── */
.car-schematic-wrap { margin-top: 0.5rem; }
.car-schematic-body {
  display: grid;
  grid-template-columns: 311px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.car-schematic-readonly .car-schematic-body {
  grid-template-columns: minmax(280px, 311px) minmax(0, 1fr);
}
.car-schematic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.legend-item i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.15);
}
.car-schematic-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.car-schematic-stage {
  display: flex;
  justify-content: center;
  padding: 0;
  overflow: visible;
}
.car-schematic-stage .damage-area {
  width: 311px;
  height: 391px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #faf6ef;
}
.car-schematic-stage .car-parts {
  width: 311px;
  height: 391px;
  position: relative;
}
.car-parts-list { min-width: 0; }
.car-parts-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.car-part-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.84rem;
}
.car-part-chip-name {
  color: var(--text);
  font-weight: 500;
}
.car-parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.75rem;
}
.car-parts-table th,
.car-parts-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.car-parts-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}
.car-parts-empty { margin: 0.5rem 0 0; font-size: 0.85rem; }
.part-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.part-local { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.part-painted { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.part-changed { background: rgba(239, 68, 68, 0.15); color: #f87171; }

@media (max-width: 720px) {
  .car-schematic-body,
  .car-schematic-readonly .car-schematic-body {
    grid-template-columns: 1fr;
  }
  .car-schematic-stage {
    justify-content: center;
  }
  .car-parts-chips {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .car-schematic-stage .damage-area {
    transform: scale(0.88);
    transform-origin: top center;
  }
}

/* ── Araç detay özet kartları ── */
.detail-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.detail-summary-row .stat-card { margin: 0; }
.detail-summary-cost { font-size: 1.35rem !important; }
.detail-summary-text { font-size: 1.05rem !important; line-height: 1.3; }
@media (max-width: 768px) {
  .detail-summary-row { grid-template-columns: 1fr; }
}

/* ── Canlı destek (support.css ile senkron) ── */
.support-page { display: flex; flex-direction: column; gap: 1rem; flex: 1; min-height: 0; height: calc(100vh - var(--header-h) - 2.5rem); max-height: calc(100vh - var(--header-h) - 2.5rem); }
.support-layout { flex: 1; min-height: 0; overflow: hidden; align-items: stretch; }
.support-chat { height: 100%; max-height: 100%; min-height: 0; }
.support-chat-log { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
