/* =========================
   styles.css — FULL FILE
   ========================= */

:root{
  --bg:#0b1020;
  --card:#0f172a;
  --muted:#94a3b8;
  --border:rgba(255,255,255,0.10);
  --border-strong:rgba(255,255,255,0.18);
  --text:#e2e8f0;

  /* culori ajutătoare */
  --doctor-green:#10b981;
  --assistant-pink:#f472b6;
  --assistant-pink-bg: rgba(244,114,182,.15);
  --assistant-pink-bd: rgba(244,114,182,.35);

  --cabinet-chip-bg:#0b1f36;
  --cabinet-chip-bd:#1e3a8a;
  --cabinet-chip-tx:#93c5fd;
}

html,body{ height:100%; }
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}

/* Cards */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.glass{ background: rgba(255,255,255,0.06); backdrop-filter: blur(8px); }

.tab-btn[aria-selected="true"]{ background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }

.grid-auto{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

/* Scrollbars */
.scroll-slim{ scrollbar-width: thin; scrollbar-color: #475569 transparent; }
.scroll-slim::-webkit-scrollbar{ height:8px; width:8px; }
.scroll-slim::-webkit-scrollbar-thumb{ background:#475569; border-radius:8px; }

/* Badges / Pills */
.badge{ font-size:.75rem; padding:.15rem .5rem; border-radius:9999px; border:1px solid rgba(255,255,255,.12); }
.pill{ display:inline-block; font-size:.7rem; padding:.15rem .4rem; border-radius:9999px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); }

/* Switch */
.switch{ position: relative; display:inline-block; width:44px; height:24px; }
.switch input{ opacity:0; width:0; height:0; }
.slider{ position:absolute; cursor:pointer; top:0; left:0; right:0; bottom:0; background:#475569; transition:.2s; border-radius:9999px; }
.slider:before{ position:absolute; content:""; height:18px; width:18px; left:3px; bottom:3px; background:white; transition:.2s; border-radius:9999px; }
input:checked + .slider{ background:#22c55e; }
input:checked + .slider:before{ transform:translateX(20px); }

/* =========================
   MODAL OPAC (fără transparență)
   ========================= */
.modal{
  position:fixed; inset:0; display:none; align-items:center; justify-content:center;
  background:rgba(0,0,0,.6); z-index:50;
}
.modal.open{ display:flex; }
.modal .card{
  background-color:#0f172a !important;
  background-image:none !important;
  border:1px solid var(--border-strong) !important;
  box-shadow:0 14px 40px rgba(0,0,0,.55);
  opacity:1 !important;
}
#modal button, #modal input, #modal select, #modal textarea{
  color:#e5e7eb;
}
#modal select, #modal input[type="time"], #modal input[type="date"], #modal input[type="text"], #modal textarea{
  background:#0b1220;
  border:1px solid rgba(255,255,255,0.18);
}
#modal select:focus, #modal input:focus, #modal textarea:focus{
  outline:none;
  box-shadow:0 0 0 2px rgba(99,102,241,0.45);
}

/* =========================
   WEEK GRID — Luni–Duminică mereu vizibil
   ========================= */
.week-grid{
  display:grid;
  grid-template-columns: 110px repeat(7, minmax(0, 1fr));
  width:100%;
  min-width:0;
  border:1px solid var(--border);
  border-radius:12px;
}
.week-grid > div{ border-bottom:1px solid var(--border); }
.week-grid .cell{
  min-height: 170px;
  border-left:1px solid var(--border);
  padding:8px;
}

/* Conflicte (cabinet/asistentă dublat) */
.border-danger{
  border-color:#ef4444 !important;
  box-shadow:0 0 0 1px rgba(239,68,68,.25) inset;
}

/* CULORI cerute */
.cabinet-blue { color:#60a5fa; }
.select-cabinet { color:#93c5fd !important; }
.chip-assistant{
  display:inline-block; padding:.15rem .5rem; border-radius:9999px;
  background: var(--assistant-pink-bg); color:var(--assistant-pink); border:1px solid var(--assistant-pink-bd);
}

/* Chip cabinet */
.cab-chip{
  display:inline-block; padding:2px 6px; border-radius:9999px;
  background: var(--cabinet-chip-bg);
  border:1px solid var(--cabinet-chip-bd);
  color: var(--cabinet-chip-tx);
  font-weight:600;
}

/* Etichete vizuale utile */
.tag-doctor { color:#d1fae5; background: rgba(16,185,129,.12); border:1px solid rgba(16,185,129,.35); }
.tag-assistant { color:#fce7f3; background: rgba(244,114,182,.12); border:1px solid rgba(244,114,182,.35); }

/* =========================
   FORM CONTROLS — contrast bun (DARK)
   ========================= */
select,
option{
  color:#e5e7eb;
  background:#0f172a;
}
.bg-select{
  background:#0f172a !important;
  color:#e5e7eb !important;
  border-color: rgba(148,163,184,0.35) !important;
}
select:hover, select:focus{
  outline:none;
  box-shadow:0 0 0 2px rgba(99,102,241,0.35);
  border-color: rgba(99,102,241,0.55);
}
select:disabled{
  color:#94a3b8;
  background:#0b1220;
  opacity:1;
}

/* Inputs/Date */
input[type="text"], input[type="number"], input[type="date"], textarea, select{ outline:none; }
input[type="date"]{
  background:#0b1220;
  border:1px solid var(--border);
  color:var(--text);
  padding:6px 10px;
  border-radius:8px;
}

/* =========================
   TOAST
   ========================= */
.toast-wrap{
  position: fixed; top:16px; right:16px;
  display:flex; flex-direction:column; gap:8px; z-index:60;
}
.toast{
  background:#1f2937; color:#e5e7eb;
  border:1px solid rgba(255,255,255,.12);
  border-radius:8px; padding:10px 12px; font-size:14px;
}
.toast.success{ background:#065f46; }
.toast.error{ background:#7f1d1d; }
.toast.info{ background:#1f2937; }

/* Card compact în grilă */
.week-card{
  padding:8px; border-radius:10px;
  background: rgba(255,255,255,0.04);
  border:1px solid var(--border);
}

/* Butoane utile */
.btn{ display:inline-flex; align-items:center; justify-content:center; padding:.35rem .6rem; border-radius:.5rem; border:1px solid transparent; font-size:.8rem; line-height:1rem; }
.btn-danger{ background:#dc2626; color:#fff; } .btn-danger:hover{ background:#b91c1c; }
.btn-success{ background:#16a34a; color:#fff; } .btn-success:hover{ background:#15803d; }
.btn-warning{ background:#d97706; color:#fff; } .btn-warning:hover{ background:#b45309; }

/* Tabele */
table{ width:100%; border-collapse: collapse; }
th, td{ border-bottom:1px solid var(--border); }

/* ==== Assistants planning grid ==== */
.hour-cell{
  min-width: 64px;
  min-height: 28px;
  border:1px solid rgba(255,255,255,0.07);
  vertical-align: top;
}
.hour-cell.asst-busy{
  background: rgba(244,114,182,.35);
  color:#fff;
}

/* ABSENT (galben) — prioritar */
.hour-cell.asst-absent{
  background: rgba(250,204,21,.35);
  color:#111;
  border-color: rgba(250,204,21,.55);
}

/* --- Modal complet opac --- */
.modal { background: rgba(0,0,0,.70) !important; }
.modal .card{
  background: #111827 !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  box-shadow: 0 24px 48px rgba(0,0,0,.65) !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
}

/* --- Selecturi mai închise (nu mai e „alb pe alb”) --- */
.bg-select{
  background: #0f172a !important;
  color: #e5e7eb !important;
  border: 1px solid #334155 !important;
}
.bg-select option{
  background: #ffffff !important;
  color: #0b1020 !important;
}

/* ===== Weekly board – layout ===== */
#weekGrid .doc-card{ display:flex; flex-direction:column; gap:10px; }
#weekGrid .assign-line{ display:flex; align-items:center; gap:8px; }
#weekGrid .assign-line select{ flex:1 1 auto; min-width:0; }
#weekGrid .assign-line .btn-assign{ flex:0 0 auto; white-space:nowrap; }

/* Chip asistentă (roz) */
#weekGrid .asst-chip{
  display:flex; align-items:center; gap:8px;
  max-width:100%; padding:6px 10px; border-radius:9999px;
  background: rgba(244,114,182,.15);
  border:1px solid rgba(244,114,182,.35);
  color:#f472b6; font-weight:600;
}
#weekGrid .asst-chip .asst-name{
  min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
#weekGrid .asst-chip .btn-remove{
  margin-left:auto; flex:0 0 auto;
  padding:.25rem .5rem; font-size:.75rem; line-height:1rem;
}

/* Asigurăm că nimic nu iese din celulă */
#weekGrid .cell{ overflow:visible; }

/* === TIME INPUTS — 24h === */
input[type="time"] { -webkit-appearance: none; appearance: none; }
input[type="time"]::-webkit-datetime-edit-ampm-field { display: none; }
input[type="time"]::-webkit-clear-button { display: none; }
input[type="time"]::-webkit-calendar-picker-indicator { opacity: .7; }
input[type="time"] {
  background:#0f172a; color:#e5e7eb; border:1px solid rgba(148,163,184,0.35);
  padding:.35rem .5rem; border-radius:.5rem;
}
input[type="time"]:focus {
  outline:none;
  box-shadow:0 0 0 2px rgba(99,102,241,0.35);
  border-color: rgba(99,102,241,0.55);
}

/* ===== Assistants Plan — Zi liberă (FT) ===== */
.hour-cell.asst-off{
  background: rgba(239,68,68,.28);
  border-color: rgba(239,68,68,.42);
}
tr.row-asst-off td:first-child .off-badge{
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.45);
  color: #fecaca;
}
tr.row-asst-off .hour-cell{
  background: rgba(239,68,68,.20);
}

/* Busy rămâne peste off, dacă apare cumva */
tr.row-asst-off .hour-cell.asst-busy{
  background: rgba(244,114,182,.35);
  border-color: rgba(244,114,182,.55);
}

/* ABSENT > OFF: dacă e zi liberă, dar ai marcat absență pe oră, păstrăm galbenul */
tr.row-asst-off .hour-cell.asst-absent{
  background: rgba(250,204,21,.45);
  color:#111;
  border-color: rgba(250,204,21,.65);
}
/* Users table micro-tweaks */
#usersTable th, #usersTable td { padding: 10px; }
.btn.btn-xs{ padding:.2rem .45rem; font-size:.72rem; line-height:1rem; border-radius:.35rem; }

/* Modal reset parolă – folosește schema ta .modal/.card deja existentă */
#pwdModal .card { max-width: 480px; width: calc(100% - 32px); }
#pwdModal input[type="text"]{
  width:100%; background:#0b1220; border:1px solid rgba(255,255,255,.18);
  color:#e5e7eb; padding:8px 10px; border-radius:8px;
}
#pwdModal .actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:6px; }
/* Absențe grupate */
.group-card { border:1px solid var(--border); border-radius:10px; background: rgba(255,255,255,0.04); margin:8px 0; }
.group-head {
  width:100%; text-align:left; padding:.5rem .75rem; display:flex; align-items:center; gap:.5rem;
  font-weight:600; background:transparent; border:none; cursor:pointer;
}
.group-head .caret { transition: transform .15s ease; opacity:.8; }
.group-head.open .caret { transform: rotate(90deg); }
.group-head .count {
  margin-left:auto; font-size:.75rem; padding:.1rem .45rem; border-radius:9999px;
  background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12);
}
.group-body { padding: .25rem .75rem .5rem; }
.group-body .list { margin: 0; padding-left: 0; list-style: none; }
.btn.btn-xs { padding:.2rem .45rem; font-size:.7rem; border-radius:.4rem; }
