/* ─── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0b;
  --bg-elevated: #141416;
  --bg-surface: #1a1a1f;
  --bg-hover: #222228;
  --border: #2a2a30;
  --border-light: #333339;
  --text: #e8e8ed;
  --text-secondary: #8e8e96;
  --text-muted: #5c5c64;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-bg: rgba(99, 102, 241, 0.1);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.1);
  --green-border: rgba(34, 197, 94, 0.25);
  --yellow: #eab308;
  --yellow-bg: rgba(234, 179, 8, 0.1);
  --yellow-border: rgba(234, 179, 8, 0.25);
  --orange: #f97316;
  --orange-bg: rgba(249, 115, 22, 0.1);
  --orange-border: rgba(249, 115, 22, 0.25);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
  --transition: 150ms ease;
}

/* ─── Light Theme ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-surface: #eeeef0;
  --bg-hover: #e4e4e8;
  --border: #d4d4d8;
  --border-light: #c4c4ca;
  --text: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
}

[data-theme="light"] .media-panel {
  background: #e4e4e8;
}

[data-theme="light"] .media-filename {
  background: rgba(0,0,0,0.05);
  color: var(--text-secondary);
}

[data-theme="light"] .modal-overlay {
  background: rgba(0,0,0,0.3);
}

html {
  font-size: 15px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

/* ─── Header ──────────────────────────────────────────────── */
.header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.logo:hover {
  color: var(--text);
}

.logo svg {
  color: var(--accent);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.creative-counter {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 60px;
  text-align: center;
}

/* ─── Main Layout ─────────────────────────────────────────── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ─── Section Header ──────────────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 4px;
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* ─── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb svg {
  opacity: 0.4;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-ghost:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

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

.btn-danger:hover {
  opacity: 0.9;
}

.btn-danger-outline {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger-outline:hover {
  background: var(--red-bg);
}

.btn-approve {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  flex: 1;
}

.btn-approve:hover {
  background: rgba(34, 197, 94, 0.2);
}

.btn-request-revision {
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid var(--orange-border);
  flex: 1;
}

.btn-request-revision:hover {
  background: rgba(249, 115, 22, 0.2);
}

.btn-reset {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  width: 100%;
}

.btn-reset:hover {
  background: var(--bg-hover);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--accent-hover);
}

/* ─── Progress Bar ────────────────────────────────────────── */
.approval-progress {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.progress-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-approved { background: var(--green); }
.dot-pending { background: var(--yellow); }
.dot-revision { background: var(--orange); }

.progress-bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ─── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 24px;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-content svg {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.upload-content h3 {
  font-weight: 600;
  font-size: 1.05rem;
}

.upload-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.upload-hint {
  color: var(--text-muted) !important;
  font-size: 0.8rem !important;
  margin-top: 4px;
}

.upload-progress {
  max-width: 400px;
  margin: 0 auto;
}

.upload-progress-bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.upload-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s ease;
}

#upload-status {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ─── Projects Grid ───────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
}

.project-card:hover {
  border-color: var(--border-light);
  background: var(--bg-surface);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 8px;
}

.project-card-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.client-badge {
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

.project-card-stats {
  margin-bottom: 12px;
}

.mini-progress {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.mini-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.project-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-dots {
  display: flex;
  gap: 4px;
}

.mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* ─── Creatives Grid ──────────────────────────────────────── */
.creatives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.creative-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
  text-decoration: none;
  display: block;
}

.creative-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.creative-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
}

.creative-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.creative-card:hover .creative-thumb img {
  transform: scale(1.05);
}

.thumb-video {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-badge {
  position: absolute;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  backdrop-filter: blur(4px);
}

.thumb-pdf {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}

.creative-info {
  padding: 12px;
}

.creative-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.creative-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
}

.status-approved {
  background: var(--green-bg);
  color: var(--green);
}

.status-pending {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.status-revision {
  background: var(--orange-bg);
  color: var(--orange);
}

.comment-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.no-creatives {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 40px;
  grid-column: 1 / -1;
}

/* ─── Review Layout ───────────────────────────────────────── */
.review-layout {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.media-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  min-width: 0;
}

.media-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
}

.media-content {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}

.media-content.media-pdf {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

video.media-content {
  max-height: calc(100vh - 130px);
}

img.media-content {
  object-fit: contain;
}

.media-filename {
  padding: 8px 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(0,0,0,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Review Sidebar ──────────────────────────────────────── */
.review-sidebar {
  width: 380px;
  min-width: 380px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.status-banner.status-approved {
  background: var(--green-bg);
  color: var(--green);
  border-bottom: 1px solid var(--green-border);
}

.status-banner.status-pending {
  background: var(--yellow-bg);
  color: var(--yellow);
  border-bottom: 1px solid var(--yellow-border);
}

.status-banner.status-revision {
  background: var(--orange-bg);
  color: var(--orange);
  border-bottom: 1px solid var(--orange-border);
}

.sidebar-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ─── Form Inputs ─────────────────────────────────────────── */
.input-field {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.textarea {
  resize: vertical;
  min-height: 60px;
}

/* ─── Approval Actions ────────────────────────────────────── */
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.approval-actions .btn {
  justify-content: center;
}

/* ─── Comments ────────────────────────────────────────────── */
.comments-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: none;
}

.comment-count-badge {
  background: var(--bg-surface);
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 100px;
  font-weight: 500;
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
  max-height: 300px;
}

.comment {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 0.82rem;
  font-weight: 600;
}

.comment-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.comment-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--transition);
}

.comment:hover .comment-delete {
  opacity: 1;
}

.comment-delete:hover {
  color: var(--red);
}

.comment-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.no-comments {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px 0;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.comment-form .btn {
  align-self: flex-end;
}

.comment-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 6px 0;
}

.comment-identity .link-btn {
  font-size: 0.78rem;
}

.identity-actions {
  display: flex;
  gap: 8px;
}

/* ─── Auth Tabs ───────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.auth-tab:not(:last-child) {
  border-right: 1px solid var(--border);
}

.auth-tab.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.auth-tab:hover:not(.active) {
  background: var(--bg-hover);
}

.auth-panel {
  min-height: 120px;
}

.auth-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
  line-height: 1.5;
}

.magic-link-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px 0;
  color: var(--green);
}

.magic-link-sent svg {
  opacity: 0.8;
}

.magic-link-sent p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-hint {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
  margin-top: 4px;
}

/* ─── Client Name Suggestions ─────────────────────────────── */
.suggestions-wrapper {
  position: relative;
}

.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 150px;
  overflow-y: auto;
  z-index: 10;
}

.suggestion-item {
  padding: 8px 12px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text);
}

.suggestion-item:hover {
  background: var(--bg-hover);
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.close-btn:hover {
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.modal-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ─── Empty State ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  gap: 16px;
}

.empty-state svg {
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h2 {
  font-size: 1.3rem;
  font-weight: 600;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 400px;
}

/* ─── Loading ─────────────────────────────────────────────── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 56px);
  gap: 16px;
}

.loading p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 2000;
  animation: toast-in 0.2s ease;
}

.toast-success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.toast-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .review-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .media-panel {
    max-height: 50vh;
  }

  .media-container {
    padding: 10px;
  }

  .review-sidebar {
    width: 100%;
    min-width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .comments-list {
    max-height: 200px;
  }

  .section-header {
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .creatives-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .nav-controls {
    gap: 4px;
  }

  .btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 20px 16px;
  }

  .creatives-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .upload-zone {
    padding: 24px 16px;
  }
}

/* ─── Settings Panel ─────────────────────────────────────── */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.settings-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logo-preview-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.logo-preview-default {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.logo-actions {
  display: flex;
  gap: 8px;
}

.theme-toggle {
  display: flex;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.theme-option {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.theme-option:not(:last-child) {
  border-right: 1px solid var(--border);
}

.theme-option.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.theme-option:hover:not(.active) {
  background: var(--bg-hover);
}

.color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

.color-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-custom-row input[type="color"] {
  width: 36px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-surface);
  padding: 2px;
}

.color-custom-row span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Custom logo in header */
.logo-img {
  height: 40px;
  width: 150px;
  object-fit: contain;
  object-position: left;
  border-radius: 4px;
}

/* ─── Archive / Project Tabs ─────────────────────────────── */
.project-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.project-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.project-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.project-tab:hover:not(.active) {
  color: var(--text-secondary);
}

.project-tab .tab-count {
  font-size: 0.75rem;
  background: var(--bg-surface);
  padding: 1px 6px;
  border-radius: 100px;
  margin-left: 4px;
}

.btn-archive {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-archive:hover {
  background: var(--bg-hover);
}

.archived-badge {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 100px;
}

/* ─── Project Card Actions ───────────────────────────────── */
.project-card-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover .project-card-actions {
  opacity: 1;
}

.card-action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.card-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-light);
}

.card-action-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ─── Project Card Thumbnails ────────────────────────────── */
.card-thumbs {
  display: flex;
  gap: 2px;
  margin: -16px -16px 12px -16px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  height: 80px;
}

.card-thumb {
  flex: 1;
  overflow: hidden;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumb-video,
.card-thumb-pdf {
  color: var(--text-muted);
  background: var(--bg-surface);
}

.card-thumb-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  min-width: 40px;
  flex: 0;
  padding: 0 10px;
}

/* ─── Media Navigation Arrows ────────────────────────────── */
.media-panel {
  position: relative;
}

.media-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0.7;
}

.media-nav-arrow:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-50%) scale(1.05);
}

.media-nav-left {
  left: 16px;
}

.media-nav-right {
  right: 16px;
}

[data-theme="light"] .media-nav-arrow {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

[data-theme="light"] .media-nav-arrow:hover {
  background: rgba(255, 255, 255, 0.95);
}

/* ─── Back to All Link ───────────────────────────────────── */
.back-to-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color var(--transition);
}

.back-to-all:hover {
  color: var(--accent);
}

/* ─── Admin Login Screen ─────────────────────────────────── */
.admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 24px;
}

.admin-login-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.admin-login-card svg {
  margin-bottom: 16px;
}

.admin-login-card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.admin-login-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.admin-login-card form {
  text-align: left;
}

.admin-login-card .input-field {
  margin-bottom: 0;
}

/* Admin header sign-out */
.admin-signout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-family: inherit;
  transition: all var(--transition);
}

.admin-signout-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-light);
}

/* ─── Version History ────────────────────────────────────── */
.version-info {
  margin-bottom: 10px;
}

.version-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.version-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.version-history {
  margin-bottom: 10px;
}

.version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  margin-bottom: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background var(--transition);
}

.version-item:hover {
  background: var(--bg-hover);
}

.version-item.active {
  border: 1px solid var(--accent);
  background: var(--accent-bg);
}

.version-item-label {
  font-weight: 500;
  color: var(--text);
}

.version-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Media Error Placeholder ────────────────────────────── */
.media-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.media-error p {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

.media-error span {
  font-size: 0.85rem;
  color: var(--text-muted);
}
