:root {
  --lime: #ccff33;
  --ink: #0b1220;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.10);
  --panel: rgba(255,255,255,0.88);
  --blue: #2563eb;
  --soft: #eef4fb;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 6%, rgba(204,255,51,0.24), transparent 24rem),
    radial-gradient(circle at 92% 0%, rgba(37,99,235,0.16), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 44%, #f4f7fb 100%);
}
.page { max-width: 1440px; margin: 0 auto; padding: 28px; }
.hidden { display: none !important; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(38px, 4.2vw, 64px); line-height: 0.92; letter-spacing: -0.065em; }
h2 { margin-bottom: 8px; font-size: 28px; letter-spacing: -0.045em; }
.muted, .hint { color: var(--muted); line-height: 1.45; }
.hint { font-size: 14px; }
.eyebrow {
  margin: 0 0 8px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.loginOnly {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 15%, rgba(148,163,184,0.18), transparent 24rem),
    linear-gradient(135deg, #f8fafc, #eef2f7 54%, #f8fafc);
}
.loginCard {
  width: min(420px, 100%);
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 30px;
  padding: 34px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.14);
  display: grid;
  gap: 16px;
}
.loginCard h1 { font-size: 46px; letter-spacing: -0.06em; }
.loginNote { margin-bottom: 10px; color: #667085; font-size: 18px; }
.loginCard button {
  background: #111827;
  color: #fff;
  margin-top: 4px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 14px 50px rgba(15,23,42,0.08);
  backdrop-filter: blur(12px);
}
.brandBlock { display: flex; align-items: center; gap: 18px; min-width: 0; }
.brandLogo { width: 76px; height: 76px; border-radius: 22px; object-fit: cover; box-shadow: 0 14px 34px rgba(15,23,42,0.12); flex: 0 0 auto; }
.dashboardGrid { display: grid; grid-template-columns: 170px 170px minmax(260px, 1fr); gap: 14px; margin-bottom: 18px; }
.statCard, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 16px 50px rgba(15,23,42,0.08);
  backdrop-filter: blur(12px);
}
.statCard { padding: 16px; min-width: 0; }
.statLabel { display: block; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.statCard strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card { padding: 22px; margin-bottom: 18px; }
.cardTitleRow { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.cardTitleRow.tight { margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.searchGrid { display: grid; grid-template-columns: minmax(280px, 1fr) 170px auto; gap: 14px; align-items: end; }
label { display: grid; gap: 7px; color: #273449; font-weight: 850; font-size: 13px; }
input, select {
  width: 100%;
  border: 1px solid rgba(15,23,42,0.15);
  border-radius: 16px;
  padding: 13px 15px;
  background: rgba(255,255,255,0.96);
  color: var(--ink);
  font: inherit;
  outline: none;
}
input:focus, select:focus, button:focus-visible { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,0.14); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.alignEnd { margin-top: 0; align-items: end; }
button {
  border: 0;
  border-radius: 15px;
  background: var(--lime);
  color: #050505;
  padding: 12px 17px;
  cursor: pointer;
  font-weight: 950;
  letter-spacing: -0.02em;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(15,23,42,0.15); }
button.secondary { background: #eaf0f7; color: #1f2937; }
button.danger { background: #fee2e2; color: #991b1b; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.collapsedCreate { padding: 0; overflow: hidden; }
.collapsedCreate summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.collapsedCreate summary::-webkit-details-marker { display: none; }
.collapsedCreate summary strong { display: block; font-size: 22px; letter-spacing: -0.04em; }
.summaryHint { color: var(--muted); font-weight: 800; font-size: 13px; }
.createContent { padding: 0 20px 20px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; background: #ecfccb; color: #365314; border: 1px solid #d9f99d; padding: 7px 10px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.status { min-height: 20px; color: var(--muted); font-size: 13px; align-self: center; }
.resultsCard { margin-top: -4px; }
.tableWrap { overflow-x: auto; border: 1px solid rgba(15,23,42,0.08); border-radius: 20px; }
table { width: 100%; border-collapse: collapse; min-width: 1120px; background: rgba(255,255,255,0.78); }
th, td { border-bottom: 1px solid rgba(15,23,42,0.08); padding: 12px; text-align: left; vertical-align: top; font-size: 13px; }
th { background: rgba(248,250,252,0.96); font-size: 12px; color: #475569; text-transform: uppercase; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-weight: 900; font-size: 12px; }
.badge.on { background: #dcfce7; color: #166534; }
.badge.off { background: #fee2e2; color: #991b1b; }
.linkBox { max-width: 290px; overflow-wrap: anywhere; }
.rowActions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 280px; }
.rowActions button { padding: 8px 10px; border-radius: 11px; font-size: 12px; }
@media (max-width: 920px) {
  .page { padding: 18px; }
  .topbar, .brandBlock { align-items: flex-start; }
  .topbar { flex-direction: column; }
  .dashboardGrid, .grid.two, .searchGrid { grid-template-columns: 1fr; }
  .alignEnd { align-items: stretch; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
}
@media (max-width: 560px) {
  .loginCard { padding: 26px; border-radius: 24px; }
  .brandLogo { width: 58px; height: 58px; border-radius: 16px; }
  h1 { font-size: 38px; }
  .card, .topbar { border-radius: 22px; }
  .collapsedCreate summary { align-items: flex-start; flex-direction: column; }
}

/* Cleaner upload-link results table */
.resultsCard { overflow: hidden; }
.tableWrap {
  overflow-x: auto;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 24px;
  background: rgba(255,255,255,0.72);
}
table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}
th, td {
  padding: 16px 14px;
  font-size: 14px;
  line-height: 1.25;
  vertical-align: middle;
}
th:nth-child(1), td:nth-child(1) { width: 120px; }
th:nth-child(2), td:nth-child(2) { width: 230px; }
th:nth-child(3), td:nth-child(3) { width: 260px; }
th:nth-child(4), td:nth-child(4) { width: 260px; }
th:nth-child(5), td:nth-child(5) { width: 230px; }
th:nth-child(6), td:nth-child(6) { width: 120px; }
th:nth-child(7), td:nth-child(7) { width: 330px; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(37,99,235,0.035); }
td.mono, .mono { overflow-wrap: anywhere; }
.cellPrimary {
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subtleMono {
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}
.compactId {
  color: #111827;
  font-size: 12px;
  line-height: 1.35;
}
.linkButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 13px;
  background: #eaf0f7;
  color: #0f172a;
  text-decoration: none;
  font-weight: 950;
  white-space: nowrap;
}
.linkButton:hover { background: #dfe8f3; }
.rowActions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}
.rowActions button {
  white-space: nowrap;
  padding: 9px 12px;
  border-radius: 13px;
}
.emptyState {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 850;
}
@media (max-width: 920px) {
  table { min-width: 1040px; }
  th:nth-child(5), td:nth-child(5) { width: 190px; }
  th:nth-child(7), td:nth-child(7) { width: 300px; }
}

/* admin table/action upgrades */
.batchBar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 18px;
  background: rgba(248,250,252,.9);
}
.selectAllWrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  margin: 0;
}
.selectCol { width: 42px; }
.keySelect, #selectAllKeys { width: 18px; height: 18px; accent-color: #111827; }
.usageText { margin-top: 6px; font-size: 12px; color: #64748b; font-weight: 700; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(8px);
}
.modalCard {
  width: min(980px, 96vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: 28px;
  padding: 28px;
  background: #fff;
  box-shadow: 0 35px 90px rgba(2,6,23,.35);
}
.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.fullWidth { grid-column: 1 / -1; }
.tableWrap table { table-layout: fixed; min-width: 1180px; }
.tableWrap th:nth-child(1) { width: 44px; }
.tableWrap th:nth-child(2) { width: 115px; }
.tableWrap th:nth-child(3) { width: 220px; }
.tableWrap th:nth-child(4) { width: 260px; }
.tableWrap th:nth-child(5) { width: 260px; }
.tableWrap th:nth-child(6) { width: 230px; }
.tableWrap th:nth-child(7) { width: 120px; }
.tableWrap th:nth-child(8) { width: 360px; }
.rowActions { justify-content: flex-start; }
@media (max-width: 800px) {
  .modalCard { padding: 18px; border-radius: 20px; }
  .batchBar { align-items: stretch; }
}

.usageLimitSection {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(248,250,252,0.98), rgba(255,255,255,0.98));
}
.sectionTitleRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.sectionTitleRow h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}
