/* ============ VİRA MARİN — Tevzi & Puantaj ============ */
:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --navy-3: #1d4478;
  --gold: #d4a531;
  --gold-soft: #f3e3bb;
  --bg: #f2f5f9;
  --card: #ffffff;
  --text: #17222f;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #15803d;
  --green-bg: #dcfce7;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(11,37,69,.08), 0 4px 14px rgba(11,37,69,.06);
  --shadow-lg: 0 8px 30px rgba(11,37,69,.18);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, select, textarea { outline: none; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, #0e2c54 100%);
  padding: 24px; position: relative; overflow: hidden;
}
.login-screen::before {
  content: ""; position: absolute; inset: auto -20% -35% -20%; height: 55%;
  background: radial-gradient(ellipse at center, rgba(212,165,49,.14), transparent 65%);
}
.login-logo { text-align: center; margin-bottom: 34px; position: relative; }
.login-logo .anchor {
  width: 84px; height: 84px; border-radius: 50%; border: 2.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; margin: 0 auto 18px; color: var(--gold);
  box-shadow: 0 0 0 8px rgba(212,165,49,.08), 0 0 40px rgba(212,165,49,.15);
}
.login-logo h1 { color: #fff; font-size: 30px; letter-spacing: 5px; font-weight: 800; }
.login-logo p { color: #8fa3bd; font-size: 13.5px; letter-spacing: 2.5px; margin-top: 7px; text-transform: uppercase; }
.login-card {
  width: 100%; max-width: 400px; background: rgba(255,255,255,.06); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 26px; position: relative;
}
.login-card h2 { color: #fff; font-size: 17px; margin-bottom: 4px; }
.login-card .sub { color: #8fa3bd; font-size: 13px; margin-bottom: 20px; }
.login-card .field { margin-bottom: 14px; }
.login-card label { display: block; color: #a9bcd4; font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 7px; }
.login-card input {
  width: 100%; padding: 15px 16px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08); color: #fff; font-size: 16px; transition: border-color .18s;
}
.login-card input::placeholder { color: #5f7492; }
.login-card input:focus { border-color: var(--gold); }
.btn-login {
  width: 100%; padding: 16px; border-radius: 12px; margin-top: 8px;
  background: var(--gold); color: var(--navy); font-weight: 800; font-size: 16px; letter-spacing: .5px;
  transition: transform .12s, filter .15s;
}
.btn-login:active { transform: scale(.98); filter: brightness(1.08); }
.login-err { background: rgba(185,28,28,.25); border: 1px solid rgba(252,165,165,.4); color: #fecaca; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 14px; }
.login-info { background: rgba(212,165,49,.14); border: 1px solid rgba(212,165,49,.4); color: var(--gold-soft); padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 14px; line-height: 1.45; }
.login-foot { position: relative; color: #58708f; font-size: 11.5px; margin-top: 26px; letter-spacing: 1px; }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  background: var(--navy); color: #fff; padding: 14px 16px calc(14px);
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 40;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar .brand .mini-anchor {
  width: 34px; height: 34px; border-radius: 50%; border: 1.8px solid var(--gold); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 17px;
}
.topbar .brand b { font-size: 16.5px; letter-spacing: 2.5px; font-weight: 800; }
.topbar .brand small { display: block; color: #8fa3bd; font-size: 10.5px; letter-spacing: 1.6px; margin-top: 1px; }
.topbar .user-chip {
  display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.1);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; color: #dbe6f2; max-width: 46%;
}
.topbar .user-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex-shrink: 0; }
.topbar .user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.view { flex: 1; padding: 16px 16px calc(96px + var(--safe-b)); max-width: 760px; width: 100%; margin: 0 auto; }

/* Bottom nav */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-b);
  box-shadow: 0 -4px 20px rgba(11,37,69,.07);
}
.bottomnav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px 9px; color: var(--muted); font-size: 11px; font-weight: 600;
  transition: color .15s;
}
.bottomnav button svg { width: 24px; height: 24px; }
.bottomnav button.active { color: var(--navy); }
.bottomnav button.active svg { stroke: var(--gold); }

/* ---------- Common components ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.page-head h2 { font-size: 21px; font-weight: 800; color: var(--navy); flex: 1; min-width: 0; }
.page-head h2 small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.btn-back {
  width: 40px; height: 40px; border-radius: 12px; background: #fff; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--navy);
}
.btn-icon {
  width: 40px; height: 40px; border-radius: 12px; background: #fff; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--muted);
}
.searchbar {
  display: flex; align-items: center; gap: 9px; background: #fff; border-radius: 13px;
  padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.searchbar svg { color: var(--muted); flex-shrink: 0; }
.searchbar input { border: none; flex: 1; font-size: 15.5px; background: transparent; min-width: 0; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-box { background: #fff; border-radius: var(--radius); padding: 13px 8px; text-align: center; box-shadow: var(--shadow); }
.stat-box b { display: block; font-size: 19px; color: var(--navy); font-weight: 800; }
.stat-box.hero { background: var(--navy); }
.stat-box.hero b { color: var(--gold); }
.stat-box.hero span { color: #8fa3bd; }
.stat-box span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; font-weight: 600; display: block; margin-top: 3px; }

.chip-row { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  padding: 8px 15px; border-radius: 999px; background: #fff; color: var(--muted);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow); white-space: nowrap; flex-shrink: 0;
  border: 1.5px solid transparent; transition: all .15s;
}
.chip.active { background: var(--navy); color: #fff; }

/* Cards */
.card-list { display: flex; flex-direction: column; gap: 11px; }
.item-card {
  background: var(--card); border-radius: var(--radius); padding: 15px 16px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 13px;
  text-align: left; width: 100%; transition: transform .1s;
  border: 1px solid transparent;
}
.item-card:active { transform: scale(.985); }
.item-card .avatar {
  width: 50px; height: 50px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(145deg, var(--navy), var(--navy-3));
  color: var(--gold); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; letter-spacing: .3px;
}
.item-card .avatar small { font-size: 8px; color: #8fa3bd; font-weight: 700; letter-spacing: 1px; }
.item-card .avatar.done-av { background: linear-gradient(145deg, #14532d, #166534); color: #bbf7d0; }
.item-card .mid { flex: 1; min-width: 0; }
.item-card .mid .title { font-weight: 800; font-size: 16.5px; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-card .mid .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.item-card .end { text-align: right; flex-shrink: 0; }
.item-card .end b { display: block; font-size: 17px; color: var(--navy); font-weight: 800; }
.item-card .end span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }

.progress { height: 5px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), #e7bc4f); }

.badge { font-size: 10.5px; font-weight: 800; padding: 3.5px 9px; border-radius: 999px; letter-spacing: .6px; }
.badge.open { background: var(--amber-bg); color: var(--amber); }
.badge.done { background: var(--green-bg); color: var(--green); }

/* Work type badges */
.wt { font-size: 10px; font-weight: 800; padding: 2.5px 8px; border-radius: 999px; letter-spacing: .4px; }
.wt.montaj { background: #dbeafe; color: #1d4ed8; }
.wt.kaynak { background: #ffedd5; color: #c2410c; }
.wt.tas { background: #ede9fe; color: #6d28d9; }

/* Compare diff badges */
.diff { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; margin-top: 3px; }
.diff.up { background: var(--red-bg); color: var(--red); }
.diff.down { background: var(--green-bg); color: var(--green); }
.diff.same { background: var(--bg); color: var(--muted); }

/* Segmented control */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button {
  padding: 12px 6px; border-radius: 11px; background: var(--bg); border: 1.5px solid var(--line);
  font-weight: 700; font-size: 14px; color: var(--muted); transition: all .15s;
}
.seg button.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.stat-row.four { grid-template-columns: repeat(3, 1fr); }
.report-table tr.sec-row td { padding: 6px 12px; font-size: 12px; color: var(--muted); background: #fafcfe; }
.report-table tr.sec-row td:first-child { padding-left: 22px; }

/* Entry rows */
.entry-row {
  background: #fff; border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.entry-row .cal {
  width: 44px; flex-shrink: 0; text-align: center; background: var(--bg); border-radius: 10px; padding: 6px 2px;
}
.entry-row .cal b { display: block; font-size: 16px; color: var(--navy); font-weight: 800; line-height: 1.1; }
.entry-row .cal span { font-size: 9.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.entry-row .mid { flex: 1; min-width: 0; }
.entry-row .mid .dates { font-size: 13.5px; font-weight: 700; color: var(--text); }
.entry-row .mid .meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-row .amount { font-size: 19px; font-weight: 800; color: var(--navy); flex-shrink: 0; }
.entry-row .amount small { font-size: 10px; color: var(--muted); display: block; text-align: right; font-weight: 600; }
.entry-row .row-menu { color: #b6c0cc; padding: 6px 2px 6px 8px; flex-shrink: 0; }

/* FAB */
.fab {
  position: fixed; right: 18px; bottom: calc(86px + var(--safe-b)); z-index: 45;
  width: 58px; height: 58px; border-radius: 18px;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(212,165,49,.45); transition: transform .12s;
}
.fab:active { transform: scale(.92); }
.fab svg { width: 28px; height: 28px; }

/* Empty state */
.empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty .ic { font-size: 44px; margin-bottom: 12px; opacity: .5; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 5px; }
.empty p { font-size: 13.5px; line-height: 1.5; }

/* ---------- Modal / bottom sheet ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11,37,69,.55); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: 22px 22px 0 0; padding: 10px 20px calc(24px + var(--safe-b));
  animation: slideUp .22s cubic-bezier(.3,1.1,.4,1); max-height: 88dvh; overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(60px); opacity: .5; } }
.sheet .grab { width: 42px; height: 4.5px; border-radius: 99px; background: var(--line); margin: 4px auto 16px; }
.sheet h3 { font-size: 18.5px; font-weight: 800; color: var(--navy); margin-bottom: 3px; }
.sheet .sheet-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.sheet .field { margin-bottom: 14px; }
.sheet label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 7px; }
.sheet input, .sheet select, .sheet textarea {
  width: 100%; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line);
  font-size: 16px; background: var(--bg); transition: border-color .15s;
}
.sheet input:focus, .sheet select:focus, .sheet textarea:focus { border-color: var(--navy-3); background: #fff; }
.sheet .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet .btns { display: flex; gap: 10px; margin-top: 20px; }
.btn {
  flex: 1; padding: 15px; border-radius: 13px; font-weight: 800; font-size: 15.5px;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-ghost { background: var(--bg); color: var(--muted); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-green { background: var(--green-bg); color: var(--green); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 14px; }
.switch-row span { font-size: 14px; font-weight: 600; color: var(--text); }
.switch { position: relative; width: 50px; height: 29px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .2s; cursor: pointer;
}
.switch i::before {
  content: ""; position: absolute; width: 23px; height: 23px; border-radius: 50%;
  left: 3px; top: 3px; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.switch input:checked + i { background: var(--navy); }
.switch input:checked + i::before { transform: translateX(21px); }

/* Action list sheet */
.action-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.action-list button {
  display: flex; align-items: center; gap: 13px; padding: 15px 14px; border-radius: 13px;
  background: var(--bg); font-size: 15.5px; font-weight: 700; color: var(--text); text-align: left;
}
.action-list button.danger { color: var(--red); background: var(--red-bg); }
.action-list button svg { flex-shrink: 0; }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  background: var(--navy); color: #fff; padding: 13px 20px; border-radius: 13px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toastIn .25s cubic-bezier(.3,1.3,.4,1); max-width: 480px;
  display: flex; align-items: center; gap: 9px;
}
.toast.err { background: #7f1d1d; }
.toast.ok::before { content: "✓"; color: #4ade80; font-weight: 800; }
.toast.err::before { content: "!"; color: #fca5a5; font-weight: 800; }
@keyframes toastIn { from { transform: translateY(-18px); opacity: 0; } }
.toast.hide { animation: toastOut .25s forwards; }
@keyframes toastOut { to { transform: translateY(-16px); opacity: 0; } }

/* ---------- Report ---------- */
.report-filters { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.report-filters .field { margin-bottom: 12px; }
.report-filters label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 6px; }
.report-filters select, .report-filters input {
  width: 100%; padding: 13px; border-radius: 11px; border: 1.5px solid var(--line); font-size: 15px; background: var(--bg);
}
.report-filters .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-dates { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.quick-dates button { padding: 7px 13px; border-radius: 999px; background: var(--bg); font-size: 12.5px; font-weight: 700; color: var(--muted); border: 1.5px solid transparent; }
.quick-dates button.active { background: var(--navy); color: #fff; }
.report-actions { display: flex; gap: 10px; }

.report-ship { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.report-ship .rs-head {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 15px 16px;
  background: linear-gradient(145deg, var(--navy), var(--navy-2)); color: #fff; text-align: left;
}
.report-ship .rs-head b { font-size: 16px; flex: 1; }
.report-ship .rs-head .tot { color: var(--gold); font-weight: 800; font-size: 16px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { text-align: left; padding: 9px 12px; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--line); }
.report-table td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; }
.report-table tr:last-child td { border-bottom: none; }
.report-table .num { text-align: right; font-weight: 800; color: var(--navy); }
.report-table th.num { font-weight: 700; }
.grand-card {
  background: var(--gold); border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.grand-card span { font-weight: 800; color: var(--navy); font-size: 13px; letter-spacing: 1px; }
.grand-card b { font-size: 23px; color: var(--navy); font-weight: 800; }

/* ---------- Log ---------- */
.log-row { background: #fff; border-radius: 13px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; gap: 11px; }
.log-row .lg-ic {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 17px; background: var(--bg);
}
.log-row .lg-mid { flex: 1; min-width: 0; }
.log-row .lg-mid p { font-size: 13.5px; line-height: 1.45; color: var(--text); }
.log-row .lg-mid .lg-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.log-row .lg-user { background: var(--bg); padding: 2px 8px; border-radius: 99px; font-weight: 700; font-size: 10.5px; color: var(--navy); }
.load-more { width: 100%; padding: 14px; border-radius: 13px; background: #fff; box-shadow: var(--shadow); font-weight: 700; color: var(--navy); margin-top: 12px; }

.section-title { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin: 20px 0 10px; }

.status-banner {
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 11px; font-size: 14px; font-weight: 700;
}
.status-banner.done { background: var(--green-bg); color: var(--green); }
.status-banner small { display: block; font-weight: 500; font-size: 12px; margin-top: 2px; opacity: .85; }

@media (min-width: 640px) {
  .view { padding-top: 24px; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
}
