/* ==========================================================================
   Erkport Survey — mobil hasar kontrol uygulamasi
   Renkler erkport.com.tr tasarim sisteminden birebir alinmistir.
   ========================================================================== */

:root {
  --navy-900: #001a37;
  --navy-800: #002d5d;
  --navy-700: #123f77;
  --navy-600: #245f9e;
  --navy-100: #dce7f4;
  --orange-500: #f5801f;
  --orange-600: #eb6607;
  --orange-700: #c95204;
  --rust-700: #971b17;

  --ink: #0c1a2b;
  --body: #4c5c70;
  --muted: #7a8798;
  --line: #e3e9f1;
  --line-soft: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #edf2f8;

  --ok: #0f7a4a;
  --ok-bg: #e6f5ee;
  --warn-bg: #fdf0e4;

  --font-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 2px 8px rgba(12, 26, 43, .06), 0 1px 2px rgba(12, 26, 43, .04);
  --shadow: 0 10px 30px -12px rgba(12, 26, 43, .18), 0 2px 8px rgba(12, 26, 43, .05);
  --shadow-lg: 0 28px 60px -24px rgba(0, 45, 93, .32), 0 6px 18px rgba(12, 26, 43, .07);

  --topbar-h: 56px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* --------------------------------------------------------------- ust bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  background: var(--navy-800);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 26, 55, .22);
}
.topbar__logo { height: 26px; width: auto; flex: none; }
.topbar__title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: .01em; flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar__back, .topbar__menu {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer;
}
.topbar__back:active, .topbar__menu:active { background: rgba(255, 255, 255, .22); }
.topbar__menu svg { fill: currentColor; }

.view {
  padding: 14px 12px calc(28px + env(safe-area-inset-bottom));
  max-width: 900px; margin: 0 auto;
}

/* ---------------------------------------------------------------- yazilar */
h2.page { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-bottom: 2px; }
p.page-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.section-title {
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--navy-600);
  margin: 22px 0 8px;
}
.empty {
  text-align: center; color: var(--muted); font-size: 14px;
  padding: 38px 16px; background: var(--surface); border-radius: var(--radius);
  border: 1px dashed var(--line);
}

/* ---------------------------------------------------------------- kartlar */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 14px; margin-bottom: 10px;
}
.card--tap { cursor: pointer; transition: transform .15s var(--ease-out), box-shadow .15s; }
.card--tap:active { transform: scale(.988); box-shadow: var(--shadow); }

.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: grid; gap: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  letter-spacing: .06em;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  background: var(--surface-3); color: var(--navy-700);
}
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--orange-700); }
.pill--closed { background: #f0eeee; color: var(--muted); }

/* ---------------------------------------------------------------- butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 14.5px;
  cursor: pointer; background: var(--surface-3); color: var(--navy-800);
  transition: transform .12s var(--ease-out), filter .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--orange-600); color: #fff; }
.btn--primary:active { background: var(--orange-700); }
.btn--navy { background: var(--navy-800); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--navy-800); }
.btn--danger { background: #fdecec; color: var(--rust-700); }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }

.fab {
  position: fixed; right: 16px; z-index: 30;
  bottom: calc(18px + env(safe-area-inset-bottom));
  min-height: 54px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--orange-600); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  box-shadow: 0 12px 28px -8px rgba(235, 102, 7, .55);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.fab:active { transform: scale(.96); background: var(--orange-700); }

/* ---------------------------------------------------------------- formlar */
.field { display: block; margin-bottom: 12px; }
.field > span {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--body); margin-bottom: 5px;
}
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 70px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(36, 95, 158, .14);
}
.field--vin input {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 19px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; text-align: center;
}
.field__hint {
  display: flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--muted); margin-top: 4px;
}
.field__hint--err { color: var(--rust-700); font-weight: 600; }
.field__hint--ok { color: var(--ok); font-weight: 600; }
/* ikon + metin tasiyan rozetler */
.pill svg, .btn svg, .opt__code svg { flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------ diyagram secici */
.diagram { margin-bottom: 14px; }
.diagram__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 6px;
}
.diagram__label { font-family: var(--font-display); font-size: 13px; font-weight: 700; }
.diagram__hint { font-size: 11.5px; color: var(--muted); }
.diagram__wrap {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
/* Cizim her ekranda ayni olcekte cizilir; telefonda yatay kaydirilir.
   Boylece numaralarin dokunma hedefi her cihazda parmak boyunda kalir. */
.diagram__inner { position: relative; width: clamp(900px, 100%, 1120px); }
.diagram__img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.hot {
  position: absolute; transform: translate(-50%, -50%);
  border: 0; padding: 0; background: transparent; cursor: pointer;
  border-radius: 999px; -webkit-tap-highlight-color: transparent;
}
.hot::after {
  content: ""; position: absolute; inset: -6px; border-radius: 999px;
}
.hot__mark {
  display: block; width: 100%; height: 100%; border-radius: 999px;
  border: 2.5px solid transparent; transition: all .16s var(--ease-out);
}
.hot[aria-pressed="true"] .hot__mark {
  border-color: var(--orange-600);
  background: rgba(245, 128, 31, .17);
  box-shadow: 0 0 0 3px rgba(235, 102, 7, .18);
}
.hot:active .hot__mark { border-color: var(--navy-600); background: rgba(36, 95, 158, .12); }

/* ------------------------------------------------------- hasar satirlari */
.dmg {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 10px 12px; margin-bottom: 8px;
}
.dmg__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dmg__no {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--radius-xs);
  background: var(--navy-800); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.dmg__side { font-size: 12px; color: var(--muted); }
.dmg__name { font-weight: 600; font-size: 14px; }
.dmg__x {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--surface-3); color: var(--rust-700);
  font-size: 19px; line-height: 1; cursor: pointer;
}
.dmg select { min-height: 42px; }
.dmg .field { margin-bottom: 8px; }
.dmg__remarks { display: grid; gap: 6px; }
.dmg__remarks input { font-size: 13.5px; min-height: 40px; }

/* --------------------------------------------------------- fotograf sirasi */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo__x {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer;
}
.photo--add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; border: 1.5px dashed var(--line);
  background: var(--surface); color: var(--navy-600); font-size: 12.5px;
  font-weight: 600; text-align: center; cursor: pointer;
}

/* Parca numarasinin cizimdeki yerini gosteren kucuk pencere (yonetim) */
.thumb {
  position: relative; flex: none;
  border: 1px solid var(--line); border-radius: var(--radius-xs);
  background-color: #fff; overflow: hidden;
}
.thumb__ring {
  position: absolute; left: 50%; top: 50%;
  width: 40px; height: 26px; transform: translate(-50%, -50%);
  border: 2px solid var(--orange-600); border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(235, 102, 7, .16);
}
.thumb__na {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-family: var(--font-display); font-weight: 700; color: var(--muted);
}

/* --------------------------------------------------------------- alt sayfa */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(6, 18, 34, .45); animation: fade .2s; }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88vh; overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  animation: rise .26s var(--ease-out);
}
@media (min-width: 700px) {
  .sheet__panel {
    left: 50%; bottom: auto; top: 50%; transform: translate(-50%, -50%);
    width: min(560px, 92vw); border-radius: var(--radius-lg); animation: fade .2s;
  }
}
.sheet__grip { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 12px; }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 12px; margin-bottom: 6px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); text-align: left; cursor: pointer;
}
.opt:active { border-color: var(--navy-600); background: var(--surface-2); }
.opt__code {
  flex: none; display: grid; place-items: center; min-width: 46px; height: 38px;
  border-radius: var(--radius-xs); background: var(--navy-100);
  font-family: var(--font-display); font-weight: 700; color: var(--navy-800);
}
.opt__t { font-weight: 600; font-size: 14.5px; }
.opt__s { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom));
  max-width: 92vw; padding: 11px 18px; border-radius: 999px;
  background: var(--navy-900); color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow); animation: fade .18s;
}
.toast--err { background: var(--rust-700); }
.toast--ok { background: var(--ok); }

/* ------------------------------------------------------------------ giris */
.login {
  min-height: 100dvh; display: grid; place-content: center; gap: 18px;
  padding: 24px; background:
    radial-gradient(120% 80% at 50% 0%, #123f77 0%, #002d5d 55%, #001a37 100%);
}
.login__card {
  width: min(400px, 92vw); background: #fff;
  border-radius: var(--radius-lg); padding: 30px 24px;
  box-shadow: var(--shadow-lg);
}
.login__logo { height: 40px; width: auto; margin: 0 auto 20px; }
.login h1 {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  text-align: center; color: var(--navy-800);
}
.login__sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login__err {
  background: #fdecec; color: var(--rust-700); font-size: 13px; font-weight: 500;
  padding: 9px 12px; border-radius: var(--radius-xs); margin-bottom: 12px;
}
.login__foot { text-align: center; color: rgba(255, 255, 255, .55); font-size: 12px; }

/* ------------------------------------------------------------------ tablo */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tbl tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.spin {
  width: 22px; height: 22px; border-radius: 50%; margin: 40px auto;
  border: 2.5px solid var(--line); border-top-color: var(--navy-600);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
