/* ============================================================
   Impact Training Studio — mobile first
   Μονόχρωμη παλέτα, ταιριάζει με το ασπρόμαυρο λογότυπο.
   ============================================================ */

:root {
  --ink:      #111111;
  --ink-soft: #5b5b5b;
  --line:     #e3e3e3;
  --bg:       #f6f6f6;
  --panel:    #ffffff;
  --ok:       #1a7f4b;
  --warn:     #9a6700;
  --danger:   #b3261e;
  --radius:   12px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { text-decoration: none; }

.brand-mark {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 15px;
  color: #fff;
}


/* ---------- Layout ---------- */

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

h1 { font-size: 22px; margin: 0 0 2px; }

.muted { color: var(--ink-soft); font-size: 14px; margin: 0; }

/* ---------- Messages ---------- */

.flash, .alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 15px;
}

.flash { background: #e8f3ec; border: 1px solid #bfe0cc; color: var(--ok); }
.alert { background: #fdecea; border: 1px solid #f5c6c2; color: var(--danger); }

/* ---------- Search ---------- */

.searchbar { display: flex; gap: 8px; margin-bottom: 16px; }
.searchbar input { flex: 1; }

/* ---------- Contact cards ---------- */

.cards { list-style: none; margin: 0; padding: 0; }
.cards li { margin-bottom: 8px; }

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-decoration: none;
  color: inherit;
  min-height: 60px;            /* άνετο target για δάχτυλο */
}

.card:active { background: #fafafa; }

.card-main { display: flex; flex-direction: column; min-width: 0; }

.card-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub {
  color: var(--ink-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.badge {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-ok   { background: #e8f3ec; color: var(--ok); }
.badge-warn { background: #fdf4e3; color: var(--warn); }
.badge-off  { background: #eeeeee; color: var(--ink-soft); }

/* ---------- Forms ---------- */

.form, .login-box form { display: flex; flex-direction: column; }

label {
  font-size: 14px;
  font-weight: 600;
  margin: 14px 0 6px;
}

input[type=text], input[type=tel], input[type=email],
input[type=password], input[type=search], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-size: 16px;             /* κάτω από 16px το iOS κάνει zoom */
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

textarea { resize: vertical; }

.hint { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

.field-error { font-size: 13px; color: var(--danger); margin-top: 6px; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 4px;
  font-weight: 400;
  font-size: 15px;
}

.checkbox input { width: 20px; height: 20px; accent-color: var(--ink); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  min-height: 46px;
  white-space: nowrap;
}

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:active { background: #000; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }

.btn-block { width: 100%; margin-top: 22px; }

.danger-zone {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ---------- Empty state ---------- */

.empty {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
}

.empty .btn { margin-top: 14px; }

/* ---------- Login ---------- */

.login-box {
  max-width: 380px;
  margin: 8vh auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 24px;
}

.login-logo {
  text-align: center;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.14em;
}

.login-sub {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 4px 0 22px;
}

/* ---------- Desktop ---------- */

@media (min-width: 640px) {
  .wrap { padding: 28px 20px; }
  h1 { font-size: 26px; }
}

/* ============================================================
   ΒΗΜΑ 2 — Ομάδες και αποστολή
   ============================================================ */


.badge-neutral { background: #ececec; color: var(--ink-soft); }
.badge-fail    { background: #fdecea; color: var(--danger); }

/* ---------- Banner δοκιμής ---------- */

.banner-test {
  background: #fff8e1;
  border: 1px solid #f0d99b;
  color: #7a5a00;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- Chips ομάδων ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { margin: 0; font-weight: 400; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 14px;
  cursor: pointer;
  min-height: 42px;
}

.chip span em {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-soft);
  background: #f0f0f0;
  border-radius: 999px;
  padding: 1px 7px;
}

.chip input:checked + span {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.chip input:checked + span em { background: rgba(255,255,255,.22); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Λίστα επιλογής ---------- */

.member-filter { margin-bottom: 8px; }

.picker {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  cursor: pointer;
  min-height: 56px;
}

.picker-row:last-child { border-bottom: none; }
.picker-row input { width: 20px; height: 20px; flex: none; accent-color: var(--ink); }

.picker-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.picker-name { font-size: 15px; }
.picker-sub  { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- Μετρητής χαρακτήρων ---------- */

.counter {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.counter-warn { color: var(--warn); font-weight: 600; }

/* ---------- Προεπισκόπηση ---------- */

.preview-msg {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.preview-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.preview-msg p { margin: 6px 0 0; white-space: pre-wrap; }

/* ---------- Στατιστικά ---------- */

.stats { display: flex; gap: 8px; margin-bottom: 16px; }

.stat {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}

.stat-num { display: block; font-size: 21px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--ink-soft); }

.tip {
  background: #eef4fb;
  border: 1px solid #cfe0f2;
  color: #2a4a6b;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ---------- Αναδιπλούμενα ---------- */

.reveal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.reveal summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.reveal[open] summary { margin-bottom: 10px; }
.reveal-warn { background: #fffaf0; border-color: #f0d99b; }

.plain-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.plain-list li { padding: 5px 0; }

.list-rows { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }

.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--line);
}

.row-item:last-child { border-bottom: none; }

.section-title { font-size: 16px; margin: 26px 0 10px; }

/* ---------- Ιστορικό ---------- */

.card-stack { flex-direction: column; align-items: stretch; gap: 6px; }

.msg-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.msg-excerpt {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
}

.confirm-actions { margin-top: 4px; }
.confirm-actions .btn[disabled] { opacity: .6; }

/* ============================================================
   ΒΗΜΑ 3 — Editor, πρότυπα, προεπισκόπηση κινητού
   ============================================================ */

.editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tool-select {
  flex: 1;
  min-width: 150px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}

.tool-btn {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
  color: var(--ink);
}

.tool-btn:active { background: #f0f0f0; }

/* ---------- Emoji ---------- */

/* Το [hidden] είναι display:none, αλλά το display:flex παρακάτω
   το υπερισχύει. Χρειάζεται ρητός κανόνας. */
.emoji-tray[hidden] { display: none; }

.emoji-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.emoji-btn {
  font-size: 22px;
  line-height: 1;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  min-width: 42px;
  min-height: 42px;
}

.emoji-btn:active { background: #f0f0f0; }

.emoji-warn {
  width: 100%;
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--warn);
}

.emoji-cost {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #fdf4e3;
  border: 1px solid #f0d99b;
  color: #7a5a00;
  font-size: 13px;
}

/* ---------- Προεπισκόπηση κινητού ---------- */

.phone-preview { margin-top: 20px; }

.phone-screen {
  margin-top: 8px;
  padding: 14px;
  background: #ece9e4;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 70px;
}

.bubble {
  position: relative;
  align-self: flex-start;
  max-width: 88%;
  background: #fff;
  border-radius: 16px 16px 16px 5px;
  padding: 10px 13px 10px 13px;
  font-size: 15px;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,.09);
}

.bubble-empty { color: #9a9a9a; font-style: italic; }

.bubble-tag {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--ink-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Αποθήκευση προτύπου ---------- */

.save-tmpl {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.tmpl-name { flex: 1; }
.save-tmpl .btn { white-space: nowrap; }

.tmpl-actions { display: flex; gap: 12px; font-size: 13px; }
.tmpl-actions a { color: var(--ink-soft); }

.link-danger {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13px;
  font-family: inherit;
  padding: 4px 0 0;
  cursor: pointer;
  text-align: left;
}

code {
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

@media (max-width: 420px) {
  .save-tmpl { flex-direction: column; }
}

.rendered-line {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ============================================================
   ΛΟΓΟΤΥΠΟ
   ============================================================ */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  display: block;
  flex: none;
}

.login-logo-img {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 10px;
}

/* Στα πολύ στενά κινητά κρατάμε μόνο το σήμα, ώστε να χωρέσει
   το μενού χωρίς να σπάσει σε δεύτερη γραμμή. */

/* ============================================================
   ΠΛΟΗΓΗΣΗ
   Κινητό: μπάρα κάτω, εκεί που φτάνει ο αντίχειρας.
   Desktop: κουμπιά πάνω δεξιά.
   ============================================================ */

/* ---------- Κοινά ---------- */

.nav-item {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 8px;
  color: inherit;
}

.nav-item svg { width: 20px; height: 20px; flex: none; }

/* ---------- Κάτω μπάρα (κινητό) ---------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar .nav-item {
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 9px 2px 7px;
  min-height: 56px;             /* άνετος στόχος για δάχτυλο */
  color: #8a8a8a;
  font-size: 10.5px;
  letter-spacing: -0.1px;
  -webkit-tap-highlight-color: transparent;
}

.tabbar .nav-item svg { width: 22px; height: 22px; }

.tabbar .nav-item.is-active { color: var(--ink); }

/* Ενεργή καρτέλα: γεμάτο σήμα από πάνω */
.tabbar .nav-item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--ink);
}

.tabbar .nav-item { position: relative; }

.tabbar .nav-item:active { background: rgba(0, 0, 0, .04); }

/* Χώρος ώστε το περιεχόμενο να μην κρύβεται πίσω από την μπάρα */
.wrap.has-tabbar {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* ---------- Πάνω μπάρα ---------- */

.nav-top { display: none; }

.logout-link {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
}

.logout-link svg { width: 18px; height: 18px; }
.logout-link:active { background: rgba(255, 255, 255, .1); }
.logout-link span { display: none; }

/* ---------- Desktop ---------- */

@media (min-width: 720px) {
  .tabbar { display: none; }

  .wrap.has-tabbar { padding-bottom: 40px; }

  .nav-top {
    display: flex;
    gap: 4px;
    margin-left: auto;
    margin-right: 8px;
  }

  .nav-top .nav-item {
    padding: 8px 13px;
    border-radius: 999px;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    transition: background .12s, color .12s;
  }

  .nav-top .nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
  }

  .nav-top .nav-item.is-active {
    color: var(--ink);
    background: #fff;
    font-weight: 600;
  }

  .logout-link span { display: inline; }
  .logout-link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
}

/* Πολύ στενές οθόνες: μόνο το σήμα πάνω αριστερά */
@media (max-width: 400px) {
  .brand-mark { display: none; }
}

[hidden] { display: none !important; }

/* ============================================================
   ΕΝΔΕΙΞΕΙΣ ΜΗΚΟΥΣ
   Δεν εμποδίζουν τίποτα — ενημερώνουν.
   ============================================================ */

.length-note {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.45;
}

.note-info { background: #eef4fb; border: 1px solid #cfe0f2; color: #2a4a6b; }
.note-warn { background: #fdf4e3; border: 1px solid #f0d99b; color: #7a5a00; }
.note-stop { background: #fdecea; border: 1px solid #f5c6c2; color: var(--danger); }

/* ============================================================
   ΔΙΟΡΘΩΣΕΙΣ ΕΜΦΑΝΙΣΗΣ
   ============================================================ */

/* ---------- Λογότυπο & επωνυμία στη μαύρη μπάρα ---------- */

.brand-logo { width: 46px; height: 46px; }

.brand-mark {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-mark strong {
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 15px;
}

.brand-mark em {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.68;
  margin-top: 1px;
}

.topbar { padding-top: 10px; padding-bottom: 10px; }

.login-logo-img { width: 130px; height: 130px; }

.login-sub {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 14px;
}

/* ---------- Όριο χρέωσης μέσα στη φούσκα ----------
   Ο παραλήπτης βλέπει ένα ενιαίο μήνυμα. Η γραμμή δείχνει
   μόνο πού αλλάζει η χρέωση, όχι πού σπάει το μήνυμα. */

.seg-break {
  display: block;
  position: relative;
  height: 1px;
  background: repeating-linear-gradient(
    to right, #d7d3cd 0 5px, transparent 5px 10px);
  margin: 11px 0 13px;
}

.seg-break::after {
  content: attr(data-label);
  position: absolute;
  right: 0;
  top: -7px;
  background: #fff;
  padding: 0 5px;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a09a92;
}

.bubble { max-width: 100%; }

@media (max-width: 400px) {
  .brand-mark em { display: none; }
  .brand-logo { width: 38px; height: 38px; }
}
