body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f2f5f8;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 80%;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.container-login {
    max-width: 20%;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

h2, h3 {
    color: #2765A0;
}

input, select, button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-top: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
}

button {
    background-color: #2765A0;
    color: #fff;
    border: none;
    transition: background-color 0.3s ease;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background-color: #1f4f7d;
}

a button {
    width: auto;
    display: inline-block;
    margin-top: 0;
}


/* Buton Șterge de dimensiune fixă */
.btn-danger.fixed {
  width: 80px;               /* poți regla: 80–100px */
  text-align: center;
  padding: 6px 0;
  white-space: nowrap;
  display: inline-block;
}

table.report td .btn-danger.fixed {
  width: 90px;               /* păstrează în tabel */
  min-width: 90px;
  max-width: 90px;
}



/* Lista utilizatori */
.user-card {
    background-color: #f4f8fb;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.user-name {
    font-weight: bold;
    color: #2765A0;
}

.user-role {
    font-style: italic;
    color: #333;
}

.user-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.user-actions button {
    padding: 6px 10px;
    font-size: 14px;
    background-color: #e0e6ec;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.user-actions button:hover {
    background-color: #d0dbe7;
}

.edit-form {
    width: 100%;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mesaj-succes {
    padding: 12px;
    margin-top: 10px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
}
.mesaj-eroare {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* ===== Calendar ===== */

.calendar-header {
    margin-bottom: 15px;
    text-align: center;
}

.data-calendar {
    font-size: 18px;
    font-weight: bold;
    margin: 0 15px;
    color: #2765A0;
}

.calendar-grid {
    overflow-x: auto;
}

/* Varianta „gap” pentru tabele:
   - separate + border-spacing: 1px => linii albe de 1px între celule
   - fără border pe th/td
   - fundalul tabelului alb devine „dunga” dintre celule
*/
.calendar-tabel {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 1px !important;   /* echivalentul lui gap: 1px */
    background: #ffffff;               /* culoarea „dungii” */
    table-layout: fixed;               /* coloane consistente la scroll/resize */
}

.calendar-tabel th,
.calendar-tabel td {
    border: 0 !important;              /* eliminăm liniile clasice */
    padding: 8px;
    text-align: center;
    min-width: 120px;
    background-clip: padding-box;      /* previne „sângerarea” fundalului în spacing */
}


.calendar-tabel {
  border-collapse: separate !important;
  border-spacing: 1px !important; 
  background: #e9eef3;               /* linia devine gri-deschis */
  table-layout: fixed;
}

.calendar-tabel td { background: #ffffff; }
.calendar-tabel th { background-color: #2765A0; color:#fff; }




/* Headerul rămâne pe brand */
.calendar-tabel th {
    background-color: #2765A0;
    color: white;
    font-weight: 600;
}

/* (Opțional) highlight discret pe celule libere, nu afectează spacing-ul alb */
.calendar-tabel td:not(.ocupat):hover {
    filter: brightness(1.04);
    transition: filter .15s ease-in-out;
}


/* === Delimitatori fini pentru calendar — varianta stabilă cu collapse === */
.calendar-tabel {
  width: 100%;
  border-collapse: collapse !important; /* liniile interioare rămân 1px */
  table-layout: fixed;
  background: #ffffff; /* fundalul general */
}

.calendar-tabel th,
.calendar-tabel td {
  padding: 8px;
  text-align: center;
  min-width: 120px;
  background-clip: padding-box;
}

/* headere pe brand */
.calendar-tabel th {
  background-color: #2765A0;
  color: #fff;
  font-weight: 600;
}

/* celule: tentă foarte fină ca linia albă să se distingă */
.calendar-tabel td {
  background: #f6f9fc;
}

/* ——— liniile „fine” ———
   desenăm DOAR dreapta + jos, ca să evităm dublarea */
.calendar-tabel th,
.calendar-tabel td {
  border-right: 1px solid #fff !important;
  border-bottom: 1px solid #fff !important;
  border-left: 0 !important;
  border-top: 0 !important;
}

/* ultima coloană nu mai are marginea din dreapta */
.calendar-tabel tr th:last-child,
.calendar-tabel tr td:last-child {
  border-right: 0 !important;
}

/* ultimul rând nu mai are marginea de jos */
.calendar-tabel tr:last-child th,
.calendar-tabel tr:last-child td {
  border-bottom: 0 !important;
}

/* hover discret pe celulele libere */
.calendar-tabel td:not(.ocupat):hover {
  filter: brightness(1.04);
  transition: filter .15s ease-in-out;
}

.calendar-grid-orar {
    width: 100%;
    margin: 0 auto; /* centrează pe orizontală */
    display: grid;
    grid-template-columns: 100px repeat(var(--cols, 1), 1fr);
    gap: 1px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}


/* ====== Programare nouă (stil general) ====== */
.appointment .page-actions {
  display:flex; gap:10px; margin: 8px 0 16px;
}

.form-section {
  background:#fff;
  border:1px solid #e8edf3;
  border-radius:14px;
  padding:18px;
  margin:14px 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.04);
}

.section-title {
  margin:0 0 14px 0;
  color:#3a4a63;
  font-size: 18px;
  font-weight: 700;
}

/* grilă flexibilă pentru câmpuri */
.form-grid {
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

/* helper span-uri */
.span-12{grid-column: span 12;}
.span-6 {grid-column: span 6;}
.span-4 {grid-column: span 4;}
.span-3 {grid-column: span 3;}
.span-2 {grid-column: span 2;}

/* câmp + etichetă */
.field label {
  display:block;
  font-weight:600;
  color:#51627c;
  margin-bottom:6px;
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field input[type="date"],
.field input[type="time"],
.field select,
.field textarea {
  width:100%;
  padding:12px 14px;
  border:1px solid #d6deea;
  border-radius:10px;
  background:#f7faff;
  outline:none;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
  font-size:15px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color:#b6c9e6;
  box-shadow: 0 0 0 3px rgba(39,101,160,.12);
  background:#fff;
}

/* radio group frumos aliniat */
.radio-group {
  display:flex; align-items:center; gap:18px;
  padding:10px 12px; background:#f7faff; border:1px solid #d6deea; border-radius:10px;
}
.radio-group label { margin:0; font-weight:600; color:#51627c; }
.radio-group input[type="radio"] { transform: translateY(1px); }

/* input cu id pacient lângă autocomplete */
.inline-group { display:grid; grid-template-columns: 1fr 140px; gap:12px; }

/* footer acțiuni */
.form-actions {
  display:flex; gap:12px; margin-top: 10px;
}
.form-actions .btn-secondary {
  background:#eef3f9; color:#1f2a44; border:1px solid #d6deea;
}
.form-actions .btn-secondary:hover { background:#e6eef8; }

/* Select + date/time să aibă aceeași înălțime ca input-urile */
.field select, .field input[type="date"], .field input[type="time"] { height: 44px; }

/* responsive */
@media (max-width: 1100px){
  .span-6{grid-column: span 12;}
  .span-4{grid-column: span 12;}
  .span-3{grid-column: span 6;}
  .inline-group{ grid-template-columns: 1fr; }
}


.msg-eroare {
  color: #d00 !important;
  font-weight: bold;
  font-size: 14px;
}
.msg-succes {
  color: #155724;
  font-weight: bold;
}


.calendar-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:10px 0 18px;
}

.calendar-left {
  display:flex;
  align-items:center;
  gap:12px;
}

.calendar-right {
  display:flex;
  align-items:center;
  gap:8px;
}

.date-jump {
  width: 170px;
  padding: 8px 10px;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  background:#fff;
  font-size:14px;
}

.data-calendar {
  font-weight:600;
  color:#2765A0;
  font-size:15px;
}


.btn-fisa {
  background-color: #9D00FF; /* mov violet */
  color: #fff;
  border: none;
}
.btn-fisa:hover {
  filter: brightness(1.08);
}


.btn-nav,
.btn-today {
  padding:8px 14px;
  border:1px solid #d0d7e2;
  border-radius:8px;
  background:#fff;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  color:#1f2a44;
  transition:background .2s ease;
}

.btn-nav:hover,
.btn-today:hover {
  background:#f5f7fb;
}


/* ===== Calendar: bara de control (stânga data, dreapta butoane) ===== */
.calendar-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:14px 0 18px;
  gap:10px;
}
.calendar-left{ display:flex; align-items:center; gap:12px; }
.calendar-right{ display:flex; align-items:center; gap:8px; }

#date-picker{
  width:170px;
  padding:6px 10px;
  border:1px solid #d0d7e2;
  border-radius:8px;
  background:#fff;
  font-size:14px;
}
#date-picker:focus{
  border-color:#2765A0;
  box-shadow:0 0 0 2px rgba(39,101,160,.15);
  outline:none;
}

/* butoanele din header – anulează width:100% din stilul global */
.calendar-header .btn-nav,
.calendar-header .btn-today{
  width:auto;
  display:inline-block;
  margin:0;
  padding:8px 12px;
  border:1px solid #d0d7e2;
  border-radius:8px;
  background:#fff;
  font-weight:600;
  color:#1f2a44;
  cursor:pointer;
  transition:background .15s ease;
}
.calendar-header .btn-nav:hover,
.calendar-header .btn-today:hover{ background:#f5f7fb; }

/* ===== Modal detalii programare ===== */
.modal-backdrop{
  position:fixed; inset:0;
  background:rgba(17,24,39,.5);
  display:none; /* se face flex din JS */
  align-items:center; justify-content:center;
  z-index:1000;
}
.modal{
  background:#fff; border-radius:14px; padding:18px;
  width:min(520px, 92vw);
  box-shadow:0 20px 40px rgba(0,0,0,.18);
  border:1px solid #e5e7eb;
}
.modal h3{ margin:0 0 10px; color:#1f2a44; }
.modal .row{ margin:6px 0; color:#374151; font-size:14px; }
.modal .actions{ display:flex; gap:10px; margin-top:14px; justify-content:flex-end; }

/* butoanele din modal – anulează width:100% & margin global */
.modal .actions button{
  width:auto;
  margin:0;
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
}
.btn-primary{ background:#2765A0; color:#fff; border:none; }
.btn-primary:hover{ filter:brightness(1.05); }
.btn-danger{ background:#e11d48; color:#fff; border:none; }
.btn-danger:hover{ filter:brightness(1.05); }
.btn-secondary{ background:#fff; color:#1f2a44; border:1px solid #d0d7e2; }
.btn-secondary:hover{ background:#f5f7fb; }


/* ===== Programator (grid orar) – celule & culori ===== */
.calendar-grid-orar {
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 100px repeat(var(--cols, 1), 1fr); /* --cols vine din JS */
  gap: 1px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff; /* „dunga” dintre celule */
}

.calendar-grid-orar > div {
  border: none;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

/* headere */
.header-ora {
  background: #f3f5f8;
  font-weight: 600;
}
.header-doctor {
  background: #2765A0;
  color: #fff;
  font-weight: 600;
}

/* sloturi */
.slot-liber {
  background: #e8f6ee;
  cursor: pointer;
}
.slot-liber:hover { background: #dbf1e5; }

.slot-ocupat {
  background: #ffe6cc;
  border: 1px solid #ffc799;
  color: #5a2a00;
  font-weight: 600;
  cursor: pointer;
}


/* ===== Programări compacte (fără linii interne) ===== */

/* scoatem gap-ul pentru a controla delimitările cu border */
.calendar-grid-orar {
  gap: 0 !important;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

/* delimitare fină implicită cu borduri (în loc de gap) */
.calendar-grid-orar > div {
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

/* headerele rămân cum erau */
.header-ora { background:#f3f5f8; font-weight:600; }
.header-doctor { background:#2765A0; color:#fff; font-weight:600; }

/* bloc ocupat – culoare & colțuri; vom elimina liniile interne prin segmente */
.slot-ocupat {
  background: #ffe6cc;
  border: 1px solid #ffc799;            /* păstrăm conturul exterior */
  color: #5a2a00;
  font-weight: 600;
}

/* ——— Segmentele dintr-o programare verticală pe aceeași coloană ———
   .seg-single  = 1 singură celulă
   .seg-start   = prima celulă din bloc
   .seg-mid     = celulă din mijloc (interioară)
   .seg-end     = ultima celulă din bloc
*/

/* una singură: colțuri rotunde pe toate părțile */
.slot-ocupat.seg-single {
  border-radius: 8px;
}

/* început: păstrăm sus, anulăm „prinderea” de celula de jos */
.slot-ocupat.seg-start {
  border-bottom: 0;               /* fără linia internă către .seg-mid */
  border-radius: 8px 8px 0 0;
}

/* mijloc: fără linii sus/jos ca să se unească perfect */
.slot-ocupat.seg-mid {
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
}

/* sfârșit: lipim de segmentul de deasupra, păstrăm contur jos */
.slot-ocupat.seg-end {
  border-top: 0;                  /* fără linia internă către .seg-mid */
  border-radius: 0 0 8px 8px;
}

/* pentru un plus de “bloc compact”, eliminăm separatările verticale între sloturile libere
   doar dacă vrei: decomentează linia următoare */
/* .calendar-grid-orar > div:not(.slot-ocupat) { background:#f6fbf8; } */


/* ===== Modal: câmp motiv + durată ===== */
.editor-row{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:10px;
}
.editor-row label{
  font-weight:600;
  color:#51627c;
}
.textarea-lg{
  width:100%;
  min-height:90px;
  padding:12px 14px;
  border:1px solid #d6deea;
  border-radius:10px;
  background:#f7faff;
  outline:none;
  font-size:15px;
  resize:vertical;
}
.textarea-lg:focus{
  border-color:#b6c9e6;
  box-shadow:0 0 0 3px rgba(39,101,160,.12);
  background:#fff;
}
#edit-durata{
  width:220px;
  height:44px;
  padding:8px 12px;
  border:1px solid #d6deea;
  border-radius:10px;
  background:#fff;
  font-size:15px;
}


/* --- Fișa pacientului: text lung, auto-wrap, fără overflow --- */
.text-long{
  padding:12px 14px;
  border:1px solid #d6deea;
  border-radius:10px;
  background:#f7faff;
  min-height:72px;
  white-space:pre-wrap;        /* păstrează \n, rupe la spațiu */
  word-break:break-word;       /* rupe și cuvinte foarte lungi */
  overflow-wrap:anywhere;      /* siguranță pentru siruri lungi */
}

/* dacă există inputuri/textarea editabile în fișă */
.form-section .field textarea{
  width:100%;
  min-height:120px;
  resize:vertical;
  padding:12px 14px;
  border:1px solid #d6deea;
  border-radius:10px;
  background:#f7faff;
  outline:none;
}
.form-section .field textarea:focus{
  border-color:#b6c9e6;
  box-shadow:0 0 0 3px rgba(39,101,160,.12);
  background:#fff;
}

.compact-wide textarea {
  width: 90% !important;
}
.mini-grid {
  display: flex;
  gap: 20px;              /* controlează distanța între câmpuri */
  align-items: flex-end;
  flex-wrap: wrap;        /* se sparg pe rânduri dacă nu încape */
  margin: 8px 0 12px;
}


/* culori status programare */
.slot-ocupat.slot-anulata {
  background: #ffe3e3;
  border-color: #f5a5a5;
  color: #7a1f1f;
  text-decoration: line-through; /* vizibil că nu mai e activă */
}
.slot-ocupat.slot-efectuata {
  background: #c9f2c7;
  border-color: #7bc47f;
  color: #174d1f;
}


.slot-ocupat.slot-ocupat-anulata    { background:#ffd6d6; border-color:#ffb3b3; color:#7a0f0f; }
.slot-ocupat.slot-ocupat-finalizata { background:#c8ead5; border-color:#a5dbbb; color:#0f4d2f; }


/* ===== Footer bloc rotunjit ===== */
.site-footer{
  max-width: 80%;
  margin: 18px auto 36px;
}
.footer-inner{
  background:#fff;
  border:1px solid #e8edf3;
  border-radius:16px;
  padding:12px 16px;
  box-shadow:0 4px 14px rgba(0,0,0,.04);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.footer-left{ display:flex; align-items:center; gap:10px; }
.footer-logo{ width:32px; height:32px; border-radius:8px; object-fit:cover; }
.footer-title{ font-weight:700; color:#1f2a44; }
.footer-sub{ color:#6b7280; font-size:13px; margin-top:2px; }

.footer-right{ display:flex; flex-wrap:wrap; gap:8px; }
.footer-right a{
  text-decoration:none;
  padding:6px 10px;
  border:1px solid #d6deea;
  border-radius:8px;
  background:#eef3f9;
  color:#1f2a44;
  font-weight:600;
  font-size:14px;
}
.footer-right a:hover{ background:#e6eef8; }


/* "De sunat!" – aceleași culori ca statusul consultat */
.slot-de-sunat      { background:#bfe7cf !important; border-color:#8fd1ad !important; color:#134e2c !important; }
.subslot-de-sunat   { background:#bfe7cf; border-color:#8fd1ad; color:#134e2c; }



/* Dinte marcat ca lipsă (hașurat, gri) */
.tooth-item.missing{
  background:
    repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 6px, #e5e7eb 6px, #e5e7eb 12px);
  border:1px dashed #9ca3af; border-radius:10px; padding:6px;
  opacity:.85;
}
.tooth-item.missing input[type="text"]{ background:#f3f4f6; color:#6b7280; }

/* checkbox „lipsește” mic și discret */
.tooth-item .t-miss{ width:16px; height:16px; cursor:pointer; accent-color:#6b7280; }

/* la print păstrăm evidențierea vizuală */
@media print {
  .tooth-item.missing{
    background:
      repeating-linear-gradient(45deg, #eee, #eee 6pt, #ddd 6pt, #ddd 12pt) !important;
    border:0.6pt dashed #666 !important;
    opacity:1 !important;
  }
  .tooth-item.missing input[type="text"]{
    background:transparent !important; color:#000 !important;
  }
}
