/* ============================================================
   Portal Client–Contabil – Premium Dark Luxury
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --primary:    #6366f1;
  --primary-h:  #818cf8;
  --accent:     #06b6d4;
  --accent2:    #a855f7;
  --danger:     #f43f5e;
  --success:    #10b981;
  --warn:       #f59e0b;

  --bg:         #080b14;
  --bg2:        #0d1120;
  --surface:    rgba(255,255,255,.045);
  --surface-h:  rgba(255,255,255,.07);
  --border:     rgba(255,255,255,.09);
  --border-h:   rgba(99,102,241,.4);
  --text:       #e2e8f0;
  --muted:      #64748b;
  --radius:     14px;

  --glow-indigo: 0 0 40px rgba(99,102,241,.25);
  --glow-cyan:   0 0 40px rgba(6,182,212,.2);
}

/* ── Reset & base ──────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated mesh background ──────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99,102,241,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(168,85,247,.14) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 60% 30%, rgba(6,182,212,.10) 0%, transparent 50%);
  animation: meshShift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.025) 1px, transparent 0);
  background-size: 36px 36px;
  pointer-events: none;
}

@keyframes meshShift {
  0%   { opacity: 1; transform: scale(1) rotate(0deg); }
  50%  { opacity: .85; transform: scale(1.05) rotate(1deg); }
  100% { opacity: 1; transform: scale(1.02) rotate(-1deg); }
}

/* ── All content above background ─────────────────────────── */
.navbar, .container, .login-page > * { position: relative; z-index: 1; }

/* ── Login page ────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow:
    var(--glow-indigo),
    0 32px 64px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.08);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  animation: slideUp .6s cubic-bezier(.22,1,.36,1) both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent2));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 20px rgba(99,102,241,.5);
  flex-shrink: 0;
}

.login-box h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
}

.login-box .subtitle {
  color: var(--muted);
  font-size: .82rem;
  margin-top: .1rem;
}

/* ── Formulare ─────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }

.field label {
  display: block;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: .7rem 1rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .93rem;
  font-family: 'Sora', sans-serif;
  color: var(--text);
  transition: border-color .2s, background .2s, box-shadow .2s;
}

input::placeholder { color: var(--muted); opacity: .6; }

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(99,102,241,.07);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

select option { background: #1a1f35; color: var(--text); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.3rem;
  border: none;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, opacity .15s;
  letter-spacing: -.01em;
}

.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,.35);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(99,102,241,.55);
  transform: translateY(-1px);
}

.btn-danger  { background: linear-gradient(135deg, var(--danger), #e11d48); color: #fff; box-shadow: 0 4px 16px rgba(244,63,94,.3); }
.btn-danger:hover:not(:disabled) { box-shadow: 0 6px 24px rgba(244,63,94,.5); transform: translateY(-1px); }

.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: #fff; box-shadow: 0 4px 16px rgba(16,185,129,.3); }
.btn-success:hover:not(:disabled) { box-shadow: 0 6px 24px rgba(16,185,129,.5); transform: translateY(-1px); }

.btn-warn    { background: linear-gradient(135deg, var(--warn), #d97706); color: #fff; box-shadow: 0 4px 16px rgba(245,158,11,.3); }
.btn-warn:hover:not(:disabled) { box-shadow: 0 6px 24px rgba(245,158,11,.5); transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-h);
  border-color: var(--border-h);
}

.btn-sm { padding: .38rem .8rem; font-size: .8rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ── Messages ──────────────────────────────────────────────── */
.msg {
  padding: .7rem 1rem;
  border-radius: 10px;
  font-size: .85rem;
  margin-top: .9rem;
  display: none;
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.msg.error   { background: rgba(244,63,94,.12); color: #fda4af; border: 1px solid rgba(244,63,94,.25); display: block; }
.msg.success { background: rgba(16,185,129,.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,.25); display: block; }
.msg.info    { background: rgba(99,102,241,.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,.25); display: block; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  background: rgba(8,11,20,.8);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: .9rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -.03em;
  background: linear-gradient(90deg, var(--primary-h), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-user {
  font-size: .8rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.navbar-right { display: flex; align-items: center; gap: .9rem; }

/* ── Container ─────────────────────────────────────────────── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.8rem 1.2rem;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  padding: 1.6rem;
  margin-bottom: 1.5rem;
  transition: border-color .2s, box-shadow .2s;
  animation: cardIn .5s cubic-bezier(.22,1,.36,1) both;
}

.card:hover { border-color: rgba(99,102,241,.2); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }

.card-title {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 1.1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  color: #fff;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Filters ───────────────────────────────────────────────── */
.filters {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.filters select, .filters input { width: auto; flex: 1; min-width: 120px; }

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

th {
  background: rgba(255,255,255,.03);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}

td {
  padding: .7rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text);
}

tr:last-child td { border-bottom: none; }

tr:hover td {
  background: rgba(255,255,255,.025);
}

/* Filename in mono */
td:first-child { font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: var(--primary-h); }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge-closed {
  background: rgba(244,63,94,.12);
  color: #fda4af;
  border: 1px solid rgba(244,63,94,.2);
}
.badge-open {
  background: rgba(16,185,129,.12);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,.2);
}

/* ── Upload form ───────────────────────────────────────────── */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.file-input-wrap {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.file-input-wrap:hover {
  border-color: var(--primary);
  background: rgba(99,102,241,.05);
  color: var(--primary-h);
}
.file-input-wrap input { display: none; }
.file-input-wrap .upload-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: .4rem;
  opacity: .5;
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.2rem 0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .navbar { flex-direction: column; gap: .5rem; text-align: center; }
  .filters { flex-direction: column; }
  .login-box { padding: 2rem 1.5rem; }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,.4); }

/* ── ANAF Preview (contabil – adaugă firmă) ────────────────── */
.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.preview-row:last-child { border-bottom: none; }

.preview-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.badge-green { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.25); }
.badge-blue  { background: rgba(6,182,212,.15);  color: #67e8f9; border: 1px solid rgba(6,182,212,.25); }
.badge-red   { background: rgba(244,63,94,.15);  color: #fda4af; border: 1px solid rgba(244,63,94,.25); }

/* ── Spinner (loading state pe butoane) ────────────────────── */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-right: .4rem;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
