:root {
  --navy: #123c69;
  --navy-dark: #0b2949;
  --blue: #1d67b1;
  --blue-soft: #e9f3fc;
  --gold: #c9933b;
  --ink: #172333;
  --muted: #617083;
  --line: #dce4ec;
  --surface: #fff;
  --canvas: #f4f7fa;
  --success: #17795b;
  --danger: #b42335;
  --radius: 16px;
  --shadow: 0 16px 45px rgba(24, 49, 76, .1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .7rem 1rem; color: white; background: var(--navy); border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.site-header { height: 76px; padding: 0 clamp(1rem, 4vw, 4rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: white; background: var(--navy-dark); border-bottom: 3px solid var(--gold); }
.brand { display: flex; align-items: center; gap: .85rem; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; font-family: Georgia, serif; font-weight: 700; }
.brand span:last-child { display: grid; gap: .15rem; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; }
.brand small { color: #b9cce0; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: .7rem; }
.status-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .75rem; font-size: .78rem; color: #d4e3f2; background: rgba(255,255,255,.08); border-radius: 999px; }
.status-chip i { width: 8px; height: 8px; background: #e8b454; border-radius: 50%; }
.status-chip.online i { background: #46c797; box-shadow: 0 0 0 4px rgba(70,199,151,.15); }
.status-chip.offline i { background: #f47777; }
.site-footer { padding: 1rem; color: #b9cce0; background: var(--navy-dark); border-top: 1px solid rgba(255,255,255,.1); text-align: center; font-size: .8rem; }
.site-footer a { color: #dce9f5; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: white; }

.public-layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); }
.hero { position: relative; overflow: hidden; padding: clamp(3.5rem, 8vw, 7.5rem) clamp(2rem, 8vw, 8rem); color: white; background: linear-gradient(115deg, rgba(9,38,68,.96), rgba(18,70,116,.87)), url("/view/palatuldejustitieiasi.jpg") center/cover; }
.hero::after { content: ""; position: absolute; width: 420px; height: 420px; right: -180px; bottom: -190px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.eyebrow { margin: 0 0 .7rem; color: var(--gold); font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 720px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.6rem, 5vw, 5rem); line-height: 1.02; font-weight: 500; letter-spacing: -.035em; }
.hero-copy { max-width: 650px; margin: 1.6rem 0; color: #d9e5ef; font-size: 1.12rem; line-height: 1.75; }
.trust-list { display: flex; flex-wrap: wrap; gap: .8rem 1.3rem; color: #dbe8f3; font-size: .9rem; }
.trust-list span { display: inline-flex; align-items: center; gap: .45rem; }
.trust-list b { color: #75d2ae; }
.hero-note { position: relative; z-index: 1; max-width: 620px; margin-top: 4rem; padding: 1rem 1.15rem; display: grid; gap: .25rem; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; backdrop-filter: blur(5px); }
.hero-note span { color: #cbd9e6; font-size: .85rem; line-height: 1.5; }

.auth-card { align-self: center; width: min(470px, calc(100% - 2rem)); margin: 2rem auto; padding: clamp(1.5rem, 4vw, 2.6rem); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 2rem; padding: 4px; background: #edf2f7; border-radius: 10px; }
.auth-tab { padding: .7rem; color: var(--muted); background: transparent; border: 0; border-radius: 8px; font-weight: 700; }
.auth-tab.active { color: var(--navy); background: white; box-shadow: 0 3px 10px rgba(30,55,80,.08); }
.auth-panel { display: none; }
.auth-panel.active { display: block; animation: rise .25s ease-out; }
.auth-panel h2, .panel h2 { margin: 0 0 .5rem; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; font-weight: 600; }
.muted { margin: 0 0 1.6rem; color: var(--muted); line-height: 1.55; }
form { display: grid; gap: 1.05rem; }
label { display: grid; gap: .45rem; color: #344355; font-size: .84rem; font-weight: 700; }
input, select { width: 100%; min-height: 46px; padding: .7rem .8rem; color: var(--ink); background: white; border: 1px solid #cbd6e1; border-radius: 9px; outline: none; transition: border .2s, box-shadow .2s; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,103,177,.13); }
input:disabled { color: var(--muted); background: #f1f4f7; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 4rem; }
.show-password { position: absolute; right: .4rem; top: .4rem; height: 38px; color: var(--blue); background: transparent; border: 0; font-size: .75rem; font-weight: 800; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.code-input { text-transform: uppercase; text-align: center; letter-spacing: .45em; font-size: 1.2rem; font-weight: 800; }
.button { min-height: 44px; padding: .7rem 1.1rem; border: 1px solid transparent; border-radius: 9px; font-weight: 800; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 8px 22px rgba(29,103,177,.22); }
.button-primary:hover { background: #165993; }
.button-secondary { color: var(--navy); background: var(--blue-soft); border-color: #cfe0f1; }
.button-ghost { color: white; background: transparent; border-color: rgba(255,255,255,.3); }
.button-wide { width: 100%; margin-top: .25rem; }
.text-button, .back-button { margin-top: 1rem; padding: .25rem 0; color: var(--blue); background: transparent; border: 0; font-weight: 800; }
.back-button { margin: 0 0 1.5rem; color: var(--muted); }

.app-layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 260px 1fr; }
.sidebar { padding: 1.5rem 1rem; color: white; background: var(--navy-dark); }
.user-summary { display: flex; align-items: center; gap: .7rem; margin-bottom: 2rem; padding: .7rem; }
.user-summary > span:last-child { min-width: 0; display: grid; gap: .15rem; }
.user-summary strong, .user-summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-summary small { color: #9fb6cb; }
.avatar { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; color: var(--navy); background: #dbeafa; border-radius: 50%; font-weight: 900; }
.sidebar nav { display: grid; gap: .35rem; }
.nav-item { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .8rem .9rem; color: #b9cad9; background: transparent; border: 0; border-radius: 9px; text-align: left; font-weight: 700; }
.nav-item span { width: 22px; font-size: 1.15rem; text-align: center; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.1); }
.sidebar-help { margin: 3rem .5rem 0; padding: 1rem; display: grid; gap: .35rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; }
.sidebar-help span { color: #a9bece; font-size: .8rem; line-height: 1.5; }
.workspace { min-width: 0; padding: clamp(1.2rem, 3vw, 3rem); }
.mobile-nav { display: none; }
.page { display: none; max-width: 1280px; margin: auto; }
.page.active { display: block; animation: rise .25s ease-out; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.page-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; letter-spacing: -.025em; }
.page-heading p:last-child { margin: .5rem 0 0; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stat-card { padding: 1.2rem; display: flex; align-items: center; gap: 1rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.stat-card div { display: grid; gap: .2rem; }
.stat-card small { color: var(--muted); }
.stat-card strong { font-size: 1.3rem; }
.stat-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; font-size: 1.4rem; font-weight: 800; }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.green { color: var(--success); background: #e5f6ef; }
.stat-icon.gold { color: #98702c; background: #fff4df; }
.content-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1rem; }
.panel { padding: clamp(1.2rem, 2.5vw, 2rem); background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 20px rgba(30,55,80,.04); }
.quick-upload { min-height: 270px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; background: linear-gradient(135deg, white, #eef6fd); }
.quick-upload p:not(.eyebrow) { max-width: 620px; color: var(--muted); line-height: 1.7; }
.steps ol { margin: 1.3rem 0 0; padding: 0; display: grid; gap: 1.1rem; list-style: none; }
.steps li { display: flex; align-items: center; gap: .85rem; }
.steps li > b { width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 50%; }
.steps li span { display: grid; gap: .15rem; }
.steps small { color: var(--muted); }
.form-panel { gap: 1.25rem; }
.form-panel.compact { align-content: start; }
.form-section { margin-top: .5rem; display: flex; align-items: center; gap: .8rem; }
.form-section:first-child { margin-top: 0; }
.form-section h2 { margin: 0; font-size: 1.35rem; }
.form-section p { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }
.section-number { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; color: white; background: var(--navy); border-radius: 50%; font-weight: 900; }
.drop-zone { min-height: 190px; padding: 2rem; place-items: center; align-content: center; text-align: center; color: var(--muted); background: #f8fbfd; border: 2px dashed #b9cad9; border-radius: 14px; transition: .2s; }
.drop-zone:hover, .drop-zone.dragging { background: var(--blue-soft); border-color: var(--blue); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { color: var(--ink); font-size: 1rem; }
.upload-symbol { width: 48px; height: 48px; display: grid; place-items: center; color: var(--blue); background: white; border-radius: 50%; box-shadow: 0 4px 14px rgba(30,70,110,.12); font-size: 1.5rem; }
.selected-file { margin-top: .4rem; padding: .5rem .75rem; color: var(--success); background: #e5f6ef; border-radius: 8px; }
.consent { grid-template-columns: 20px 1fr; align-items: start; font-weight: 500; }
.consent input { min-height: auto; margin-top: .15rem; accent-color: var(--blue); }
.form-actions { display: flex; justify-content: flex-end; }
.filter-bar { grid-template-columns: 1.4fr 1fr .8fr .8fr auto; align-items: end; margin-bottom: 1rem; padding: 1.2rem; }
.filter-bar .button { margin-bottom: 1px; }
.table-panel { padding: 0; overflow: hidden; }
.table-header { padding: 1.3rem 1.5rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.table-header h2 { margin: 0; }
.table-header span { color: var(--muted); font-size: .82rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 1rem 1.2rem; border-bottom: 1px solid #e8edf2; text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f8fafc; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
td:first-child { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.status-badge { padding: .3rem .55rem; color: #8a5c0a; background: #fff4d8; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.status-badge.validated { color: var(--success); background: #e2f5ed; }
.download-button { padding: .45rem .7rem; color: var(--blue); background: var(--blue-soft); border: 0; border-radius: 7px; font-weight: 800; }
.empty-state { min-height: 270px; display: grid; place-items: center; align-content: center; gap: .35rem; color: var(--muted); text-align: center; }
.empty-state > span { font-size: 2rem; color: #91a8bc; }
.empty-state p { margin: 0; }
.password-hint { margin: -.3rem 0 .2rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.password-layout { min-height: calc(100vh - 76px); padding: 2rem; display: grid; grid-template-columns: minmax(280px, 520px) minmax(340px, 460px); align-items: center; justify-content: center; gap: clamp(2rem, 7vw, 7rem); background: linear-gradient(120deg, #eef4f9, #f8fafc); }
.password-intro h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; color: var(--navy-dark); font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.04; font-weight: 500; }
.password-intro > p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.password-intro ul { padding: 0; display: grid; gap: .7rem; color: #405166; list-style: none; }
.password-intro li::before { content: "✓"; margin-right: .65rem; color: var(--success); font-weight: 900; }
.password-card { width: 100%; margin: 0; }
.password-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.password-meter i { height: 4px; background: #dce4ec; border-radius: 999px; transition: background .2s; }
.password-meter i.active { background: var(--success); }
.form-message { min-height: 1.4rem; margin: 1rem 0 0; font-size: .85rem; font-weight: 700; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }
.password-card > a.button { display: block; margin-top: 1rem; text-align: center; text-decoration: none; }

.toast-region { position: fixed; z-index: 90; right: 1rem; bottom: 1rem; display: grid; gap: .6rem; width: min(390px, calc(100% - 2rem)); }
.toast { padding: .9rem 1rem; display: flex; gap: .7rem; color: #fff; background: var(--navy-dark); border-radius: 10px; box-shadow: var(--shadow); animation: toast-in .25s ease-out; }
.toast.error { background: #8d2030; }
.toast.success { background: #12634d; }
.loading-overlay { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; align-content: center; gap: .8rem; color: var(--navy); background: rgba(244,247,250,.78); backdrop-filter: blur(3px); }
.spinner { width: 34px; height: 34px; border: 3px solid #c8d8e7; border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 1000px) {
  .public-layout { grid-template-columns: 1fr; }
  .hero { padding: 4rem clamp(1.5rem, 7vw, 5rem); }
  .hero h1 { max-width: 800px; }
  .auth-card { margin-block: 3rem; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { position: sticky; z-index: 20; top: 0; margin: -1.2rem -1.2rem 1.5rem; padding: .5rem; display: grid; grid-template-columns: repeat(4, 1fr); background: white; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .mobile-nav .nav-item { justify-content: center; padding: .7rem .4rem; color: var(--muted); text-align: center; font-size: .78rem; }
  .mobile-nav .nav-item.active { color: var(--blue); background: var(--blue-soft); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar label:first-child { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .site-header { height: 68px; padding-inline: .8rem; }
  .brand small, .status-chip { display: none; }
  .public-layout { min-height: calc(100vh - 68px); }
  .hero { padding: 3rem 1.3rem; }
  .hero h1 { font-size: 2.55rem; }
  .hero-note { margin-top: 2.5rem; }
  .auth-card { width: calc(100% - 1.4rem); margin-block: 1rem; padding: 1.25rem; }
  .workspace { padding: 1rem; }
  .mobile-nav { margin: -1rem -1rem 1.3rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .stat-grid, .content-grid, .field-row { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar label:first-child { grid-column: auto; }
  .form-actions .button { width: 100%; }
  .table-header { align-items: flex-start; flex-direction: column; }
  .password-layout { min-height: calc(100vh - 68px); padding: 2rem 1rem; grid-template-columns: 1fr; gap: 1rem; }
  .password-intro h1 { font-size: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
