@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #09090f;
  --bg-2: #0f0f18;
  --surface: #14141f;
  --surface-2: #1c1c2a;
  --surface-3: #242436;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text: #f4f4f8;
  --text-muted: #8b8ba3;
  --primary: #7c3aed;
  --primary-2: #a855f7;
  --primary-glow: rgba(124, 58, 237, 0.35);
  --accent: #22d3ee;
  --danger: #f43f5e;
  --danger-hover: #e11d48;
  --success: #34d399;
  --warning: #fbbf24;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(124, 58, 237, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34, 211, 238, 0.08), transparent),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(124, 58, 237, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-name span {
  background: linear-gradient(90deg, #c4b5fd, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Login */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-2), var(--accent), transparent);
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .brand-icon {
  width: 56px;
  height: 56px;
  font-size: 18px;
  margin: 0 auto 16px;
  border-radius: 16px;
}

.login-brand .brand-name {
  font-size: 24px;
  justify-content: center;
}

.login-brand .brand-tag {
  margin-top: 6px;
  font-size: 13px;
}

.login-card label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.login-card input {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  margin-bottom: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-card button[type="submit"] {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #6d28d9);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.login-card button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.login-card button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(14, 14, 22, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-right { display: flex; gap: 10px; align-items: center; }

/* Layout */
.layout {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

.content-area {
  flex: 1;
  padding: 28px;
  min-width: 0;
}

/* Search with icon */
.search-box {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.search-icon {
  padding: 0 14px;
  color: var(--text-muted);
  font-size: 16px;
}

.search-box input {
  flex: 1;
  padding: 11px 14px 11px 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
}

.search-box input:focus { outline: none; }
.search-box:focus-within { border-color: var(--primary); }

.view-toggle {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-btn {
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s;
}

.view-btn.active {
  background: var(--primary);
  color: #fff;
}

.view-btn:hover:not(.active) {
  background: var(--surface-3);
  color: var(--text);
}

/* Bulk bar */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: var(--radius);
  animation: slideIn 0.2s ease;
}

.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Files container */
.files-container { min-height: 200px; }

/* Skeleton */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.skeleton-card {
  height: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* File grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.file-card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.file-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.card-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.card-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.card-preview {
  position: relative;
  height: 140px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-type {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  border-radius: 8px;
}

.type-img { background: rgba(34, 211, 238, 0.15); color: var(--accent); }
.type-vid { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.type-zip { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.type-pdf { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.type-txt { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.type-file { background: rgba(124, 58, 237, 0.15); color: #c4b5fd; }

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.card-preview:hover .card-overlay { opacity: 1; }

.card-action {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.card-action:hover { background: var(--primary); border-color: var(--primary); }

.card-info { padding: 12px 14px; }

.card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }

/* Detail panel */
.detail-panel {
  width: 360px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px;
  text-align: center;
}

.detail-content { padding: 20px; }

.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-2);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

.detail-close:hover { background: var(--surface-3); color: var(--text); }

.detail-preview {
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-img, .detail-vid {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  display: block;
}

.detail-file-icon {
  font-size: 32px;
  font-weight: 700;
  padding: 40px;
  border-radius: 16px;
}

.detail-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.detail-meta span {
  padding: 4px 8px;
  background: var(--surface-2);
  border-radius: 6px;
}

.detail-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.detail-link-box input {
  flex: 1;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 11px;
  font-family: ui-monospace, monospace;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.page-num {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.file-table tr.selected td { background: rgba(124, 58, 237, 0.06); }

.thumb.type-img, .thumb.type-vid, .thumb.type-zip,
.thumb.type-pdf, .thumb.type-txt, .thumb.type-file {
  font-size: 11px;
  font-weight: 700;
}

/* Upload queue */
.upload-queue {
  margin-bottom: 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.upload-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.upload-item:last-child { border-bottom: none; }

.upload-item-name {
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.upload-item-size {
  font-size: 11px;
  color: var(--text-muted);
}

.upload-progress {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  margin: 8px 0 4px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
  border-radius: 2px;
}

.upload-item-status {
  font-size: 11px;
  font-weight: 600;
}

.upload-item-status.uploading { color: var(--warning); }
.upload-item-status.success { color: var(--success); }
.upload-item-status.error { color: var(--danger); }

.modal-upload { max-width: 520px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

/* Main legacy - removed */

/* Hero strip */
.page-hero {
  margin-bottom: 24px;
}

.page-hero h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Toolbar card */
.toolbar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-pill {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--text);
  font-weight: 600;
}

.stat-pill.accent {
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.1);
  color: #c4b5fd;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6d28d9);
  color: #fff;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: var(--surface-3);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
}

.file-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.file-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.file-table tbody tr {
  transition: background 0.15s;
}

.file-table tbody tr:hover td {
  background: rgba(124, 58, 237, 0.04);
}

.file-table tr:last-child td { border-bottom: none; }

.col-check { width: 44px; }

.col-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.loading, .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 56px 24px !important;
  font-size: 14px;
}

.thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.thumb img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
}

.file-info .name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text);
}

.file-info .meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.link-cell { max-width: 300px; }

.cdn-link,
.download-link {
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
  text-decoration: none;
  font-family: ui-monospace, monospace;
  line-height: 1.5;
}

.cdn-link:hover,
.download-link:hover { color: #67e8f9; text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-ready { background: rgba(52, 211, 153, 0.12); color: var(--success); }
.badge-processing { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.badge-failed { background: rgba(244, 63, 94, 0.12); color: var(--danger); }

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s ease;
}

.modal-sm { max-width: 380px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.modal-content label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal-content input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  margin-bottom: 16px;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s;
  background: var(--surface-2);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.06);
}

.drop-zone-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.drop-zone .link {
  color: var(--primary-2);
  font-weight: 600;
}

.drop-zone .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

.upload-preview {
  margin-bottom: 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.upload-preview .file-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.upload-preview .file-item:last-child { border-bottom: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 14px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 300;
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.25s ease;
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--success);
}

.toast.error {
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--danger);
}

@keyframes slideIn {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 1024px) {
  .layout { flex-direction: column; }
  .detail-panel {
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: 70vh;
    border-left: none;
    border-top: 1px solid var(--border);
    z-index: 150;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  .detail-panel.open { transform: translateY(0); }
}

@media (max-width: 768px) {
  .header { padding: 12px 16px; }
  .content-area { padding: 16px; }
  .toolbar-card { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .file-table { font-size: 13px; }
  .file-table th, .file-table td { padding: 10px 12px; }
  .link-cell { max-width: 140px; }
  .brand-tag { display: none; }
  .detail-panel { height: 85vh; }
}
