/* ─────────────────────────────────────────────────────────
   ARAÇ KULLANIM TAKİP — styles.css v2
   Font: Outfit (Google Fonts)
   Tema: Açık / Kurumsal
───────────────────────────────────────────────────────── */

:root {
  --bg:          #f0f3f7;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --surface-3:   #f1f5f9;
  --text:        #0f172a;
  --muted:       #64748b;
  --border:      #e2e8f0;
  --orange:      #f97316;
  --orange-dk:   #ea580c;
  --orange-dim:  rgba(249,115,22,.1);
  --green:       #16a34a;
  --green-bg:    #dcfce7;
  --green-txt:   #14532d;
  --red:         #dc2626;
  --red-bg:      #fee2e2;
  --red-txt:     #7f1d1d;
  --amber-bg:    #ffedd5;
  --amber-txt:   #7c2d12;
  --blue:        #2563eb;
  --shadow-sm:   0 1px 3px rgba(15,23,42,.06),0 1px 2px rgba(15,23,42,.04);
  --shadow:      0 4px 16px rgba(15,23,42,.08),0 2px 4px rgba(15,23,42,.04);
  --shadow-lg:   0 20px 48px rgba(15,23,42,.12);
  --radius-sm:   10px;
  --radius:      16px;
  --radius-lg:   24px;
}

/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html  { min-height: 100%; background: var(--bg); }
body  {
  min-height: 100%;
  margin: 0;
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(ellipse at top left, rgba(249,115,22,.08) 0%, transparent 55%),
    linear-gradient(170deg, #f8fafc 0%, var(--bg) 100%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1,h2,h3,p { margin: 0; }

/* ─── LOGIN OVERLAY ──────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #1c1917 100%);
  padding: 20px;
}
.login-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo {
  width: 72px; height: 72px;
  border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--orange) 0%, #111827 100%);
  color: #fff; font-size: 1.5rem; font-weight: 900;
  letter-spacing: -0.04em; margin-bottom: 20px;
  box-shadow: 0 12px 28px rgba(249,115,22,.3);
}
.login-title { font-size: 1.6rem; letter-spacing: -0.04em; font-weight: 800; }
.login-sub   { color: var(--muted); margin-top: 6px; margin-bottom: 28px; }
.login-form  { display: grid; gap: 14px; text-align: left; }
.login-form label { display: grid; gap: 6px; font-weight: 600; }
.login-btn   { width: 100%; margin-top: 4px; font-size: 1rem; }
.login-error {
  color: var(--red); background: var(--red-bg);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-weight: 600; font-size: .9rem;
}

/* ─── APP SHELL ──────────────────────────────────────────── */
.app-shell {
  width: min(1200px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

/* ─── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid rgba(249,115,22,.18);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.brand    { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  color: #fff; font-weight: 900; letter-spacing: -0.04em; font-size: 1rem;
  background: linear-gradient(135deg, var(--orange) 0%, #111827 100%);
  box-shadow: 0 10px 24px rgba(249,115,22,.25); flex-shrink: 0;
}
h1 { font-size: clamp(1.2rem,2.5vw,1.75rem); line-height: 1.1; letter-spacing: -0.04em; font-weight: 800; }
.brand p { color: var(--muted); margin-top: 4px; font-size: .88rem; }
.top-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.user-info   { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.user-name   { font-weight: 700; font-size: .9rem; }
.role-badge  {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px;
  border-radius: 999px; font-size: .75rem; font-weight: 800;
  background: var(--orange-dim); color: var(--orange-dk);
}
.role-badge.admin { background: #dbeafe; color: #1e40af; }

/* ─── SYNC BADGE ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 0 12px;
  border-radius: 999px; font-weight: 700; font-size: .82rem;
  background: var(--amber-bg); color: var(--amber-txt);
}
.badge-online  { background: var(--green-bg);  color: var(--green-txt); }
.badge-offline { background: var(--red-bg);    color: var(--red-txt); }
.badge-pending { background: #fef9c3; color: #713f12; }
.badge-error   { background: var(--red-bg);    color: var(--red-txt); }

/* ─── ÖZET KARTLAR ───────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.summary-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.summary-card span   { display: block; color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.summary-card strong { display: block; margin-top: 8px; font-size: 2.2rem; letter-spacing: -0.05em; font-weight: 800; }

/* ─── TABS ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.8);
  position: sticky; top: 8px; z-index: 10;
  backdrop-filter: blur(12px);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 16px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  border: 0; border-radius: 999px;
  padding: 10px 16px;
  color: var(--muted); background: transparent;
  font-weight: 700; font-size: .88rem;
  white-space: nowrap; transition: all .18s ease;
}
.tab:hover:not(.active) { background: var(--surface-3); color: var(--text); }
.tab.active { color: #fff; background: #0f172a; box-shadow: 0 8px 20px rgba(15,23,42,.18); }

/* Sub-tabs (Yönetim paneli içinde) */
.sub-tabs {
  display: flex; gap: 6px; padding: 5px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-3); width: fit-content;
}
.sub-tab {
  border: 0; border-radius: 999px; padding: 8px 20px;
  color: var(--muted); background: transparent;
  font-weight: 700; font-size: .85rem;
}
.sub-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.sub-panel  { display: none; }
.active-sub-panel { display: block; }

/* ─── PANELLER ───────────────────────────────────────────── */
.panel          { display: none; }
.active-panel   { display: block; }
.panel-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 14px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 1.35rem; letter-spacing: -0.03em; font-weight: 800; }
.panel-head p  { color: var(--muted); margin-top: 4px; font-size: .88rem; }
.history-head  { align-items: center; }

/* ─── FORM ───────────────────────────────────────────────── */
.form-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
label { display: grid; gap: 6px; font-weight: 600; color: #334155; }
.full-width  { display: grid; margin-top: 14px; }
.required    { color: var(--orange-dk); }
input, select, textarea {
  width: 100%; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  outline: none; padding: 12px 14px;
  transition: border-color .16s, box-shadow .16s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; justify-content: flex-end; }

/* ─── BUTONLAR ───────────────────────────────────────────── */
.primary-btn, .ghost-btn, .danger-btn, .icon-btn {
  border: 0; border-radius: var(--radius-sm); min-height: 42px; padding: 0 18px;
  font-weight: 700; transition: all .16s ease;
}
.primary-btn { color: #fff; background: var(--orange); box-shadow: 0 8px 20px rgba(249,115,22,.22); }
.primary-btn:hover { background: var(--orange-dk); transform: translateY(-1px); }
.primary-btn:disabled { opacity: .6; pointer-events: none; }
.ghost-btn { color: var(--text); background: var(--surface-3); border: 1px solid var(--border); }
.ghost-btn:hover { background: #e2e8f0; }
.danger-btn { color: #fff; background: var(--red); }
.danger-btn:hover { filter: brightness(1.1); }
.icon-btn { width: 40px; padding: 0; border-radius: 999px; color: var(--text); background: var(--surface-3); font-size: 1.3rem; border: 1px solid var(--border); }
.hidden { display: none !important; }

/* ─── FOTOĞRAFLAR ────────────────────────────────────────── */
.photo-section {
  margin-top: 14px; border: 1.5px dashed rgba(249,115,22,.35);
  background: #fffbf5; border-radius: var(--radius); padding: 14px;
}
.photo-section summary { cursor: pointer; font-weight: 700; color: var(--orange-dk); }
.hint { color: var(--muted); margin: 8px 0 12px; font-size: .88rem; }
.photo-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.photo-box {
  min-height: 140px; border: 1px solid rgba(249,115,22,.2);
  border-radius: var(--radius); background: #fff;
  padding: 12px; display: grid; gap: 8px; font-size: .88rem; font-weight: 600;
}
.photo-box input { padding: 8px; }
.photo-box img {
  display: none; width: 100%; height: 80px;
  object-fit: cover; border-radius: 8px; border: 1px solid var(--border);
}
.photo-box.has-photo img { display: block; }

/* ─── KAYIT LİSTESİ ──────────────────────────────────────── */
.record-list { display: grid; gap: 12px; }
.empty-state {
  padding: 28px 20px; border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg); color: var(--muted);
  background: rgba(255,255,255,.6); text-align: center; font-weight: 600;
}
.record-card {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px;
}
.record-main {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
}
.record-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.record-title strong { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.status-pill {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px;
  border-radius: 999px; font-size: .75rem; font-weight: 800;
  background: var(--amber-bg); color: var(--amber-txt);
}
.status-pill.closed { background: var(--green-bg); color: var(--green-txt); }
.record-meta {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px; margin-top: 12px;
}
.meta-item {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.meta-item span { display: block; color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.meta-item b    { display: block; margin-top: 3px; font-weight: 700; overflow-wrap: anywhere; font-size: .9rem; }
.record-notes {
  margin-top: 12px; color: #374151;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: .88rem;
}
.record-driver { color: var(--muted); font-size: .84rem; margin-top: 4px; }

/* ─── ADMİN DASHBOARD ────────────────────────────────────── */
.dashboard-grid { display: grid; gap: 16px; }
.dash-section-title { font-size: 1rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.dash-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.dash-stat {
  padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.dash-stat .stat-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dash-stat .stat-value { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.06em; margin-top: 6px; }
.dash-stat .stat-sub   { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.dash-stat.accent { border-color: rgba(249,115,22,.35); background: linear-gradient(135deg, #fff8f4 0%, #fff 100%); }
.dash-stat.accent .stat-value { color: var(--orange); }

.open-vehicles-list { display: grid; gap: 10px; }
.open-vehicle-card {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.ov-plate {
  font-size: 1.1rem; font-weight: 900; letter-spacing: .04em;
  background: #0f172a; color: #fff;
  padding: 8px 14px; border-radius: var(--radius-sm);
}
.ov-info .ov-driver { font-weight: 700; }
.ov-info .ov-route  { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.ov-time { font-size: .82rem; color: var(--muted); text-align: right; }

/* ─── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.filter-grid {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px;
}

/* ─── ARAÇ / KULLANICI LİSTE ─────────────────────────────── */
.vehicle-item, .user-item {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: center;
  padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.vehicle-plate { font-size: 1.05rem; font-weight: 900; letter-spacing: .04em; }
.vehicle-details, .user-meta { color: var(--muted); font-size: .85rem; margin-top: 3px; }
.item-actions { display: flex; gap: 8px; }
.inactive-tag {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: var(--red-bg); color: var(--red-txt);
}

/* ─── EXPORT PANELİ ──────────────────────────────────────── */
.export-card { max-width: 640px; }

/* ─── SEARCH (Geçmişim) ──────────────────────────────────── */
.history-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.history-actions input { min-width: min(300px,100%); }

/* ─── DIALOGLAR ──────────────────────────────────────────── */
.app-dialog {
  border: 0; padding: 0;
  width: min(560px, calc(100% - 24px));
  border-radius: var(--radius-lg);
  background: transparent; box-shadow: var(--shadow-lg);
}
.app-dialog::backdrop { background: rgba(15,23,42,.55); backdrop-filter: blur(4px); }
.dialog-inner {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: grid; gap: 14px;
}
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-head h3 { font-size: 1.15rem; font-weight: 800; }
.return-context {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); font-size: .9rem;
}
.dialog-actions { justify-content: flex-end; }

/* ─── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 20px;
  transform: translateX(-50%) translateY(14px);
  min-width: min(420px, calc(100% - 28px));
  border-radius: var(--radius); padding: 13px 18px;
  color: #fff; background: #0f172a;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  font-weight: 700; z-index: 200;
}
.toast.show   { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error  { background: var(--red); }
.toast.success{ background: var(--green); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .dash-stats   { grid-template-columns: repeat(2,1fr); }
  .filter-grid  { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  .topbar, .panel-head { flex-direction: column; align-items: stretch; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .form-grid, .record-meta { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: repeat(2,1fr); }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .open-vehicle-card { grid-template-columns: 1fr; }
  .ov-time { text-align: left; }
  .history-head { align-items: stretch; }
}

@media (max-width: 520px) {
  .app-shell { width: calc(100% - 16px); padding-top: 10px; }
  .topbar { border-radius: var(--radius); }
  .tabs   { border-radius: var(--radius); top: 6px; }
  .tab    { padding: 9px 12px; font-size: .82rem; }
  .summary-grid, .form-grid, .record-meta, .photo-grid,
  .filter-grid, .dash-stats { grid-template-columns: 1fr; }
  .record-main { grid-template-columns: 1fr; }
  .record-main .primary-btn { width: 100%; }
  .vehicle-item, .user-item { grid-template-columns: 1fr; }
}
