:root {
  --blue: #58585a; --blue2: #5f9c33; --brand-green: #78b643; --bg: #f3f5f8; --card: #fff; --text: #1d2733;
  --muted: #6b7785; --line: #e1e6ec; --green: #1e8e3e; --red: #c5221f; --amber: #b06000;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.loading { padding: 40vh 0; text-align: center; color: var(--muted); }

header.top { background: #fff; color: var(--text); border-bottom: 3px solid var(--brand-green); padding: calc(env(safe-area-inset-top) + 12px) 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 5; }
header.top .t { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--blue); }
header.top .t img { height: 30px; width: auto; }
header.top .who { font-size: 13px; color: var(--muted); }
header.top button { background: #eef1ec; color: var(--blue); border: 0; padding: 8px 12px; border-radius: 8px; font-size: 14px; }

nav.tabs { display: flex; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 62px; z-index: 4; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button { flex: 0 0 auto; border: 0; background: none; padding: 12px 14px; font-size: 15px; color: var(--muted);
  border-bottom: 3px solid transparent; white-space: nowrap; }
nav.tabs button.on { color: var(--blue); border-bottom-color: var(--brand-green); font-weight: 600; }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 12px; margin-left: 4px; }

main { padding: 12px; max-width: 900px; margin: 0 auto; padding-bottom: 80px; }
.card { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.card h2 { margin: 0 0 10px; font-size: 17px; }
.card h3 { margin: 12px 0 6px; font-size: 15px; }
.muted { color: var(--muted); font-size: 14px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
textarea { min-height: 60px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }

.btn { display: inline-block; border: 0; border-radius: 10px; padding: 12px 16px; font-size: 16px; font-weight: 600;
  background: var(--blue2); color: #fff; cursor: pointer; }
.btn.full { width: 100%; margin-top: 14px; }
.btn.sec { background: #eef1ec; color: var(--blue); }
.btn.ok { background: var(--green); } .btn.no { background: var(--red); }
.btn.sm { padding: 7px 10px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

.list .it { border-top: 1px solid var(--line); padding: 10px 0; display: flex; gap: 10px; align-items: center; }
.list .it:first-child { border-top: 0; }
.list .it .main { flex: 1; min-width: 0; }
.list .it .main b { display: block; }

.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.chip.pending { background: #fff4e0; color: var(--amber); }
.chip.approved { background: #e6f4ea; color: var(--green); }
.chip.rejected { background: #fce8e6; color: var(--red); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.stat { background: #f2f6ee; border-radius: 10px; padding: 10px; }
.stat .v { font-size: 22px; font-weight: 700; color: var(--blue2); }
.stat .l { font-size: 12px; color: var(--muted); }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; }
.tbl td.n, .tbl th.n { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; }
.scroll { overflow-x: auto; }
details { border-top: 1px solid var(--line); padding: 8px 0; }
details summary { cursor: pointer; font-weight: 600; }

.seg { display: flex; background: #eef1ec; border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 8px; font-size: 15px; color: var(--blue); }
.seg button.on { background: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.1); }

.auth { max-width: 420px; margin: 0 auto; padding: 24px 16px; }
.auth .logo { text-align: center; margin: 20px 0; }
.auth .logo img { width: 100%; max-width: 300px; height: auto; }
.auth .logo h1 { margin: 14px 0 0; color: var(--blue); font-size: 22px; }
.err { color: var(--red); font-size: 14px; margin-top: 8px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 15px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; max-width: 90vw; }
#toast.show { opacity: 1; }

#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; font-size: 11pt; color: #000; }
  #print-area h1 { font-size: 16pt; margin: 0 0 4px; }
  #print-area h2 { font-size: 13pt; margin: 16px 0 6px; }
  #print-area .tbl th, #print-area .tbl td { border-bottom: 1px solid #999; padding: 4px; }
  @page { size: A4; margin: 14mm; }
}

#print-area .print-logo { height: 34px; margin-bottom: 6px; }

.ratebox { background: #f2f6ee; border-left: 4px solid var(--brand-green); padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-d { aspect-ratio: 1 / 1; border-radius: 8px; background: #f3f4f6; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 14px; }
.cal-d.empty { background: none; }
.cal-d .s { font-size: 10px; margin-top: 2px; }
.cal-d.approved { background: #dff0d0; color: #2f6b12; font-weight: 600; }
.cal-d.pending { background: #fff1d6; color: #9a5b00; font-weight: 600; }
.cal-d.rejected { background: #fde2e1; color: #b3261e; }
.cal-d.leave { background: #dbe8fb; color: #1d4f91; }
.cal-d.leavepend { background: #eef3fb; color: #1d4f91; border: 1px dashed #8aa8d6; }
.cal-d.today { outline: 2px solid var(--blue); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.cal-legend i.approved { background: #dff0d0; } .cal-legend i.pending { background: #fff1d6; }
.cal-legend i.rejected { background: #fde2e1; } .cal-legend i.leave { background: #dbe8fb; }

tr.click { cursor: pointer; } tr.click:hover td { background: #f2f6ee; }

.cal-d.tap { cursor: pointer; } .cal-d.tap:active { transform: scale(.95); }

/* απόκρυψη λεφτών για όσους δεν επιτρέπεται (η βάση ούτως ή άλλως δεν τα στέλνει) */
body.nomoney .m { display: none !important; }
body.nomoney .showm .m { display: revert !important; }

.chk { margin:0; display:flex; gap:6px; align-items:center; color: var(--text); font-size: 14px; } .chk input { width:auto; }

.tasksbox { background: #f6f8f4; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 12px; }
.taskrow { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 8px 0; }
.taskrow .row select { flex: 1; } .taskrow .row .btn { flex: 0 0 auto; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumbs .th { position: relative; } .thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; display: block; }
.thumbs .th button { position: absolute; top: -6px; right: -6px; border: 0; border-radius: 50%; width: 22px; height: 22px; background: var(--red); color: #fff; font-size: 12px; }
.phase-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 14px; }
.phase-bar span { width: 62px; color: var(--muted); } .phase-bar .bar { flex: 1; height: 8px; background: #e8ece4; border-radius: 4px; overflow: hidden; }
.phase-bar .bar i { display: block; height: 100%; background: var(--brand-green); }
.card.click { cursor: pointer; }
details.task { border-top: 1px solid var(--line); padding: 8px 0; } details.task summary { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
details.task summary span:first-child { flex: 1; } details.task.is-na summary { opacity: .5; text-decoration: line-through; }
.chip.inprog { background: #e7f0fb; color: #1d4f91; } .chip.na { background: #eee; color: #777; }
.logline { border-left: 3px solid #dfe7d6; padding: 4px 0 4px 10px; margin: 8px 0; font-size: 14px; }
.linkbtn { border: 0; background: none; color: var(--red); font-size: 12px; padding: 4px 0; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.picbox { position: relative; }
.picbtn { position: relative; overflow: hidden; cursor: pointer; margin: 0; color: var(--text); }
.ratereq { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ===== Παραγγελίες ===== */
.mic { width: 100%; padding: 22px; font-size: 20px; border-radius: 14px; border: 0; background: var(--brand-green); color: #fff; font-weight: 700; margin: 8px 0; }
.mic.on { background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.sug { font-size: 11px; color: var(--amber); font-weight: 600; margin-left: 6px; }
.line { display: grid; grid-template-columns: 1fr 64px 64px 30px; gap: 6px; align-items: start; margin: 6px 0; }
.line input { margin: 0; }
.line .x { border: 0; background: #fce8e6; color: var(--red); border-radius: 8px; height: 40px; font-size: 16px; }
.ask { background: #f2f6ee; border: 2px solid var(--brand-green); border-radius: 12px; padding: 14px; text-align: center; margin-top: 14px; }
.ask b { display: block; font-size: 18px; margin-bottom: 10px; }
.ask .btns { justify-content: center; } .ask .btn { min-width: 110px; }
.why { color: var(--red); font-size: 13px; margin-top: 6px; }
.ord .num { font-weight: 700; } .ord .meta { font-size: 13px; color: var(--muted); }
.chip.draft { background: #eef1ec; color: var(--blue); } .chip.sent { background: #e8f0fe; color: #1a56c4; }
.chip.confirmed { background: #e6f4ea; color: var(--green); } .chip.partial { background: #fff4e0; color: var(--amber); }
.chip.done { background: #dff0d0; color: #2f6b12; } .chip.cancelled { background: #fce8e6; color: var(--red); }
.chip.rfq { background: #f3e8fd; color: #7b3fb8; }
.late { color: var(--red); font-size: 12px; font-weight: 600; }
.click { cursor: pointer; }
textarea { font-family: inherit; font-size: 16px; }
