:root {
  --canvas: #f8fafc;
  --panel: #ffffff;
  --panel-nested: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-ghost: #94a3b8;
  --brand: #d97706;
  --brand-glow: rgba(217, 119, 6, 0.08);
  --brand-solid: #b45309;
  --brand-light: #fef3c7;
  --border-subtle: #e2e8f0;
  --border-active: #cbd5e1;
  --success: #059669;
  --success-bg: #d1fae5;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --radius-pill: 9999px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font); }

body {
  background: var(--canvas);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(#e2e8f0 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  z-index: -1;
  opacity: 0.7;
  pointer-events: none;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ===== Top Bar ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.2s;
  text-decoration: none;
}

.icon-link:hover {
  background: var(--panel-nested);
  color: var(--brand);
}

/* ===== Header ===== */
.app-header {
  text-align: center;
  margin-bottom: 48px;
  margin-top: 20px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border-subtle);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-solid);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.app-header h1 {
  font-size: 42px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.app-header p {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 16px;
}

.header {
  text-align: center;
  padding: 24px 0;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.header p {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 6px;
}

/* ===== Auth Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

/* ===== Auth Panel (standalone page) ===== */
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 400px;
  margin: 60px auto 0;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-icon-shield {
  width: 64px;
  height: 64px;
  background: var(--brand-glow);
  color: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

/* ===== Form Elements ===== */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.input-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--canvas);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.input-group input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--text-main);
  color: #fff;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover { background: #1e293b; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  background: var(--panel);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-active);
  color: var(--text-main);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid transparent;
}

.btn-danger:hover { background: var(--error); color: white; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-full { width: 100%; }

/* ===== Custom Checkbox ===== */
.admin-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.admin-checkbox input[type="checkbox"],
.toolbar-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-active);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toolbar-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.admin-checkbox input[type="checkbox"]:hover,
.toolbar-checkbox input[type="checkbox"]:hover {
  border-color: var(--brand);
}

.admin-checkbox input[type="checkbox"]:checked,
.toolbar-checkbox input[type="checkbox"]:checked {
  background: var(--brand);
  border-color: var(--brand);
}

.admin-checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.toolbar-checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 1px;
  width: 5px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.toolbar-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* ===== Tabs (centered pill style) ===== */
.tab-container {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.tabs-wrapper {
  background: var(--panel-nested);
  padding: 4px;
  border-radius: var(--radius-md);
  display: flex;
  width: 320px;
  position: relative;
}

.tabs-wrapper .tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 1;
  transition: color 0.2s;
  border-radius: var(--radius-sm);
  font-family: var(--font);
}

.tabs-wrapper .tab-btn.active {
  color: var(--text-main);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Upload Hub ===== */
.upload-hub {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.upload-hub:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--brand-glow);
  transform: translateY(-2px);
}

.upload-hub.dragover {
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand-light), var(--panel));
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--brand-glow);
}

.upload-illustration {
  width: 80px;
  height: 80px;
  background: var(--panel-nested);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
  transition: all 0.3s ease;
}

.upload-hub:hover .upload-illustration {
  background: var(--brand-glow);
  transform: scale(1.05);
}

.upload-illustration svg {
  width: 32px;
  height: 32px;
  color: var(--brand);
}

.upload-hub h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.upload-hub p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

.upload-hub input { display: none; }

/* ===== Split Result Layout ===== */
.layout-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  margin-top: 32px;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: slideUp 0.35s ease;
}

.preview-pane {
  background: var(--panel-nested);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border: 1px solid var(--border-subtle);
}

.preview-pane img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s;
}

.preview-pane img:hover { transform: scale(1.02); }

.info-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  background: rgba(5, 150, 105, 0.08);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  width: max-content;
  margin-bottom: 16px;
}

.meta-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  word-break: break-all;
}

.meta-size {
  font-size: 13px;
  color: var(--text-ghost);
  margin-bottom: 24px;
}

/* ===== Code Fields ===== */
.code-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.code-field {
  background: var(--panel-nested);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  cursor: pointer;
}

.code-field:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.field-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-ghost);
  text-transform: uppercase;
  width: 80px;
  flex-shrink: 0;
}

.field-string {
  font-size: 13px;
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding: 0 12px;
}

.copy-trigger {
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  flex-shrink: 0;
  font-family: var(--font);
}

.copy-trigger:hover { background: var(--brand-glow); }

/* ===== Ticket Box (Extract Code) ===== */
.ticket-box {
  background: linear-gradient(135deg, var(--brand-light), #fff7ed);
  border: 1px dashed rgba(217, 119, 6, 0.3);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  margin-bottom: 24px;
}

.ticket-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-solid);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.ticket-code {
  font-size: 48px;
  font-weight: 900;
  color: var(--brand-solid);
  letter-spacing: 4px;
  font-family: "SF Mono", "Fira Code", monospace;
}

/* ===== Progress ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--panel-nested);
  border-radius: 3px;
  margin-top: 16px;
  overflow: hidden;
  display: none;
}

.progress-bar.active { display: block; }

.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-solid));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  display: none;
}

.progress-text.active { display: block; }

/* ===== Result Card (legacy, kept for compatibility) ===== */
.result-card {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
  display: none;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.35s ease;
}

.result-card.active { display: block; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card .success-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.result-card .file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--panel-nested);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.result-card .file-info .name {
  font-weight: 600;
  font-size: 14px;
  word-break: break-all;
}

.result-card .file-info .size {
  font-size: 13px;
  color: var(--text-ghost);
}

/* ===== Preview Container (legacy) ===== */
.preview-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.result-card .preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.2s;
}

.result-card .preview:hover { transform: scale(1.01); }

/* ===== Preview Modal ===== */
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
}

.preview-modal.active { opacity: 1; pointer-events: all; }

.preview-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.preview-modal.active img { transform: scale(1); }

/* ===== Link List (legacy) ===== */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel-nested);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  user-select: all;
  border: 1px solid transparent;
}

.link-row:hover {
  background: var(--brand-light);
  border-color: var(--brand-glow);
}

.link-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-ghost);
  min-width: 60px;
  text-transform: uppercase;
}

.link-value {
  font-size: 13px;
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--text-main);
  word-break: break-all;
  line-height: 1.4;
}

/* ===== Inline Link ===== */
.inline-link {
  color: var(--brand);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s;
}

.inline-link:hover { color: var(--brand-solid); text-decoration: underline; }

/* ===== Extract Code Display (legacy) ===== */
.code-display {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--brand-light), var(--panel-nested));
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid rgba(217, 119, 6, 0.12);
}

.code-display .label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.code-display .code {
  font-size: 32px;
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", monospace;
  letter-spacing: 4px;
  color: var(--brand);
  cursor: pointer;
  transition: color 0.2s;
  user-select: all;
}

.code-display .code:hover { color: var(--brand-solid); }

/* ===== Extract Hub ===== */
.extract-hub {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.extract-section {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow-md);
}

.extract-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.extract-form {
  display: flex;
  gap: 10px;
  max-width: 400px;
  margin: 24px auto 0;
}

.extract-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 700;
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.extract-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.extract-result {
  margin-top: 24px;
  display: none;
  animation: slideUp 0.3s ease;
}

.extract-result.active { display: block; }

.extract-file-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--panel-nested);
  border-radius: var(--radius-md);
}

.extract-file-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.extract-file-info h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  word-break: break-all;
}

.extract-file-info p {
  font-size: 12px;
  color: var(--text-ghost);
}

.extract-download-btn {
  flex-shrink: 0;
  width: auto !important;
  padding: 8px 20px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 24px;
  background: var(--text-main);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-ghost);
  font-size: 13px;
}

/* ===== Gear Button ===== */
.gear-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 50;
  color: var(--text-muted);
}

.gear-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 4px 14px var(--brand-glow);
  transform: rotate(30deg);
}

.gear-btn:active { transform: scale(0.92); }

/* ===== Admin Toolbar ===== */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.admin-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-toolbar .btn-danger {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.admin-count {
  font-size: 13px;
  color: var(--text-ghost);
  font-weight: 500;
}

/* ===== Admin Search ===== */
.admin-search {
  position: relative;
  margin-bottom: 16px;
}

.admin-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--panel);
}

.admin-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.admin-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-ghost);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

/* ===== Admin Image Grid ===== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  min-height: 120px;
}

.admin-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s ease;
}

.admin-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--border-active);
}

.admin-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--panel-nested);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.admin-thumb:hover { transform: scale(1.05); }

.admin-card-info {
  padding: 10px 12px 12px;
}

.admin-card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-card-meta {
  font-size: 11px;
  color: var(--text-ghost);
  margin-top: 2px;
}

/* Frosted glass overlay on admin cards */
.admin-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  border-radius: var(--radius-md);
}

.admin-card:hover .admin-card-overlay {
  opacity: 1;
  pointer-events: all;
}

.overlay-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.overlay-btn:hover {
  transform: scale(1.12);
  box-shadow: var(--shadow-md);
}

.overlay-btn.del:hover { background: var(--error); color: white; }

/* ===== Admin File Cards (same grid as images) ===== */
.admin-file-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s ease;
}

.admin-file-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--border-active);
}

.admin-file-icon {
  width: 100%;
  height: 140px;
  background: var(--panel-nested);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.admin-file-icon svg {
  width: 40px;
  height: 40px;
  color: var(--text-ghost);
}

.admin-file-card .admin-card-overlay { border-radius: 0; }

.admin-file-code {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--brand-solid);
  letter-spacing: 1px;
}

.admin-file-card-info {
  padding: 10px 12px 12px;
}

.admin-file-card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-file-card-meta {
  font-size: 11px;
  color: var(--text-ghost);
  margin-top: 2px;
}

/* ===== Admin Tags ===== */
.admin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.admin-tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--brand-light);
  color: var(--brand-solid);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
}

.admin-tag:hover { background: var(--brand); color: white; }

.admin-dir {
  font-size: 11px;
  color: var(--text-ghost);
  margin-top: 2px;
}

/* ===== Admin Empty State ===== */
.admin-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-ghost);
  font-size: 14px;
  background: var(--panel);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

.pagination .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .container { padding: 24px 16px; }
  .app-header h1 { font-size: 28px; }
  .layout-split { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .tabs-wrapper { width: 280px; }
  .extract-form { flex-direction: column; }
}

@media (max-width: 640px) {
  .container { padding: 16px 12px; }
  .header h1 { font-size: 22px; }
  .upload-hub { padding: 40px 20px; }
}
