/* ══════════════════════════════════════════════
   FANTASY ART ONLINE — UPLOAD PORTAL
   Model-themed dark luxury design
══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  --black:       #080810;
  --black-soft:  #0e0e18;
  --card:        #13131f;
  --card-raised: #18182a;
  --input-bg:    #1e1e2e;
  --border:      rgba(255,255,255,0.07);
  --border-glow: rgba(197,164,114,0.35);

  --gold:        #c5a472;
  --gold-light:  #e8d4aa;
  --gold-pale:   #f5ecda;
  --gold-dark:   #9a7a4a;
  --rose:        #c47a8a;

  --text:        #f0ece4;
  --text-soft:   #a09888;
  --text-dim:    #5a5660;

  --success:     #6ecca0;
  --danger:      #e07070;
  --warn:        #e0b060;

  --radius:      16px;
  --radius-sm:   10px;
  --radius-xs:   6px;

  --shadow-card: 0 8px 48px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(197,164,114,0.12);

  --font-display: 'Cormorant Garamond', serif;
  --font-ui:      'Montserrat', sans-serif;
}

/* ── Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--black);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-ui); }
input, textarea { font-family: var(--font-ui); }

/* ── Utility animations ─────────────────── */
@keyframes fadeUp   { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes shimmer  { 0%,100% { opacity:.4; } 50% { opacity:1; } }
@keyframes pulseGold {
  0%,100% { box-shadow: 0 0 0 0 rgba(197,164,114,0); }
  50%     { box-shadow: 0 0 0 6px rgba(197,164,114,0.15); }
}
@keyframes scanline {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(400%); }
}


/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Left panel — decorative */
.login-visual {
  position: relative;
  overflow: hidden;
  background: var(--black-soft);
}
.login-visual-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(197,164,114,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 20% 80%, rgba(196,122,138,0.1) 0%, transparent 60%),
    linear-gradient(160deg, #0d0d1a 0%, #080810 100%);
}
.login-visual-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
}
.visual-monogram {
  font-family: var(--font-display);
  font-size: 9rem;
  font-weight: 300;
  color: transparent;
  -webkit-text-stroke: 1px rgba(197,164,114,0.5);
  line-height: 1;
  letter-spacing: -0.02em;
  animation: shimmer 4s ease-in-out infinite;
  text-shadow: 0 0 60px rgba(197,164,114,0.15);
}
.visual-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.visual-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: shimmer 3s ease-in-out infinite;
}
.visual-line:nth-child(1) { width: 180px; animation-delay: 0s; }
.visual-line:nth-child(2) { width: 100px; animation-delay: 0.4s; }
.visual-line:nth-child(3) { width: 60px; animation-delay: 0.8s; }
.visual-tagline {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--gold-pale);
  letter-spacing: 0.15em;
  opacity: 0.6;
  text-align: center;
  padding: 0 2rem;
}
/* animated scan line */
.visual-scan {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(197,164,114,0.3), transparent);
  animation: scanline 8s linear infinite;
  pointer-events: none;
}
/* corner decorations */
.visual-corner {
  position: absolute;
  width: 32px; height: 32px;
  border-color: rgba(197,164,114,0.3);
  border-style: solid;
}
.vc-tl { top: 2rem; left: 2rem; border-width: 1px 0 0 1px; }
.vc-tr { top: 2rem; right: 2rem; border-width: 1px 1px 0 0; }
.vc-bl { bottom: 2rem; left: 2rem; border-width: 0 0 1px 1px; }
.vc-br { bottom: 2rem; right: 2rem; border-width: 0 1px 1px 0; }

/* Right panel — form */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: var(--black);
  position: relative;
}
.login-form-panel::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border-glow), transparent);
}
.login-form-inner {
  width: 100%;
  max-width: 380px;
  animation: fadeUp 0.6s ease both;
}

.brand-mark {
  text-align: center;
  margin-bottom: 3rem;
}
.brand-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border: 1px solid var(--gold-dark);
  border-radius: 50%;
  margin-bottom: 1.25rem;
  position: relative;
}
.brand-emblem::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(197,164,114,0.2);
  border-radius: 50%;
}
.brand-emblem-icon { font-size: 1.5rem; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
  display: block;
}
.brand-sub {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.form-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.form-section-label::before,
.form-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Fields ─────────────────────────────── */
.field-group { margin-bottom: 1.25rem; }
.field-group label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}
.field-group input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.85rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: border-color 0.25s, box-shadow 0.25s;
  -webkit-appearance: none;
  outline: none;
}
.field-group input:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(197,164,114,0.1), inset 0 0 0 1px rgba(197,164,114,0.05);
}
.field-group input::placeholder { color: var(--text-dim); letter-spacing: 0; }

.hint { font-size: 0.7rem; color: var(--text-dim); font-weight: 400; text-transform: none; letter-spacing: 0; }
.field-hint { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.4rem; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 3.25rem; }
.toggle-pw {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  font-size: 1rem; opacity: 0.3; padding: 0.25rem;
  transition: opacity 0.2s;
}
.toggle-pw:hover { opacity: 0.8; }

/* ── Buttons ─────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%;
  background: linear-gradient(135deg, #9a7a4a 0%, #c5a472 50%, #e8d4aa 100%);
  background-size: 200% 200%;
  color: #0d0d10;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-xs);
  padding: 1rem 1.5rem;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 0.75rem;
}
.btn-primary:hover { opacity: 0.92; box-shadow: 0 4px 24px rgba(197,164,114,0.3); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.99) translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.65rem 1.1rem;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--gold-dark); color: var(--gold-light); background: rgba(197,164,114,0.04); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: none; border: none;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-xs);
  transition: color 0.2s;
}
.btn-ghost:hover { color: var(--text); }

.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  transition: all 0.2s;
}
.btn-logout:hover { border-color: rgba(224,112,112,0.4); color: var(--danger); }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(224,112,112,0.12);
  border: 1px solid rgba(224,112,112,0.3);
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
}
.btn-danger:hover { background: rgba(224,112,112,0.2); }

.full-width { width: 100%; }
.btn-spinner { display: inline-block; animation: spin 0.8s linear infinite; font-style: normal; }

/* ── Error messages ─────────────────────── */
.error-msg {
  background: rgba(224,112,112,0.08);
  border: 1px solid rgba(224,112,112,0.25);
  color: #f09090;
  border-radius: var(--radius-xs);
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
  animation: fadeIn 0.2s ease;
}
.loading-msg { color: var(--text-dim); font-size: 0.85rem; padding: 2rem 0; text-align: center; letter-spacing: 0.05em; }
.empty-msg {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; }
.empty-text { font-size: 0.85rem; }

.login-footer { text-align: center; margin-top: 2.5rem; }
.login-footer p { font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.05em; }


/* ══════════════════════════════════════════
   SHARED HEADER
══════════════════════════════════════════ */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.75rem;
  height: 60px;
  background: rgba(8,8,16,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-brand { display: flex; align-items: center; gap: 0.75rem; }
.header-emblem {
  width: 30px; height: 30px;
  border: 1px solid var(--gold-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
.header-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--gold-light);
  letter-spacing: 0.06em;
}
.header-sub {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-left: 0.1rem;
}
.admin-pill {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #080810;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.header-user { display: flex; align-items: center; gap: 1rem; }
.welcome-name { font-size: 0.75rem; color: var(--text-soft); letter-spacing: 0.03em; }


/* ══════════════════════════════════════════
   UPLOAD PAGE
══════════════════════════════════════════ */
.upload-page { background: var(--black); }

.upload-main {
  max-width: 700px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}

.page-heading {
  margin-bottom: 2rem;
  animation: fadeUp 0.5s ease both;
}
.page-heading h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--gold-pale);
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}
.page-heading p {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Drop zone ─────────────────────────── */
.dropzone {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
  background: var(--card);
  overflow: hidden;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.5s 0.1s ease both;
}
.dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(197,164,114,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.dropzone-corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: rgba(197,164,114,0.2);
  border-style: solid;
  transition: border-color 0.3s;
}
.dc-tl { top: 1rem; left: 1rem; border-width: 1px 0 0 1px; }
.dc-tr { top: 1rem; right: 1rem; border-width: 1px 1px 0 0; }
.dc-bl { bottom: 1rem; left: 1rem; border-width: 0 0 1px 1px; }
.dc-br { bottom: 1rem; right: 1rem; border-width: 0 1px 1px 0; }

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--gold-dark);
  background: rgba(197,164,114,0.03);
}
.dropzone:hover .dropzone-corner,
.dropzone.drag-over .dropzone-corner {
  border-color: rgba(197,164,114,0.5);
}
.file-input-hidden {
  position: absolute; inset: 0; opacity: 0;
  cursor: pointer; width: 100%; height: 100%;
}

.dz-icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px;
  border: 1px solid rgba(197,164,114,0.2);
  border-radius: 50%;
  margin-bottom: 1.25rem;
  font-size: 2rem;
  background: rgba(197,164,114,0.04);
  transition: all 0.3s;
}
.dropzone:hover .dz-icon-wrap { border-color: rgba(197,164,114,0.4); transform: scale(1.05); }
.dz-primary {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.dz-secondary { font-size: 0.8rem; color: var(--text-soft); margin-bottom: 0.75rem; }
.dz-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.dz-chip {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.2rem 0.6rem;
}

/* ── Queue ─────────────────────────────── */
.queue-section { margin-bottom: 1.5rem; animation: fadeUp 0.3s ease both; }
.queue-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 0.75rem;
}
.queue-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  display: flex; align-items: center; gap: 0.6rem;
}
.badge {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #080810;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
.queue-actions { display: flex; gap: 0.5rem; }

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.file-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  animation: fadeUp 0.25s ease both;
  transition: border-color 0.2s;
}
.file-card:hover { border-color: rgba(197,164,114,0.2); }
.file-thumb-preview {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--input-bg);
}
.file-thumb-placeholder {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  background: var(--input-bg);
}
.file-card-body { padding: 0.5rem 0.6rem; }
.file-card-name {
  font-size: 0.72rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.file-card-size { font-size: 0.65rem; color: var(--text-dim); }

.file-card-status {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  border-radius: var(--radius-sm);
  transition: opacity 0.3s;
  pointer-events: none;
}
.file-card-status.uploading { background: rgba(8,8,16,0.6); animation: shimmer 1s infinite; }
.file-card-status.done { background: rgba(110,204,160,0.15); }
.file-card-status.error { background: rgba(224,112,112,0.15); }
.file-card-status.pending { opacity: 0; }

.file-remove-btn {
  position: absolute; top: 0.4rem; right: 0.4rem;
  width: 22px; height: 22px;
  background: rgba(8,8,16,0.75);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: var(--text-soft);
  font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  opacity: 0;
}
.file-card:hover .file-remove-btn { opacity: 1; }
.file-remove-btn:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ── Overall Progress ───────────────────── */
.overall-progress {
  margin-bottom: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  animation: fadeIn 0.2s ease;
}
.progress-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.9rem;
}
.progress-label { font-size: 0.75rem; color: var(--text-soft); letter-spacing: 0.05em; }
.progress-pct { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold); }
.progress-bar-track {
  height: 3px;
  background: var(--input-bg);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}
.progress-files { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.6rem; letter-spacing: 0.05em; }

/* ── Results ─────────────────────────────── */
.results-section { margin-bottom: 1.5rem; animation: fadeUp 0.3s ease both; }
.result-banner {
  display: flex; align-items: flex-start; gap: 1rem;
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.result-banner.success {
  background: rgba(110,204,160,0.07);
  border: 1px solid rgba(110,204,160,0.25);
}
.result-banner.error {
  background: rgba(224,112,112,0.07);
  border: 1px solid rgba(224,112,112,0.25);
}
.result-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.1rem; }
.result-text h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.result-text p { font-size: 0.8rem; color: var(--text-soft); }
.result-banner.success .result-text h4 { color: var(--success); }
.result-banner.error .result-text h4 { color: var(--danger); }

/* ── History ─────────────────────────────── */
.history-section { margin-top: 3rem; animation: fadeUp 0.5s 0.2s ease both; }
.section-heading {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-heading h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-soft);
  white-space: nowrap;
}
.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
}
.history-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.history-card:hover { border-color: rgba(197,164,114,0.2); transform: translateY(-2px); }
.history-thumb {
  width: 100%; aspect-ratio: 1;
  background: var(--input-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  position: relative;
  overflow: hidden;
}
.history-thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.history-card-body { padding: 0.45rem 0.55rem; }
.history-card-name { font-size: 0.65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-soft); }
.history-card-meta { font-size: 0.6rem; color: var(--text-dim); margin-top: 0.15rem; }


/* ══════════════════════════════════════════
   ADMIN PAGE
══════════════════════════════════════════ */
.admin-page { background: var(--black); }
.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  animation: fadeUp 0.4s ease both;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
  opacity: 0.5;
}
.stat-card:hover { border-color: rgba(197,164,114,0.2); }
.stat-val {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
  letter-spacing: 0.02em;
}
.stat-lbl {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.tab {
  background: none; border: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.25rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab:hover:not(.active) { color: var(--text-soft); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.3s ease both; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
}

/* User cards */
.users-list { display: flex; flex-direction: column; gap: 1px; }
.users-list-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.user-row {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  flex-wrap: wrap;
}
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: rgba(255,255,255,0.02); }

.user-avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: #080810;
}
.user-info { flex: 1; min-width: 140px; }
.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.user-username {
  font-size: 0.72rem;
  color: var(--gold-dark);
  letter-spacing: 0.05em;
}
.user-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}
.user-stats { text-align: right; min-width: 90px; }
.user-upload-count { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.user-upload-size { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.15rem; }

.user-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.btn-edit, .btn-del {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-edit:hover { border-color: var(--gold-dark); color: var(--gold); }
.btn-del:hover { border-color: rgba(224,112,112,0.4); color: var(--danger); }

/* Upload rows */
.uploads-list { display: flex; flex-direction: column; }
.uploads-list-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.upload-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  transition: background 0.15s;
  flex-wrap: wrap;
}
.upload-row:last-child { border-bottom: none; }
.upload-row:hover { background: rgba(255,255,255,0.02); }
.upload-icon { font-size: 1.1rem; flex-shrink: 0; }
.upload-name { flex: 1; min-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.upload-client {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold-dark);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.upload-meta { font-size: 0.7rem; color: var(--text-dim); flex-shrink: 0; }

/* Recent uploads in stats */
.recent-uploads { margin-top: 0.75rem; }

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal-overlay[hidden] { display: none; }

.modal-card {
  background: var(--card);
  border: 1px solid rgba(197,164,114,0.15);
  border-radius: 20px;
  width: 100%; max-width: 460px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: fadeUp 0.25s ease both;
  position: relative;
}
.modal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197,164,114,0.4), transparent);
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--gold-pale);
}
.modal-close {
  background: none; border: 1px solid var(--border);
  color: var(--text-dim);
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { border-color: var(--text-soft); color: var(--text); }

.modal-actions {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.confirm-text {
  color: var(--text-soft);
  font-size: 0.875rem;
  line-height: 1.65;
}
.confirm-name { color: var(--gold-light); font-weight: 600; }

/* ── Mobile login layout ─────────────────── */
@media (max-width: 768px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form-panel::before { display: none; }
  .login-form-panel { padding: 2.5rem 1.5rem; }
  .visual-monogram { font-size: 7rem; }

  .stats-row { gap: 0.6rem; }
  .stat-val { font-size: 1.6rem; }

  .user-row { gap: 0.75rem; }
  .upload-client, .upload-meta { flex-basis: 100%; }
}

@media (max-width: 480px) {
  .upload-main { padding: 1.5rem 1rem 4rem; }
  .page-heading h2 { font-size: 1.75rem; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .history-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .queue-header { flex-direction: column; align-items: flex-start; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .stat-val { font-size: 1.3rem; }
  .stat-lbl { font-size: 0.55rem; }
  .admin-main { padding: 1.5rem 0.75rem 4rem; }
}
