:root {
  --bg: #020617;
  --bg-elevated: #020617;
  --card: #020617;
  --card-border: #1f2937;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --accent-strong: #2563eb;
  --danger: #ef4444;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --border-radius: 12px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.65);
  --shadow-subtle: 0 6px 20px rgba(15, 23, 42, 0.6);
  --transition-fast: 0.15s ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.theme-dark {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #020617 0, #020617 38%, #020617 100%);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 96px 16px 40px;
}

.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: radial-gradient(circle at top left, #020617, #020617 65%, #020617);
  border-radius: var(--border-radius);
  padding: 24px 24px 20px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  margin: 0 0 4px;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

.card-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.topbar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, 100% - 32px);
  height: 56px;
  border-radius: 999px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
      120deg,
      rgba(148, 163, 184, 0.06),
      rgba(148, 163, 184, 0.02)
    ),
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), transparent 55%);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(22px);
  z-index: 20;
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-email {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), border-color var(--transition-fast);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.btn:hover {
  background: rgba(15, 23, 42, 1);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: rgba(59, 130, 246, 0.35);
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 15px 38px rgba(37, 99, 235, 0.75);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.95);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.35);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

form {
  margin: 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row {
  display: flex;
  gap: 12px;
}

label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

input,
select {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast);
}

input:focus,
select:focus {
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.7);
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.8rem;
}

.error-text {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.09);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text);
  font-size: 0.85rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  z-index: 50;
}

.toast.hidden {
  display: none;
}

.home-section {
  margin-bottom: 18px;
}

.home-section-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.home-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  background: rgba(15, 23, 42, 0.98);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75);
}

.home-list-item + .home-list-item {
  border-top: 1px solid rgba(31, 41, 55, 0.9);
}

.home-list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
}

.home-list-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-list-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.95);
  font-size: 1.1rem;
}

.home-list-icon-home {
  background: linear-gradient(135deg, #f97316, #fb923c);
}

.home-list-icon-photo {
  background: linear-gradient(135deg, #22c55e, #4ade80);
}

.home-list-icon-star {
  background: linear-gradient(135deg, #eab308, #facc15);
}

.home-list-icon-nearby,
.home-list-icon-connection {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

.home-list-text {
  display: flex;
  flex-direction: column;
}

.home-list-title {
  font-size: 0.95rem;
}

.home-list-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.home-list-chevron {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.home-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-add {
  position: fixed;
  top: 70px;
  right: 24px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.75);
  cursor: pointer;
  z-index: 25;
}

.floating-add:active {
  transform: scale(0.96);
}

.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.home-shortcut {
  border-radius: 999px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.7);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.home-shortcut:hover {
  background: rgba(15, 23, 42, 1);
  transform: translateY(-1px);
}

.home-shortcut-icon {
  font-size: 1.1rem;
}

.home-shortcut-text {
  display: flex;
  flex-direction: column;
}

.home-shortcut-title {
  font-size: 0.9rem;
}

.home-shortcut-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.connection-card {
  background: radial-gradient(circle at top, #020617, #020617 65%, #020617);
  border-radius: 18px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.9);
}

.connection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.connection-header h2 {
  margin: 0;
  font-size: 1rem;
}

.connection-meta {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.connection-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  background: var(--accent-soft);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.7);
}

.modal {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top, #020617, #020617 65%, #020617);
  color: var(--text);
  width: min(420px, 100% - 32px);
  padding: 0;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
}

.modal-header,
.modal-footer {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.modal-body {
  padding: 12px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.explorer-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.explorer-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.explorer-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.explorer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.explorer-dropzone {
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  padding: 4px;
  transition: border-color var(--transition-fast),
    background var(--transition-fast);
}

.explorer-dropzone.drag-over {
  border-color: rgba(59, 130, 246, 0.9);
  background: rgba(15, 23, 42, 0.8);
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.file-table th,
.file-table td {
  padding: 6px 8px;
}

.file-table thead {
  background: rgba(15, 23, 42, 0.9);
}

.file-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.65);
}

.file-table tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.35);
}

.file-table a {
  text-decoration: none;
}

.file-table a:hover {
  text-decoration: underline;
}

.col-actions {
  text-align: right;
  white-space: nowrap;
}

.inline-form {
  display: inline;
}

.file-input-hidden {
  display: none;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb-separator {
  opacity: 0.6;
}

.upload-progress {
  margin-top: 12px;
}

.upload-progress-bar {
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.upload-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.2s ease-out;
}

.upload-progress.hidden {
  display: none;
}

.bottom-nav {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 100% - 32px);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  z-index: 30;
  backdrop-filter: blur(18px);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
}

.bottom-nav-icon {
  font-size: 1rem;
}

.bottom-nav-label {
  font-size: 0.7rem;
}

.bottom-nav-item-active {
  color: #e5e7eb;
}

@media (max-width: 768px) {
  .page {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .card {
    padding: 18px 16px 14px;
  }

  .topbar {
    height: 50px;
    padding-inline: 14px;
  }

  .connections-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }
}

