@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f4f4f5;
  --card: #ffffff;
  --text: #14161a;
  --muted: #5f636b;
  --muted-light: #9296a0;
  --border: #e4e4e7;
  /* Marka: kirmizi / siyah / beyaz */
  --accent: #d61f2b;
  --accent-dark: #a4141e;
  --accent-soft: #fdeaeb;
  --sidebar-bg: #101012;
  --sidebar-bg-2: #1a1a1d;
  --sidebar-text: #b3b5bd;
  --sidebar-text-active: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #15803d;
  --success-soft: #dcfce7;
  --info: #b91c1c;
  --info-soft: #fde8e8;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,10,12,.05), 0 4px 16px rgba(214,31,43,.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 16.5px;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin-top: 0; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: 27px; }
h2 { font-size: 19px; }
svg.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
  color: var(--sidebar-text);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.sidebar-brand .logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand .logo-mark svg { width: 18px; height: 18px; stroke: #fff; }
.sidebar-brand .brand-logo-img {
  width: 46px; height: 46px; border-radius: 999px; flex-shrink: 0;
  object-fit: cover; background: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.15);
}
.topbar-logo-img {
  width: 46px; height: 46px; border-radius: 999px; flex-shrink: 0;
  object-fit: cover; background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; padding: 14px 10px 6px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 15px;
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar nav a.active svg { stroke: #fff; }

/* Bolum accordion menusu */
.nav-group { display: flex; flex-direction: column; }
.nav-group-head {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border: none; background: transparent; cursor: pointer;
  color: var(--sidebar-text); font-family: inherit; font-size: 15px; font-weight: 500;
  border-radius: 8px; text-align: left;
  transition: background-color .15s ease, color .15s ease;
}
.nav-group-head:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-group-head .nav-chevron { margin-left: auto; display: flex; transition: transform .2s ease; }
.nav-group-head .nav-chevron svg { width: 16px; height: 16px; }
.nav-group.open .nav-group-head .nav-chevron { transform: rotate(180deg); }
.nav-group.open .nav-group-head { color: #fff; }
.nav-group-body { display: none; flex-direction: column; gap: 2px; padding: 2px 0 6px 20px; }
.nav-group.open .nav-group-body { display: flex; }
.nav-group-body a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--sidebar-text); font-size: 14px; font-weight: 500; }
.nav-group-body a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-group-body a.active { background: var(--accent); color: #fff; }

.sidebar-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sidebar-user .avatar {
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sidebar-user .name { color: #fff; font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.sidebar-user .role { color: #8b90a0; font-size: 12px; }
.sidebar-footer a.logout-link {
  display: flex; align-items: center; gap: 8px;
  color: #b8bcc8; font-size: 13px; padding: 6px 2px;
}
.sidebar-footer a.logout-link:hover { color: #fff; text-decoration: none; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,10,15,.5);
  z-index: 150;
}
.sidebar-backdrop.show { display: block; }

.main { margin-left: 236px; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: var(--sidebar-bg);
  color: #fff;
  border-bottom: 3px solid var(--accent);
  position: sticky; top: 0; z-index: 60;
}
.topbar .menu-btn {
  border: none; background: transparent; padding: 6px; color: #fff;
  display: none; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
}
.topbar .menu-btn svg { stroke: #fff; }
.topbar .menu-btn:hover { background: rgba(255,255,255,.1); }
.topbar .topbar-brand { display: none; font-weight: 800; font-size: 16px; color: #fff; }

/* Sag ust: iletisim + logo */
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-contact {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
  text-align: right;
}
.topbar-contact .tc-lines { line-height: 1.35; }
.topbar-contact .tc-phone { font-weight: 800; font-size: 15px; color: #fff; letter-spacing: .01em; }
.topbar-contact .tc-addr { font-size: 12.5px; color: #c9cbd2; }
.topbar-logo {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(214,31,43,.4);
}
.topbar-logo svg { width: 26px; height: 26px; stroke: #fff; fill: none; }
@media (max-width: 620px) {
  .topbar-contact .tc-addr { display: none; }
  .topbar-contact { gap: 10px; }
}

/* Kenar cubugu marka alt basligi */
.sidebar-brand .brand-lines { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar-brand .brand-tag { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

.content { padding: 28px 32px; max-width: 1180px; width: 100%; }

@media (max-width: 920px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: flex; }
  .topbar .topbar-brand { display: block; }
  .content { padding: 18px 16px 32px; }
  .form-row { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ---------- Cards / stats ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; position: relative; border-bottom: 2px solid var(--border); padding-bottom: 14px; }
.page-head::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 72px; height: 3px; background: var(--page, var(--accent)); border-radius: 3px; }
.page-head h1 { margin: 0; border-left: 5px solid var(--page, var(--accent)); padding-left: 12px; }
.page-sub { color: var(--muted); font-size: 14.5px; margin-top: 3px; }

/* Sayfa bazli renk kodlamasi (--page) */
body { --page: var(--accent); }
body.pg-index { --page: #d61f2b; }
body.pg-reminders { --page: #b45309; }
body.pg-customers, body.pg-vehicles, body.pg-customer_detail, body.pg-vehicle_detail { --page: #0e7490; }
body.pg-records, body.pg-record_detail { --page: #d61f2b; }
body.pg-quotes, body.pg-quote_detail { --page: #6d28d9; }
body.pg-products, body.pg-stock { --page: #15803d; }
body.pg-reports, body.pg-work_report, body.pg-cost_report { --page: #111827; }
body.pg-users { --page: #a4141e; }
body.pg-plate_lookup { --page: #d61f2b; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.stat-box .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-box .value { font-size: 23px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.stat-box.accent .value { color: var(--accent-dark); }
.stat-box.good .value { color: var(--success); }
.stat-box.bad .value { color: var(--danger); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { text-align: left; padding: 12px 11px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td.wrap, th.wrap { white-space: normal; }
th { color: var(--muted); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: #fafafa; }
tfoot td { border-top: 2px solid var(--border); border-bottom: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.3;
  transition: background-color .15s ease, transform .06s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 13px; font-size: 13.8px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: #eef0f3; color: var(--text); }
.btn-secondary:hover { background: #e2e4e9; color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 14.5px; font-weight: 600; }
.form-hint { color: var(--muted-light); font-size: 13px; margin-top: 4px; }
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=number],
.form-group input[type=date],
.form-group input[type=datetime-local],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; min-width: 0; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* Segmentli secim (Mevcut / Yeni) */
.seg-toggle { display: inline-flex; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.seg-toggle .seg { padding: 9px 20px; cursor: pointer; font-weight: 700; font-size: 14.5px; color: var(--muted); background: #fff; user-select: none; transition: background-color .15s ease, color .15s ease; }
.seg-toggle .seg + .seg { border-left: 2px solid var(--border); }
.seg-toggle .seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg-toggle .seg.active { background: var(--accent); color: #fff; }
.sub-block { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; background: #fafbfc; }
.mode-panel[hidden] { display: none; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 14.5px; font-weight: 600; background: #fff; }
.check-chip:hover { border-color: var(--accent); }
.check-chip input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Ayri ayri arama kutulari (plaka / ad / sasi) */
.search-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.search-3col label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.search-3col .inline-form { flex-wrap: nowrap; gap: 8px; }
.search-3col .inline-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; }
.search-3col .inline-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 820px) { .search-3col { grid-template-columns: 1fr; } }

/* Aranabilir/yazilabilir secim kutusu (combo) */
.combo { position: relative; }
.combo-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
.combo-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.combo-menu {
  display: none; position: absolute; z-index: 90; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 260px; overflow-y: auto; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0,0,0,.14);
}
.combo.open .combo-menu { display: block; }
.combo-item { padding: 9px 12px; font-size: 14.5px; cursor: pointer; }
.combo-item:hover, .combo-item.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.combo-empty { padding: 9px 12px; color: var(--muted); font-size: 14px; }

.search-form { display: flex; gap: 8px; }
.search-form input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: inherit; min-width: 200px; }

/* File upload */
.file-drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color .15s;
}
.file-drop:hover { border-color: var(--accent); }
.file-drop.has-file { border-color: var(--success); border-style: solid; background: #f0fbf4; }
.file-drop.has-file .file-drop-label { color: var(--success); }
.file-drop.has-file .file-drop-label strong { color: var(--success); }
.file-drop input[type=file] { display: none; }
.file-drop .file-drop-label { color: var(--muted); font-size: 13px; }
.file-drop .file-drop-label strong { color: var(--accent-dark); }
.preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.preview-grid .thumb { width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); position: relative; background: #f3f4f6; }
.preview-grid .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-grid .thumb.pdf { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; font-weight: 700; }

/* Arac detayinda servise gore gruplu foto galerisi */
.photo-service-group { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: #fafbfc; }
.photo-service-group .psg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

.file-gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.file-gallery .file-card { width: 120px; }
.file-gallery .file-thumb {
  width: 120px; height: 120px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
}
.file-gallery .file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-gallery .file-name { font-size: 11.5px; color: var(--muted); margin-top: 5px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11.8px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-open { background: var(--warn-soft); color: var(--warn); }
.badge-closed { background: var(--success-soft); color: var(--success); }
.badge-admin { background: #ede9fe; color: #5b21b6; }
.badge-personel { background: var(--info-soft); color: var(--info); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-wait { background: #f3f4f6; color: var(--muted); }
.badge-progress { background: var(--info-soft); color: var(--info); }
.badge-done { background: var(--success-soft); color: var(--success); }
.badge-gelir { background: var(--success-soft); color: var(--success); }
.badge-gider { background: var(--danger-soft); color: var(--danger); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 4px; margin-right: 14px; font-size: 13.8px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent-dark); border-color: var(--accent); }

/* ---------- Flash ---------- */
.flash { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 13.8px; font-weight: 500; }
.flash-success { background: var(--success-soft); color: #14532d; }
.flash-error { background: var(--danger-soft); color: #7f1d1d; }

/* ---------- Login / setup ---------- */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #23262d, #101114 70%);
  padding: 20px;
}
.login-box {
  background: var(--card);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%; max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-box .logo-mark {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.login-box .logo-mark svg { width: 24px; height: 24px; stroke: #fff; }
.login-box .login-logo { display: block; width: 96px; height: 96px; border-radius: 999px; object-fit: cover; margin: 0 auto 16px; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.login-box h1 { text-align: center; font-size: 19px; margin-bottom: 4px; }
.login-box .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.actions-cell { white-space: nowrap; }
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty-state svg { width: 34px; height: 34px; stroke: var(--muted-light); margin-bottom: 10px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: none; }
.section-title { font-size: 13.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 0 0 12px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.plate-tag {
  display: inline-block; font-weight: 800; letter-spacing: .03em;
  background: #111827; color: #fff; padding: 3px 9px; border-radius: 6px; font-size: 12.5px;
}
.plate-tag-lg { font-size: 19px; padding: 6px 14px; letter-spacing: .08em; border-radius: 8px; }
.money { font-variant-numeric: tabular-nums; }
.summary-list { display: flex; flex-direction: column; gap: 10px; }
.summary-list .row { display: flex; justify-content: space-between; font-size: 13.8px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.summary-list .row:last-child { border-bottom: none; font-weight: 700; }

/* ---------- Surec / asama zaman cizelgesi ---------- */
.stage-timeline { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.stage-step {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 10px;
  background: #f3f4f6; border: 1px solid transparent;
  min-width: 150px;
}
.stage-step.stage-tamamlandi { background: var(--success-soft); }
.stage-step.stage-devam_ediyor { background: var(--info-soft); box-shadow: 0 0 0 2px rgba(37,99,235,.18); }
.stage-step.stage-bekliyor { background: #f3f4f6; }
.stage-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--muted-light); flex-shrink: 0; }
.stage-step.stage-tamamlandi .stage-dot { background: var(--success); }
.stage-step.stage-devam_ediyor .stage-dot { background: var(--info); animation: stagepulse 1.6s infinite; }
.stage-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.stage-status { font-size: 11.5px; color: var(--muted); }
.stage-time { font-size: 10.5px; color: var(--muted-light); margin-top: 1px; }
.stage-connector { width: 20px; height: 2px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
@keyframes stagepulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Plaka sorgulama kutusu ---------- */
.plate-search-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 34px 24px;
  margin-bottom: 22px;
  text-align: center;
}
.plate-search-card h2 { font-size: 26px; margin-bottom: 6px; }
.plate-search-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.plate-input-wrap {
  display: flex;
  align-items: stretch;
  max-width: 560px;
  margin: 0 auto 18px;
  border: 3px solid #111827;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(16,20,30,.08);
}
.plate-input-wrap .tr-badge {
  background: #1e63d0;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 0 8px;
  width: 46px;
  flex-shrink: 0;
  letter-spacing: .05em;
}
.plate-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .18em;
  text-align: center;
  text-transform: uppercase;
  color: var(--text);
  padding: 10px 8px;
  font-family: inherit;
  background: transparent;
  min-width: 0;
}
.plate-input-wrap input::placeholder { color: #c7cbd2; }
.plate-search-card .btn-lg { padding: 13px 28px; font-size: 16px; background: var(--accent); }
.plate-search-card .btn-lg:hover { background: var(--accent-dark); }
@media (max-width: 520px) {
  .plate-input-wrap input { font-size: 22px; letter-spacing: .1em; }
  .plate-search-card h2 { font-size: 20px; }
}

/* ---------- Ikonlu istatistik kartlari ---------- */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.stat-card .stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-card .stat-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; line-height: 1.35; }
.stat-card .stat-value { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em; }
.stat-card .stat-value.money { font-size: 22px; }
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.stat-icon.i-blue { background: var(--info-soft); color: var(--info); }
.stat-icon.i-amber { background: var(--warn-soft); color: var(--warn); }
.stat-icon.i-green { background: var(--success-soft); color: var(--success); }
.stat-icon.i-cyan { background: #cffafe; color: #0e7490; }
.stat-icon.i-accent { background: var(--accent-soft); color: var(--accent-dark); }
.stat-icon svg { stroke: currentColor; fill: none; }
.stat-progress { height: 5px; border-radius: 999px; background: #eef0f3; margin-top: 14px; overflow: hidden; }
.stat-progress > span { display: block; height: 100%; border-radius: 999px; }
.stat-progress > span.p-blue { background: var(--info); }
.stat-progress > span.p-amber { background: #f59e0b; }
.stat-progress > span.p-green { background: var(--success); }
.stat-progress > span.p-cyan { background: #06b6d4; }

/* ---------- Iki kolon dizilim ---------- */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 920px) { .grid-2 { grid-template-columns: 1fr; } }

/* Uyari / liste satirlari */
.mini-list { display: flex; flex-direction: column; }
.mini-list .mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.mini-list .mini-row:last-child { border-bottom: none; }
.mini-list .mini-row .m-title { font-weight: 600; }
.mini-list .mini-row .m-sub { color: var(--muted); font-size: 12px; }

/* ---------- POS ---------- */
.pos-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 920px) { .pos-layout { grid-template-columns: 1fr; } }
.product-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.product-pick {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer;
  background: #fff; text-align: left; font-family: inherit;
}
.product-pick:hover { border-color: var(--accent); background: var(--accent-soft); }
.product-pick .pp-name { font-weight: 700; font-size: 13.5px; }
.product-pick .pp-meta { color: var(--muted); font-size: 12px; margin-top: 3px; display: flex; justify-content: space-between; }
.product-pick .pp-price { color: var(--accent-dark); font-weight: 700; }
.product-pick[disabled] { opacity: .5; cursor: not-allowed; }
.cart-line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cart-line .cl-name { flex: 1; font-size: 13.5px; font-weight: 600; }
.cart-line input.cl-qty { width: 56px; text-align: center; padding: 5px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; }
.cart-line .cl-price { width: 90px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.cart-line .cl-remove { border: none; background: transparent; color: var(--danger); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 20px; font-weight: 800; margin: 14px 0; }

.stock-low { color: var(--danger); font-weight: 700; }
.stock-ok { color: var(--success); font-weight: 700; }

/* ---------- Renkli tablo satirlari (odeme durumu) ---------- */
tbody tr.row-unpaid { background: #fff1f1; }
tbody tr.row-unpaid:hover { background: #ffe5e5; }
tbody tr.row-paid { background: #f0fbf4; }
tbody tr.row-paid:hover { background: #e3f7ea; }
.amount-pos { color: var(--danger); font-weight: 700; }
.amount-zero { color: var(--success); font-weight: 700; }

/* Detay bilgi satirlari (arac/musteri karti) */
.detail-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.detail-list .drow { display: flex; border-bottom: 1px solid var(--border); }
.detail-list .drow:last-child { border-bottom: none; }
.detail-list .drow:nth-child(even) { background: #fafbfc; }
.detail-list .dlabel { width: 200px; flex-shrink: 0; padding: 12px 16px; font-weight: 600; color: var(--muted); text-align: right; }
.detail-list .dval { padding: 12px 16px; font-weight: 600; }
@media (max-width: 560px) { .detail-list .dlabel { width: 130px; text-align: left; } }

/* ---------- Yazdirilabilir form ---------- */
.print-sheet { background: #fff; color: #000; max-width: 800px; margin: 0 auto; padding: 24px; }
.print-sheet .ph-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; border-bottom: 2px solid #000; padding-bottom: 10px; }
.print-sheet .ph-brandwrap { display: flex; align-items: center; gap: 12px; }
.print-sheet .ph-logo { width: 70px; height: 70px; border-radius: 999px; object-fit: cover; flex-shrink: 0; }
.print-sheet .ph-brand { font-size: 18px; font-weight: 800; line-height: 1.15; max-width: 420px; }
.print-sheet .ph-addr { font-size: 11px; color: #333; margin-top: 3px; max-width: 380px; }
.print-sheet .ph-phone { font-size: 12.5px; color: #000; font-weight: 700; margin-top: 2px; }
.print-sheet .ph-contact { font-size: 12px; color: #333; text-align: right; white-space: nowrap; }

/* Fatura QR kodu */
.ph-qr { margin-top: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ph-qr #invoiceQr img, .ph-qr #invoiceQr canvas { display: block; }
.ph-qr-cap { font-size: 9px; color: #555; text-align: right; line-height: 1.2; }

/* Misafir fatura sayfasi (fatura.php) */
body.public-invoice { background: #eceef1; padding: 20px 12px; }
body.public-invoice .print-sheet { background: #fff; margin: 0 auto; box-shadow: 0 8px 30px rgba(0,0,0,.12); border-radius: 8px; }
body.public-invoice .pub-toolbar { max-width: 800px; margin: 0 auto 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
body.public-invoice .pub-toolbar .pub-brand { font-weight: 800; color: var(--accent); }

/* Fatura: urun/iscilik iki sutun + arac fotograflari */
.print-sheet .col-title { font-weight: 800; font-size: 13px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.print-sheet .info-table th { width: 15%; white-space: nowrap; }
.print-photos { margin: 12px 0 14px; }
.print-photos .pp-title { font-weight: 800; font-size: 13px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }
.print-photos .pp-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.print-photos .pp-grid img { width: 132px; height: 99px; object-fit: cover; border: 1px solid #333; border-radius: 4px; }
@media print {
  .print-photos .pp-grid img { width: 120px; height: 90px; }
  .print-grid { display: flex !important; }
}

/* On Ekspertiz Raporu duzeni */
.print-sheet.eks { max-width: 830px; }
.eks-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 2px solid #000; padding-bottom: 6px; }
.eks-promo { font-size: 9.5px; font-weight: 700; text-transform: uppercase; max-width: 175px; line-height: 1.6; color: #b0141e; }
.eks-center { text-align: center; flex: 1; }
.eks-center .eks-logo { width: 54px; height: 54px; border-radius: 999px; object-fit: cover; }
.eks-center .b { font-size: 16px; font-weight: 800; margin-top: 2px; }
.eks-center .ph { font-size: 10.5px; color: #222; }
.eks-brands { font-size: 9.5px; font-weight: 700; max-width: 150px; text-align: right; line-height: 1.6; color: #b0141e; }
.eks-title { text-align: center; font-size: 15px; font-weight: 800; letter-spacing: 1px; margin: 8px 0; }
.eks-grid { display: flex; gap: 10px; align-items: flex-start; }
.eks-parts { flex: 1.7; min-width: 0; }
.eks-side { flex: 1; min-width: 0; }
.eks-info th, .eks-info td, .eks-labor th, .eks-labor td { font-size: 12px; padding: 4px 7px; }
.eks-info th, .eks-labor th { width: 46%; white-space: nowrap; }
.eks-labor { margin-top: 8px; }
.eks-labor .tot th, .eks-labor .tot td { background: #f2f2f2; }
.eks-labor .grand th, .eks-labor .grand td { background: #e6e6e6; font-size: 13px; }
.eks-onarim { margin-top: 10px; border: 1px solid #333; }
.eks-onarim-title { background: #ececec; font-weight: 800; font-size: 12px; padding: 4px 8px; border-bottom: 1px solid #333; }
.eks-onarim-body { min-height: 60px; padding: 8px; font-size: 12px; }
.eks-diagram { margin-top: 10px; }

/* Imza alanlari */
.print-sheet .sign-row { display: flex; gap: 48px; margin-top: 40px; }
.print-sheet .sign-box { flex: 1; }
.print-sheet .sign-line { border-top: 1px solid #000; margin-top: 54px; padding-top: 6px; font-size: 12.5px; font-weight: 700; text-align: center; }
.print-sheet .ph-plate { font-size: 30px; font-weight: 800; margin: 10px 0 18px; }
.print-sheet .ph-plate .line { display: inline-block; min-width: 300px; border-bottom: 3px solid #000; }
.print-grid { display: flex; gap: 18px; align-items: flex-start; }
.print-grid .pg-left { flex: 1; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { border: 1px solid #333; padding: 7px 9px; font-size: 13px; text-align: left; vertical-align: top; }
.info-table th { width: 38%; font-weight: 700; background: #fff; white-space: normal; }
.info-table td { min-height: 22px; }
.items-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.items-table th, .items-table td { border: 1px solid #333; padding: 8px; font-size: 13px; }
.items-table th { background: #ececec; }
.items-table td.num, .items-table th.num { text-align: right; }
.items-table .rownum { width: 28px; text-align: center; }
.items-table .fill td { height: 30px; }
.totals-row { text-align: right; font-weight: 800; font-size: 15px; margin-top: 4px; }
.totals-row .tline { display: inline-block; min-width: 220px; border-bottom: 2px solid #000; margin-left: 8px; }
.diagram-box { width: 320px; flex-shrink: 0; }
.diagram-box svg { width: 100%; height: auto; }

/* Arac diyagrami isaret katmani */
.diagram-wrap { position: relative; width: 100%; }
.diagram-wrap svg { width: 100%; height: auto; display: block; }
.diagram-wrap img.diagram-car { width: 100%; height: auto; display: block; }
.diagram-box img.diagram-car { width: 100%; height: auto; }
.diagram-marks { position: absolute; inset: 0; pointer-events: none; }
.dmark {
  position: absolute; transform: translate(-50%, -50%);
  width: 20px; height: 20px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #dc2626;
}
/* Hasar tipi secim butonlari */
.damage-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dtype-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--c, #dc2626); background: #fff; color: var(--c, #dc2626);
  font-family: inherit; font-size: 14px; font-weight: 700;
  transition: background-color .15s ease, color .15s ease;
}
.dtype-btn::before { content: ''; width: 12px; height: 12px; border-radius: 999px; background: var(--c, #dc2626); }
.dtype-btn:hover { background: color-mix(in srgb, var(--c) 12%, #fff); }
.dtype-btn.active { background: var(--c, #dc2626); color: #fff; }
.dtype-btn.active::before { background: #fff; }

/* Duzenleme modunda tiklanabilir alan */
.diagram-edit { max-width: 500px; }
.diagram-edit .diagram-wrap { cursor: crosshair; border: 1px dashed var(--border); border-radius: 10px; overflow: hidden; }
.diagram-edit .dmark { cursor: pointer; pointer-events: auto; }
.diagram-marks.editable { pointer-events: none; }
.dmark-list { margin-top: 10px; }
.dmark-list .dmark-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.dmark-list .dmark-badge { width: 20px; height: 20px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.print-toolbar { margin-bottom: 16px; }
@media print {
  .sidebar, .topbar, .sidebar-backdrop, .print-toolbar, .no-print { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  body { background: #fff !important; font-size: 12px; }
  .card, .print-sheet { box-shadow: none !important; border: none !important; }
  @page { margin: 12mm; }
}

/* ---------- Is kalemi kartlari ---------- */
.task-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.task-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.task-card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.task-desc { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.task-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.task-photo-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.file-drop.small { padding: 8px 12px; }
.file-gallery.small .file-thumb, .file-gallery.small { width: 64px; height: 64px; }
.file-gallery.small .file-card { width: 64px; }

/* ---------- Sag alt kose bildirimleri (Alacak / Verecek vadesi) ---------- */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 320px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  position: relative;
  pointer-events: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted-light);
  border-radius: var(--radius);
  padding: 13px 34px 13px 15px;
  box-shadow: 0 2px 6px rgba(20, 10, 12, .08), 0 12px 28px rgba(20, 10, 12, .16);
  opacity: 0;
  transform: translateY(16px) scale(.98);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .28s ease;
  will-change: transform, opacity;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.hiding { opacity: 0; transform: translateX(110%); }
.toast-alacak { border-left-color: var(--success); }
.toast-verecek { border-left-color: var(--danger); }
.toast-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  color: var(--muted-light);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: transform .15s ease, opacity .15s ease, background-color .15s ease;
}
.toast-close:hover { color: var(--text); background: var(--bg); }
.toast-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.toast-close:active { transform: scale(.9); }
.toast-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.toast-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 999px;
}
.toast-alacak .toast-tag { background: var(--success-soft); color: var(--success); }
.toast-verecek .toast-tag { background: var(--danger-soft); color: var(--danger); }
.toast-when { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.toast-title { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; }
.toast-amount { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.toast-verecek .toast-amount { color: var(--danger); }
.toast-alacak .toast-amount { color: var(--success); }
.toast-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.toast-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  transition: transform .15s ease, opacity .15s ease;
}
.toast-link:hover { opacity: .8; transform: translateX(2px); }
.toast-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 520px) {
  .toast-stack { right: 12px; left: 12px; bottom: 12px; width: auto; }
}
