:root {
  --brand: #0f6e6e;
  --brand-soft: #e3f1f1;
  --bg: #f4f7f7;
  --card: #ffffff;
  --text: #1c2526;
  --muted: #66737a;
  --line: #dde5e6;
  --danger: #b3261e;
  --warn-bg: #fff4d6;
  --warn-text: #6b4e00;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }

/* ---------- Σύνδεση ---------- */
.screen { min-height: 100vh; }
#login { display: grid; place-items: center; padding: 24px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.login-card { width: min(380px, 100%); padding: 28px 24px; display: grid; gap: 14px; text-align: center; }
.login-card h1 { margin: 0 0 6px; font-size: 1.5rem; }
.login-icon { width: 64px; height: 64px; margin: 0 auto; }
label { display: grid; gap: 6px; text-align: left; font-size: .9rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=date], input[type=time], input[type=search], input[type=number] {
  width: 100%; padding: 12px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); font-size: 1rem;
}
input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }

.btn { padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 600; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f0c9c6; }
.error { color: var(--danger); margin: 0; font-size: .9rem; }
.warn { background: var(--warn-bg); color: var(--warn-text); padding: 10px 12px; border-radius: 10px; margin: 0; font-size: .9rem; }
.hint { color: var(--muted); font-size: .85rem; margin: 6px 0; }

/* ---------- Πάνω μπάρα ---------- */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--brand); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.topbar-row { display: flex; align-items: center; justify-content: space-between; max-width: 760px; margin: 0 auto; }
.topbar-actions { display: flex; gap: 4px; }
.icon-btn { background: transparent; border: 0; color: inherit; font-size: 1.15rem; padding: 8px 10px; border-radius: 10px; line-height: 1; }
.text-btn { font-size: .85rem; font-weight: 600; border: 1px solid rgba(255,255,255,.45); padding: 6px 10px; margin-left: 4px; }
.icon-btn:hover, .icon-btn:focus-visible { background: rgba(255,255,255,.15); }
.datebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 760px; margin: 8px auto 0; }
.date-label { position: relative; flex: 1; text-align: center; color: #fff; font-size: 1.1rem; font-weight: 600; cursor: pointer; display: block; }
.date-label input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; padding: 0; border: 0; }
.daymeta { display: flex; align-items: center; justify-content: space-between; max-width: 760px; margin: 6px auto 0; font-size: .9rem; opacity: .95; }
.chip { border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; border-radius: 999px; padding: 4px 12px; font-size: .85rem; }

/* ---------- Λίστα ημέρας ---------- */
.daylist { max-width: 760px; margin: 0 auto; padding: 12px 12px 110px; display: grid; gap: 8px; }
.section-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 4px 0; }
.appt { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 12px; border-left: 5px solid var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,.05); cursor: pointer; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; color: inherit; }
.appt.past { opacity: .6; }
.appt .time { font-weight: 700; font-size: 1.05rem; }
.appt .time small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.appt .who { min-width: 0; }
.appt .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt .who span { color: var(--muted); font-size: .88rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call { text-decoration: none; background: var(--brand-soft); color: var(--brand); border-radius: 999px; width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.1rem; }
.free { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 12px; color: var(--muted); text-align: left; }
.free:hover, .free:focus-visible { border-color: var(--brand); color: var(--brand); background: #fff; }
.free .time { width: 62px; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.fab { position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom)); width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 2rem; box-shadow: 0 6px 18px rgba(15,110,110,.35); }

/* ---------- Φόρμες (dialog) ---------- */
dialog.sheet { border: 0; padding: 0; border-radius: var(--radius); width: min(520px, calc(100% - 24px)); max-height: calc(100vh - 24px); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
dialog.sheet::backdrop { background: rgba(10,25,25,.45); }
dialog.sheet form { padding: 20px; display: grid; gap: 12px; }
dialog.sheet h2 { margin: 0; font-size: 1.2rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
fieldset.durations { border: 0; padding: 0; margin: 0; }
fieldset.durations legend { font-size: .9rem; color: var(--muted); padding: 0; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 600; color: var(--text); }
.chips button[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: #fff; }
.sheet-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.spacer { flex: 1; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.results button { width: 100%; text-align: left; background: var(--bg); border: 0; border-radius: 10px; padding: 10px 12px; color: inherit; }
.row-add { display: grid; grid-template-columns: 1fr 96px; gap: 10px; }
.svc-row { display: flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 10px; padding: 4px 4px 4px 12px; }
.svc-row .svc-name { flex: 1; min-width: 0; }
.svc-row .svc-name small { color: var(--muted); }
.svc-row .icon-btn, .results .svc-row button.icon-btn { color: var(--text); width: auto; flex: none; background: transparent; padding: 8px 10px; }
.svc-row.editing { outline: 2px solid var(--brand); }
.results small { color: var(--muted); display: block; }

@media (max-width: 520px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--radius) var(--radius) 0 0; max-height: 92vh; }
  dialog.sheet form { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #1c2526; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .9rem; z-index: 20; }

/* ---------- Εκτύπωση ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .screen, dialog, .toast, .fab { display: none !important; }
  .print-only { display: block; font-family: Arial, Helvetica, sans-serif; color: #000; }
  .print-only h1 { font-size: 16pt; margin: 0 0 2mm; }
  .print-only .sub { font-size: 11pt; margin: 0 0 5mm; }
  .print-only table { width: 100%; border-collapse: collapse; font-size: 11pt; }
  .print-only th, .print-only td { border: 1px solid #555; padding: 2.2mm 2mm; text-align: left; vertical-align: top; }
  .print-only th { background: #e8e8e8; }
  .print-only td.obs { width: 30%; }
  .print-only tr { page-break-inside: avoid; }
  .print-only .foot { margin-top: 4mm; font-size: 9pt; color: #444; }
}
