/* ==========================================================================
   ValTranslate - foaie de stil unica
   Paleta se schimba dintr-un singur loc: variabilele din :root
   ========================================================================== */

:root {
  /* Paleta oficiala Valrom, preluata din logo:
     #003865 navy  +  #00a3e0 cyan. Restul sunt derivate ale lor. */
  --brand:        #003865;
  --brand-dark:   #002a49;
  --brand-mid:    #00558f;
  --brand-light:  #e4f2fb;
  --cyan:         #00a3e0;
  --accent:       #00679a;

  --bg:           #f4f6f9;
  --surface:      #ffffff;
  --surface-2:    #fafbfd;
  --border:       #dfe4ec;
  --border-strong:#c6cedb;

  --text:         #16202e;
  --text-soft:    #5a6779;
  --text-faint:   #8b97a8;

  --ok:           #1a7f52;
  --ok-bg:        #e6f5ee;
  --warn:         #9a6300;
  --warn-bg:      #fdf3e0;
  --err:          #b3261e;
  --err-bg:       #fdecea;
  --info:         #003865;
  --info-bg:      #e4f2fb;

  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 1px 2px rgba(16,32,54,.06), 0 4px 14px rgba(16,32,54,.05);
  --shadow-lg:    0 10px 40px rgba(16,32,54,.14);
  --sidebar:      248px;
  --header-h:     58px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:#11151b; --surface:#181d25; --surface-2:#1e242e; --border:#2a323e;
    --border-strong:#3a4453; --text:#e7ecf3; --text-soft:#a3aebd; --text-faint:#7c8798;
    --brand-light:#0b2c45; --ok-bg:#12271e; --warn-bg:#2a2314; --err-bg:#2c1917;
    --info-bg:#0b2c45; --shadow:0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
    --shadow-lg:0 10px 40px rgba(0,0,0,.5);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 .8rem; }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82rem; }

::selection { background: var(--brand); color: #fff; }

/* ---------------------------------------------------------------- layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--brand-dark);
  color: #cfe0f4;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .22s ease;
  z-index: 60;
}
.sidebar.open { transform: translateX(0); }

.sidebar__brand {
  display: block; padding: 1.15rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand img { display: block; width: 100%; max-width: 188px; height: auto; }
.sidebar__brand small {
  display: block; margin: .4rem 0 0 3px; font-size: .64rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cyan);
}

.sidebar__nav { padding: .7rem .6rem; overflow-y: auto; flex: 1; }
.sidebar__label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: #7ea6d4; padding: .9rem .6rem .35rem; font-weight: 600;
}
.sidebar__link {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .65rem; border-radius: var(--radius-sm);
  color: #cfe0f4; font-size: .92rem; font-weight: 500;
}
.sidebar__link:hover { background: rgba(255,255,255,.09); text-decoration: none; color: #fff; }
.sidebar__link.active {
  background: #00456f; color: #fff; box-shadow: inset 3px 0 0 var(--cyan);
}
.sidebar__link svg { width: 18px; height: 18px; flex: none; opacity: .95; }

.sidebar__footer {
  padding: .8rem 1rem; border-top: 1px solid rgba(255,255,255,.12);
  font-size: .78rem; color: #8fb4dd;
}

.scrim {
  position: fixed; inset: 0; background: rgba(8,18,32,.55);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 55;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: .8rem;
  padding: 0 1rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar__mark { height: 25px; width: auto; flex: none; }
.topbar__title { font-weight: 650; font-size: .98rem; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__user { display: flex; align-items: center; gap: .55rem; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; font-size: .8rem; font-weight: 650;
  display: grid; place-items: center;
}
.topbar__meta { display: none; line-height: 1.15; }
.topbar__meta b { display: block; font-size: .84rem; }
.topbar__meta span { font-size: .72rem; color: var(--text-faint); }

.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }

.content { padding: 1rem; flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; }

.page-head { margin-bottom: 1rem; }
.page-head h1 { margin-bottom: .15rem; }
.page-head p { color: var(--text-soft); margin: 0; font-size: .9rem; }

@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .main { margin-left: var(--sidebar); }
  .scrim { display: none; }
  #menuToggle { display: none; }
  .topbar__mark { display: none; }
  .topbar { padding: 0 1.5rem; }
  .content { padding: 1.5rem; }
  .topbar__meta { display: block; }
  h1 { font-size: 1.6rem; }
}

/* ----------------------------------------------------------------- carduri */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card__head {
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  flex-wrap: wrap;
}
.card__head h2, .card__head h3 { margin: 0; }
.card__body { padding: 1.1rem; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: .7rem 1.1rem; border-top: 1px solid var(--border);
  background: var(--surface-2); font-size: .85rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (min-width: 1100px) {
  .grid--main { grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); }
}

/* ------------------------------------------------------------------- stats */
.stat { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
.stat__label { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); font-weight: 600; }
.stat__value { font-size: 1.6rem; font-weight: 680; line-height: 1.15; margin-top: .15rem; }
.stat__hint { font-size: .78rem; color: var(--text-soft); }

/* ------------------------------------------------------------------ butoane */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .58rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--brand); color: #fff;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, opacity .15s;
  min-height: 40px;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--err); }
.btn--danger:hover { background: #8f1e17; }
.btn--sm { padding: .35rem .7rem; font-size: .82rem; min-height: 32px; }
.btn--block { width: 100%; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: #00537c; color: #fff; }

/* ---------------------------------------------------------------- formulare */
.field { margin-bottom: .9rem; }
.field > label, .label {
  display: block; font-size: .82rem; font-weight: 600; color: var(--text-soft);
  margin-bottom: .3rem;
}
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=date], select, textarea {
  width: 100%; padding: .58rem .7rem; font: inherit; font-size: .92rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  min-height: 40px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,163,224,.18);
}
.hint { font-size: .78rem; color: var(--text-faint); margin-top: .25rem; }

.form-row { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .form-row--2 { grid-template-columns: 1fr 1fr; } }

/* --------------------------------------------------------- selectie limbi */
.lang-grid { display: grid; gap: .55rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 520px) { .lang-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1100px) { .lang-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }

.lang { position: relative; }
.lang input { position: absolute; opacity: 0; width: 0; height: 0; }
.lang span {
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .7rem .4rem; border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; text-align: center; transition: .15s;
}
.lang span b { font-size: .88rem; font-weight: 620; }
.lang span i { font-style: normal; font-size: .74rem; color: var(--text-faint); }
.lang input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,163,224,.28); }
.lang input:checked + span {
  border-color: var(--cyan); background: var(--brand-light); color: var(--brand);
  box-shadow: 0 0 0 1px var(--cyan);
}
.lang input:checked + span i { color: var(--brand); }
.lang span:hover { border-color: var(--cyan); }

/* ------------------------------------------------------------------ upload */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 1.8rem 1rem; text-align: center;
  cursor: pointer; transition: .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--cyan); background: var(--brand-light); }
.dropzone svg { width: 38px; height: 38px; color: var(--cyan); margin-bottom: .4rem; }
.dropzone b { display: block; font-size: .98rem; }
.dropzone small { color: var(--text-soft); }

.filelist { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .45rem; }
.filelist li {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: .88rem;
}
.filelist .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.filelist .meta { color: var(--text-faint); font-size: .78rem; flex: none; }
.filelist button {
  border: none; background: transparent; color: var(--text-faint); cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: .15rem .3rem;
}
.filelist button:hover { color: var(--err); }

/* ------------------------------------------------------------------ alerte */
.alert {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .75rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: .88rem; margin-bottom: .7rem;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: .1rem; }
.alert--info    { background: var(--info-bg); border-color: rgba(11,79,158,.25); color: var(--info); }
.alert--success { background: var(--ok-bg);   border-color: rgba(26,127,82,.25);  color: var(--ok); }
.alert--warning { background: var(--warn-bg); border-color: rgba(154,99,0,.28);   color: var(--warn); }
.alert--error   { background: var(--err-bg);  border-color: rgba(179,38,30,.25);  color: var(--err); }
.alert b { font-weight: 650; }
.alert ul { margin: .35rem 0 0; padding-left: 1.1rem; }

.notice {
  border-left: 3px solid var(--warn); background: var(--warn-bg);
  padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .87rem;
  color: var(--text);
}
.notice h3 { font-size: .9rem; margin-bottom: .35rem; color: var(--warn); }
.notice ul { margin: 0; padding-left: 1.15rem; }
.notice li { margin-bottom: .2rem; }

/* ------------------------------------------------------------------ tabele */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
table.data th, table.data td { padding: .6rem .8rem; text-align: left; vertical-align: middle; }
table.data thead th {
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); font-weight: 650; white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid var(--border); }
table.data tbody tr:last-child { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-file { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.cell-file .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 260px; font-weight: 500; }

.ftype { font-size: .66rem; font-weight: 700; padding: .12rem .32rem; border-radius: 3px;
  background: var(--brand-light); color: var(--brand); flex: none; letter-spacing: .04em; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .55rem; border-radius: 20px; font-size: .74rem; font-weight: 620;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok   { background: var(--ok-bg);   color: var(--ok); }
.badge--err  { background: var(--err-bg);  color: var(--err); }
.badge--wait { background: var(--warn-bg); color: var(--warn); }
.badge--run  { background: var(--info-bg); color: var(--info); }
.badge--flat { background: var(--surface-2); color: var(--text-soft); }
.badge--flat::before { display: none; }

.chip { display: inline-block; padding: .12rem .5rem; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .76rem; color: var(--text-soft); }

/* --------------------------------------------------------------- progresie */
.progress { height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--cyan); border-radius: 4px;
  transition: width .35s ease; width: 0; }
.progress__bar--done { background: var(--ok); }
.progress__bar--err  { background: var(--err); }

.job-card { border: 1px solid var(--border); border-radius: var(--radius);
  padding: .8rem .9rem; background: var(--surface); margin-bottom: .6rem; }
.job-card__top { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.job-card__top .name { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card__stage { font-size: .78rem; color: var(--text-soft); margin-top: .35rem;
  display: flex; justify-content: space-between; gap: .5rem; }

.spinner {
  width: 14px; height: 14px; border: 2px solid rgba(0,163,224,.3);
  border-top-color: var(--cyan); border-radius: 50%; display: inline-block;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------- login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.login-hero {
  background: linear-gradient(155deg, #002139, var(--brand) 52%, #0a6fa8);
  color: #fff; padding: 2.2rem 1.6rem; display: none;
}
.login-hero h1 { color: #fff; font-size: 1.7rem; }
.login-hero p { color: #cfe0f4; max-width: 42ch; }
.login-hero ul { list-style: none; padding: 0; margin: 1.6rem 0 0; }
.login-hero li { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .9rem;
  color: #e3edf9; font-size: .92rem; }
.login-hero li svg { width: 18px; height: 18px; flex: none; margin-top: .18rem; color: #6fd0f7; }
.login-form-wrap { display: grid; place-items: center; padding: 1.6rem 1.1rem; }
.login-box { width: 100%; max-width: 400px; }
.login-logo { display: block; width: 100%; max-width: 296px; height: auto; margin: 0 0 1.7rem; }
.error-logo { display: block; width: 100%; max-width: 240px; height: auto; margin: 0 auto 1.2rem; }
@media (min-width: 940px) {
  .login-page { grid-template-columns: 1.05fr .95fr; }
  .login-hero { display: block; padding: 3rem 3rem; align-content: center; }
}

/* -------------------------------------------------------------- utilitare */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.toolbar .field { margin: 0; flex: 1 1 150px; min-width: 130px; }
.toolbar .field--sm { flex: 0 1 130px; }

.pagination { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap;
  justify-content: center; padding: .8rem; }
.pagination a, .pagination span {
  padding: .35rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--text-soft); background: var(--surface);
}
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

.empty { text-align: center; padding: 2.4rem 1rem; color: var(--text-faint); }
.empty svg { width: 42px; height: 42px; margin-bottom: .5rem; opacity: .5; }

.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; }
.muted { color: var(--text-soft); }
.nowrap { white-space: nowrap; }
.mb0 { margin-bottom: 0; }
.mt1 { margin-top: 1rem; }
.flex { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; gap: .6rem; align-items: center; justify-content: space-between;
  flex-wrap: wrap; }
.text-right { text-align: right; }
.hide-sm { display: none; }
@media (min-width: 720px) { .hide-sm { display: table-cell; } }

.bar-list { display: grid; gap: .55rem; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 46px; gap: .6rem;
  align-items: center; font-size: .85rem; }
.bar-track { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--cyan); border-radius: 4px; }

.kv { display: grid; grid-template-columns: 1fr; gap: .1rem .8rem; font-size: .88rem; }
.kv dt { color: var(--text-faint); font-size: .78rem; }
.kv dd { margin: 0 0 .6rem; font-weight: 550; }
@media (min-width: 520px) { .kv { grid-template-columns: 150px 1fr; }
  .kv dt { padding-top: .1rem; } .kv dd { margin-bottom: .35rem; } }

details.disclosure { border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); }
details.disclosure summary { padding: .6rem .8rem; cursor: pointer; font-weight: 600;
  font-size: .9rem; }
details.disclosure .inner { padding: 0 .8rem .8rem; }

@media print {
  .sidebar, .topbar, .btn, .toolbar, .pagination { display: none !important; }
  .main { margin: 0; } .card { box-shadow: none; border-color: #ccc; }
}
