:root {
  --bg: #0b0f17;
  --card: #121927;
  --line: #22304a;
  --text: #e7edf6;
  --muted: #8b98ae;
  --accent: #3b82f6;
  --accent2: #8b5cf6;
  --danger: #ef4444;
  --ok: #10b981;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }

header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 23, .85);
  backdrop-filter: blur(8px);
}
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: .2px; }
.brand span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand em { font-style: normal; font-weight: 500; color: var(--muted); margin-left: .4rem; }

main { max-width: 1040px; margin: 0 auto; padding: 1.2rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.error { color: var(--danger); min-height: 1.2em; margin: .6rem 0 0; }

.card {
  max-width: 420px;
  margin: 12vh auto 0;
  padding: 1.8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.card h1 { margin: 0 0 .3rem; font-size: 1.5rem; }
.card p { margin: 0; }
.card form { display: flex; flex-direction: column; gap: .8rem; margin-top: 1.2rem; }

.field {
  width: 100%;
  padding: .7rem .9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d1320;
  color: var(--text);
  font-size: 1rem;
}
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #172036;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #33466a; background: #1c2640; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, .35);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .6rem; font-size: .82rem; border-radius: 8px; }
.btn.danger { color: #fca5a5; }
.btn.danger:hover { background: rgba(239, 68, 68, .15); border-color: rgba(239, 68, 68, .4); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 600;
}
.breadcrumb .sep { color: var(--muted); }
.breadcrumb .current { color: #fff; }
.actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .9rem; cursor: pointer; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: 2rem 1rem;
  margin-bottom: 1rem;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .02);
  text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--accent); background: rgba(59, 130, 246, .08); }

.queue {
  margin-bottom: 1rem;
  padding: .8rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.qbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .4rem;
  color: var(--muted);
  font-size: .9rem;
}
.qitem { padding: .45rem 0; border-top: 1px solid var(--line); }
.qhead { display: flex; align-items: center; gap: .7rem; font-size: .92rem; }
.qname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qsize { color: var(--muted); white-space: nowrap; }
.qstatus { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qitem[data-status="gata"] .qstatus { color: var(--ok); }
.qitem[data-status="eroare"] .qstatus,
.qitem[data-status="anulat"] .qstatus { color: var(--danger); }
.bar { height: 5px; margin-top: .35rem; border-radius: 4px; background: #1a2338; overflow: hidden; }
.fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .12s linear;
}
.qitem[data-status="gata"] .fill { background: var(--ok); }
.qitem[data-status="eroare"] .fill,
.qitem[data-status="anulat"] .fill { background: var(--danger); }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
td.icon { width: 2rem; text-align: center; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.date { white-space: nowrap; color: var(--muted); }
td.act { text-align: right; width: 1%; white-space: nowrap; }
td.act .btn + .btn { margin-left: .35rem; }
td .name { word-break: break-all; }

footer { margin-top: .8rem; font-size: .85rem; text-align: right; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 10;
  max-width: 90vw;
  padding: .7rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #1f2a44;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.toast.error { background: #3a1d22; border-color: rgba(239, 68, 68, .5); }
.toast { user-select: text; word-break: break-all; }

@media (max-width: 640px) {
  .date { display: none; }
  th, td { padding: .5rem; }
  .card { margin-top: 6vh; }
}
