:root {
  /* Surfaces — lavender canvas, white cards (ref: SquadStack mock) */
  --bg:           #F1ECFB;
  --surface:      #ffffff;
  --surface-2:    #FAF8FE;
  --surface-3:    #FCFBFE;
  --border:       #E6E1F5;
  --border-2:     #D9CEF5;
  --hairline:     #F0ECF9;

  /* Ink */
  --text:         #191132;
  --text-soft:    #5A5172;
  --muted:        #8B84A1;
  --faint:        #B6ABD8;

  /* Brand — violet primary */
  --primary:      #6F39F5;
  --primary-hover:#5A2DDB;
  --primary-soft: #EFE9FF;

  --danger:       #C0392B;
  --danger-hover: #A52F22;
  --danger-soft:  #FDECEC;
  --danger-border:#F1D6D2;

  --warn-bg:      #F7E2D4;
  --warn-fg:      #9A4A1E;

  --mono:         ui-monospace,SFMono-Regular,Menlo,'Cascadia Code',monospace;
  --sans:         'Albert Sans',-apple-system,BlinkMacSystemFont,system-ui,sans-serif;
  --radius:       12px;
  --radius-sm:    8px;
  --pill:         999px;
  --shadow:       0 1px 2px rgba(25,17,50,.06);
  --shadow-pop:   0 8px 20px rgba(111,57,245,.24);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #E1D5FF; color: var(--text); }

h1 { font-size: 1.5rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: 1.375rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }

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

@keyframes ss-stripes { from { background-position: 0 0; } to { background-position: 28px 0; } }

/* ── Logo mark ───────────────────────────────────────── */
.logomark { display: block; flex-shrink: 0; }

/* ── Buttons ─────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  padding: 9px 20px;
  color: #fff;
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: var(--pill);
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: background .2s, border-color .2s, color .2s, transform .12s;
  white-space: nowrap;
}
.btn, a.btn { text-decoration: none; }
.btn:hover, a.btn:hover { text-decoration: none; }
button:hover    { background: var(--primary-hover); }
button:active   { transform: scale(.97); }
button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Outline / neutral button */
button.secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}
button.secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--surface); }

/* Square-cornered variant (copy / open / set-expiry) */
button.sq, .btn.sq { border-radius: var(--radius-sm); box-shadow: none; }

/* Danger */
button.danger {
  color: var(--danger);
  background: var(--surface);
  border-color: var(--danger-border);
  box-shadow: none;
}
button.danger:hover { background: var(--danger-soft); border-color: #E8B5AE; color: var(--danger); }

button.danger-solid {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
  box-shadow: none;
}
button.danger-solid:hover { background: var(--danger-hover); }

/* ── Inputs ──────────────────────────────────────────── */
label {
  display: block;
  font-size: .6875rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

input {
  font: inherit;
  width: 100%;
  padding: 10px 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
input:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }
input::placeholder  { color: var(--muted); }
input[type="datetime-local"] { width: auto; font-size: .84375rem; font-family: var(--sans); padding: 9px 12px; }

/* ── Auth pages ──────────────────────────────────────── */
body.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.auth-logo {
  width: 60px; height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(111,57,245,.18);
  user-select: none;
}

.auth-app-name {
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: -8px;
}

.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.card h1 { margin-bottom: 8px; }
.card > p {
  color: var(--text-soft);
  font-size: .875rem;
  margin-bottom: 22px;
}
.card form { display: grid; gap: 18px; }
.card form button { width: 100%; padding: 12px; font-size: .875rem; }
.card .back {
  text-align: center;
  margin-top: 18px;
  font-size: .8125rem;
  color: var(--muted);
}
.h-captcha { display: flex; justify-content: center; }

/* ── App shell ───────────────────────────────────────── */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 14px 32px;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(140%) blur(20px);
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -.02em;
  margin-right: auto;
  color: var(--text);
}

.topbar a {
  font-size: .875rem;
  font-weight: 600;
  color: var(--primary);
  transition: color .2s;
}
.topbar a:hover { color: var(--primary-hover); text-decoration: none; }

.topbar .meta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .875rem;
  color: var(--text-soft);
  font-weight: 500;
}
.topbar .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--pill);
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar form { display: inline; }
.topbar form button { padding: 8px 18px; font-size: .8125rem; }

/* ── Main content ────────────────────────────────────── */
main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 44px 32px 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Card section */
main > section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 32px 18px;
}
.section-head .eyebrow {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary);
}
.section-head h2 { margin: 0; }
.section-head .count {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--pill);
  padding: 3px 11px;
}

/* ── Upload dropzone ─────────────────────────────────── */
.upload-form {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 0 32px 28px;
}
.upload-zone {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px dashed var(--border-2);
  background: var(--surface-3);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover,
.upload-zone:focus-within { border-color: var(--primary); background: #F3EEFE; }

.upload-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
}
.upload-ic svg { width: 22px; height: 22px; }
.upload-zone .title { font-size: .9375rem; font-weight: 700; color: var(--text); }
.upload-zone .hint  { font-size: .8125rem; color: var(--text-soft); margin-top: 1px; }
.upload-zone .hint .em { color: var(--primary); font-weight: 600; }

/* hidden native file input; whole zone is the label */
.upload-zone input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
.upload-zone .filename {
  font-size: .875rem;
  font-weight: 600;
  color: var(--primary);
  font-family: var(--mono);
  word-break: break-all;
}
.upload-zone.has-file .fz-idle { display: none; }
.upload-zone:not(.has-file) .fz-name { display: none; }

.upload-form > button { flex-shrink: 0; }

/* ── File list (accordion) ───────────────────────────── */
.file-list { display: block; }

.file-card { border-top: 1px solid var(--hairline); }
.file-card > summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  cursor: pointer;
  list-style: none;
  transition: background .16s;
}
.file-card > summary::-webkit-details-marker { display: none; }
.file-card > summary:hover { background: var(--surface-2); }
.file-card[open] > summary { background: var(--surface-2); }

.file-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}

.file-meta { flex: 1; min-width: 0; }
.file-meta .name {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-meta .host {
  font-size: .78125rem;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.file-card > summary .copy-share {
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: .78125rem;
}

.file-views {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: .84375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 74px;
  justify-content: flex-end;
}

.file-status { flex-shrink: 0; width: 96px; display: flex; justify-content: center; }

.chev {
  flex-shrink: 0;
  color: var(--faint);
  display: flex;
  transition: transform .24s cubic-bezier(.2,.8,.2,1);
}
.file-card[open] > summary .chev { transform: rotate(180deg); }

/* expanded panel */
.file-panel {
  background: var(--surface-2);
  border-top: 1px solid var(--hairline);
  padding: 22px 32px 24px;
}

.field-label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.url-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 22px;
}
.url-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.url-row .btn, .url-row button { height: 40px; }

.detail-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px 40px;
}
.detail-grid .val { font-size: .875rem; font-weight: 600; color: var(--text); }
.detail-grid .expiry-set { margin-left: auto; display: flex; align-items: flex-end; gap: 10px; }
.detail-grid .expiry-set form { display: flex; align-items: flex-end; gap: 10px; }
.detail-grid .expiry-set button { height: 40px; }

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}
.panel-actions .spacer { margin-left: auto; }

/* ── Pills ───────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  font-size: .75rem;
  font-weight: 600;
  border-radius: var(--pill);
}
.pill .dot { width: 7px; height: 7px; border-radius: var(--pill); display: inline-block; }
.pill.on  { color: var(--primary); background: var(--primary-soft); }
.pill.on .dot  { background: var(--primary); }
.pill.off { color: var(--muted); background: var(--bg); }
.pill.off .dot { background: var(--faint); }
.pill.expiry-some { color: var(--primary); background: var(--primary-soft); }
.pill.expiry-none { color: var(--muted); background: var(--bg); }

.muted { color: var(--muted); }

/* ── Empty state ─────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 56px 32px 64px;
  color: var(--muted);
}
.empty .empty-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--faint);
}
.empty .empty-title { font-size: 1rem; font-weight: 700; color: var(--text); }

/* ── Admin tables ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 13px 18px 11px;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  font-size: .875rem;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
td.mono { font-family: var(--mono); font-size: .8125rem; color: var(--text); }
td.mono a { color: var(--muted); font-size: .78125rem; word-break: break-all; }
td.mono a:hover { color: var(--primary); }
td.num { font-family: var(--mono); font-size: .8125rem; font-variant-numeric: tabular-nums; color: var(--text-soft); }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions form { display: flex; gap: 8px; align-items: center; }
.row-actions button { padding: 7px 15px; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar { padding: 12px 18px; }
  main { padding: 28px 16px 56px; }
  .section-head { padding: 20px 18px 14px; }
  .upload-zone { margin: 0 18px 22px; padding: 28px 18px; }
  .file-card > summary { padding: 14px 18px; gap: 12px; }
  .file-views { width: auto; }
  .file-status { width: auto; }
  .file-panel { padding: 18px; }
  .url-row { flex-wrap: wrap; }
  .detail-grid .expiry-set { margin-left: 0; }
  .card { padding: 24px; }
  th, td { padding: 10px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
