/* =============================================================
   NTY – Evidență Angajați (eu.nty.ro)
   Stiluri custom: temă, badge-uri, rapoarte, print, responsive
   ============================================================= */

:root {
  --nty-dark:   #1e3a5f;
  --nty-blue:   #2563eb;
  --nty-blue-2: #1e40af;
  --nty-bg:     #f4f6f9;
}

body {
  background-color: var(--nty-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main { flex: 1 0 auto; }
.app-footer { flex-shrink: 0; }

/* ---------------- Butoane / accente ---------------- */

.btn-primary {
  --bs-btn-bg: var(--nty-blue);
  --bs-btn-border-color: var(--nty-blue);
  --bs-btn-hover-bg: var(--nty-blue-2);
  --bs-btn-hover-border-color: var(--nty-blue-2);
  --bs-btn-active-bg: var(--nty-dark);
  --bs-btn-active-border-color: var(--nty-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--nty-blue);
  --bs-btn-border-color: var(--nty-blue);
  --bs-btn-hover-bg: var(--nty-blue);
  --bs-btn-hover-border-color: var(--nty-blue);
  --bs-btn-active-bg: var(--nty-blue-2);
  --bs-btn-active-border-color: var(--nty-blue-2);
}

a { color: var(--nty-blue); }

.text-primary { color: var(--nty-blue) !important; }

/* ---------------- Navbar ---------------- */

.app-navbar {
  background-color: var(--nty-dark);
  box-shadow: 0 2px 8px rgba(30, 58, 95, .25);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nty-blue);
  color: #fff;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: .45rem;
  padding: .2rem .5rem;
  font-size: .95rem;
}

.app-navbar .navbar-brand { font-weight: 600; }

.app-navbar .nav-link {
  color: rgba(255, 255, 255, .82);
  border-radius: .4rem;
  margin-right: .15rem;
  padding-left: .75rem;
  padding-right: .75rem;
  transition: background-color .15s ease, color .15s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus { color: #fff; background: rgba(255, 255, 255, .08); }

.app-navbar #mainMenu .nav-link.active {
  color: #fff;
  background: var(--nty-blue);
  font-weight: 600;
}

/* ---------------- Carduri ---------------- */

.card {
  border: none;
  border-radius: .6rem;
  box-shadow: 0 1px 3px rgba(30, 58, 95, .10), 0 1px 2px rgba(30, 58, 95, .06);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid rgba(30, 58, 95, .1);
  font-weight: 600;
  color: var(--nty-dark);
  border-radius: .6rem .6rem 0 0 !important;
}

.card-footer { background: #fbfcfe; }

.view-title { color: var(--nty-dark); font-weight: 700; }

/* Carduri statistici (dashboard) */

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .75rem;
  font-size: 1.4rem;
  color: #fff;
}

.stat-blue   { background: var(--nty-blue); }
.stat-indigo { background: #6610f2; }
.stat-green  { background: #198754; }
.stat-orange { background: #fd7e14; }

.stat-card .stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--nty-dark);
  line-height: 1.2;
}

.stat-card .stat-label { font-size: .82rem; color: #6c757d; }
.stat-card .stat-sub   { font-size: .75rem; }

.dash-list .list-group-item { padding-top: .55rem; padding-bottom: .55rem; }

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

.table thead th {
  color: var(--nty-dark);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
  background: #f8fafc;
}

.table > :not(caption) > * > * { padding: .55rem .75rem; }

/* ---------------- Badge-uri tipuri beneficii ---------------- */

.badge[class*="tip-"] { font-weight: 600; }

.tip-bani      { background-color: #198754; color: #fff; }   /* verde */
.tip-avans     { background-color: #20c997; color: #fff; }   /* teal */
.tip-bonus     { background-color: #0dcaf0; color: #073642; }/* cyan */
.tip-bunuri    { background-color: #fd7e14; color: #fff; }   /* portocaliu */
.tip-masa      { background-color: #ffc107; color: #3d3000; }/* galben */
.tip-transport { background-color: #0d6efd; color: #fff; }   /* albastru */
.tip-cazare    { background-color: #6610f2; color: #fff; }   /* indigo */
.tip-altele    { background-color: #6c757d; color: #fff; }   /* gri */

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

.login-body {
  background: linear-gradient(135deg, #1e3a5f 0%, #24487a 45%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-wrap { width: 100%; display: flex; justify-content: center; }

.login-card {
  width: 100%;
  max-width: 430px;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(10, 20, 40, .45);
}

.login-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--nty-dark), var(--nty-blue));
  color: #fff;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 1px;
  border-radius: 1.1rem;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .4);
}

.login-title { color: var(--nty-dark); font-weight: 700; }

/* ---------------- Fișa angajatului ---------------- */

.fisa-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #8492a6;
  margin-bottom: .1rem;
}

.fisa-value { font-size: .95rem; }

.fisa-section {
  color: var(--nty-dark);
  font-weight: 700;
  border-bottom: 2px solid var(--nty-blue);
  padding-bottom: .3rem;
  margin-bottom: .6rem;
}

/* ---------------- Atașamente ---------------- */

.att-list .att-item { background: #fbfcfe; font-size: .88rem; }
.att-list .att-item a { color: var(--nty-blue); }

/* ---------------- Zona de raport (ecran) ---------------- */

.report-area .card-body { padding: 1.5rem; }

.report-header .report-app {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #6c757d;
}

.report-header .report-title {
  color: var(--nty-dark);
  font-weight: 800;
  font-size: 1.35rem;
  margin: .2rem 0;
}

.report-header .report-period { font-weight: 600; font-size: 1rem; }
.report-header .report-extra  { color: #6c757d; font-size: .9rem; }

.report-section-title {
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--nty-dark);
  border-bottom: 2px solid var(--nty-blue);
  padding-bottom: .25rem;
  margin: 1rem 0 .6rem;
}

.report-table th.report-th {
  background: #f2f5fa;
  width: 22%;
  white-space: nowrap;
}

.report-totals { max-width: 520px; }

.report-total-general th,
.report-total-general td {
  background: #e8eefb !important;
  font-weight: 700;
  color: var(--nty-dark);
}

.report-obs-input { resize: vertical; min-height: 5rem; overflow: hidden; }

/* =============================================================
   SECURITATE (V2) — sub-navigație, badge-uri, tabele, 2FA
   ============================================================= */

.sec-subnav .btn { --bs-btn-border-color: #d7dde6; }
.sec-subnav .btn.active {
  background: var(--nty-blue);
  border-color: var(--nty-blue);
  color: #fff;
}

/* Badge status autentificare */
.badge.st-ok   { background-color: #198754; color: #fff; }
.badge.st-fail { background-color: #dc3545; color: #fff; }

/* Badge evenimente jurnal */
.badge.ev {
  font-weight: 600;
  background: #eef2f7;
  color: var(--nty-dark);
  border: 1px solid #d7dde6;
}
.badge.ev-login_success { background: #d1e7dd; color: #0f5132; border-color: #badbcc; }
.badge.ev-login_fail,
.badge.ev-login_2fa_fail { background: #f8d7da; color: #842029; border-color: #f5c2c7; }
.badge.ev-logout         { background: #e2e3e5; color: #41464b; border-color: #d3d6d8; }
.badge.ev-geo_block,
.badge.ev-ip_blocked     { background: #fde2c8; color: #7a3d00; border-color: #f8cfa5; }
.badge.ev-session_timeout{ background: #fff3cd; color: #664d03; border-color: #ffecb5; }
.badge.ev-2fa_enabled,
.badge.ev-2fa_disabled,
.badge.ev-setup          { background: #cfe2ff; color: #084298; border-color: #b6d4fe; }

/* Steag / țară */
.flag { font-size: 1.05rem; line-height: 1; }

/* Tabele securitate compacte */
.sec-table { font-size: .84rem; }
.sec-table td, .sec-table th { white-space: nowrap; vertical-align: middle; }
.sec-table td.wrap { white-space: normal; }
.ip-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }

/* Carduri statistici securitate */
.sec-stat .card-body { padding: .8rem 1rem; }
.sec-stat .sec-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--nty-dark); line-height: 1.1; }
.sec-stat .sec-stat-label { font-size: .78rem; color: #6c757d; }

/* Cheie manuală 2FA */
.twofa-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  letter-spacing: .12em;
  background: #f2f5fa;
  border: 1px dashed var(--nty-blue);
  border-radius: .5rem;
  padding: .6rem .8rem;
  word-break: break-all;
}
.twofa-uri {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .4rem;
  padding: .5rem .6rem;
  word-break: break-all;
  color: #475569;
}
.totp-input { letter-spacing: .4em; font-weight: 700; }

/* Comutator geo */
.geo-switch .form-check-input { width: 2.6em; height: 1.35em; }

/* =============================================================
   PARTICIPANȚI ACTIVITĂȚI (V2)
   ============================================================= */

.participants-box { max-height: 240px; overflow-y: auto; background: #fbfcfe; }
.participant-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .25rem;
  border-bottom: 1px solid #eef1f6;
}
.participant-row:last-child { border-bottom: none; }
.participant-row .p-name { flex: 1 1 auto; min-width: 0; }
.participant-row .p-hours { flex: 0 0 110px; }
.participant-row.hide-row { display: none; }

/* Chip-uri participanți în tabelul de activități */
.chip {
  display: inline-block;
  background: #e8eefb;
  color: var(--nty-dark);
  border-radius: 1rem;
  padding: .1rem .55rem;
  font-size: .78rem;
  margin: .1rem .15rem .1rem 0;
  white-space: nowrap;
}
.chip.more { background: #dbe2ec; color: #475569; }

/* =============================================================
   PRINT — se vede DOAR #print-area (raportul generat), A4
   ============================================================= */

@page { margin: 1.5cm; }

@media print {
  body {
    background: #fff !important;
    display: block;
  }

  /* ascunde tot… */
  body * { visibility: hidden !important; }

  /* …în afară de zona de raport */
  #print-area, #print-area * { visibility: visible !important; }

  #print-area {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 12px;
    color: #000;
  }

  #print-area .card-body { padding: 0 !important; }

  #print-area .table-responsive { overflow: visible !important; }

  #print-area table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 12px !important;
    color: #000 !important;
  }

  #print-area table th,
  #print-area table td {
    border: 1px solid #000 !important;
    padding: 3px 6px !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  #print-area thead th { font-weight: 700 !important; }

  #print-area .report-total-general th,
  #print-area .report-total-general td { font-weight: 700 !important; }

  #print-area tr { page-break-inside: avoid; }

  #print-area .report-header { text-align: center; margin-bottom: 12px; }
  #print-area .report-title  { font-size: 16px !important; color: #000 !important; }
  #print-area .report-app,
  #print-area .report-period,
  #print-area .report-extra  { color: #000 !important; }

  #print-area .report-section-title {
    color: #000 !important;
    border-bottom: 1px solid #000 !important;
    font-size: 12px !important;
  }

  /* badge-urile devin text simplu cu contur negru */
  #print-area .badge {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    font-weight: 600 !important;
    padding: 1px 4px !important;
  }

  /* textarea „Observații finale" apare cu chenar la print */
  #print-area .report-obs-input {
    border: 1px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
    width: 100% !important;
    overflow: visible !important;
    resize: none !important;
    min-height: 3rem;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
  }

  .no-print { display: none !important; }
}

/* =============================================================
   RESPONSIVE (sub 768px)
   ============================================================= */

@media (max-width: 767.98px) {
  .app-main { padding-left: .6rem; padding-right: .6rem; }

  .view-title { font-size: 1.15rem; }

  .stat-card .card-body { padding: .8rem; gap: .6rem !important; }
  .stat-card .stat-icon { width: 42px; height: 42px; flex-basis: 42px; font-size: 1.1rem; }
  .stat-card .stat-value { font-size: 1.05rem; }
  .stat-card .stat-label { font-size: .72rem; }

  .table { font-size: .84rem; }
  .table > :not(caption) > * > * { padding: .4rem .5rem; }

  .report-area .card-body { padding: .9rem; }
  .report-header .report-title { font-size: 1.1rem; }

  .modal-footer { justify-content: center; }
}
