/* ===========================================================
   Περιβάλλον επιχείρησης
   Φορτώνεται μετά το app.css. Σχεδιασμένο πρώτα για κινητό:
   η ρεσεψιόν συχνά δουλεύει όρθια, με το τηλέφωνο στο χέρι.
   =========================================================== */

.admin-bar { flex-wrap: wrap; row-gap: 8px; }
.admin-bar .who { display: none; }

.admin-nav {
  order: 3; width: 100%;
  display: flex; gap: 2px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a {
  flex: none;
  padding: .42em .8em; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-dim);
  font-weight: 550; font-size: .88rem; white-space: nowrap;
}
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.on { background: var(--brand-soft); color: var(--brand); }

.admin-main { padding: 14px 16px 96px; max-width: 1400px; margin: 0 auto; }

/* ---------------- Γραμμή εργαλείων ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.toolbar .spacer { margin-left: auto; }
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav input[type=date] { width: auto; padding: .42em .6em; font-size: .88rem; }
.today-label { font-weight: 650; font-size: 1.02rem; }
.view-switch { display: flex; gap: 4px; }

/* ---------------- Στατιστικά ---------------- */
.stat-row {
  display: flex; gap: 8px; margin-bottom: 14px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.stat-row::-webkit-scrollbar { display: none; }
.stat {
  flex: 1 0 auto; min-width: 116px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 13px;
}
.stat .k {
  display: block; font-size: .76rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 650;
}
.stat .v {
  display: block; font-size: 1.32rem; font-weight: 700; line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

/* ---------------- Χρονογραμμή ---------------- */
.plan {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.plan-scroll { overflow: auto; max-height: calc(100vh - 270px); }
.plan-grid { display: grid; min-width: 620px; position: relative; }

.plan-head {
  position: sticky; top: 0; z-index: 12;
  display: grid; background: var(--surface); border-bottom: 1px solid var(--border);
}
.plan-head .cell { padding: 9px 8px; text-align: center; border-left: 1px solid var(--border);
                   font-size: .84rem; }
.plan-head .cell:first-child { border-left: 0; }
.plan-head .nm { font-weight: 650; }
.plan-head .rl { font-size: .76rem; color: var(--text-dim); }
.plan-head .bar { height: 3px; border-radius: 2px; margin: 6px auto 0; width: 34px; }

.plan-body { display: grid; position: relative; }
.time-col { position: relative; border-right: 1px solid var(--border); background: var(--surface-2); }
.time-label {
  position: absolute; right: 6px;
  font-size: .76rem; color: var(--text-faint); transform: translateY(-.55em);
  font-variant-numeric: tabular-nums;
}
.staff-col { position: relative; border-left: 1px solid var(--border); }
.hour-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.half-line { position: absolute; left: 0; right: 0; border-top: 1px dotted var(--border); opacity: .5; }
.offhours  { position: absolute; left: 0; right: 0; background: var(--surface-2); opacity: .7; }

.now-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--bad); z-index: 8; pointer-events: none;
}
.now-line::before {
  content: ''; position: absolute; left: -4px; top: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--bad);
}

.appt {
  position: absolute; left: 3px; right: 3px; z-index: 6;
  border-radius: 7px; padding: 4px 7px; overflow: hidden; cursor: pointer;
  border: 0; border-left: 3px solid var(--brand);
  background: var(--surface); box-shadow: var(--shadow);
  font: inherit; font-size: .78rem; line-height: 1.25; text-align: left; color: var(--text);
}
.appt:hover { box-shadow: var(--shadow-lg); }
.appt .t { font-weight: 650; font-variant-numeric: tabular-nums; }
.appt .c { font-weight: 600; display: block;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .s { color: var(--text-dim); display: block;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .pin { position: absolute; right: 5px; top: 3px; font-size: .76rem; opacity: .6; }
.appt-compact { display: flex; align-items: center; padding: 2px 7px; font-size: .78rem; }
.appt-compact .t { color: var(--text-dim); margin-right: .25em; }

.appt.st-pending          { border-left-style: dashed; background: var(--warn-soft); }
.appt.st-cancel_requested { border-left-style: dashed; background: var(--warn-soft); outline: 1px dashed var(--warn); }
.appt.st-cancelled        { opacity: .45; text-decoration: line-through; }
.appt.st-completed        { opacity: .78; }
.appt.st-no_show          { background: var(--bad-soft); }

.slot-add {
  position: absolute; left: 0; right: 0; z-index: 2;
  border: 0; background: transparent; padding: 0; cursor: copy;
}
.slot-add:hover { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }

/* ---------------- Πλωτό κουμπί (κινητό) ---------------- */
.fab {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 45; width: 56px; height: 56px; border-radius: 50%;
  border: 0; background: var(--brand); color: #fff;
  font-size: 1.9rem; line-height: 1; cursor: pointer;
  box-shadow: 0 10px 26px -8px rgba(0,0,0,.5);
}
.fab:active { transform: translateY(1px); }

/* ---------------- Φύλλο (modal / bottom sheet) ---------------- */
body.sheet-open { overflow: hidden; }

.sheet-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(24,14,20,.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex: none;
}
.sheet-head h2 { margin: 0; font-size: 1.05rem; }
.sheet-head .spacer { margin-left: auto; }
.sheet-body { padding: 18px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.sheet-foot .spacer { margin-left: auto; }

/* Σε κινητό ανεβαίνει από κάτω και πιάνει όλο το πλάτος. */
@media (max-width: 620px) {
  .sheet-back { align-items: flex-end; padding: 0; }
  .sheet { max-width: none; max-height: 94vh; border-radius: var(--radius) var(--radius) 0 0; }
  .sheet-foot .btn-primary { flex: 1; }
}

/* Γρήγορες ενέργειες */
.quick-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border);
}

/* Προτάσεις πελατών */
.field { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  margin-top: 4px; max-height: 260px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.suggest-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit;
}
.suggest-item:hover { background: var(--brand-soft); }
.suggest-item .nm  { display: block; font-weight: 600; }
.suggest-item .sub { display: block; font-size: .82rem; color: var(--text-dim); }

.time-row { display: flex; gap: .5rem; }
.time-row select { flex: 1; }
.time-row input[type=time] { width: auto; flex: none; }

/* ---------------- Στενή οθόνη ---------------- */
@media (max-width: 820px) {
  .admin-main { padding: 12px 12px 96px; }
  .plan-scroll { max-height: none; }
  .toolbar { gap: 8px; }
  .toolbar .today-label { order: 5; width: 100%; font-size: .95rem; }
  .new-desktop { display: none; }         /* το αντικαθιστά το πλωτό κουμπί */
  .stat { min-width: 104px; padding: 8px 11px; }
  .stat .v { font-size: 1.15rem; }
}

@media (min-width: 821px) {
  .fab { display: none; }
  .admin-bar .who { display: inline; }
}

/* ---------------- Διαχείριση καταλόγων ---------------- */
.row-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row-form .field { margin-bottom: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.hours-grid { display: grid; gap: 8px; }
.hours-day {
  display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 8px; align-items: center;
}
.hours-day .dayname { font-weight: 600; font-size: .9rem; }
@media (max-width: 620px) {
  .hours-day { grid-template-columns: 1fr 1fr; grid-template-areas: "name name" "from to"; }
  .hours-day .dayname { grid-area: name; }
}

.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------------- Διαχείριση αναρτήσεων video ---------------- */
.vid-layout {
  display: grid; gap: 16px; align-items: start;
  grid-template-columns: minmax(300px, 380px) 1fr;
}
@media (max-width: 980px) { .vid-layout { grid-template-columns: 1fr; } }

.vid-thumb {
  width: 50px; height: 88px; flex: none; border-radius: 8px; overflow: hidden;
  background: linear-gradient(160deg, #2a1a34, #120d17);
  display: grid; place-items: center;
}
.vid-thumb img, .vid-thumb video { width: 100%; height: 100%; object-fit: cover; }
.vid-none { color: rgba(255,255,255,.45); font-size: 1.05rem; }

.vid-stats { display: flex; gap: 12px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }

/* Ομαδικό μάθημα στο πλάνο: ένα μπλοκ για όλη την τάξη, με διακριτό
   περίγραμμα ώστε να μη μοιάζει με ατομικό ραντεβού. */
.appt.appt-group { border-style: dashed; border-width: 1px; }
.appt.appt-group .c { font-variant-numeric: tabular-nums; }

/* Απλός πίνακας δεδομένων. Ήταν αντιγραμμένος μέσα στη σελίδα των μαθημάτων —
   με δεύτερη σελίδα που τον χρειάζεται, ζει εδώ. */
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase;
          letter-spacing: .05em; color: var(--text-dim); padding: 6px 8px;
          border-bottom: 1px solid var(--border); }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
