/* finance.css — ίδιο ύφος με operator / agent */
:root {
    --navy: #000080; --black: #000; --bg: #e4e5ea; --panel: #fff; --border: #d6d6e2;
    --text: #1a1a2e; --muted: #7a7a8c; --green: #007C1A; --green-l: #e3f5e8;
    --red: #c40000; --red-l: #fde8e8; --orange: #e66a00; --orange-l: #fff0e2;
    --blue-l: #e8ebff; --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--bg); font-family: "Poppins", sans-serif; font-size: 13px; color: var(--text); }
a { color: var(--navy); }
.hidden { display: none !important; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--black); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 16px; height: 52px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 15px; white-space: nowrap; }
.brand i { color: #f0b400; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a { color: rgba(255,255,255,.65); text-decoration: none; display: flex; align-items: center; gap: 7px; padding: 0 13px; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; border-bottom-color: #f0b400; }
.spacer { flex: 1; }
.user { opacity: .75; font-size: 12px; white-space: nowrap; }
.logout { color: #fff; opacity: .7; font-size: 16px; }
.logout:hover { opacity: 1; }

.page { max-width: 1280px; margin: 0 auto; padding: 18px 16px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; font-weight: 800; }
.page-head .sub { color: var(--muted); }
.back { text-decoration: none; color: var(--muted); font-weight: 600; }

/* Κάρτες */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.card .value { font-size: 22px; font-weight: 800; margin-top: 4px; }
.card .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.card.income .value { color: var(--green); }
.card.expense .value { color: var(--red); }
.card.owed .value { color: var(--orange); }

.panel { background: var(--panel); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 16px; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h2 { font-size: 14px; font-weight: 800; }
.panel-body { padding: 14px 16px; }

/* Πίνακες */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); background: #f6f6fa; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid #eeeef4; vertical-align: middle; }
table.t tr:hover td { background: #fafaff; }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t tr.sel td { background: #f2fff5; }
table.t tr.muted td { color: var(--muted); }
table.t tfoot td { font-weight: 800; background: #f6f6fa; }
.route { line-height: 1.35; max-width: 340px; }
.route .from { color: #c0392b; font-weight: 600; }
.route .to { color: var(--green); font-weight: 600; }
.small { font-size: 11px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* Ενδείξεις */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 12px; white-space: nowrap; }
.tag.cash { background: #fff3cd; color: #8a6100; }
.tag.card { background: var(--blue-l); color: var(--navy); }
.tag.online { background: var(--green-l); color: var(--green); }
.tag.done { background: var(--green-l); color: var(--green); }
.tag.ride { background: var(--orange-l); color: var(--orange); }
.tag.upcoming { background: #eee; color: #666; }
.tag.reopened { background: var(--red-l); color: var(--red); }
.tag.warn { background: var(--orange-l); color: var(--orange); }

/* Κουμπιά & πεδία */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: #fff; color: var(--text); padding: 8px 14px; border-radius: 8px; font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #aaa; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.red { background: #fff; border-color: #f0b4b4; color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 11.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input.in, select.in, textarea.in { height: 34px; border: 1.5px solid var(--border); border-radius: 7px; padding: 0 10px; font-family: inherit; font-size: 12.5px; background: #fff; }
textarea.in { height: auto; padding: 8px 10px; resize: vertical; }
input.in:focus, select.in:focus, textarea.in:focus { outline: none; border-color: var(--navy); }
input.amount { width: 92px; text-align: right; height: 30px; }
input.amount.range { border-color: var(--orange); background: #fffaf3; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 16px; padding: 5px 12px; font-family: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; color: var(--muted); }
.chip.active { background: var(--black); color: #fff; border-color: var(--black); }
input[type=checkbox].ck { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }

/* Μπάρα επιλογής (driver page) */
.selbar { position: sticky; bottom: 0; z-index: 10; background: #111; color: #fff; display: flex; align-items: center; gap: 18px; padding: 12px 16px; border-radius: 12px; margin-top: 12px; box-shadow: 0 -4px 20px rgba(0,0,0,.2); flex-wrap: wrap; }
.selbar b { font-size: 17px; }
.selbar .sb-item { display: flex; flex-direction: column; }
.selbar .sb-item span { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: .6; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; align-items: center; justify-content: center; padding: 16px; }
.modal.active { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 520px; max-width: 100%; max-height: 92vh; overflow: auto; box-shadow: 0 16px 50px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; padding: 12px 16px; background: var(--black); color: #fff; font-weight: 700; }
.modal-head b { flex: 1; }
.modal-head .x { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-body label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 12px; }
.modal-body .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.sumbox { background: #f6f6fa; border-radius: 8px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.sumbox .big { font-size: 18px; font-weight: 800; color: var(--green); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg label { flex-direction: row; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; }
.seg input { display: none; }
.seg label:has(input:checked) { border-color: var(--navy); background: var(--blue-l); color: var(--navy); }

/* Γράφημα μηνών */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 160px; padding-top: 10px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar .pair { display: flex; gap: 3px; align-items: flex-end; height: 130px; }
.bar .in, .bar .out { width: 12px; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar .in { background: var(--green); }
.bar .out { background: var(--red); opacity: .8; }
.bar small { font-size: 10px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { background: #fff; border-radius: 14px; padding: 28px; width: 380px; max-width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 12px; }
.login h1 { font-size: 20px; font-weight: 800; }
.login h1 i { color: #f0b400; }
.login label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 12px; }
.login .err { background: var(--red-l); color: var(--red); padding: 8px 10px; border-radius: 7px; font-weight: 600; }
.login .info { background: var(--blue-l); color: var(--navy); padding: 8px 10px; border-radius: 7px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background: #111; color: #fff; padding: 10px 20px; border-radius: 22px; font-weight: 600; transition: transform .25s; z-index: 99; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* Εκτύπωση απόδειξης */
@media print {
    .topbar, .no-print, .toast { display: none !important; }
    body { background: #fff; }
    .page { padding: 0; }
    .panel, .card { box-shadow: none; border: 1px solid #ccc; }
}
@media (max-width: 760px) {
    .nav a span { display: none; }
    .user { display: none; }
    .modal-body .row2 { grid-template-columns: 1fr; }
}
