/* ============================================================
   OTO EKSPERTİZ — ANA STİL DOSYASI
   ============================================================ */

/* ---------- RESET & TEMEL ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Renkler */
  --primary:        #1E3A5F;
  --primary-dark:   #152A47;
  --primary-light:  #2E5490;
  --accent:         #E8A020;
  --accent-dark:    #C8881A;

  --bg:             #F0F4F8;
  --bg-card:        #FFFFFF;
  --bg-sidebar:     #F7F9FC;
  --border:         #D8E2EE;
  --border-light:   #EAF0F8;

  --text:           #1A2535;
  --text-muted:     #6B7C93;
  --text-light:     #A0ADBF;

  /* Durum renkleri */
  --status-original: #22C55E;
  --status-changed:  #111111;
  --status-wrapped:  #FACC15;
  --status-painted:  #EF4444;
  --status-plastic:  #A855F7;

  /* UI */
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(30,58,95,.08), 0 1px 2px rgba(30,58,95,.06);
  --shadow:    0 4px 12px rgba(30,58,95,.10), 0 2px 4px rgba(30,58,95,.06);
  --shadow-lg: 0 8px 24px rgba(30,58,95,.13), 0 4px 8px rgba(30,58,95,.07);
  --transition: 0.18s ease;
}

/* =============================================
   HAMBURGER & MOBİL NAV
   ============================================= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 6px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .18s;
}
.hamburger:hover { background: rgba(255,255,255,.12); }
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .22s, opacity .22s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  z-index: 99;
  flex-direction: column;
  padding: 8px;
  gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: .92rem;
}
.mobile-nav .nav-link span { display: inline !important; }

@media (max-width: 640px) {
  .app-nav { display: none; }
  .hamburger { display: flex; }
  .app-header { position: relative; }
}

@media (min-width: 641px) {
  .mobile-nav { display: none !important; }
  .hamburger { display: none !important; }
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- HEADER ---------- */
.app-header {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand-icon { color: var(--accent); display: flex; align-items: center; }
.brand-text  { display: flex; flex-direction: column; line-height: 1.2; }
.brand-main  { font-size: 1.05rem; font-weight: 800; letter-spacing: .06em; color: #fff; }
.brand-sub   { font-size: .62rem; font-weight: 500; color: rgba(255,255,255,.65); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- NAV ---------- */
.app-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 6px;
  color: rgba(255,255,255,.80); font-size: .9rem; font-weight: 500;
  text-decoration: none; transition: background var(--transition), color var(--transition);
}
.nav-link:hover   { background: rgba(255,255,255,.12); color: #fff; }
.nav-link.active  { background: var(--accent); color: #fff; }
.nav-link svg     { flex-shrink: 0; }

/* ---------- MAIN ---------- */
.app-main { flex: 1; padding: 28px 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---------- FOOTER ---------- */
.app-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.55);
  font-size: .78rem;
  padding: 12px 24px;
  text-align: center;
}
.footer-inner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.footer-sep   { opacity: .4; }

/* ---------- SAYFA BAŞLIĞI ---------- */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 1.35rem; font-weight: 700; color: var(--primary); }
.page-subtitle { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- KARTLAR ---------- */
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  overflow: hidden;
}
.card-header {
  padding: 14px 20px; background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-header h3 { font-size: .92rem; font-weight: 700; color: var(--primary); letter-spacing: .03em; text-transform: uppercase; }
.card-header .card-icon { color: var(--primary-light); }
.card-body { padding: 20px; }

/* ---------- FORM ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.form-group label .required { color: #EF4444; margin-left: 2px; }

.form-control {
  width: 100%; padding: 9px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: #fff; color: var(--text);
  font-size: .92rem; font-family: inherit; transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46,84,144,.12);
}
.form-control::placeholder { color: var(--text-light); }
.form-control.error        { border-color: #EF4444; }
textarea.form-control      { resize: vertical; min-height: 110px; line-height: 1.6; }

/* ---------- BUTONLAR ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--radius); border: none; cursor: pointer;
  font-size: .9rem; font-weight: 600; font-family: inherit;
  text-decoration: none; transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg    { flex-shrink: 0; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }

.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); box-shadow: var(--shadow); }

.btn-success   { background: #22C55E; color: #fff; }
.btn-success:hover { background: #16A34A; box-shadow: var(--shadow); }

.btn-danger    { background: #EF4444; color: #fff; }
.btn-danger:hover { background: #DC2626; box-shadow: var(--shadow); }

.btn-outline   { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost     { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg-sidebar); color: var(--text); }

.btn-sm  { padding: 6px 14px; font-size: .82rem; }
.btn-lg  { padding: 12px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; }

/* ---------- UYARI / BİLDİRİM ---------- */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: .88rem; display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-error   { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }

/* ---------- YENİ EKSPERTİZ SAYFASI LAYOUT ---------- */
.report-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.report-section-title {
  font-size: .75rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
  display: flex; align-items: center; gap: 8px;
}
.report-section-title::before {
  content: ''; display: block; width: 4px; height: 16px;
  background: var(--accent); border-radius: 2px;
}

/* ---------- ARAÇ ŞABLONU ALANI ---------- */
.vehicle-schema-wrapper {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.vehicle-schema-header {
  padding: 14px 20px; background: var(--primary);
  display: flex; align-items: center; justify-content: space-between;
}
.vehicle-schema-header h3 {
  font-size: .88rem; font-weight: 700; color: #fff;
  text-transform: uppercase; letter-spacing: .06em;
}
.vehicle-schema-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.vehicle-svg-container {
  width: 100%;
  max-width: 700px;
  position: relative;
}
.vehicle-svg-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* SVG parça stilleri */
.car-part {
  cursor: pointer;
  transition: opacity var(--transition), filter var(--transition);
  stroke: #1E3A5F;
  stroke-width: 1.2;
  fill: #D1D9E6;
}
.car-part:hover { opacity: .80; filter: brightness(1.08); }
.car-part.selected { stroke-width: 2; filter: brightness(.92); }

/* Durum renkleri SVG parçaları için */
.status-original { fill: var(--status-original); }
.status-changed  { fill: var(--status-changed);  }
.status-wrapped  { fill: var(--status-wrapped);  }
.status-painted  { fill: var(--status-painted);  }
.status-plastic  { fill: var(--status-plastic);  }

/* ---------- LEGEND / AÇIKLAMA ---------- */
.legend-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  padding: 14px 20px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
}
.legend-item {
  display: flex; align-items: center; gap: 7px;
  font-size: .82rem; font-weight: 600; color: var(--text);
  padding: 5px 12px; border-radius: 20px;
  background: #fff; border: 1.5px solid var(--border);
  cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition);
  user-select: none;
}
.legend-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }
.legend-dot {
  width: 14px; height: 14px; border-radius: 3px;
  flex-shrink: 0; border: 1px solid rgba(0,0,0,.15);
}
.legend-dot.original { background: var(--status-original); }
.legend-dot.changed  { background: var(--status-changed);  }
.legend-dot.wrapped  { background: var(--status-wrapped);  }
.legend-dot.painted  { background: var(--status-painted);  }
.legend-dot.plastic  { background: var(--status-plastic);  }

/* ---------- PARÇA SEÇİM POPUP ---------- */
.part-popup {
  position: fixed; z-index: 999;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  min-width: 200px; overflow: hidden;
  animation: popupIn .14s ease;
}
@keyframes popupIn {
  from { opacity: 0; transform: scale(.92) translateY(-4px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}
.part-popup-header {
  padding: 10px 14px; background: var(--primary);
  color: #fff; font-size: .82rem; font-weight: 700;
  letter-spacing: .04em;
}
.part-popup-options { padding: 6px; }
.part-popup-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px;
  cursor: pointer; font-size: .88rem; font-weight: 500;
  transition: background var(--transition);
  border: none; background: none; width: 100%; text-align: left; color: var(--text);
}
.part-popup-option:hover { background: var(--bg-sidebar); }
.part-popup-option.active-option { background: var(--bg-sidebar); font-weight: 700; }
.option-dot {
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.2);
}

/* ---------- PARÇA TABLO GÖRÜNÜMÜ ---------- */
.parts-table-section {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.parts-group { margin-bottom: 0; }
.parts-group-title {
  padding: 8px 16px; background: var(--bg-sidebar);
  font-size: .75rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.parts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0; border-bottom: 1px solid var(--border-light);
}
.part-cell {
  padding: 10px 14px; border-right: 1px solid var(--border-light);
  cursor: pointer; transition: background var(--transition);
  display: flex; align-items: center; gap: 9px;
}
.part-cell:hover { background: var(--bg-sidebar); }
.part-cell:last-child { border-right: none; }
.part-cell-indicator {
  width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0;
  background: #D1D9E6; border: 1px solid rgba(0,0,0,.12);
  transition: background var(--transition);
}
.part-cell-name { font-size: .82rem; color: var(--text); }

/* ---------- AKSİYON TOOLBAR ---------- */
.action-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 18px 20px; background: var(--bg-card);
  border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.action-toolbar .toolbar-left  { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.action-toolbar .toolbar-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- KAYITLI RAPORLAR ---------- */
.reports-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.report-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
}
.report-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.report-card-header {
  padding: 14px 18px; background: var(--primary);
  display: flex; align-items: center; justify-content: space-between;
}
.report-card-plate {
  font-size: 1rem; font-weight: 800; color: #fff;
  letter-spacing: .1em; font-family: monospace;
}
.report-card-date { font-size: .78rem; color: rgba(255,255,255,.7); }
.report-card-body { padding: 14px 18px; flex: 1; }
.report-card-info { display: flex; flex-direction: column; gap: 5px; }
.report-info-row  { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.report-info-label { color: var(--text-muted); min-width: 70px; font-size: .78rem; font-weight: 600; text-transform: uppercase; }
.report-info-value { color: var(--text); font-weight: 500; }
.report-card-actions {
  padding: 12px 18px; border-top: 1px solid var(--border-light);
  display: flex; gap: 8px; background: var(--bg-sidebar);
}

/* ---------- BOŞ DURUM ---------- */
.empty-state {
  text-align: center; padding: 60px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.empty-state-icon { color: var(--text-light); }
.empty-state h3   { font-size: 1.1rem; color: var(--text-muted); font-weight: 600; }
.empty-state p    { font-size: .88rem; color: var(--text-light); max-width: 320px; }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 480px;
  animation: slideUp .18s ease;
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity:0; }
  to   { transform: translateY(0);    opacity:1; }
}
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--primary); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- TOAST ---------- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: .88rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px;
  animation: toastIn .2s ease;
}
@keyframes toastIn {
  from { opacity:0; transform: translateX(40px); }
  to   { opacity:1; transform: translateX(0); }
}
.toast-success { background: #166534; color: #fff; }
.toast-error   { background: #991B1B; color: #fff; }
.toast-info    { background: var(--primary); color: #fff; }
.toast-out     { animation: toastOut .22s ease forwards; }
@keyframes toastOut {
  to { opacity:0; transform: translateX(40px); }
}

/* ---------- YÜKLEME ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(255,255,255,.7); backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid var(--border); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: .9rem; color: var(--text-muted); font-weight: 500; }

/* ---------- BADGE ---------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: 20px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF9C3; color: #854D0E; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-muted   { background: var(--bg-sidebar); color: var(--text-muted); border: 1px solid var(--border); }

/* ---------- AYIRICI ---------- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---------- YARDIMCI ---------- */
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ============================================================
   YAZDIRMA / PRINT STİLLERİ
   ============================================================ */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }

  body { background: #fff !important; font-size: 11pt; color: #000; }

  /* Gizlenecekler */
  .app-header, .app-footer, .app-nav,
  .action-toolbar, .part-popup,
  .btn, button, .no-print,
  .toast-container, .loading-overlay,
  .modal-overlay { display: none !important; }

  /* Yazdırılacak alan */
  .app-main { padding: 0 !important; max-width: 100% !important; }
  .print-area { display: block !important; }

  /* Kart stilleri yazdırmada */
  .card, .vehicle-schema-wrapper, .parts-table-section {
    box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid;
  }
  .card-header, .vehicle-schema-header, .parts-group-title { background: #eee !important; color: #000 !important; }

  /* Sayfa boyutu */
  @page { size: A4 portrait; margin: 10mm 12mm; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* 1200px ve altı */
@media (max-width: 1200px) {
  .app-main { padding: 20px 16px; }
}

/* 1100px ve altı */
@media (max-width: 1100px) {
  .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .reports-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* 768px ve altı — Tablet */
@media (max-width: 768px) {
  html { font-size: 14px; }

  /* Header */
  .header-inner  { padding: 0 14px; height: 56px; gap: 12px; }
  .brand-sub     { display: none; }
  .brand-main    { font-size: .95rem; }
  .nav-link      { padding: 6px 10px; font-size: .80rem; gap: 5px; }
  .nav-link span { display: none; } /* sadece ikon göster */

  /* Main */
  .app-main { padding: 14px 12px; }

  /* Sayfa başlığı */
  .page-header   { margin-bottom: 16px; gap: 10px; }
  .page-title    { font-size: 1.15rem; }
  .page-subtitle { font-size: .80rem; }

  /* Formlar */
  .form-grid,
  .form-grid-2,
  .form-grid-3,
  .form-grid-4 { grid-template-columns: 1fr; }

  /* Butonlar — action bar içindekiler hariç tam genişlik olmasın */
  .page-header .btn { width: auto; }
  .report-card-footer .btn { width: auto; }

  /* Raporlar */
  .reports-grid { grid-template-columns: 1fr; }
  .reports-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .reports-toolbar > div { width: 100%; justify-content: space-between; }
  .search-box { width: 100%; }
  .search-box input { width: 100%; }

  /* Tablo görünümü mobilden taşmasın */
  .reports-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .reports-table { min-width: 600px; }

  /* Modal */
  .modal { max-width: 100%; margin: 0 12px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; min-width: 120px; }

  /* Toast */
  .toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { min-width: unset; max-width: 100%; width: 100%; }

  /* Action bar */
  .action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .action-bar .spacer { display: none; }
  .action-bar .btn {
    width: 100%;
    justify-content: center;
  }
  .action-bar .btn-accent { order: -1; } /* PDF kaydet butonu en üste */

  /* Parça grid */
  .parts-cells-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* 480px ve altı — Mobil */
@media (max-width: 480px) {
  html { font-size: 13px; }

  /* Header */
  .header-inner  { padding: 0 10px; height: 52px; }
  .brand-icon    { display: none; }
  .brand-main    { font-size: .88rem; }

  /* Nav — ikonlar bile küçülsün */
  .app-nav       { gap: 2px; }
  .nav-link      { padding: 5px 8px; }

  /* Main */
  .app-main { padding: 10px; }

  /* Kart */
  .report-card-footer { flex-wrap: wrap; gap: 6px; }
  .report-card-footer .spacer { width: 100%; display: none; }
  .report-card-footer .btn { flex: 1; justify-content: center; min-width: 80px; }

  /* Parça grid daha dar ekranda 2 kolon */
  .parts-cells-grid { grid-template-columns: repeat(2, 1fr); }

  /* Popup genişlik */
  .part-popup { min-width: 160px; max-width: calc(100vw - 24px); }

  /* İstatistik chips */
  .reports-stats { flex-wrap: wrap; }

  /* page-header dikey */
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header > div:last-child { width: 100%; }
  .page-header > div:last-child .btn { width: 100%; justify-content: center; }
}
