/* ===== EPOS.DRIVER — mobil-öncelikli kurye terminali / mobile-first driver terminal ===== */
:root {
    --navy: #0e1726;
    --navy-2: #16223c;
    --accent: #f97316;      /* turuncu vurgu (kurye modülü rengi ileride netleşir) / orange accent */
    --bg: #f1f3f7;
    --card: #ffffff;
    --text: #1f2a3a;
    --muted: #8a94a6;
    --border: #e6e9ef;
    --green: #2e8b3d;
    --red: #d92d20;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif; background: var(--bg); color: var(--text); }

.dv-topbar { position: sticky; top: 0; z-index: 20; height: 52px; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 12px; padding-top: env(safe-area-inset-top); }
.dv-brand { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dv-brand i { color: var(--accent); }
.dv-user { margin-left: auto; font-size: 13px; color: #b9c2d4; }
.dv-logout-form { margin: 0; }
.dv-logout { background: var(--navy-2); border: 0; color: #cdd5e3; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.dv-main { padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

.dv-center { min-height: calc(100vh - 24px); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.dv-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 16px; padding: 22px 20px; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.dv-logo { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dv-logo i { color: var(--accent); }
.dv-muted { color: var(--muted); font-size: 13.5px; }

/* ===== LOGIN (admin ekranıyla birebir) / admin-identical login ===== */
.login-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--navy-2); }
.login-header { background: var(--navy); padding: 48px 16px 40px; text-align: center; position: relative; }
.login-header img { height: 62px; }
.login-header::after { content: ""; position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 11px solid var(--navy); }
.login-body { flex: 1; display: flex; justify-content: center; padding: 60px 16px 0; }
.login-card { width: 100%; max-width: 372px; }
.login-field { position: relative; margin-bottom: 14px; }
.login-field i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #9aa3b2; }
.login-field input { width: 100%; height: 52px; border: 1px solid #d7dce6; border-radius: 8px; background: #eef1f7; padding: 0 16px 0 46px; font-size: 15px; color: #1f2a3a; outline: none; }
.login-field input:focus { border-color: var(--accent); background: #fff; }
.login-btn { width: 100%; height: 52px; border: 0; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
.login-error { background: #fde8e8; color: #b42318; border: 1px solid #f5c2c0; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

/* ===== Sayfa başlığı (geri + başlık) / page head ===== */
.dv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dv-back { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); text-decoration: none; }
.dv-head .ttl { font-size: 18px; font-weight: 700; }

/* ===== Dashboard karoları / dashboard tiles ===== */
.dv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dv-tile { position: relative; background: var(--card); border-radius: 16px; padding: 18px 14px; min-height: 116px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); box-shadow: 0 1px 3px rgba(16,24,40,.08); border-left: 5px solid var(--accent); }
.dv-tile i { font-size: 26px; color: var(--accent); }
.dv-tile .nm { font-weight: 700; font-size: 15px; line-height: 1.2; }
.dv-tile .ct { position: absolute; top: 12px; right: 14px; font-size: 26px; font-weight: 800; color: var(--text); }
/* Bekleyen: üst satırda TAM GENİŞLİK (2 hücre) / pending spans both columns on the top row */
.dv-tile.pending { grid-column: 1 / -1; border-left-color: #f97316; } .dv-tile.pending i { color: #f97316; }
.dv-tile.today { border-left-color: #2e8b3d; } .dv-tile.today i { color: #2e8b3d; }
.dv-tile.month { border-left-color: #3b82f6; } .dv-tile.month i { color: #3b82f6; }
.dv-tile.report { border-left-color: #8b5cf6; } .dv-tile.report i { color: #8b5cf6; }
.dv-tile.stats { border-left-color: #eab308; } .dv-tile.stats i { color: #eab308; }
.dv-tile.report, .dv-tile.stats { grid-column: span 1; }
/* Teslim edilemeyenler: TAM GENİŞLİK + YARIM YÜKSEKLİK + KIRMIZI şerit (0 ise JS gizler)
   / failed deliveries card: full width, half height, red left border, hidden at 0 */
.dv-tile.failed { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; gap: 12px; padding: 13px 16px; border-left-color: var(--red); }
.dv-tile.failed i { font-size: 20px; color: var(--red); }
.dv-tile.failed .nm { font-size: 15px; }
.dv-tile.failed .ct { position: static; margin-left: auto; font-size: 22px; color: var(--red); }

/* ===== Sipariş kartları / order cards ===== */
.dv-order { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.dv-order .r1 { display: flex; align-items: baseline; gap: 8px; }
.dv-order .no { font-weight: 800; font-size: 16px; }
.dv-order .tm { color: var(--muted); font-size: 12.5px; }
.dv-order .tot { margin-left: auto; font-weight: 700; }
.dv-order .who { font-size: 14px; margin-top: 4px; }
.dv-order .adr { color: var(--muted); font-size: 13px; margin-top: 3px; }
.dv-order .adr i { color: var(--accent); }
.dv-order .pay { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.dv-order.failed { border-left: 4px solid var(--red); }
.dv-order .failr { color: var(--red); font-size: 12.5px; margin-top: 4px; }
.dv-order .failr i { color: var(--red); }

/* ===== Detay + sebep sayfası (alttan) / bottom sheets ===== */
.dv-sheetback { display: none; position: fixed; inset: 0; background: rgba(14,23,38,.5); z-index: 55; }
.dv-sheetback.on { display: block; }
.dv-sheet { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 56; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 34px rgba(16,24,40,.35); max-height: 88vh; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.dv-sheet.on { display: flex; }
.dv-sheet .head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; font-weight: 700; font-size: 16px; }
.dv-sheet .head button { border: 0; background: #eef0f5; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.dv-sheet .body { flex: 1; overflow-y: auto; padding: 4px 16px 12px; }
.dv-sheet .line { font-size: 14px; padding: 4px 0; }
.dv-sheet .line.b { font-weight: 700; font-size: 15px; }
.dv-sheet .line.muted, .dv-sheet .line .muted { color: var(--muted); }
.dv-sheet .line a { color: var(--accent); text-decoration: none; }
.dv-sheet .line i { color: var(--accent); }
.dv-sheet .sec { color: var(--accent); font-weight: 700; margin: 12px 0 4px; border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.dv-sheet .il { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; color: #4b5563; }
.dv-sheet .il.tot { font-weight: 800; color: var(--text); border-top: 1px solid var(--border); margin-top: 4px; padding-top: 5px; }
.maprow { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; }
.dv-map { border: 0; background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; padding: 11px 16px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.dist { font-weight: 700; color: var(--green); }
.dv-sheet .foot { display: flex; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); }
.dv-fail { flex: 1; border: 1px solid var(--red); background: #fff; color: var(--red); font-weight: 700; font-size: 13.5px; padding: 13px 8px; border-radius: 10px; cursor: pointer; }
.dv-done { flex: 1; border: 0; background: var(--green); color: #fff; font-weight: 800; font-size: 14px; padding: 13px 8px; border-radius: 10px; cursor: pointer; }
.dv-reason { display: block; width: 100%; text-align: left; border: 1px solid var(--border); background: #f7f8fb; border-radius: 10px; padding: 14px; margin-bottom: 8px; font-size: 15px; cursor: pointer; color: var(--text); }
.dv-reason:active { border-color: var(--red); background: #fdecea; }
.dv-reason.other { border-style: dashed; color: var(--muted); }
.dv-othertext { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 15px; font-family: inherit; resize: vertical; margin-bottom: 8px; box-sizing: border-box; }
.dv-othertext:focus { border-color: var(--accent); outline: none; }

/* ===== Gün sonu raporu / end-of-day report ===== */
.dv-report { background: var(--card); border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.eod-head { text-align: center; margin-bottom: 10px; }
.eod-head .big { font-size: 46px; font-weight: 800; color: var(--green); line-height: 1; }
.eod-head .lbl { color: var(--muted); font-size: 13px; }
.dv-report .sec { color: var(--accent); font-weight: 700; margin: 16px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.dv-report .il { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; color: #4b5563; }
.dv-report .il .muted { color: var(--muted); font-size: 12px; }
.dv-report .il.tot { font-weight: 800; color: var(--text); border-top: 1px solid var(--border); margin-top: 4px; padding-top: 5px; }
/* Gün sonu: tıklanabilir sipariş satırı (detay açar) / clickable end-of-day order row */
.eod-order { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.eod-order:active { background: #f3f5f9; }
.eod-order i { color: var(--muted); margin-left: 6px; font-size: 12px; }

/* ===== İstatistik / statistics ===== */
.dv-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.dv-tab { flex: 1; padding: 11px; border: 1px solid var(--border); background: #fff; color: #5a6270; font-weight: 700; border-radius: 10px; cursor: pointer; }
.dv-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.dv-statnums { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.dv-statnums .sn { background: var(--card); border-radius: 14px; padding: 14px 8px; text-align: center; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.dv-statnums .v { font-size: 24px; font-weight: 800; }
.dv-statnums .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.dv-card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.dv-cardttl { font-weight: 700; font-size: 14px; margin-bottom: 8px; }

/* ===== Kısa uyarı / toast ===== */
.dv-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1f2a3a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; max-width: 90vw; }
.dv-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
