:root{
  --bg:#0b1020;
  --card:#0f172a;
  --card2:#111c33;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --border:#243253;
  --accent:#3b82f6;
  --accent2:#60a5fa;
  --danger:#ef4444;
  --ok:#22c55e;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:14px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:var(--font);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(59,130,246,.25), transparent 60%),
    radial-gradient(1000px 500px at 90% 10%, rgba(96,165,250,.18), transparent 55%),
    var(--bg);
  color:var(--text);
}

a{ color:var(--accent2); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{
  max-width:1100px;
  margin:24px auto;
  padding:0 16px;
}

/* ---------- Top Bar ---------- */
.topbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  background:rgba(15,23,42,.85);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
}

.brand h1{ margin:0; font-size:22px; }

.nav{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:linear-gradient(180deg, rgba(59,130,246,.18), rgba(59,130,246,.08));
  color:var(--text);
  cursor:pointer;
}

.btn.secondary{ background:rgba(17,28,51,.75); }
.btn.danger{
  background:linear-gradient(180deg, rgba(239,68,68,.22), rgba(239,68,68,.10));
}

/* ---------- Cards ---------- */
.card{
  margin-top:16px;
  padding:16px;
  background:rgba(15,23,42,.85);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

/* ---------- Form Layout ---------- */
.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

label{
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
  display:block;
}

input, select, textarea{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(17,28,51,.75);
  color:var(--text);
  width:260px;
}

textarea{ width:520px; }

/* ---------- Upload File + Buttons ---------- */
.file-actions{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.file-actions .filebox{
  min-width:320px;
}

.form-actions{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
}

/* ---------- Tables ---------- */
.table{
  width:100%;
  border-collapse:collapse;
  border-radius:12px;
  border:1px solid var(--border);
}

.table th,
.table td{
  padding:10px 12px;
  border-bottom:1px solid rgba(36,50,83,.65);
  text-align:center;
  font-size:14px;
}

.table th{
  background:rgba(17,28,51,.95);
  color:#dbeafe;
}

.table tr:nth-child(even) td{
  background:rgba(17,28,51,.40);
}

/* ---------- Notices ---------- */
.notice{ padding:10px; border-radius:10px; }

hr{
  border:none;
  border-top:1px solid rgba(36,50,83,.75);
  margin:14px 0;
}

/* ---------- Pagination ---------- */
.pagination{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-top:14px;
}

.pagination a.btn{
  display:inline-flex;
}

/* =========================
   Responsive – Tablet & Mobile
   ========================= */
@media (max-width: 900px){

  .container{ padding:0 10px; }

  .topbar{
    flex-direction:column;
    align-items:flex-start;
  }

  .row{
    flex-direction:column;
  }

  input, select, textarea{
    width:100%;
  }

  /* Scrollable table on mobile */
  .table{
    display:block;
    overflow-x:auto;
    white-space:nowrap;
  }

  .table th,
  .table td{
    font-size:13px;
    padding:8px;
  }

  /* Hide Source column ONLY */
  .table th:nth-child(5),
  .table td:nth-child(5){
    display:none;
  }

  /* Center upload buttons */
  .form-actions{
    justify-content:center;
    width:100%;
  }

  .file-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .file-actions .filebox,
  .file-actions .form-actions{
    width:100%;
  }
}

/* ---------- Mobile Pagination ---------- */
@media (max-width: 768px){

  .pagination{
    justify-content:center;
  }

  .pagination .btn{
    padding:8px 12px;
    font-size:13px;
  }

  .pagination .btn.prev,
  .pagination .btn.next{
    min-width:88px;
  }

  .pagination .pageinfo{
    width:100%;
    text-align:center;
    margin-bottom:6px;
  }
}

/* ---------- Filter / Reset alignment ---------- */
.filter-actions{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-start;
  margin-top:22px; /* lines up with inputs that have a label */
  flex-wrap:wrap;
}

@media (max-width: 900px){
  .filter-actions{
    margin-top:0;
    justify-content:center;
    width:100%;
  }
}
