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

:root {
  --bg:       #0d0f1a;
  --surface:  #161927;
  --surface2: #1e2235;
  --border:   #2a2f47;
  --accent:   #6c63ff;
  --green:    #22c55e;
  --red:      #ef4444;
  --text:     #e2e8f0;
  --muted:    #8892a4;
  --radius:   9px;
}

html { font-size: 14px; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── HEADER ──────────────────────────── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.logo { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.logo i { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 12px; }
.total-badge {
  background: var(--surface2); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 99px; font-size: .8rem; color: var(--muted);
}
.uploaded-badge {
  background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35);
  padding: 4px 12px; border-radius: 99px; font-size: .8rem; color: var(--green);
  font-weight: 700;
}

/* ── BUTTONS ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--radius);
  border: none; cursor: pointer; font-size: .85rem; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5a52e0; }
.btn-ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-upload { background: var(--accent); color: #fff; }
.btn-upload:hover { background: #5a52e0; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.icon-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 7px; padding: 5px 9px; cursor: pointer; font-size: .78rem;
  transition: all .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.del:hover { color: var(--red); border-color: var(--red); }

/* Upload action button */
.upload-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px; border-radius: 7px; border: none; cursor: pointer;
  font-size: .78rem; font-weight: 700; transition: all .15s;
  background: var(--accent); color: #fff;
}
.upload-btn:hover { background: #5a52e0; transform: translateY(-1px); }
.upload-btn:disabled {
  background: rgba(34,197,94,.15); color: var(--green);
  border: 1px solid rgba(34,197,94,.4); cursor: default; transform: none;
}

/* Status badges */
.badge-pending  {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  background: rgba(245,158,11,.12); color: #f59e0b; border: 1px solid rgba(245,158,11,.3);
}
.badge-uploaded {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.3);
}

/* ── TABS ────────────────────────────── */
.tabs {
  display: flex; gap: 2px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 11px 18px; background: none; border: none; color: var(--muted);
  font-size: .88rem; font-weight: 600; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
  display: flex; align-items: center; gap: 7px; transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── TAB CONTENT ─────────────────────── */
.tab-content { display: none; padding: 20px 24px; }
.tab-content.active { display: block; }

/* ── TOOLBAR ─────────────────────────── */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.search-input {
  padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-size: .85rem; width: 280px; outline: none;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--accent); }
.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.sel-count { color: var(--muted); font-size: .82rem; font-weight: 600; padding-right: 4px; }

/* ── BANNER ──────────────────────────── */
.banner {
  margin-bottom: 12px; padding: 11px 16px;
  border-radius: var(--radius); font-size: .88rem; font-weight: 600;
  border: 1px solid transparent;
}
.banner.ok  { background: rgba(34,197,94,.1);  border-color: var(--green); color: var(--green); }
.banner.err { background: rgba(239,68,68,.1);  border-color: var(--red);   color: var(--red); }

/* ── TABLE ───────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
thead { background: var(--surface2); }
th {
  padding: 11px 13px; text-align: left; color: var(--muted);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
td {
  padding: 9px 13px; border-bottom: 1px solid var(--border);
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
tbody tr { background: var(--surface); transition: background .1s; }
tbody tr:hover { background: var(--surface2); }
tbody tr.sel { background: rgba(108,99,255,.08); }
tbody tr:last-child td { border-bottom: none; }
.rn { color: var(--muted); font-size: .72rem; }
.empty { text-align: center; padding: 40px; color: var(--muted); }

/* ── PAGINATION ──────────────────────── */
.pagination { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 14px; }
.pg-btn {
  padding: 5px 11px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; font-size: .8rem;
  transition: all .13s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pg-btn.cur { background: var(--accent); color: #fff; border-color: var(--accent); }
.pg-btn:disabled { opacity: .3; cursor: default; }
.pg-info { color: var(--muted); font-size: .78rem; padding: 0 6px; }

/* ── FORM ────────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; max-width: 860px;
}
.form-card h2 { font-size: 1rem; font-weight: 700; margin-bottom: 22px; display: flex; align-items: center; gap: 8px; }
.form-card h2 i { color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select {
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-size: .88rem; outline: none;
  transition: border-color .18s;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.req { color: var(--red); }
.form-footer { display: flex; gap: 10px; margin-top: 22px; }
.form-msg { margin-top: 12px; font-size: .88rem; font-weight: 600; min-height: 20px; }
.form-msg.ok  { color: var(--green); }
.form-msg.err { color: var(--red); }

/* ── MODAL ───────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; max-width: 380px; width: 90%;
}
.modal p { margin-bottom: 20px; font-size: .95rem; }
.modal p i { color: #f59e0b; margin-right: 6px; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }

/* ── RESPONSIVE ──────────────────────── */
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .search-input { width: 100%; }
}
