/* Garajm 2026 PWA Design System: high contrast, mobile-first, workshop-ready */
:root {
  --color-primary: #1D4ED8;
  --color-primary-dark: #1E3A8A;
  --color-primary-light: #EFF6FF;
  --color-accent: #C2410C;
  --color-accent-hover: #9A3412;
  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-surface: #F1F5F9;
  --bg-surface-hover: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #334155;
  --text-dim: #475569;
  --border-light: #E2E8F0;
  --border-strong: #94A3B8;
  --status-success: #166534;
  --status-warning: #92400E;
  --status-danger: #B91C1C;
  --status-info: #075985;
  --touch-target-min: 48px;
  --touch-target-lg: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, .08), 0 2px 6px -1px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, .12), 0 4px 10px -2px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; height: 100%; background: #0F172A; color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale; overflow: hidden;
}
body { display: flex; justify-content: center; align-items: center; min-height: 100vh; min-height: 100dvh; }
.phone-frame {
  width: 100%; max-width: 480px; height: 100vh; height: 100dvh; background: var(--bg-app);
  display: flex; flex-direction: column; overflow: hidden; position: relative; border: 0; box-shadow: none;
}
@media (min-width: 641px) {
  body { background: radial-gradient(circle at 50% 20%, #1E293B, #0F172A); padding: 20px; }
  .phone-frame { height: 94vh; max-height: 900px; border-radius: 36px; border: 8px solid #334155; box-shadow: 0 25px 60px -15px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); }
}
.topbar {
  background: #FFF; color: var(--text-main); padding: 0 16px; padding-top: env(safe-area-inset-top, 0px);
  display: flex; justify-content: space-between; align-items: center; z-index: 40;
  height: calc(58px + env(safe-area-inset-top, 0px)); min-height: 58px;
  border-bottom: 1px solid var(--border-light); box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.topbar-brand { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; color: var(--color-primary-dark); display: flex; align-items: center; gap: 6px; user-select: none; }
.topbar-btn {
  width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); color: var(--text-main); cursor: pointer; transition: background .15s, transform .1s;
  position: relative; background: transparent; border: 0;
}
.topbar-btn:active { background: var(--bg-surface); transform: scale(.95); }
.topbar-btn svg { width: 24px; height: 24px; stroke-width: 2.2; }
.content { overflow-y: auto; flex: 1; background: var(--bg-app); position: relative; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; padding-bottom: 80px; }
.bottom-nav {
  position: absolute; bottom: 0; left: 0; right: 0; height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px); background: #FFF; border-top: 1px solid var(--border-light);
  display: flex; justify-content: space-around; align-items: center; z-index: 50; box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.bottom-nav-item {
  flex: 1; min-height: 48px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-dim); text-decoration: none; font-size: .72rem; font-weight: 600; cursor: pointer;
  transition: color .15s, transform .1s; position: relative; padding: 4px 0; user-select: none;
}
.bottom-nav-item:active { transform: scale(.92); }
.bottom-nav-item.active { color: var(--color-primary); }
.bottom-nav-item svg { width: 22px; height: 22px; stroke-width: 2; }
.bottom-nav-item.active svg { stroke-width: 2.4; }
.bottom-nav-badge { position: absolute; top: 6px; right: calc(50% - 18px); background: var(--status-danger); color: #FFF; min-width: 16px; height: 16px; border-radius: 8px; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 2px solid #FFF; }
.card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 18px; margin: 14px 16px; border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; }
h2 { color: var(--color-primary-dark); font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; letter-spacing: -.3px; display: flex; align-items: center; gap: 8px; }
h3 { color: var(--text-main); font-size: 1.05rem; font-weight: 600; }
input, select, textarea { width: 100%; min-height: var(--touch-target-min); padding: 12px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-md); margin-bottom: 14px; background: #FFF; color: var(--text-main); outline: none; font-size: 1rem; line-height: 1.4; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(29,78,216,.18); }
label { display: block; font-size: .9rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.btn { width: 100%; min-height: var(--touch-target-min); background: var(--color-accent); color: #FFF; padding: 12px 16px; border: 0; border-radius: var(--radius-md); font-weight: 700; font-size: 1.05rem; cursor: pointer; margin-bottom: 12px; transition: background .15s, transform .1s, box-shadow .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 2px 4px rgba(194,65,12,.2); touch-action: manipulation; }
.btn:active { transform: scale(.98); background: var(--color-accent-hover); }
.btn-blue { background: var(--color-primary); box-shadow: 0 2px 4px rgba(29,78,216,.2); }
.btn-blue:active { background: var(--color-primary-dark); }
.btn-green { background: var(--status-success); box-shadow: 0 2px 4px rgba(22,101,52,.2); }
.btn-green:active { background: #14532D; }
.btn-red { background: var(--status-danger); box-shadow: 0 2px 4px rgba(185,28,28,.2); }
.btn-red:active { background: #7F1D1D; }
.btn-outline { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-primary); box-shadow: none; }
.btn-outline:active { background: var(--color-primary-light); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.list-item { background: var(--bg-card); padding: 16px; border-radius: var(--radius-md); margin-bottom: 12px; border: 1px solid var(--border-light); border-left: 5px solid var(--color-accent); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.list-item:active { transform: scale(.99); }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-full); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.badge-blue { background: #DBEAFE; color: #1E40AF; }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.sahibinden-item { display: flex; align-items: center; min-height: 58px; padding: 14px 18px; background: #FFF; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background .15s; }
.sahibinden-item:active { background: var(--bg-surface); }
.sahibinden-icon { width: 42px; height: 42px; border-radius: var(--radius-md); background: var(--color-primary-light); color: var(--color-primary); display: flex; justify-content: center; align-items: center; margin-right: 14px; flex-shrink: 0; }
.sahibinden-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }
.sahibinden-text { flex: 1; }
.s-title { font-size: 1rem; font-weight: 600; color: var(--text-main); }
.s-subtitle { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.sahibinden-arrow { color: var(--text-dim); padding-left: 10px; transition: transform .25s; display: flex; align-items: center; }
.sahibinden-arrow.open { transform: rotate(90deg); }
.cat-content { display: none; padding: 8px 16px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border-light); }
#sidebarOverlay { position: absolute; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 99; transition: opacity .3s; }
#sidebarMenu { position: absolute; top: 0; left: -280px; width: 260px; height: 100%; background: #FFF; z-index: 100; transition: left .3s cubic-bezier(.16,1,.3,1); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.sb-header { background: linear-gradient(135deg,var(--color-primary-dark),var(--color-primary)); color: #FFF; padding: 40px 20px 24px; }
.sb-item { min-height: 52px; padding: 14px 20px; color: var(--text-main); font-weight: 600; font-size: .95rem; border-bottom: 1px solid var(--border-light); cursor: pointer; display: flex; align-items: center; transition: background .15s; }
.sb-item:active { background: var(--bg-surface); }
.sb-icon { margin-right: 14px; width: 24px; min-height: 24px; display: flex; align-items: center; justify-content: center; }
#notifPanel { position: absolute; top: 64px; right: 14px; width: calc(100% - 28px); max-width: 360px; background: #FFF; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 900; padding: 16px; max-height: 420px; overflow-y: auto; border: 1px solid var(--border-light); animation: slideDown .2s cubic-bezier(.16,1,.3,1); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.car-part, .chassis-part { cursor: pointer; transition: transform .15s, filter .15s; border: 2px solid #FFF; color: #FFF !important; box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.8); font-weight: 700; border-radius: var(--radius-sm); font-size: 12px; user-select: none; }
.car-part:active, .chassis-part:active { transform: scale(.96); filter: brightness(1.15); }
.cp-lg { height: 75px; } .cp-xl { height: 158px; font-size: 15px; } .cp-md { height: 75px; font-size: 13px; } .cp-sm { width: 76%; height: 40px; border-radius: var(--radius-sm); font-size: 12px; } .cp-ch-md { height: 50px; } .cp-ch-lg { height: 80px; }
.status-orijinal { background: #334155 !important; } .status-lokal { background: #C2410C !important; } .status-boyali { background: #FACC15 !important; color: #713F12 !important; text-shadow: none; } .status-degisen { background: #DC2626 !important; } .status-islemli { background: #DB2777 !important; } .status-soktak { background: #6D28D9 !important; } .status-ezik { background: #047857 !important; } .status-dolu { background: #0369A1 !important; } .status-hasarli { background: #0F172A !important; }
.exp-sec-box { border: 1px solid var(--border-light); border-radius: var(--radius-md); margin-bottom: 12px; background: #FFF; overflow: hidden; box-shadow: var(--shadow-sm); }
.exp-sec-hdr { background: var(--color-primary-dark); color: #FFF; padding: 12px 14px; font-weight: 700; font-size: .9rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.exp-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border-light); font-size: .85rem; }
.exp-row:nth-child(even) { background: var(--bg-app); }
.exp-val-bad { color: var(--status-danger) !important; font-weight: 700 !important; } .exp-val-ok { color: var(--status-success) !important; font-weight: 600 !important; }
.exp-eval-bar { display: flex; align-items: center; font-size: .8rem; font-weight: 700; border-top: 2px solid var(--border-light); padding: 8px 12px; }
.legend-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.part-status-tag { display: block; font-size: 10px; line-height: 1.3; margin-top: 2px; font-weight: 700; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media print {
  body { background: #FFF !important; margin: 0; padding: 0; display: block; }
  .phone-frame { width: 100% !important; height: auto !important; border: none !important; border-radius: 0 !important; box-shadow: none !important; margin: 0; padding: 0; }
  .topbar, .bottom-nav, #sidebarMenu, #sidebarOverlay, .btn { display: none !important; }
  .content { padding: 0 !important; overflow: visible !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

#topNavbar.hidden ~ #bottomNavbar { display: none !important; }



/* Senior UI/UX: İkon & Rozet Hizalama Standartları */
.sahibinden-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; vertical-align: middle; }
.btn-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.card-header-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: -3px; margin-right: 8px; }
.card-header-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
/* Inline SVG Icon standard */
.inline-svg {
    width: 1.1em;
    height: 1.1em;
    display: inline-block;
    vertical-align: -0.18em;
    stroke: currentColor;
    flex-shrink: 0;
}
.sahibinden-icon .inline-svg {
    width: 1.3em;
    height: 1.3em;
    vertical-align: middle;
}

/* UI/UX: ortak yukleme durumu (spinner) */
.loading-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 22px 16px; color: var(--text-muted); font-size: .95rem; font-weight: 600; text-align: center; }
.loading-block .spinner { width: 28px; height: 28px; border: 3px solid var(--border-light); border-top-color: var(--color-primary); border-radius: 50%; animation: gm-spin .8s linear infinite; }
@keyframes gm-spin { to { transform: rotate(360deg); } }
/* UI/UX: cevrimdisi bildirimi (alt gezinme ustunde) */
.offline-banner { position: absolute; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); z-index: 90; background: var(--status-warning); color: #FFF; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.offline-banner svg { width: 24px; height: 24px; flex-shrink: 0; }
.offline-banner b { display: block; font-size: 1rem; }
.offline-banner span { display: block; font-size: .85rem; opacity: .95; }
/* UI/UX: mesaj sohbeti geri donus butonu (48px dokunma alani) */
.chat-back-btn { width: 48px; height: 48px; min-width: 48px; margin-left: -12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.14); border: 0; border-radius: var(--radius-full); color: #FFF; cursor: pointer; }
.chat-back-btn svg { width: 24px; height: 24px; }
.chat-back-btn:active { background: rgba(255,255,255,.28); }

/* === Masaüstü / Tablet Yatay (>=1024px): kalici sol menu + genis icerik; telefon gorunumu degismez === */
@media (min-width: 1024px) {
  body { padding: 0; background: var(--bg-app); }
  .phone-frame { max-width: none !important; width: 100% !important; height: 100vh !important; height: 100dvh !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  #sidebarMenu { left: 0 !important; width: 280px; transform: none !important; transition: none; box-shadow: none; border-right: 1px solid var(--border-light); }
  .sb-header { padding-top: 20px; }
  #sidebarOverlay, #menuBtnTop { display: none !important; }
  #bottomNavbar { display: none !important; }
  .content { margin-left: 280px; padding: 24px max(32px, calc((100% - 1240px) / 2)) 48px; }
}

/* === Usta özeti ve iş listesi: kompakt modern bileşenler (telefon + masaüstü) === */
.mech-hero { background: #0F172A; border-radius: 14px; padding: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; margin-bottom: 12px; }
.mech-hero .mh-cell { background: #1E293B; border-radius: 10px; padding: 8px 14px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.mech-hero .mh-next { flex: 1 1 200px; }
.mech-hero .mh-stat { flex: 0 1 auto; min-width: 104px; text-align: center; align-items: center; }
.mech-hero .mh-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.5px; color: #94A3B8; text-transform: uppercase; }
.mech-hero .mh-plate { font-size: 1.35rem; font-weight: 800; letter-spacing: 1px; color: #F8FAFC; line-height: 1.25; }
.mech-hero .mh-sub { font-size: 0.75rem; font-weight: 600; color: #93C5FD; }
.mech-hero .mh-num { font-size: 1.5rem; font-weight: 800; color: #F8FAFC; line-height: 1.2; }
.mech-hero .mh-warn { color: #FCD34D; }
.mech-hero .mh-empty { font-size: 1.05rem; font-weight: 700; color: #CBD5E1; }
.mech-lowstock { background: #7F1D1D; border-radius: 10px; padding: 8px 12px; font-size: 0.78rem; color: #FECACA; }
.mech-lowstock.mh-inside { width: 100%; margin-top: 4px; }

.mech-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.mech-summary .ms-chip { background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 10px; padding: 8px 10px; text-align: center; }
.mech-summary .ms-label { font-size: 0.7rem; color: #6B7280; font-weight: 700; }
.mech-summary .ms-value { font-size: 1.05rem; font-weight: 800; line-height: 1.35; }
.ms-prim { background: #FEF9C3; border-radius: 10px; padding: 8px 12px; text-align: center; margin-bottom: 12px; }
@media (min-width: 641px) { .mech-summary { grid-template-columns: repeat(4, 1fr); } }

.job-item { background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.job-item .ji-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.job-item .ji-plate { font-size: 1rem; font-weight: 800; letter-spacing: 0.5px; color: #111827; }
.job-item .ji-price { font-size: 1rem; font-weight: 800; color: #111827; white-space: nowrap; }
.job-item .ji-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: #6B7280; margin-top: 4px; }

@media (min-width: 1024px) {
  /* Masaustunde usta ekranlarini okunabilir sutuna sinirla; plaka/fiyat birbirine yaklasir */
  #myJobsScreen .card, #mechList { max-width: 900px; }
}
