/* =========================================================
   Pontaj — Ecom Digital
   Paletă inspirată din Microsoft Azure / Fluent Design.
   ========================================================= */

:root {
  --bg: #faf9f8;
  --card: #ffffff;
  --border: #e1dfdd;
  --text: #201f1e;
  --muted: #605e5c;

  --accent: #0078d4;        /* Azure Blue */
  --accent-dark: #106ebe;   /* Azure Blue, hover */
  --accent-darker: #005a9e; /* Azure Blue, apăsat */
  --accent-cyan: #50e6ff;   /* Azure Cyan, accent secundar */
  --accent-navy: #1f232f;   /* Navy din logo, pt. contrast pe accent-cyan */

  --success: #107c10;
  --success-bg: #dff6dd;
  --danger: #d13438;
  --danger-bg: #fde7e9;
  --warning: #8a6116;
  --warning-bg: #fff4ce;

  --radius: 10px;
  --radius-sm: 8px;
  --header-h: 60px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }

/* ---------- Header / meniu ---------- */

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand-logo { height: 30px; width: auto; display: block; }

.meniu-toggle-input { display: none; }

.meniu-toggle-buton {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  margin-left: auto;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.meniu-toggle-buton:hover { background: var(--bg); }
.meniu-toggle-buton span {
  display: block;
  height: 2px;
  width: 22px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
}

nav.meniu-principal {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex: 1;
  min-width: 0;
}
nav.meniu-principal a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  white-space: nowrap;
}
nav.meniu-principal a:hover { color: var(--accent); }
nav.meniu-principal a:focus-visible,
.meniu-toggle-buton:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.spacer { flex: 1; }
.utilizator-curent { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* Grupul "Adaugă pentru membru" (details/summary - fără JavaScript) */
.meniu-dropdown { position: relative; }
.meniu-dropdown > summary {
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.4rem 0;
  white-space: nowrap;
}
.meniu-dropdown > summary::-webkit-details-marker { display: none; }
.meniu-dropdown > summary::after { content: " ▾"; font-size: 0.75em; color: var(--muted); }
.meniu-dropdown[open] > summary::after { content: " ▴"; }
.meniu-dropdown > summary:hover { color: var(--accent); }

.meniu-dropdown-continut {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 60;
}
.meniu-dropdown-continut a {
  padding: 0.5rem 0.75rem !important;
  border-radius: var(--radius-sm);
}
.meniu-dropdown-continut a:hover { background: var(--bg); }

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

.pagina-continut { max-width: 1080px; margin: 1.75rem auto; padding: 0 1.25rem; }

h1 { font-size: 1.5rem; margin: 0 0 1.1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat .label { color: var(--muted); font-size: 0.85rem; }
.stat .value { font-size: 1.6rem; font-weight: 700; }
.stat .value.negativ { color: var(--danger); }
.stat .value.pozitiv { color: var(--success); }

/* ---------- Tabele ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -0.25rem; padding: 0 0.25rem; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
tbody tr:hover { background: var(--bg); }
td.negativ { color: var(--danger); font-weight: 600; }
td.pozitiv { color: var(--success); font-weight: 600; }

/* ---------- Butoane / acțiuni ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { background: var(--accent-darker); }
.btn.secundar { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.secundar:hover { background: #eff6fc; }

/* Paginile standard Identity (Logare, Schimbă parola) folosesc clase Bootstrap -
   aliniem doar culoarea butonului principal cu paleta Azure, fără să atingem restul. */
.btn-primary { background-color: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background-color: var(--accent-dark); border-color: var(--accent-dark); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }

/* ---------- Formulare ---------- */

form.form-simplu { max-width: 480px; }
form.form-simplu label { display: block; margin: 0.9rem 0 0.3rem; font-size: 0.9rem; color: var(--muted); }
form.form-simplu input,
form.form-simplu select,
form.form-simplu textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
}
form.form-simplu input:focus,
form.form-simplu select:focus,
form.form-simplu textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}
form.form-simplu input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: none;
  accent-color: var(--accent);
}

.eroare-validare { color: var(--danger); margin-top: 1rem; }
.eroare-validare ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.text-ajutator { color: var(--muted); font-size: 0.85rem; }

/* ---------- Insigne de stare ---------- */

.badge { padding: 0.25rem 0.65rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge.aprobat { background: var(--success-bg); color: var(--success); }
.badge.asteptare { background: var(--warning-bg); color: var(--warning); }
.badge.respins { background: var(--danger-bg); color: var(--danger); }

/* ---------- Responsive: sub 900px, meniul devine listă verticală ---------- */

@media (max-width: 900px) {
  .meniu-toggle-buton { display: flex; }

  nav.meniu-principal {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1.5rem;
    overflow-y: auto;
    border-top: 1px solid var(--border);
  }
  .meniu-toggle-input:checked ~ nav.meniu-principal { display: flex; }

  nav.meniu-principal a { padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--border); }
  .meniu-dropdown > summary { padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--border); }
  .meniu-dropdown-continut {
    position: static;
    padding-left: 1rem;
    border: none;
    box-shadow: none;
    min-width: auto;
    background: transparent;
  }
  .meniu-dropdown-continut a { border-bottom: none !important; }

  .spacer { display: none; }
  .utilizator-curent { order: 10; padding: 0.85rem 0.25rem 0.25rem; border-top: 1px solid var(--border); margin-top: 0.5rem; }

  .pagina-continut { margin: 1.25rem auto; padding: 0 1rem; }
  .card { padding: 1rem; }
  h1 { font-size: 1.3rem; }

  form.form-simplu { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
