/* ═══════════════════════════════════════════════════════════════
   PHOTO MANAGER — Premium Design System
   RC Soluciones Digitales · Professional Photo Management
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Backgrounds */
  --bg-base: #09090b;
  --bg-surface: #111113;
  --bg-elevated: #18181b;
  --bg-hover: #1f1f23;
  --bg-input: #141416;
  --bg-glass: rgba(17,17,19,.85);

  /* Borders */
  --border: rgba(255,255,255,.06);
  --border-hover: rgba(255,255,255,.12);
  --border-active: rgba(255,255,255,.18);
  --border-accent: rgba(139,92,246,.4);

  /* Text */
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --text-accent: #a78bfa;

  /* Accent — violet */
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-light: rgba(139,92,246,.1);
  --accent-glow: rgba(139,92,246,.25);

  /* Status */
  --success: #34d399;
  --success-bg: rgba(52,211,153,.08);
  --error: #f87171;
  --error-bg: rgba(248,113,113,.08);
  --warning: #fbbf24;
  --warning-bg: rgba(251,191,36,.08);
  --info: #60a5fa;
  --info-bg: rgba(96,165,250,.08);

  /* Layout */
  --sidebar-w: 272px;
  --header-h: 64px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  --shadow-xl: 0 16px 64px rgba(0,0,0,.6);
  --shadow-glow: 0 0 24px rgba(139,92,246,.15);

  /* Transitions */
  --ease: cubic-bezier(.22,1,.36,1);
  --dur: .2s;
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; transition: color var(--dur); }
a:hover { color: var(--text-accent); }
code, .mono { font-family: 'JetBrains Mono', monospace; }
::selection { background: var(--accent); color: #fff; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.14); }

/* ═══ SIDEBAR ═══ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform .35s var(--ease);
}

.sidebar-logo {
  padding: 24px 20px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}
.sidebar-logo .logo-icon::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.15));
}
.sidebar-logo .logo-icon svg {
  width: 22px; height: 22px;
  color: #fff;
  position: relative; z-index: 1;
}
.sidebar-logo .logo-text {
  display: flex; flex-direction: column;
}
.sidebar-logo .logo-title {
  font-size: 15px; font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}
.sidebar-logo .logo-sub {
  font-size: 10px; font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 16px 12px;
}
.nav-section {
  margin-bottom: 20px;
}
.nav-section-title {
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 14px;
  margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-size: 10px; font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-user {
  padding: 16px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-user .avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 13px; font-weight: 600; }
.sidebar-user .user-role { font-size: 11px; color: var(--text-muted); }
.sidebar-user .logout-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs);
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur);
}
.sidebar-user .logout-btn:hover { color: var(--error); background: var(--error-bg); }
.sidebar-user .logout-btn svg { width: 16px; height: 16px; }

/* ═══ MAIN CONTENT ═══ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.header {
  height: var(--header-h);
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  position: sticky; top: 0; z-index: 50;
}
.header-left {
  display: flex; align-items: center; gap: 12px;
}
.header h2 {
  font-size: 18px; font-weight: 700;
  letter-spacing: -.02em;
}
.header-actions { display: flex; gap: 8px; align-items: center; }
.content { padding: 28px 32px; }

/* Hamburger */
.hamburger {
  display: none;
  background: none; border: none;
  color: var(--text); cursor: pointer;
  padding: 4px;
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  transition: background var(--dur);
}
.hamburger:hover { background: var(--bg-hover); }
.hamburger svg { width: 20px; height: 20px; }

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all .25s var(--ease);
}
.card:hover { border-color: var(--border-hover); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 15px; font-weight: 600;
  letter-spacing: -.01em;
}

/* ═══ STATS ═══ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all .25s var(--ease);
}
.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity .25s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
  background: var(--accent-light);
}
.stat-card .stat-label {
  font-size: 12px; color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 28px; font-weight: 800;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--dur) var(--ease);
  font-family: inherit;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(139,92,246,.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(139,92,246,.3);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(248,113,113,.15);
}
.btn-danger:hover { background: rgba(248,113,113,.15); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-icon {
  width: 34px; height: 34px;
  padding: 0; justify-content: center;
  border-radius: var(--radius-sm);
}
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: all var(--dur);
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-input::placeholder { color: var(--text-muted); }
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2352525b'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
textarea.form-input { min-height: 90px; resize: vertical; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.color-input {
  width: 48px; height: 40px;
  padding: 3px; border-radius: var(--radius-sm);
  cursor: pointer;
}
.form-hint {
  font-size: 11px; color: var(--text-muted);
  margin-top: 4px;
}

/* ═══ TABLES ═══ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  transition: background var(--dur);
}
tr:hover td { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .01em;
}
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-expired { background: var(--error-bg); color: var(--error); }
.badge-revoked { background: var(--warning-bg); color: var(--warning); }
.badge-edited { background: rgba(168,85,247,.1); color: #a855f7; }
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.badge-dot-active { background: var(--success); }
.badge-dot-expired { background: var(--error); }

/* ═══ GRID LAYOUT ═══ */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ═══ LOCAL CARDS ═══ */
.local-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.local-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--radius) 0 0 var(--radius);
  transition: width .25s var(--ease);
}
.local-card:hover::before { width: 4px; }
.local-card .local-body { padding-left: 16px; }
.local-card .local-name {
  font-size: 15px; font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -.01em;
}
.local-card .local-meta { font-size: 12px; color: var(--text-muted); }
.local-card .local-stats {
  display: flex; gap: 16px;
  margin-top: 14px;
  font-size: 12px; color: var(--text-secondary);
}
.local-card .local-stats span {
  display: flex; align-items: center; gap: 5px;
}
.local-card .local-actions {
  position: absolute; top: 16px; right: 16px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity .2s;
}
.local-card:hover .local-actions { opacity: 1; }

/* ═══ PHOTO GRID ═══ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
}
.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-elevated);
  transition: transform .25s var(--ease);
}
.photo-item:hover { transform: scale(1.02); z-index: 2; }
.photo-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.photo-item:hover img { transform: scale(1.08); }
.photo-item .photo-check {
  position: absolute; top: 10px; left: 10px;
  width: 24px; height: 24px;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 7px;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  z-index: 3;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  opacity: 0;
}
.photo-item:hover .photo-check { opacity: 1; }
.photo-item .photo-check.checked {
  opacity: 1;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(139,92,246,.4);
}
.photo-item .photo-check.checked::after {
  content: '✓'; color: #fff;
  font-size: 12px; font-weight: 700;
}
.photo-item .photo-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  opacity: 0;
  transition: opacity .25s;
}
.photo-item:hover .photo-overlay { opacity: 1; }
.photo-item .photo-name {
  font-size: 11px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
}
.photo-item .edited-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(168,85,247,.85);
  backdrop-filter: blur(4px);
  color: #fff; font-size: 10px;
  padding: 3px 8px; border-radius: 6px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ═══ LIGHTBOX ═══ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.97);
  z-index: 1000;
  display: none;
  flex-direction: column;
}
.lightbox.active { display: flex; }
.lightbox-header {
  height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.lightbox-header .lb-title {
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
}
.lightbox-header .lb-counter {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 12px;
}
.lightbox-body { flex: 1; display: flex; overflow: hidden; }
.lightbox-image {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  padding: 16px;
}
.lightbox-image img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.lb-nav {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  color: #fff; font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur);
  backdrop-filter: blur(4px);
}
.lb-nav:hover { background: rgba(255,255,255,.12); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 22px; cursor: pointer;
  padding: 4px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs);
  transition: all var(--dur);
}
.lb-close:hover { color: #fff; background: rgba(255,255,255,.06); }

.lightbox-exif {
  width: 340px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  padding: 28px 24px;
  overflow-y: auto;
  flex-shrink: 0;
}
.lightbox-exif h3 {
  font-size: 14px; font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -.01em;
}
.exif-item { margin-bottom: 16px; }
.exif-label {
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 3px;
}
.exif-value {
  font-size: 13px; color: var(--text);
  font-weight: 500;
}

/* ═══ DROPZONE ═══ */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.dropzone::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, var(--accent-light) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .3s;
}
.dropzone:hover::before, .dropzone.dragover::before { opacity: 1; }
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  transform: scale(1.005);
}
.dropzone-icon {
  position: relative; z-index: 1;
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  background: var(--accent-light);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.dropzone-icon svg {
  width: 28px; height: 28px;
  color: var(--accent);
}
.dropzone-text {
  position: relative; z-index: 1;
  font-size: 15px; font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.dropzone-hint {
  position: relative; z-index: 1;
  font-size: 12px; color: var(--text-muted);
}

/* ═══ UPLOAD LIST ═══ */
.upload-list { margin-top: 20px; }
.upload-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: border-color var(--dur);
}
.upload-item:hover { border-color: var(--border-hover); }
.upload-item .upload-thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-base);
  flex-shrink: 0;
}
.upload-item .upload-info { flex: 1; min-width: 0; }
.upload-item .upload-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upload-item .upload-size { font-size: 11px; color: var(--text-muted); }
.upload-item .upload-status { font-size: 12px; font-weight: 600; flex-shrink: 0; }
.upload-item .upload-status.done { color: var(--success); }
.upload-item .upload-status.error { color: var(--error); }

.progress-bar {
  width: 100%; height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #c084fc);
  transition: width .3s;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(139,92,246,.4);
}

/* ═══ SELECTION BAR ═══ */
.selection-bar {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 12px 24px;
  display: none;
  align-items: center; gap: 16px;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  z-index: 200;
  backdrop-filter: blur(16px);
}
.selection-bar.active { display: flex; }
.selection-bar .sel-count {
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
  color: var(--accent);
}

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 520px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .25s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.modal-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ═══ TOAST ═══ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  animation: toastIn .35s var(--ease);
  min-width: 280px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
}
.toast-success {
  background: var(--bg-surface);
  color: var(--success);
  border: 1px solid rgba(52,211,153,.15);
}
.toast-error {
  background: var(--bg-surface);
  color: var(--error);
  border: 1px solid rgba(248,113,113,.15);
}
.toast-info {
  background: var(--bg-surface);
  color: var(--info);
  border: 1px solid rgba(96,165,250,.15);
}
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } }

/* ═══ PAGINATION ═══ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 28px;
}
.pagination .page-btn {
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--dur);
}
.pagination .page-btn:hover { border-color: var(--border-hover); color: var(--text); }
.pagination .page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .page-info { font-size: 13px; color: var(--text-muted); margin: 0 16px; }

/* ═══ FILTERS ═══ */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 24px; align-items: center;
}
.filters .form-input {
  width: auto; min-width: 160px;
  padding: 8px 14px; font-size: 13px;
}
.filters .search-input { min-width: 240px; }
.filters-count {
  font-size: 12px; color: var(--text-muted);
  font-weight: 500;
  margin-left: auto;
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
  text-align: center;
  padding: 72px 24px;
}
.empty-state .empty-icon {
  width: 72px; height: 72px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 20px;
  opacity: .5;
}
.empty-state .empty-text {
  font-size: 15px; color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
}

/* ═══ ALBUM CARDS ═══ */
.album-card {
  cursor: pointer;
  overflow: hidden;
}
.album-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}
.album-card .album-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.album-card .album-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.album-card .album-local {
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.album-card .album-date {
  font-size: 22px; font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: -.02em;
}
.album-card .album-name {
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 10px;
}
.album-card .album-count {
  font-size: 12px; color: var(--text-muted);
  font-weight: 500;
  display: flex; align-items: center; gap: 5px;
}

/* ═══ SKELETON ═══ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 14px; }
.skeleton-card { height: 140px; }
.skeleton-photo { aspect-ratio: 1; }

/* ═══ TABS ═══ */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 12px 22px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--dur);
  letter-spacing: -.01em;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ═══ SHARE LINK ═══ */
.share-link-display {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
}
.share-link-display input {
  flex: 1;
  background: transparent; border: none;
  color: var(--text); font-size: 13px;
  outline: none;
  font-family: 'JetBrains Mono', monospace;
}

/* ═══ DIVIDER ═══ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex !important; }
  .content { padding: 20px 16px; }
  .header { padding: 0 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .lightbox-exif { display: none; }
  .form-row { flex-direction: column; gap: 0; }
  .filters { flex-direction: column; }
  .filters .form-input, .filters .search-input { width: 100%; min-width: 0; }
  .selection-bar { left: 16px; right: 16px; transform: none; flex-wrap: wrap; justify-content: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
}

/* ═══ SIDEBAR OVERLAY (MOBILE) ═══ */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  display: none;
  opacity: 0;
  transition: opacity .3s;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}
