/* =========================================================
   Portal GAL — administrare
   Identitate vizuală preluată din portalul existent
   ========================================================= */

:root {
  --teal-900: #14504c;
  --teal-700: #1b6560;   /* butoane principale */
  --teal-500: #26a69a;   /* linkuri, accente */
  --teal-050: #e6f4f3;
  --cyan-400: #29b6f6;   /* badge lacăt */
  --brand-red: #d3222a;

  --ink: #212121;
  --ink-2: #4a4a4a;
  --muted: #8a8f92;

  --bg: #ffffff;
  --surface: #f5f5f5;
  --surface-2: #fafafa;
  --line: #e0e0e0;
  --line-soft: #eeeeee;

  --ok-bg: #e8f5e9;  --ok-fg: #2e7d32;
  --no-bg: #fdecea;  --no-fg: #c62828;
  --warn-bg: #fff4e5; --warn-fg: #b26a00;
  --info-bg: #e6f4f3; --info-fg: #14504c;

  --radius: 4px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .10);
  --header-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: Roboto, "Helvetica Neue", Arial, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--teal-500); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}

/* ---------------------------------------------- bandă finanțare */

.funding {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px 12px;
  text-align: center;
}

.funding__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.funding__logos img { height: 42px; width: auto; display: block; }

.funding__eu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border: 1px solid #c8d4ea;
  border-radius: 2px;
  background: #fff;
}
.funding__eu svg { display: block; }
.funding__eu span {
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: 500;
  color: #14387f;
  text-align: left;
}

.funding__line {
  font-size: 14.5px;
  color: var(--ink);
  margin: 0;
}
.funding__line strong { font-weight: 700; }

/* ---------------------------------------------- bară navigare */

.topbar {
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__brand img, .topbar__brand svg { height: 34px; width: auto; }
.topbar__brand b {
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
}

.topbar__nav { display: flex; align-items: center; gap: 6px; }

.navlink {
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal-500);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-weight: 500;
}
.navlink:hover { background: var(--teal-050); text-decoration: none; }

.navuser {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  margin-left: 6px;
  border-left: 1px solid var(--line);
}
.navuser__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--teal-700);
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  letter-spacing: .02em;
}
.navuser__meta { line-height: 1.25; }
.navuser__meta strong { display: block; font-size: 13px; font-weight: 500; }
.navuser__meta span { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------- autentificare */

.auth {
  min-height: calc(100vh - var(--header-h) - 210px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
}

.auth__card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 30px 30px;
  position: relative;
}

.auth__badge {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--cyan-400);
  display: grid; place-items: center;
  margin: 0 auto 14px;
  color: #fff;
}

.auth__title {
  margin: 0 0 22px;
  font-size: 22px;
  font-weight: 400;
  text-align: center;
  color: var(--ink);
}

.auth__links {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  font-size: 12.5px;
}
.auth__links a { color: var(--teal-500); }

.auth__note {
  max-width: 400px;
  margin: 18px auto 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* câmp cu etichetă flotantă, în stilul portalului */
.field { position: relative; margin-bottom: 18px; }

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  color: var(--ink);
  background: #eaf2f4;
  border: 1px solid #cfd8dc;
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover { border-color: #9aa8ad; }
.field input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 1px var(--teal-500);
}

.field label {
  position: absolute;
  top: -8px; left: 10px;
  padding: 0 5px;
  background: var(--surface);
  font-size: 11.5px;
  color: var(--ink-2);
}
.field input:focus + label { color: var(--teal-700); }
.field label span { color: var(--brand-red); }

/* ---------------------------------------------- butoane */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--teal-700); color: #fff; }
.btn--primary:hover { background: var(--teal-900); box-shadow: var(--shadow); }

.btn--block { width: 100%; height: 42px; }

.btn--ghost {
  background: #fff;
  color: var(--teal-700);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--teal-050); border-color: var(--teal-500); }

.btn--sm { height: 32px; padding: 0 12px; font-size: 12px; }

.btn svg { flex: none; }

/* ---------------------------------------------- alerte */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
}
.alert--error { background: var(--no-bg); color: var(--no-fg); }
.alert--info  { background: var(--info-bg); color: var(--info-fg); }
.alert svg { flex: none; margin-top: 1px; }

/* ---------------------------------------------- structură admin */

.shell { display: flex; min-height: calc(100vh - var(--header-h)); }

.sidebar {
  width: 246px;
  flex: none;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  padding: 18px 0 30px;
}

.sidebar__group {
  padding: 16px 20px 6px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.sideitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 20px;
  color: var(--ink-2);
  border-left: 3px solid transparent;
  font-size: 13.5px;
}
.sideitem:hover { background: var(--teal-050); color: var(--teal-900); text-decoration: none; }
.sideitem.is-active {
  background: var(--teal-050);
  border-left-color: var(--teal-500);
  color: var(--teal-900);
  font-weight: 500;
}
.sideitem__count {
  font-size: 11.5px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1px 8px;
  min-width: 26px;
  text-align: center;
}
.sideitem.is-active .sideitem__count { border-color: var(--teal-500); color: var(--teal-700); }

.main { flex: 1; min-width: 0; padding: 26px 30px 50px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.page-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
}
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------- panou de start */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin: 22px 0 34px;
}

.stat {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stat:hover {
  text-decoration: none;
  border-color: var(--teal-500);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.stat__value { font-size: 30px; font-weight: 300; line-height: 1.1; color: var(--teal-700); }
.stat__label { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

.section-title {
  margin: 30px 0 12px;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

/* ---------------------------------------------- filtre */

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 18px 0 16px;
}

.filters__item { display: flex; flex-direction: column; gap: 5px; }
.filters__item label {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.filters__item input,
.filters__item select {
  height: 36px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 150px;
}
.filters__item input:focus,
.filters__item select:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 1px var(--teal-500);
}
.filters__item--grow { flex: 1 1 260px; }
.filters__item--grow input { width: 100%; }

.filters__actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------------------------------------------- tabel */

.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 68vh;
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--teal-700);
  color: #fff;
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 0;
  white-space: nowrap;
}

table.data thead a,
table.data thead span.th {
  display: block;
  padding: 11px 14px;
  color: #fff;
}
table.data thead a:hover { background: var(--teal-900); text-decoration: none; }
table.data thead .arrow { opacity: .85; margin-left: 5px; font-size: 10px; }

table.data tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  max-width: 320px;
}
table.data tbody tr:nth-child(even) { background: #fbfcfc; }
table.data tbody tr:hover { background: var(--teal-050); }
table.data tbody tr:last-child td { border-bottom: none; }

td.is-primary { font-weight: 500; color: var(--ink); }
td.is-primary a.row-link { color: var(--ink); border-bottom: 1px dashed var(--teal-500); }
td.is-primary a.row-link:hover { color: var(--teal-700); text-decoration: none; }

.cell-link { color: var(--teal-500); }
.muted { color: var(--muted); }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.pill--yes, .pill--accepted, .pill--in_progress, .pill--signed {
  background: var(--ok-bg); color: var(--ok-fg); border-color: #c8e6c9;
}
.pill--no, .pill--rejected, .pill--high {
  background: var(--no-bg); color: var(--no-fg); border-color: #f5c6c2;
}
.pill--pending, .pill--waiting, .pill--new, .pill--medium {
  background: var(--warn-bg); color: var(--warn-fg); border-color: #ffe0b2;
}
.pill--admin, .pill--partner, .pill--download {
  background: var(--info-bg); color: var(--info-fg); border-color: #b2dfdb;
}

.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: 11px;
  background: var(--teal-050);
  color: var(--teal-900);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}
.tag--more { background: var(--surface); color: var(--muted); }

/* ---------------------------------------------- paginare */

.tablefoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-2);
}

.pager { display: flex; gap: 4px; align-items: center; }
.pager a, .pager span {
  min-width: 32px; height: 32px;
  display: grid; place-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
  background: #fff;
  font-size: 13px;
}
.pager a:hover { border-color: var(--teal-500); color: var(--teal-700); text-decoration: none; }
.pager .is-current { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.pager .is-disabled { color: #c4c9cb; background: var(--surface-2); }

.empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; font-size: 15px; }

/* ---------------------------------------------- pagina de detalii */

.breadcrumb {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.breadcrumb span { margin: 0 4px; }
.breadcrumb a { color: var(--teal-500); }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 22px;
  margin: 18px 0 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0;
  margin: 0;
}

.detail-grid__item {
  padding: 14px 14px 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.detail-grid__item dt {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 5px;
}
.detail-grid__item dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  word-break: break-word;
}
.detail-grid__item code {
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px;
}

.main--detail .section-title:first-of-type { margin-top: 34px; }

.table-wrap--mini {
  max-height: none;
  margin-bottom: 6px;
  box-shadow: none;
}
.table-wrap--mini table.data thead th { font-size: 10.5px; }
.table-wrap--mini table.data tbody td { padding: 8px 12px; }

/* ---------------------------------------------- meniu export */

.dropdown { position: relative; }
.dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 258px;
  padding: 6px;
  z-index: 30;
  display: none;
}
.dropdown.is-open .dropdown__menu { display: block; }
.dropdown__menu a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 13px;
}
.dropdown__menu a:hover { background: var(--teal-050); text-decoration: none; }
.dropdown__menu a small { display: block; color: var(--muted); font-size: 11.5px; }
.dropdown__sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }

/* ---------------------------------------------- subsol */

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
}
.footer__links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.footer__links a { color: var(--teal-500); }
.footer__links span { color: var(--line); }

/* ---------------------------------------------- responsiv */

.menu-toggle { display: none; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 8px 0 14px;
    display: none;
  }
  .sidebar.is-open { display: block; }
  .menu-toggle { display: inline-flex; }
  .main { padding: 18px 16px 40px; }
  .table-wrap { max-height: none; }
  .funding__logos { gap: 16px; }
  .funding__logos img { height: 32px; }
  .navuser__meta { display: none; }
  .page-head h1 { font-size: 22px; }
  .filters__actions { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .sidebar, .topbar, .filters, .page-actions, .footer, .tablefoot { display: none; }
  .table-wrap { max-height: none; border: none; }
}
