/* ================================================================
   Prismo — Photography Gallery Platform
   langenkaemper.org Design System · Cormorant Garamond + Inter
   ================================================================ */

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

/* ── Design Tokens ───────────────────────────────────────────── */

:root {
  --bg-body: #f7f4f0;
  --bg-card: #fdfcfb;
  --bg-elevated: #f0ede8;
  --bg-hover: #e8e4de;
  --bg-active: #e0dbd5;
  --bg-input: #fdfcfb;
  --bg-sidebar: #1a1a1a;
  --bg-overlay: rgba(10, 10, 9, 0.97);
  --bg-backdrop: rgba(28, 27, 25, 0.35);

  --text-bright: #1a1a1a;
  --text-primary: #333;
  --text-muted: #aaa;
  --text-dimmed: #ccc;
  --text-sidebar: rgba(255, 255, 255, 0.55);
  --text-sidebar-active: #ffffff;

  --accent: #1a1a1a;
  --accent-hover: #333;
  --accent-bg: rgba(26, 26, 26, 0.05);
  --accent-border: rgba(26, 26, 26, 0.15);
  --accent-text: #ffffff;

  --pop: #1a1a1a;
  --pop-hover: #333;

  --border: #e0dbd5;
  --border-light: #ebe8e3;
  --border-focus: var(--accent);

  --danger: #b85450;
  --danger-bg: rgba(184, 84, 80, 0.06);
  --warning: #c49a2a;
  --warning-bg: rgba(196, 154, 42, 0.06);
  --success: #4a8c6f;
  --success-bg: rgba(74, 140, 111, 0.06);
  --info: #5a7fa8;
  --info-bg: rgba(90, 127, 168, 0.06);

  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;

  --transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  --sidebar-w: 230px;
}

/* ── Dark Theme ──────────────────────────────────────────────── */

[data-theme="dark"] {
  --bg-body: #0f0f0e;
  --bg-card: #171716;
  --bg-elevated: #1f1f1e;
  --bg-hover: #292928;
  --bg-active: #333332;
  --bg-input: #171716;
  --bg-sidebar: #0a0a0a;
  --bg-overlay: rgba(8, 8, 7, 0.97);
  --bg-backdrop: rgba(0, 0, 0, 0.5);

  --text-bright: #f0eeeb;
  --text-primary: #b8b4ae;
  --text-muted: #706d68;
  --text-dimmed: #4a4844;
  --text-sidebar: rgba(255, 255, 255, 0.4);
  --text-sidebar-active: rgba(255, 255, 255, 0.9);

  --accent: #f0eeeb;
  --accent-hover: #d8d5d0;
  --accent-bg: rgba(240, 238, 235, 0.06);
  --accent-text: #1a1a1a;

  --border: #262625;
  --border-light: #2e2e2d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* ── Reset & Base ────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-bright);
  font-weight: 300;
  letter-spacing: 0.08em;
}

h3, h4 {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 400;
}

::selection {
  background: var(--accent);
  color: white;
}

/* ── App Layout ──────────────────────────────────────────────── */

.app-layout {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ── Sidebar ─────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: none;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 22px 20px;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  background: var(--pop);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.sidebar-brand {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 12px;
  overflow-y: auto;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 2px;
  color: var(--text-sidebar);
  font-size: 11px;
  font-weight: 400;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 1px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}

.sidebar-nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sidebar-active);
  font-weight: 500;
}

.nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  opacity: 0.65;
  flex-shrink: 0;
}

.sidebar-nav-link.active .nav-icon {
  opacity: 1;
  color: var(--accent);
}

.sidebar-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-section-title {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.22);
  padding: 0 14px 8px;
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-sidebar);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  align-items: center;
  justify-content: center;
}

/* ── Main Content ────────────────────────────────────────────── */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.main-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px 40px;
  scroll-behavior: smooth;
}

/* ── Topbar ──────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-search input {
  width: 200px;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  transition: all var(--transition);
}

.topbar-search input::placeholder { color: var(--text-dimmed); }
.topbar-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
  width: 280px;
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-dimmed);
  font-size: 14px;
  pointer-events: none;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.breadcrumb a { color: var(--text-muted); font-weight: 400; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-dimmed); font-size: 11px; }
.breadcrumb .current {
  color: var(--text-bright);
  font-weight: 500;
}

/* ── User Menu ───────────────────────────────────────────────── */

.user-menu { position: relative; }
.user-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-sidebar);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.03em;
  transition: transform var(--transition);
}

.user-avatar:hover { transform: scale(1.06); }

/* ── Dropdown Menu ───────────────────────────────────────────── */

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 6px;
  overflow: hidden;
}

.dropdown-menu.open { display: block; }

.dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: background var(--transition);
}

.dropdown-item:hover { background: var(--bg-elevated); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
.dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Login Page ──────────────────────────────────────────────── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-body);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
}

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

.login-card h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 300;
  margin-bottom: 24px;
  color: var(--text-bright);
  letter-spacing: 0.08em;
}

/* ── Page Titles & Sections ──────────────────────────────────── */

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  color: var(--text-bright);
  margin-bottom: 24px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.08em;
}

/* ── Stats Grid ──────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-light);
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 300;
  color: var(--text-bright);
  line-height: 1;
  letter-spacing: 0.02em;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-dimmed);
  margin-top: 4px;
}

/* ── Settings Card ───────────────────────────────────────────── */

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  max-width: 560px;
}

/* ── Events ──────────────────────────────────────────────────── */

.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.event-row:hover { background: var(--bg-elevated); }
.event-row.event-unread {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
}

.event-info { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; min-width: 0; }
.event-type { font-weight: 550; color: var(--text-bright); font-size: 13px; }
.event-detail { color: var(--text-primary); font-size: 13px; }
.event-actor { font-size: 12px; }
.event-time { font-size: 10px; color: var(--text-dimmed); white-space: nowrap; flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.1em; }

/* ── Gallery Grid ────────────────────────────────────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.gallery-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.gallery-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.gallery-card-cover {
  aspect-ratio: 3 / 2;
  background: var(--bg-elevated);
  overflow: hidden;
}

.gallery-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-card-cover img { transform: scale(1.04); }

.gallery-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.gallery-card:hover .gallery-card-delete { opacity: 1; }
.gallery-card-delete:hover { background: var(--danger); }

.gallery-card-info { padding: 14px 16px; }

.gallery-card-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-bright);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-meta {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Gallery View Header ─────────────────────────────────────── */

#gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.view-toggle { display: flex; gap: 2px; background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 2px; }
.view-toggle-btn {
  padding: 6px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: all var(--transition);
}

.view-toggle-btn:hover { color: var(--text-primary); }
.view-toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-bright);
  box-shadow: var(--shadow-sm);
}

/* ── Gallery Actions Dropdown ────────────────────────────────── */

.gallery-actions-wrap { position: relative; display: inline-block; }
.gallery-actions-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: 6px;
}
.gallery-actions-dropdown.open { display: block; }
.gallery-actions-dropdown button {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: background var(--transition);
}
.gallery-actions-dropdown button:hover { background: var(--bg-elevated); }

/* ── Gallery Sidebar Panel ───────────────────────────────────── */

#gallery-sidebar-panel {
  width: 260px;
  flex-shrink: 0;
  padding-right: 24px;
  border-right: 1px solid var(--border-light);
}

#gallery-sidebar-panel .sidebar-section {
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
}

#gallery-sidebar-panel .sidebar-section:first-child {
  padding-top: 0;
  border-top: none;
}

#gallery-sidebar-panel .sidebar-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 0;
}

/* ── Color Mark Filter Buttons ───────────────────────────────── */

.mark-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.mark-filter-btn:hover { border-color: var(--text-dimmed); color: var(--text-primary); }
.mark-filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* ── File Grid ───────────────────────────────────────────────── */

.file-grid {
  display: flex;
  gap: 3px;
  align-items: flex-start;
}

.file-grid-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.file-grid-uniform {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  columns: unset;
}

.file-grid-uniform .file-thumb {
  break-inside: unset;
  aspect-ratio: 1;
}

/* ── List View ────────────────────────────────────────────────── */

.file-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.file-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background 0.15s ease;
}

.file-list-item:hover { background: var(--bg-hover); }
.file-list-item.selected { background: var(--accent-bg); }

.file-list-select { flex-shrink: 0; }

.file-list-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.file-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-list-info {
  flex: 1;
  min-width: 0;
}

.file-list-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-list-exif {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-list-meta {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.file-list-dim,
.file-list-size,
.file-list-date {
  white-space: nowrap;
}

.file-list-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.file-list-item:hover .file-list-actions { opacity: 1; }

.file-thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-elevated);
  transition: all var(--transition);
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
  opacity: 0.97;
}

.file-thumb:hover img { transform: scale(1.02); opacity: 1; }
.file-thumb:hover { box-shadow: var(--shadow-md); }

.file-thumb.selected {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.file-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4/3;
  background: var(--bg-elevated);
  color: var(--text-dimmed);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Color Mark Overlay ─────────────────────────────────────── */

.file-mark-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.7);
  pointer-events: none;
  display: none;
}

/* Show overlay only in grid view (where filename row is hidden) */
.file-grid-uniform .file-mark-overlay { display: block; }

/* ── File Thumb Overlay ──────────────────────────────────────── */

.file-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: linear-gradient(transparent 40%, rgba(28, 23, 20, 0.55));
}

.file-thumb:hover .file-actions { opacity: 1; }

.file-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-bright);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.file-action-btn:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.file-thumb-name {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 450;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-thumb-name .mark-dot {
  flex-shrink: 0;
}

.file-thumb-marks {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 3px;
}

/* ── File Select Indicator (always visible) ──────────────────── */

.file-select-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  border: 2px solid rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.25);
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  opacity: 0.5;
  transition: opacity var(--transition), background var(--transition), border-color var(--transition);
}

.file-thumb:hover .file-select-indicator { opacity: 1; }

.file-select-indicator.checked {
  background: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

/* ── Action Bar (batch selection) ────────────────────────────── */

.action-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1918;
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 12px 10px 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  backdrop-filter: blur(12px);
}

.action-bar.visible { bottom: 28px; }

.action-bar-count {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  margin-right: 8px;
  letter-spacing: 0.01em;
}

.action-bar .action-bar-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

.action-bar .ab-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.action-bar .ab-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.action-bar .ab-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.action-bar .ab-btn-danger {
  background: rgba(200, 85, 58, 0.2);
  color: #e8977f;
}

.action-bar .ab-btn-danger:hover {
  background: rgba(200, 85, 58, 0.35);
  color: #f0b5a3;
}

.action-bar .ab-btn-close {
  background: none;
  padding: 7px;
  color: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-bar .ab-btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

/* ── Color Mark Dots ─────────────────────────────────────────── */

.mark-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.mark-dot-sm { width: 8px; height: 8px; }

.mark-rot, .file-mark-overlay.mark-rot { background: #d45050; }
.mark-orange, .file-mark-overlay.mark-orange { background: #d4943a; }
.mark-gruen, .file-mark-overlay.mark-gruen { background: #4a9a6e; }
.mark-final, .file-mark-overlay.mark-final { background: #7c6aaa; }

/* ── Mark Selector Popup ─────────────────────────────────────── */

.mark-selector {
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
}

.mark-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 2px solid transparent;
}

.mark-option:hover { transform: scale(1.2); }
.mark-option.active {
  box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 5px currentColor;
}

.mark-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  transition: all var(--transition);
}

.mark-remove:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

/* ================================================================
   LIGHTBOX
   ================================================================ */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 10, 9, 0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

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

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.lb-counter { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.5); min-width: 60px; }
.lb-filename {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-main {
  flex: 1;
  display: flex;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.lightbox-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-width: 0;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  transition: transform 0.15s ease;
  user-select: none;
}

.lightbox-nav-prev, .lightbox-nav-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.lightbox-nav-prev { left: 0; }
.lightbox-nav-next { right: 0; }

.lightbox-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}

.lightbox-nav-btn:hover { background: rgba(255, 255, 255, 0.2); color: white; }

/* ── Lightbox Sidebar ────────────────────────────────────────── */

.lightbox-sidebar {
  width: 0;
  background: rgba(20, 18, 16, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: width 0.3s ease;
  flex-shrink: 0;
}

.lightbox-sidebar.open { width: 300px; }

.lightbox-sidebar-inner { width: 300px; height: 100%; display: flex; flex-direction: column; }

.lightbox-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 4px;
}

.lb-sidebar-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.lb-sidebar-tab:hover { color: rgba(255, 255, 255, 0.6); }
.lb-sidebar-tab.active { color: white; border-bottom-color: var(--accent); }

.lightbox-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.lb-info-section { margin-bottom: 24px; }
.lb-info-section h4 {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 12px;
}

.lb-info-table { width: 100%; font-size: 13px; }
.lb-info-table tr { border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.lb-info-table td { padding: 7px 0; vertical-align: top; }
.lb-info-table td:first-child { color: rgba(255, 255, 255, 0.4); width: 110px; }
.lb-info-table td:last-child { color: rgba(255, 255, 255, 0.8); text-align: right; }

.lb-comment {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.lb-comment-author { font-weight: 600; font-size: 13px; color: rgba(255, 255, 255, 0.8); margin-bottom: 4px; }
.lb-comment-text { font-size: 13px; color: rgba(255, 255, 255, 0.6); line-height: 1.5; }
.lb-comment-time { font-size: 11px; color: rgba(255, 255, 255, 0.3); margin-top: 6px; }

.lb-comment-form { margin-top: 16px; }
.lb-comment-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 13px;
  font-family: var(--font-body);
  resize: vertical;
}

.lb-comment-form textarea::placeholder { color: rgba(255, 255, 255, 0.25); }
.lb-comment-form textarea:focus { outline: none; border-color: var(--accent); }

/* ── Lightbox Toolbar ────────────────────────────────────────── */

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  flex-shrink: 0;
}

.lb-tool-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.lb-tool-btn:hover { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.8); }
.lb-tool-btn.active { color: var(--accent); }
.lb-tool-sep { width: 1px; height: 24px; background: rgba(255, 255, 255, 0.08); margin: 0 4px; }

/* ── Scribble Overlay ───────────────────────────────────────── */

.lb-scribble-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: crosshair;
  touch-action: none;
}

.lb-scribble-toolbar {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 8px;
  background: rgba(28, 27, 25, 0.85);
  backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ================================================================
   MODALS
   ================================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: var(--bg-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
}

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

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 92vw;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-enter 0.25s ease;
}

.modal-content.modal-lg { max-width: 640px; }

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h2 { font-family: var(--font-display); font-size: 18px; font-weight: 300; margin: 0; letter-spacing: 0.08em; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 20px; }
.modal-tab {
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.modal-tab:hover { color: var(--text-primary); }
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.modal-body { padding: 24px; }
.modal-tab-panel { display: none; }
.modal-tab-panel.active { display: block; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ================================================================
   UPLOAD
   ================================================================ */

.upload-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 360px;
  max-height: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 900;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.upload-modal-overlay {
  position: fixed; inset: 0; z-index: 6000;
  background: var(--bg-backdrop);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}

.upload-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 92vw; max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.upload-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.upload-modal-header h3 { font-family: var(--font-display); font-size: 18px; font-weight: 300; margin: 0; letter-spacing: 0.08em; }
.upload-modal-body { padding: 24px; }

.upload-drop-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.upload-drop-area:hover { border-color: var(--accent); background: var(--accent-bg); }
.upload-drop-area.dragover { border-color: var(--accent); background: var(--accent-bg); }

.upload-zone-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.5; }
.upload-zone-text { font-size: 15px; font-weight: 400; color: var(--text-bright); margin-bottom: 6px; }
.upload-zone-hint { font-size: 13px; color: var(--text-muted); }
.upload-zone-formats { font-size: 11px; color: var(--text-dimmed); margin-top: 12px; }

.upload-overlay {
  position: fixed; inset: 0; z-index: 7000;
  background: rgba(250, 248, 245, 0.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.upload-overlay.visible { opacity: 1; pointer-events: auto; }
.upload-overlay-inner {
  text-align: center; padding: 60px;
  border: 3px dashed var(--accent);
  border-radius: var(--radius-lg); background: white;
}

.upload-list { margin-top: 16px; max-height: 280px; overflow-y: auto; }
.upload-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.upload-item:last-child { border-bottom: none; }
.upload-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-weight: 500; }
.upload-item-size { color: var(--text-dimmed); font-size: 12px; flex-shrink: 0; }
.upload-item-status { font-size: 12px; font-weight: 600; flex-shrink: 0; }
.upload-item-status.done { color: var(--success); }
.upload-item-status.error { color: var(--danger); }
.upload-item-status.uploading { color: var(--accent); }

.upload-progress { width: 100%; height: 3px; background: var(--bg-elevated); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.upload-progress-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.2s ease; }

/* ================================================================
   FORMS
   ================================================================ */

.form-field { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  transition: all var(--transition);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.form-input::placeholder { color: var(--text-dimmed); }
.form-select { cursor: pointer; appearance: auto; }

.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  min-height: 80px;
  resize: vertical;
  transition: border-color var(--transition);
}

.form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

.form-row { display: flex; justify-content: space-between; align-items: center; }

.form-toggle { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.form-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.form-toggle-track {
  position: absolute; inset: 0; border-radius: 12px; /* pill shape intentional */
  background: var(--bg-active); transition: background var(--transition);
}
.form-toggle-track::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: white; border-radius: 50%;
  transition: transform var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.form-toggle input:checked + .form-toggle-track { background: var(--accent); }
.form-toggle input:checked + .form-toggle-track::after { transform: translateX(20px); }

/* ================================================================
   BUTTONS
   ================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-body);
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-primary {
  background: var(--pop);
  color: #ffffff;
}
.btn-primary:hover { background: var(--pop-hover); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--text-dimmed); background: var(--bg-elevated); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-elevated); }

.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

/* ================================================================
   TOAST
   ================================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  transition: bottom 0.2s ease;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  animation: toast-enter 0.3s ease;
}

.toast.removing { opacity: 0; transform: translateX(20px); transition: all 0.2s ease; }

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info { border-left: 3px solid var(--info); }
.toast-info .toast-icon { color: var(--info); }

@keyframes toast-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ================================================================
   SKELETON
   ================================================================ */

.skeleton {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.03) 40%, rgba(0, 0, 0, 0.03) 60%, transparent 100%);
  animation: skeleton-shimmer 1.8s ease infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.03) 40%, rgba(255, 255, 255, 0.03) 60%, transparent 100%);
}

.skeleton-card { min-height: 160px; }
.skeleton-text { height: 14px; border-radius: 4px; }
.skeleton-text.short { width: 60%; }

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ================================================================
   UTILITIES
   ================================================================ */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-4 { margin-bottom: 4px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon { font-size: 36px; opacity: 0.25; margin-bottom: 14px; }
.empty-state-title { font-family: var(--font-display); font-size: 17px; font-weight: 300; color: var(--text-bright); margin-bottom: 6px; letter-spacing: 0.08em; }
.empty-state-text { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; max-width: 280px; }

/* ================================================================
   GALLERY WELCOME TEXT
   ================================================================ */

.gallery-welcome {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

/* ================================================================
   SUB-GALLERIES
   ================================================================ */

.sub-galleries-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.sub-galleries-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 300;
    color: var(--text-bright);
    margin-bottom: 16px;
    letter-spacing: 0.08em;
}

.sub-galleries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.sub-gallery-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
}

.sub-gallery-card:hover {
    border-color: var(--text-dimmed);
    box-shadow: var(--shadow-md);
}

.sub-gallery-card-cover {
    width: 100%;
    height: 120px;
    background: var(--bg-elevated);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.sub-gallery-card-name {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: flex; }

  .main-scroll { padding: 20px 18px; }
  .topbar { padding: 0 18px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .file-grid { gap: 3px; }
  .file-grid-col { gap: 3px; }

  #gallery-sidebar-panel { display: none !important; }

  .modal-content { width: 96vw; max-height: 90vh; }

  .lightbox-sidebar.open { width: 100%; position: absolute; inset: 0; }
}

/* ── Parent Gallery Link ─────────────────────────────────────── */

.gallery-parent-link {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2px;
  transition: color var(--transition);
}
.gallery-parent-link:hover {
  color: var(--text-bright);
}

/* ── Filter Checkboxes ──────────────────────────────────────── */

.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all var(--transition);
  user-select: none;
}
.filter-checkbox:hover {
  background: var(--bg-hover);
}
.filter-checkbox.active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
}
.filter-checkbox input[type="checkbox"] {
  margin: 0;
  width: 12px;
  height: 12px;
}

/* ── Comment Bubble Overlay ─────────────────────────────────── */

.file-status-overlays {
  position: absolute;
  bottom: 28px;
  left: 6px;
  display: flex;
  gap: 4px;
  z-index: 3;
  pointer-events: none;
}

.file-status-icon {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.file-status-icon svg { opacity: 0.9; }
.file-status-scribble { background: rgba(184, 84, 80, 0.7); }

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
  .page-title { font-size: 22px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .file-grid { gap: 2px; }
  .file-grid-col { gap: 2px; }
}

/* ── Video ────────────────────────────────────────────────── */

.file-thumb.is-video .file-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.92);
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
  transition: transform var(--transition);
  z-index: 2;
}
.file-thumb.is-video:hover .file-video-play { transform: scale(1.1); }

.file-thumb .file-video-duration {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  z-index: 3;
  pointer-events: none;
}

.lightbox-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #000;
  border-radius: var(--radius-sm);
}
