:root {
  --bg: #f4f1ea;
  --ink: #16181d;
  --muted: #6b6a66;
  --line: #e3ddd1;
  --card: #ffffff;
  --g1: #0f6b4f;
  --g2: #1aa37a;
  --amber: #f2b63c;
  --red: #c2412d;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 24, 29, .05), 0 12px 32px -16px rgba(22, 24, 29, .18);
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; overflow-x: hidden; }
a { color: var(--g1); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
small { color: var(--muted); }

/* forme mari animate în fundal */
.bg-shape { position: fixed; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.bg-shape.s1 { width: 520px; height: 520px; right: -160px; top: -180px; background: radial-gradient(circle at 30% 30%, #8fe3c4, #1aa37a 60%, transparent 70%); animation: drift 22s ease-in-out infinite alternate; }
.bg-shape.s2 { width: 440px; height: 440px; left: -180px; bottom: -160px; background: radial-gradient(circle at 60% 40%, #ffe2a3, #f2b63c 60%, transparent 72%); animation: drift 28s ease-in-out infinite alternate-reverse; }
.bg-shape.s3 { width: 300px; height: 300px; left: 55%; top: 60%; background: radial-gradient(circle, #b9d7ff, transparent 70%); animation: drift 19s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 50px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .bg-shape { animation: none; } }

/* antet */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 12px 28px;
  background: rgba(244, 241, 234, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand b { display: block; font-size: 18px; line-height: 1; }
.brand small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 6px 16px -6px rgba(15, 107, 79, .7); }
.logo.big { width: 72px; height: 72px; border-radius: 22px; font-size: 34px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; }
.nav a:hover { background: rgba(22, 24, 29, .06); }
.nav a.on { background: var(--ink); color: #fff; }
.me { display: flex; align-items: center; gap: 10px; }
.me form { margin: 0; }
.who { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 600; padding: 4px 10px 4px 4px; border-radius: 999px; }
.who:hover, .who.on { background: rgba(22, 24, 29, .06); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--amber); color: var(--ink); font-weight: 800; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 28px 48px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 20px 28px; }

/* titluri mari */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 8px 0 24px; }
.hero h1 { font-size: clamp(38px, 6vw, 64px); line-height: 1; font-weight: 800; word-break: break-word; }
.hero h1 span { color: var(--g2); }
.doc-hero h1 { font-size: clamp(28px, 4.4vw, 46px); }
.sub { color: var(--muted); margin: 10px 0 0; }
.kicker { margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.kicker em, .t-title em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-weight: 600; }

/* butoane */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  font: 700 15px/1 var(--font); padding: 13px 20px; border-radius: 14px; color: var(--ink); background: transparent; transition: transform .12s, box-shadow .12s, background .12s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 10px 24px -12px rgba(15, 107, 79, .9); }
.btn.primary:hover { box-shadow: 0 14px 28px -12px rgba(15, 107, 79, 1); }
.btn.dark { color: #fff; background: var(--ink); }
.btn.ghost { background: rgba(22, 24, 29, .06); }
.btn.ghost:hover { background: rgba(22, 24, 29, .1); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.big { padding: 16px 24px; font-size: 16px; border-radius: 16px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn .plus { font-size: 22px; line-height: 0; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* card și formulare */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; border: 1px solid rgba(22, 24, 29, .04); }
.card h2 { font-size: 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.count { font-style: normal; font-size: 13px; background: var(--bg); padding: 2px 9px; border-radius: 999px; color: var(--muted); }
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 14px; }
input, select { display: block; width: 100%; margin-top: 6px; font: 15px var(--font); color: var(--ink); padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; outline: none; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus { border-color: var(--g2); box-shadow: 0 0 0 4px rgba(26, 163, 122, .15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.form { max-width: 760px; }

/* mesaje */
.flash { padding: 14px 18px; border-radius: 14px; margin-bottom: 18px; font-weight: 600; }
.flash.ok { background: #dff5ea; color: #0b4f3a; }
.flash.err { background: #fde5e0; color: #8a2414; }
.flash.warn { background: #fff1cc; color: #6b4a00; }

/* zona de încărcare */
.drop { position: relative; display: block; text-align: center; padding: 34px 20px; margin-bottom: 18px; border-radius: 16px; cursor: pointer;
  border: 2px dashed #bcd9cd; background: linear-gradient(180deg, #f3fbf7, #fff); transition: border-color .15s, background .15s; font-weight: 400; }
.drop:hover, .drop.over { border-color: var(--g2); background: #e9f8f1; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.drop-ic { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 16px; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, var(--g1), var(--g2)); }
.drop strong { display: block; font-size: 16px; }
.drop small { display: block; margin-top: 4px; }
.drop-list { list-style: none; margin: 12px 0 0; padding: 0; text-align: left; position: relative; z-index: 1; pointer-events: none; }
.drop-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); margin-top: 6px; font-size: 13px; }
.drop-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* căutare și filtre */
.search { display: flex; gap: 10px; margin-bottom: 14px; }
.search input { margin: 0; flex: 1; padding: 14px 16px; border-radius: 14px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { padding: 7px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 13px; }
.chip i { font-style: normal; color: var(--muted); margin-left: 2px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on i { color: rgba(255, 255, 255, .7); }
.chip.arch { margin-left: auto; border-style: dashed; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fff3d6; color: #6b4a00; font-size: 12px; font-weight: 700; }

/* tabele (devin carduri pe mobil) */
.table { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tr { display: grid; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tr.th { border-top: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #faf8f3; }
a.tr:hover { background: #f6fbf8; }
.docs .tr { grid-template-columns: minmax(0, 1fr) 150px 90px 170px; }
.hist .tr { grid-template-columns: 140px 130px minmax(0, 1fr) minmax(0, .8fr) 110px; font-size: 14px; }
.hist .tr small { display: block; overflow-wrap: anywhere; }
.hist .tr.bad { background: #fff6f4; }
.t-title { font-weight: 700; display: flex; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.t-when small { display: block; font-size: 12px; }
.t-files { color: var(--muted); font-size: 13px; }
.ip { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.empty { text-align: center; padding: 56px 20px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-ic { font-size: 44px; color: var(--g2); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 20px; }
.pg { padding: 9px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.pg-info { color: var(--muted); font-size: 13px; }

/* pagina actului */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.grid.narrow { grid-template-columns: minmax(0, 560px); }
.side { display: grid; gap: 22px; }
.files { list-style: none; margin: 0 0 22px; padding: 0; }
.files li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.files li:first-child { border-top: 0; }
.ftype { flex: none; display: grid; place-items: center; width: 46px; height: 54px; border-radius: 10px; font-size: 11px; font-weight: 800; color: #fff; letter-spacing: .04em; }
.k-pdf { background: linear-gradient(160deg, #e5533c, #b5301c); }
.k-img { background: linear-gradient(160deg, #4e8ef7, #2457c5); }
.k-xls { background: linear-gradient(160deg, #23a566, #126b40); }
.k-doc { background: linear-gradient(160deg, #4f6bed, #2c3fae); }
.k-xml { background: linear-gradient(160deg, #9a6bf0, #6235b8); }
.k-zip { background: linear-gradient(160deg, #8b8579, #5b564c); }
.k-other { background: linear-gradient(160deg, #6b7280, #374151); }
.fmeta { flex: 1; min-width: 0; }
.fmeta b { display: block; overflow-wrap: anywhere; }
.fmeta small { font-size: 12px; }
.fbtn { display: flex; gap: 6px; flex: none; }
.add-files { border-top: 1px solid var(--line); padding-top: 18px; }
.edit summary { list-style: none; cursor: pointer; }
.edit summary::-webkit-details-marker { display: none; }
.edit summary h2 { margin: 0; }
.edit summary h2::after { content: "+"; margin-left: auto; font-size: 22px; color: var(--g2); }
.edit[open] summary h2::after { content: "–"; }
.edit[open] summary { margin-bottom: 14px; }
.edit .row2 { grid-template-columns: 1fr; gap: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); max-height: 520px; overflow: auto; }
.timeline li { position: relative; padding: 0 0 14px 8px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--g2); box-shadow: 0 0 0 3px #fff; }
.timeline small { display: block; font-size: 12px; }
.timeline span { display: block; color: var(--muted); overflow-wrap: anywhere; }

/* categorii */
.cats { list-style: none; margin: 0; padding: 0; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); margin: 0; }
.cats li:first-child .cat-row { border-top: 0; }
.cat-row input { margin: 0; flex: 1; font-weight: 600; }
.count-link { white-space: nowrap; font-size: 13px; font-weight: 600; }

/* login */
.login-body { display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 420px; }
.login-hero { text-align: center; margin-bottom: 26px; }
.login-hero h1 { font-size: 64px; font-weight: 800; margin-top: 16px; line-height: 1; }
.login-hero h1 span { color: var(--g2); }
.login-hero p { color: var(--muted); margin: 8px 0 0; }
.login-card { padding: 28px; }

/* tabletă */
@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; }
  .hist .tr { grid-template-columns: 120px 110px minmax(0, 1fr) minmax(0, .8fr); }
  .hist .tr .ip, .hist .tr.th span:last-child { display: none; }
}

/* mobil */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .brand { order: 1; }
  .me { order: 2; margin-left: auto; }
  .who-name { display: none; }
  .who { padding: 2px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 13px; font-size: 14px; }
  .wrap { padding: 20px 14px 36px; }
  .hero { flex-direction: column; align-items: stretch; margin-bottom: 18px; }
  .hero .btn.big { width: 100%; }
  .card { padding: 18px; border-radius: 16px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .search .btn { padding: 0 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 18px; padding: 0 14px 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; }
  .chip.arch { margin-left: 0; }
  .table { background: transparent; box-shadow: none; overflow: visible; }
  .tr.th { display: none; }
  .tr { background: var(--card); border: 0; border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 10px; gap: 6px; padding: 14px 16px; }
  .docs .tr { grid-template-columns: 1fr auto; }
  .docs .t-title { grid-column: 1 / -1; font-size: 16px; }
  .docs .t-files { grid-column: 2; grid-row: 2; text-align: right; }
  .docs .t-when { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
  .docs .t-when small { display: inline; margin-left: 6px; }
  .hist .tr { grid-template-columns: 1fr; }
  .hist .tr .ip { display: block; }
  .files li { flex-wrap: wrap; }
  .fbtn { width: 100%; padding-left: 60px; }
  .fbtn .btn { flex: 1; }
  .actions .btn { flex: 1; }
  .cat-row { flex-wrap: wrap; }
  .cat-row input { flex-basis: 100%; }
  .cat-row .btn { margin-left: auto; }
  .drop { padding: 26px 14px; }
  .login-hero h1 { font-size: 52px; }
}
