/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-surface-bar: #ffffff;
  --color-text: #111111;
  --color-text-secondary: #6b7280;
  --color-border: #e5e7eb;
  --color-border-light: #f0f0f0;
  --color-accent: #22c55e;
  --color-primary-btn: #111111;
  --color-primary-btn-hover: #333333;
  --color-danger: #ef4444;
  --font-family: 'JetBrains Mono', monospace;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }

/* ===== HEADER ===== */
.app-header {
  height: 56px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 100;
}

.app-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ftp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.2s;
}

.ftp-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-secondary);
  transition: background 0.2s;
}

.ftp-status.online .status-dot {
  background: var(--color-accent);
}

.ftp-status.online {
  color: var(--color-text);
}

.ftp-status.offline .status-dot {
  background: var(--color-danger);
}

.ftp-status.checking .status-dot {
  background: #f59e0b;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.btn-icon-header {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: background 0.15s, color 0.15s;
}

.btn-icon-header:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

/* ===== MATERIAL SYMBOLS ===== */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  color: inherit;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
}

/* Button-embedded icons */
.btn-outline .material-symbols-outlined,
.btn-preview .material-symbols-outlined,
.btn-download-all-link .material-symbols-outlined,
.btn-add-project .material-symbols-outlined,
.btn-primary .material-symbols-outlined {
  font-size: 16px;
}

/* Header icon buttons */
.btn-icon-header .material-symbols-outlined {
  font-size: 20px;
  color: var(--color-text);
}

/* Search bar icon */
.search-input-wrapper .material-symbols-outlined {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--color-text-secondary);
  pointer-events: none;
  flex-shrink: 0;
}

/* Project menu (three-dots) */
.project-menu-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Empty state large icon */
.empty-state-icon {
  font-size: 64px;
  color: var(--color-border);
  display: block;
}

/* Upload zone icon */
.upload-icon-symbol {
  font-size: 36px;
  color: var(--color-text-secondary);
}

/* Placeholder image icon in file cards */
.placeholder-icon {
  font-size: 40px;
  color: var(--color-border);
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--color-surface-bar);
  border-bottom: 1px solid var(--color-border);
  justify-content: center;
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  flex: 0 1 560px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input::placeholder {
  color: var(--color-text-secondary);
}

.search-input:focus {
  border-color: var(--color-text);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.btn-add-project {
  height: 44px;
  padding: 0 20px;
  background: var(--color-primary-btn);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-add-project:hover {
  background: var(--color-primary-btn-hover);
}

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.project-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-border-light);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.sidebar-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon-sort {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-icon-sort:hover,
.btn-icon-sort.active {
  background: var(--color-border-light);
  color: var(--color-text);
}

.btn-icon-sort .material-symbols-outlined {
  font-size: 18px;
}

.sort-dropdown-menu {
  display: none;
  margin: 0 12px 8px;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 4px 0;
}

.sort-dropdown-menu.visible {
  display: block;
}

.sort-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  border: none;
  background: none;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.1s;
}

.sort-item:hover {
  background: #f5f5f5;
}

.sort-item.active {
  background: var(--color-border-light);
  font-weight: 600;
}

.project-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 16px;
}

.project-list::-webkit-scrollbar {
  width: 4px;
}

.project-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.project-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-item-content {
  flex: 1;
  min-width: 0;
}

.project-menu-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
  color: var(--color-text);
}

.project-item:hover .project-menu-btn,
.project-menu-btn.menu-open {
  opacity: 1;
}

.project-menu-btn:hover {
  color: var(--color-primary-btn-hover);
}

.project-item:hover {
  background: #fafafa;
}

.project-item.active {
  border-left-color: var(--color-text);
  background: #fafafa;
}

.project-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-item-client {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.project-item-meta {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* ===== CONTENT AREA ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  min-width: 0;
  background-color: var(--color-bg);
}

.content::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-secondary);
  text-align: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.empty-state svg {
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 500;
}

.empty-state p {
  font-size: 13px;
  max-width: 280px;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--color-text-secondary);
  font-size: 14px;
  gap: 12px;
  position: relative;
  z-index: 1;
}

/* ===== PROJECT HEADER ===== */
.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.project-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.project-client {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.project-meta-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.project-meta-bar .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-text-secondary);
}

/* ===== BUTTONS ===== */
.btn-primary {
  height: 40px;
  padding: 0 20px;
  background: var(--color-primary-btn);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
  white-space: nowrap;
}

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

.btn-outline {
  height: 36px;
  padding: 0 14px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-outline:hover {
  background: #fafafa;
  border-color: #d1d5db;
}

.btn-preview {
  height: 36px;
  padding: 0 14px;
  background: var(--color-primary-btn);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  white-space: nowrap;
}

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

.btn-download-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  background: none;
  border: none;
  padding: 6px 0;
  transition: opacity 0.15s;
}

.btn-download-all-link:hover {
  opacity: 0.7;
}

/* ===== FORMAT SECTION ===== */
.format-section {
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

.format-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.format-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.variant-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-border-light);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* ===== FILE CARDS GRID ===== */
.file-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
  gap: 16px;
}

.file-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}

.file-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: #d1d5db;
}

.file-card-thumbnail {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  padding: 8px;
}

.file-card-thumbnail img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-card-thumbnail .placeholder {
  padding: 40px;
  color: var(--color-text-secondary);
  opacity: 0.4;
}

.file-card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.file-card-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tag-type {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.file-card-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.file-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.file-card-actions .btn-outline,
.file-card-actions .btn-preview {
  flex: 1;
  justify-content: center;
  height: 34px;
  font-size: 12px;
}

/* ===== LIGHTBOX ===== */
.lightbox-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;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.lightbox-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  z-index: 10;
  transition: background 0.15s;
}

.lightbox-close:hover {
  background: rgba(0,0,0,0.8);
}

.lightbox-iframe {
  border: none;
  display: block;
  background: white;
}

.lightbox-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-text-secondary);
  font-size: 14px;
  z-index: 1;
}

.lightbox-image {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

body.lightbox-open {
  overflow: hidden;
}

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

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.modal h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.modal-field {
  margin-bottom: 16px;
}

.modal-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

.modal-field input[type="text"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.modal-field input[type="text"]:focus {
  border-color: var(--color-text);
}

.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--color-text);
  background: #fafafa;
}

.upload-zone p {
  font-size: 13px;
  margin-top: 8px;
}

.upload-zone .upload-icon {
  margin-bottom: 8px;
  opacity: 0.5;
}

.upload-file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.upload-file-item .remove-file {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 16px;
  padding: 0 4px;
}

.upload-file-item .remove-file:hover {
  color: var(--color-danger);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.modal-actions .btn-cancel {
  height: 40px;
  padding: 0 20px;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}

.modal-actions .btn-cancel:hover {
  background: #fafafa;
}

/* ===== UPLOAD PREVIEW ===== */
.modal.modal-wide {
  width: 600px;
}

.upload-hint {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.upload-hint code {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 11px;
  background: #f5f5f5;
  padding: 1px 4px;
}

.upload-preview {
  margin-top: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.upload-summary {
  font-size: 12px;
  color: var(--color-text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 8px;
}

.upload-format-group {
  border: 1px solid var(--color-border-light);
  margin-bottom: 8px;
}

.upload-format-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fafafa;
  border-bottom: 1px solid var(--color-border-light);
}

.upload-format-name {
  font-size: 13px;
  font-weight: 600;
}

.upload-format-count {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.upload-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 12px;
}

.upload-file-row:last-child {
  border-bottom: none;
}

.upload-file-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.upload-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.upload-file-size {
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.upload-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  background: var(--color-text);
  color: #fff;
  flex-shrink: 0;
}

.upload-tag-type {
  background: none;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  font-weight: 500;
}

.upload-unknown-section {
  border-style: dashed;
}

.upload-unknown-section .upload-format-name {
  color: var(--color-text-secondary);
}

/* ===== EDIT MODAL - EXISTING CONTENT LIST ===== */
#editExistingContent {
  max-height: 280px;
  overflow-y: auto;
}

#editExistingContent:empty::before {
  content: "Dieses Projekt enthält noch keine Dateien.";
  display: block;
  padding: 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
  font-style: italic;
}

.existing-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 12px;
}

.existing-file-row:last-child {
  border-bottom: none;
}

.existing-file-row.marked-for-deletion {
  text-decoration: line-through;
  opacity: 0.5;
}

.existing-file-delete {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
  flex-shrink: 0;
}

.existing-file-delete:hover {
  color: var(--color-danger);
}

/* ===== ERROR PAGE ===== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  padding: 40px;
}

.error-page h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.error-page p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  max-width: 400px;
}

.error-page a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--color-primary-btn);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
}

/* ===== SPINNER ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ===== RESPONSIVE ===== */
/* ===== PROJECT DROPDOWN MENU ===== */
.project-dropdown-menu {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 160px;
  padding: 4px 0;
  display: none;
}

.project-dropdown-menu.visible {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  border: none;
  background: none;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.1s;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-item-danger {
  color: #dc2626;
}

.dropdown-item-danger:hover {
  background: #fef2f2;
}

/* ===== LOGIN PAGE ===== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: auto;
  background: var(--color-bg);
  background-image: none; /* dots.js sets this dynamically */
}

.login-container {
  position: relative;
  z-index: 1;
  width: 360px;
  max-width: 90vw;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 40px 32px;
}

.login-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

.login-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.login-field input:focus {
  border-color: var(--color-text);
}

.login-btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.login-error {
  font-size: 13px;
  color: var(--color-danger);
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 14px;
}

/* ===== CLIENT VIEW ===== */
.client-body {
  overflow: hidden;
}

.client-header {
  justify-content: center;
}

.client-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  min-width: 0;
  background-color: var(--color-bg);
}

.client-content::-webkit-scrollbar {
  width: 6px;
}

.client-content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

/* ===== SHARE MODAL ===== */
.share-modal-desc {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.share-link-field {
  display: flex;
  gap: 8px;
}

.share-link-field input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  background: #fafafa;
  color: var(--color-text);
  outline: none;
}

.share-link-expiry {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

.share-link-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ===== HELP MODAL ===== */
.help-intro {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.help-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.help-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.help-section h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.help-section p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.help-example {
  display: block;
  font-family: var(--font-family);
  font-size: 13px;
  background: #f5f5f5;
  border: 1px solid var(--color-border-light);
  padding: 8px 12px;
  margin-bottom: 4px;
}

.help-example strong {
  color: var(--color-text);
}

.help-note {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* ===== PROJECT HEADER ACTIONS ===== */
.project-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .content {
    padding: 24px 16px;
  }

  .search-bar {
    padding: 12px 16px;
  }

  .file-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}
