* { box-sizing: border-box; }
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6d7789;
  --line: #e4e9f1;
  --primary: #172033;
  --accent: #2f6fed;
  --soft: #eef4ff;
  --danger: #b42318;
}
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.sidebar {
  background: #101828;
  color: white;
  padding: 24px 16px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: start;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 24px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: white;
  color: #101828;
  font-weight: 800;
}
.brand-title { font-size: 19px; font-weight: 800; }
.brand-subtitle { font-size: 12px; color: #98a2b3; margin-top: 2px; }
.nav { display: grid; gap: 7px; }
.nav-item {
  border: 0;
  background: transparent;
  color: #cdd5df;
  width: 100%;
  display: flex;
  gap: 11px;
  align-items: center;
  text-align: left;
  padding: 12px 13px;
  border-radius: 10px;
}
.nav-item:hover, .nav-item.active {
  background: #1d2939;
  color: white;
}
.nav-icon { width: 22px; text-align: center; }
.main { padding: 28px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.topbar h1 { margin: 0; font-size: 28px; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.primary-btn, .secondary-btn, .ghost-btn, .danger-btn {
  border-radius: 9px;
  padding: 10px 14px;
  border: 1px solid transparent;
  font-weight: 700;
}
.primary-btn { background: var(--accent); color: white; }
.secondary-btn { background: var(--soft); color: var(--accent); }
.ghost-btn { background: white; border-color: var(--line); color: var(--text); }
.danger-btn { background: #fff1f0; color: var(--danger); border-color: #ffd6d2; }
.page { display: none; }
.page.active { display: block; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.stat-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-card strong { font-size: 26px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(16, 24, 40, .04);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.panel-head h2 { margin: 0; font-size: 20px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.search-input {
  width: min(340px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.vehicle-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}
.vehicle-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.vehicle-card h3 { margin: 0; font-size: 18px; }
.plate {
  margin-top: 5px;
  font-weight: 800;
  letter-spacing: .5px;
}
.badge {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #027a48;
  white-space: nowrap;
}
.badge.past {
  background: #f2f4f7;
  color: #475467;
}
.vehicle-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.meta-box {
  background: #f8fafc;
  border-radius: 9px;
  padding: 10px;
}
.meta-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.meta-value { font-size: 13px; font-weight: 700; word-break: break-word; }
.vehicle-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-state h3 { color: var(--text); margin: 0 0 7px; }
.empty-state p { margin: 0; }
.vehicle-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .inline-form input {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  outline: none;
}
.field input:focus, .search-input:focus, .inline-form input:focus {
  border-color: #98b7ff;
  box-shadow: 0 0 0 3px rgba(47,111,237,.1);
}
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 9px;
  margin-top: 8px;
}
.inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 10px;
  margin-bottom: 18px;
}
.hidden { display: none !important; }
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.data-table th, .data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}
.data-table th { color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    min-height: auto;
    padding: 14px;
  }
  .brand { padding-bottom: 14px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 18px; }
}
@media (max-width: 640px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .stats-grid, .vehicle-form { grid-template-columns: 1fr; }
  .form-actions { grid-column: auto; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .search-input { width: 100%; }
  .inline-form { grid-template-columns: 1fr; }
}

/* CordexOto v0.2 - istenen araç kartı ve detay düzenlemeleri */
#page-vehicles .vehicle-grid {
  grid-template-columns: 1fr;
}

.vehicle-card-horizontal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 18px;
}

.vehicle-card-horizontal .vehicle-card-main {
  min-width: 0;
}

.vehicle-card-horizontal .vehicle-meta {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  margin-bottom: 0;
}

.vehicle-card-view-action {
  border-top: 0;
  border-left: 1px solid var(--line);
  padding-top: 0;
  padding-left: 18px;
  align-items: center;
}

.vehicle-card-view-action .secondary-btn {
  min-width: 110px;
}

.whatsapp-link {
  color: #087f5b;
  font-weight: 700;
  text-decoration: none;
}

.whatsapp-link:hover {
  text-decoration: underline;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .58);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1000;
}

.vehicle-modal {
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(16, 24, 40, .25);
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.modal-kicker {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.modal-head h2 {
  margin: 0;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.vehicle-detail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.vehicle-detail-form .field input:disabled {
  background: #f8fafc;
  color: var(--text);
  opacity: 1;
}

.detail-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
}

@media (max-width: 840px) {
  .vehicle-card-horizontal {
    grid-template-columns: 1fr;
  }

  .vehicle-card-horizontal .vehicle-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vehicle-card-view-action {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }
}

@media (max-width: 640px) {
  .vehicle-detail-form {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    grid-column: auto;
  }
}


/* CordexOto v0.3 - satılmış araçlar, raporlar, ruhsat ve expertiz */
#page-past .vehicle-grid {
  grid-template-columns: 1fr;
}

#page-past .vehicle-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 18px;
}

#page-past .vehicle-card .vehicle-meta {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  margin-bottom: 0;
}

.report-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 18px;
}

.report-query-btn {
  min-height: 42px;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ratio-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.ratio-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
}

.ratio-track {
  width: 100%;
  height: 12px;
  background: #eef2f6;
  border-radius: 999px;
  overflow: hidden;
}

.ratio-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width .2s ease;
}

.detail-section {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 2px;
}

.detail-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.detail-section-head h3 {
  margin: 0;
  font-size: 17px;
}

.detail-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.file-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

.registration-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 13px;
}

.registration-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.expert-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.expert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: .15s ease;
}

.expert-item input {
  width: 18px;
  height: 18px;
  accent-color: #f79009;
}

.expert-item.warning {
  color: #c66a00;
  border-color: #fdb022;
  background: #fffaeb;
}

@media (max-width: 840px) {
  #page-past .vehicle-card {
    grid-template-columns: 1fr;
  }

  #page-past .vehicle-card .vehicle-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .detail-section {
    grid-column: auto;
  }

  .detail-section-head,
  .registration-file-row,
  .ratio-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .expert-list {
    grid-template-columns: 1fr;
  }
}


/* CordexOto v0.4 - MTV ve muayene uyarıları */
.warning-panel {
  background: #fff;
  border: 1px solid #fdb022;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(16, 24, 40, .04);
}

.warning-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.warning-panel-head h2 {
  margin: 0;
  font-size: 19px;
  color: #b54708;
}

.warning-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.warning-count {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fffaeb;
  color: #b54708;
  font-weight: 800;
  border: 1px solid #fdb022;
}

.warning-list {
  display: grid;
  gap: 9px;
}

.warning-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #fedf89;
  background: #fffaeb;
  border-radius: 10px;
  padding: 11px 12px;
}

.warning-row-main {
  min-width: 0;
}

.warning-title {
  display: block;
  color: #b54708;
  font-weight: 800;
  font-size: 14px;
}

.warning-detail {
  display: block;
  margin-top: 3px;
  color: #7a2e0e;
  font-size: 12px;
}

.warning-row button {
  flex: 0 0 auto;
}

.mtv-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mtv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
}

.mtv-item > div {
  display: grid;
  gap: 3px;
}

.mtv-item strong {
  font-size: 14px;
}

.mtv-item span {
  color: var(--muted);
  font-size: 12px;
}

.mtv-item input {
  width: 20px;
  height: 20px;
  accent-color: #12b76a;
}

.mtv-item.paid {
  border-color: #abefc6;
  background: #ecfdf3;
}

@media (max-width: 640px) {
  .warning-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .mtv-list {
    grid-template-columns: 1fr;
  }
}


/* CordexOto v0.5 - Expertiz Var/Yok ve koşullu alanlar */
.expert-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  transition: .15s ease;
}

.expert-question {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.expert-options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.expert-option {
  position: relative;
  cursor: pointer;
}

.expert-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.expert-option span {
  min-width: 54px;
  height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  transition: .15s ease;
}

.expert-option input:checked + span {
  border-color: #98a2b3;
  background: #f2f4f7;
  color: #344054;
  box-shadow: 0 0 0 2px rgba(152, 162, 179, .10);
}

.expert-item.warning {
  color: #b54708;
  border-color: #fdb022;
  background: #fffaeb;
}

.expert-item.warning .expert-option input:checked + span {
  border-color: #f79009;
  background: #fff0d5;
  color: #b54708;
  box-shadow: 0 0 0 2px rgba(247, 144, 9, .12);
}

.expert-conditional {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px dashed #fdb022;
}

.expert-conditional-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 800;
}

.expert-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

#dentRepairNoteArea label {
  display: block;
  margin-bottom: 7px;
  color: #b54708;
  font-size: 12px;
  font-weight: 800;
}

#dentRepairNote {
  width: 100%;
  resize: vertical;
  min-height: 76px;
  padding: 10px 11px;
  border: 1px solid #fdb022;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}

#dentRepairNote:focus {
  box-shadow: 0 0 0 3px rgba(247, 144, 9, .12);
}

@media (max-width: 640px) {
  .expert-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .expert-options {
    justify-content: flex-start;
  }
  .expert-conditional-head,
  .expert-file-row {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* CordexOto v0.6 - araç görüntüleme kilidi, evraklar ve ayarlar */
.vehicle-detail-form.view-mode .edit-only,
.vehicle-detail-form.view-mode .edit-only-action {
  display: none !important;
}

.vehicle-detail-form.view-mode .expert-option {
  cursor: default;
}

.vehicle-detail-form.view-mode .expert-option span {
  cursor: default;
}

.vehicle-detail-form.view-mode .mtv-item {
  cursor: default;
}

.vehicle-detail-form.view-mode #dentRepairNote {
  background: #f8fafc;
}

.vehicle-document-list {
  display: grid;
  gap: 10px;
}

.vehicle-document-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.vehicle-document-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.vehicle-document-info strong {
  font-size: 14px;
}

.vehicle-document-info span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.whatsapp-btn {
  border: 1px solid #abefc6;
  background: #ecfdf3;
  color: #067647;
  border-radius: 9px;
  padding: 10px 14px;
  font-weight: 700;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.settings-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 9px;
  padding: 9px 12px;
  font-weight: 700;
}

.settings-tab.active {
  border-color: #98b7ff;
  background: var(--soft);
  color: var(--accent);
}

.settings-content {
  display: none;
}

.settings-content.active {
  display: block;
}

.settings-form,
.contract-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-form textarea,
.contract-form textarea,
.settings-form select,
.contract-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}

.settings-field-wide {
  grid-column: 1 / -1;
}

.settings-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.settings-section-head h3,
.backup-card h3 {
  margin: 0;
  font-size: 17px;
}

.settings-section-head p,
.backup-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-list {
  display: grid;
  gap: 9px;
}

.settings-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.settings-list-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-list-main strong {
  font-size: 14px;
}

.settings-list-main span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.settings-list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-empty {
  padding: 34px 18px;
}

.backup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.backup-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #f8fafc;
}

.backup-card p {
  margin-bottom: 14px;
}

.checkbox-field {
  align-content: end;
}

.checkbox-field label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-weight: 700;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

@media (max-width: 760px) {
  .vehicle-document-row,
  .settings-section-head,
  .settings-list-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-form,
  .contract-form,
  .backup-grid {
    grid-template-columns: 1fr;
  }

  .settings-field-wide {
    grid-column: auto;
  }
}


/* CordexOto v0.7 - satış ve rezervasyon satış akışı */
.vehicle-card-view-action {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-width: 150px;
}

.vehicle-card-view-action .secondary-btn,
.vehicle-card-view-action .primary-btn,
.vehicle-card-view-action .reservation-btn {
  width: 100%;
}

.reservation-btn {
  border: 1px solid #fedf89;
  background: #fffaeb;
  color: #b54708;
  border-radius: 9px;
  padding: 10px 14px;
  font-weight: 700;
}

.sale-action-modal-card {
  width: min(620px, calc(100vw - 28px));
}

.sale-action-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sale-action-form .form-actions {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .sale-action-form {
    grid-template-columns: 1fr;
  }

  .sale-action-form .form-actions {
    grid-column: auto;
  }
}


/* CordexOto v0.7.2 - rezervasyonlu araç görünümü */
.vehicle-card.reservation-active {
  border-color: #fdb022;
  background: #fffaeb;
  box-shadow: 0 6px 20px rgba(181, 71, 8, .08);
}

.vehicle-card.reservation-active .vehicle-card-main {
  background: transparent;
}

.badge.reservation-badge {
  background: #fef0c7;
  color: #b54708;
  border: 1px solid #fdb022;
}

.vehicle-card.reservation-active .reservation-meta-box {
  background: #fff4d6;
  border: 1px solid #fedf89;
}

.vehicle-card.reservation-active .reservation-meta-box .meta-label,
.vehicle-card.reservation-active .reservation-meta-box .meta-value {
  color: #7a2e0e;
}


/* CordexOto v0.8 - Rezervasyon kaldır / Tramer / Araç Boya Durumu */
.reservation-remove-btn {
  border: 1px solid #fecdca;
  background: #fff;
  color: #b42318;
  border-radius: 9px;
  padding: 10px 14px;
  font-weight: 700;
}

.tramer-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.tramer-status-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.tramer-label {
  font-weight: 800;
  font-size: 14px;
}

.tramer-details {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(280px, 1.3fr);
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.tramer-image-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #f8fafc;
}

.tramer-image-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tramer-image-head > div {
  display: grid;
  gap: 4px;
}

.tramer-image-head strong {
  font-size: 13px;
}

.tramer-image-head span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.paint-status-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.25fr) minmax(320px, .75fr);
  gap: 20px;
  align-items: start;
}

.paint-status-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.paint-status-table-head,
.paint-status-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.6fr) repeat(4, minmax(72px, .7fr));
  align-items: center;
}

.paint-status-table-head {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.paint-status-table-head span,
.paint-status-row > span,
.paint-status-cell {
  padding: 10px 8px;
  text-align: center;
}

.paint-status-table-head span:first-child,
.paint-status-row > span:first-child {
  text-align: left;
  padding-left: 12px;
}

.paint-status-row {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.paint-status-row:last-child {
  border-bottom: 0;
}

.paint-status-cell {
  display: grid;
  place-items: center;
}

.paint-status-cell input {
  width: 17px;
  height: 17px;
}

.paint-status-cell.original input { accent-color: #12b76a; }
.paint-status-cell.local input { accent-color: #fdb022; }
.paint-status-cell.painted input { accent-color: #f79009; }
.paint-status-cell.changed input { accent-color: #f04438; }

.paint-car-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  padding: 14px;
  position: sticky;
  top: 16px;
}

.paint-car-svg {
  width: 100%;
  max-height: 520px;
  display: block;
  margin: 0 auto;
}

.car-outline > * {
  fill: #f2f4f7;
  stroke: #d0d5dd;
  stroke-width: 3;
}

.paint-part > * {
  fill: #12b76a;
  fill-opacity: .72;
  stroke: #98a2b3;
  stroke-width: 2;
  transition: fill .15s ease, stroke-width .15s ease;
}

.vehicle-detail-form:not(.view-mode) .paint-part {
  cursor: pointer;
}

.vehicle-detail-form:not(.view-mode) .paint-part:hover > * {
  stroke-width: 4;
}

.paint-part.status-original > * { fill: #12b76a; }
.paint-part.status-local > * { fill: #fdb022; }
.paint-part.status-painted > * { fill: #f79009; }
.paint-part.status-changed > * { fill: #f04438; }

.paint-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.paint-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.paint-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
}

.paint-dot.original { background: #12b76a; }
.paint-dot.local { background: #fdb022; }
.paint-dot.painted { background: #f79009; }
.paint-dot.changed { background: #f04438; }

@media (max-width: 980px) {
  .paint-status-layout {
    grid-template-columns: 1fr;
  }

  .paint-car-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .tramer-status-block,
  .tramer-image-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tramer-details {
    grid-template-columns: 1fr;
  }

  .paint-status-table-wrap {
    overflow-x: auto;
  }

  .paint-status-table-head,
  .paint-status-row {
    min-width: 610px;
  }
}


/* CordexOto v0.8.1 - boya durumu araç görseli referans güncelleme */
.paint-car-svg image {
  opacity: 0.98;
}

.paint-part > * {
  fill-opacity: .42 !important;
  stroke: rgba(102, 112, 133, .7) !important;
  stroke-width: 1.5 !important;
}

.vehicle-detail-form:not(.view-mode) .paint-part:hover > * {
  stroke-width: 3 !important;
  fill-opacity: .55 !important;
}

.paint-part.status-original > * { fill: #12b76a !important; }
.paint-part.status-local > * { fill: #fdb022 !important; }
.paint-part.status-painted > * { fill: #f79009 !important; }
.paint-part.status-changed > * { fill: #f04438 !important; }

.paint-car-panel {
  background: #fff;
}


/* CordexOto v0.8.2 - boya durumu hizalama ve kapat butonu */
.paint-car-svg image {
  opacity: 1;
}

.paint-part > * {
  fill-opacity: .48 !important;
  stroke: rgba(152, 162, 179, .95) !important;
  stroke-width: 1.4 !important;
}

.vehicle-detail-form:not(.view-mode) .paint-part:hover > * {
  stroke-width: 2.6 !important;
  fill-opacity: .6 !important;
}

.paint-part.status-original > * {
  fill: #12b76a !important;
}

.paint-part.status-painted > * {
  fill: #fdb022 !important;
}

.paint-part.status-local > * {
  fill: url(#paintLocalFill) !important;
  fill-opacity: 1 !important;
}

.paint-part.status-changed > * {
  fill: #f04438 !important;
}

.detail-actions {
  flex-wrap: wrap;
}


/* CordexOto v0.9 - toplu araç, güncel durum, müşteri araç bağlantısı */
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.template-download-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.current-status-panel {
  margin-bottom: 18px;
}

.current-status-head {
  margin-bottom: 14px;
}

.current-status-panel .stats-grid {
  margin-bottom: 16px;
}

.current-status-grid {
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(480px, 1.2fr);
  gap: 14px;
  align-items: stretch;
}

.current-status-panel .warning-panel {
  margin-bottom: 0;
  box-shadow: none;
  height: 100%;
}

.no-warning-row {
  padding: 13px 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

.monthly-chart-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  min-width: 0;
}

.monthly-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.monthly-chart-head h3 {
  margin: 0;
  font-size: 16px;
}

.monthly-chart-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.monthly-chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.monthly-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.chart-legend-dot.purchase {
  background: #2f6fed;
}

.chart-legend-dot.sale {
  background: #12b76a;
}

.monthly-chart {
  height: 205px;
  display: grid;
  grid-template-columns: repeat(12, minmax(32px, 1fr));
  gap: 6px;
  align-items: end;
  padding-top: 12px;
  border-bottom: 1px solid var(--line);
}

.month-chart-month {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 7px;
  min-width: 0;
}

.month-chart-bars {
  display: flex;
  gap: 3px;
  align-items: end;
  justify-content: center;
  min-height: 150px;
}

.month-chart-bar {
  width: min(14px, 42%);
  min-height: 0;
  border-radius: 5px 5px 0 0;
  position: relative;
}

.month-chart-bar.purchase {
  background: #2f6fed;
}

.month-chart-bar.sale {
  background: #12b76a;
}

.month-chart-bar.has-value {
  min-height: 8px;
}

.month-chart-label {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.customer-inline-form {
  grid-template-columns: 1fr 1fr 1.1fr auto auto;
}

.inline-form select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.vehicle-table-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

.company-doc-add {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.company-doc-add input {
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  outline: none;
}

@media (max-width: 1050px) {
  .current-status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .monthly-chart {
    overflow-x: auto;
    grid-template-columns: repeat(12, 42px);
    justify-content: start;
  }

  .customer-inline-form {
    grid-template-columns: 1fr;
  }

  .company-doc-add {
    width: 100%;
    justify-content: flex-start;
  }

  .company-doc-add input {
    width: 100%;
  }
}


/* CordexOto v0.9.1 - Güncel Durum ayrı sayfa ve yıllık rapor */
.month-chart-bar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
}

.month-chart-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.month-chart-bar:not(.has-value) .month-chart-value {
  color: var(--muted);
}

.yearly-report-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.yearly-report-head {
  margin-bottom: 14px;
}

.yearly-report-filter {
  grid-template-columns: minmax(180px, 260px) auto;
  justify-content: start;
}

.yearly-report-chart-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-top: 18px;
  background: #fff;
}

.yearly-monthly-chart {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .yearly-report-filter {
    grid-template-columns: 1fr;
  }
}


/* CordexOto v0.9.2 - Güncel Durum / Vites / Lastik */
.current-status-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

.current-status-panel .warning-panel {
  width: 100% !important;
  margin: 0 !important;
}

.current-status-panel .monthly-chart-card {
  width: 100% !important;
}

.warning-list,
.warning-row {
  width: 100%;
}

.choice-box-group,
.tire-type-options {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.choice-box,
.tire-type-options .expert-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

.choice-box input,
.tire-type-options input {
  width: 18px;
  height: 18px;
}

.vehicle-detail-form.view-mode .choice-box,
.vehicle-detail-form.view-mode .tire-type-options .expert-option {
  cursor: default;
}

.tire-expert-item {
  align-items: stretch;
  flex-direction: column;
}

.tire-date-field {
  display: grid;
  gap: 7px;
  width: 100%;
  margin-top: 4px;
}

.tire-date-field label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.tire-date-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
}

.vehicle-detail-form.view-mode .tire-date-field input {
  background: #f8fafc;
}


/* CordexOto v0.9.4 - araç kartı tamamlanma yüzdesi */
.vehicle-completion {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.vehicle-completion.incomplete {
  border-color: #fedf89;
  background: #fffaeb;
}

.vehicle-completion.complete {
  border-color: #abefc6;
  background: #ecfdf3;
}

.vehicle-completion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.vehicle-completion-head strong {
  font-size: 13px;
}

.vehicle-completion-head span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.vehicle-completion-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e7ec;
}

.vehicle-completion-fill {
  height: 100%;
  border-radius: inherit;
  background: #f79009;
  transition: width .2s ease;
}

.vehicle-completion.complete .vehicle-completion-fill {
  background: #12b76a;
}

.vehicle-completion-warning,
.vehicle-completion-success {
  margin-top: 7px;
  font-size: 11px;
  font-weight: 800;
}

.vehicle-completion-warning {
  color: #b54708;
}

.vehicle-completion-success {
  color: #027a48;
}

@media (max-width: 640px) {
  .vehicle-completion-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}


/* CordexOto v0.9.6 - Uyarılardan Araca Git */
.warning-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.vehicle-card-target {
  outline: 3px solid #f79009;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(247, 144, 9, .14);
}

@media (max-width: 640px) {
  .warning-row-actions {
    width: 100%;
  }

  .warning-row-actions button {
    flex: 1 1 0;
  }
}


/* CordexOto v0.9.7 - müşteri Excel aktar */
.customer-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .customer-panel-actions {
    width: 100%;
    justify-content: flex-start;
  }
}


/* CordexOto v0.9.8 - Müşteri TC/VKN ve müşteri şablonu */
.customer-inline-form {
  grid-template-columns: 1fr 1fr .9fr 1.1fr auto auto;
}

@media (max-width: 980px) {
  .customer-inline-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .customer-inline-form {
    grid-template-columns: 1fr;
  }
}


/* CordexOto v1.0 - kullanıcı girişi ve firma logosu */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(47, 111, 237, .12), transparent 34%),
    #f4f7fb;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 18px 55px rgba(16, 24, 40, .12);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #101828;
  color: #fff;
  font-weight: 800;
}

.login-brand h1 {
  margin: 0;
  font-size: 22px;
}

.login-brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-submit-btn {
  width: 100%;
  min-height: 44px;
}

.login-error {
  padding: 10px 12px;
  border: 1px solid #fecdca;
  border-radius: 9px;
  background: #fef3f2;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
}

.brand-mark {
  overflow: hidden;
}

.brand-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.company-logo-settings {
  padding-bottom: 6px;
}

.company-logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.company-logo-preview {
  width: 86px;
  height: 86px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  font-weight: 800;
  color: #101828;
}

.company-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.company-logo-controls {
  display: grid;
  gap: 6px;
}

.company-logo-note {
  font-size: 11px;
  color: var(--muted);
}


/* CordexOto v1.1 - lastik / takip / boya not-foto */
.tire-date-field {
  width: 260px !important;
  max-width: 100%;
}

.tire-date-field input {
  width: 220px !important;
  min-width: 180px;
  max-width: 100%;
  box-sizing: border-box;
}

.follow-up-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid #fedf89;
  border-radius: 9px;
  background: #fffaeb;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.follow-up-check input {
  width: 18px;
  height: 18px;
}

.paint-extra-fields {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.paint-extra-fields textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.paint-photo-box {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.vehicle-detail-form.view-mode .paint-extra-fields textarea {
  background: #f8fafc;
}

@media (max-width: 640px) {
  .tire-date-field,
  .tire-date-field input {
    width: 100% !important;
    min-width: 0;
  }
}


/* CordexOto v1.3.1 - sadece evrak aksiyonları için mobil düzen */
.company-document-actions {
  align-items: center;
}

@media (max-width: 760px) {
  .company-document-actions {
    width: 100%;
  }

  .company-document-actions button {
    flex: 1 1 120px;
  }
}


/* CordexOto v1.5 - Şifremi Unuttum */
.login-link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #175cd3;
  padding: 6px 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.login-link-btn:hover {
  text-decoration: underline;
}

.login-reset-info {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

#resetPasswordCode {
  letter-spacing: .22em;
  font-weight: 800;
  text-align: center;
}


/* CordexOto v1.6 - Araç Expertiz PDF */
.vehicle-expert-report-section .expert-report-details {
  margin-top: 12px;
}


/* CordexOto - giriş kolaylıkları ve çıkış */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.login-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.sidebar-logout-btn {
  border: 0;
  background: transparent;
  color: #fda29b;
  width: 100%;
  display: flex;
  gap: 11px;
  align-items: center;
  text-align: left;
  padding: 12px 13px;
  border-radius: 10px;
  margin-top: 10px;
  font-weight: 700;
}

.sidebar-logout-btn:hover {
  background: #1d2939;
  color: #fff;
}

/* CordexOto v1.7 - mobil yan menü, yetkiler, sistem sağlığı */
.topbar-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu-btn,
.mobile-sidebar-close,
.sidebar-overlay {
  display: none;
}

.topbar-logout-btn {
  white-space: nowrap;
}

.permissions-editor {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.permissions-editor-head {
  margin-bottom: 12px;
}

.permissions-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.permissions-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.permissions-table {
  width: 100%;
  min-width: 930px;
  border-collapse: collapse;
}

.permissions-table th,
.permissions-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
}

.permissions-table th:first-child,
.permissions-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  min-width: 160px;
}

.permissions-table thead th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.permissions-table thead th:first-child {
  background: #f8fafc;
  z-index: 2;
}

.permission-checkbox {
  width: 17px;
  height: 17px;
  margin: 0;
}

.permission-na {
  color: #c4cbd5;
}

.permissions-actions {
  margin-top: 14px;
}

.backup-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compact-btn {
  padding: 7px 10px;
  font-size: 12px;
}

.database-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef5;
  margin: 10px 0 12px;
}

.database-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .2s ease;
}

.database-usage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.database-usage-meta label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: var(--text);
}

.database-usage-meta input {
  width: 100px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settings-help {
  margin: 10px 0 0 !important;
  font-size: 11px !important;
}

.system-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.health-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  background: #f8fafc;
}

.health-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.health-card strong {
  font-size: 14px;
}

.health-ok { color: #067647; }
.health-warning { color: #b54708; }
.health-error { color: #b42318; }

.session-section-head {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sessions-list {
  display: grid;
  gap: 10px;
}

.session-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.session-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.session-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-current-badge {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: 10px;
  font-weight: 800;
}

.session-meta {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(82vw, 300px);
    min-height: 100dvh;
    height: 100dvh;
    padding: 20px 16px;
    overflow-y: auto;
    z-index: 1002;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 12px 0 30px rgba(16, 24, 40, .18);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar .nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(16, 24, 40, .44);
    z-index: 1001;
  }

  .app-shell.sidebar-open .sidebar-overlay {
    display: block;
  }

  .mobile-menu-btn {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 22px;
    line-height: 1;
  }

  .mobile-sidebar-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: #1d2939;
    color: #fff;
    font-size: 22px;
    line-height: 1;
  }

  .brand {
    padding-right: 42px;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-heading {
    flex: 1 1 auto;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 760px) {
  .system-health-grid {
    grid-template-columns: 1fr 1fr;
  }

  .session-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-heading {
    width: 100%;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .top-actions .primary-btn,
  .top-actions .danger-btn,
  .top-actions .secondary-btn,
  .top-actions .file-upload-btn {
    flex: 0 0 auto;
  }

  .system-health-grid {
    grid-template-columns: 1fr;
  }

  .database-usage-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}
.permission-hidden { display: none !important; }
