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

:root {
  /* Warm & Bright Honeymoon Theme */
  --bg-primary: #faf8f5;
  --bg-secondary: #fff;
  --bg-card: #fff;
  --bg-elevated: #fff;

  --text-primary: #2d2a26;
  --text-secondary: #6b6560;
  --text-muted: #9d9792;

  /* Romantic warm accents */
  --accent: #e07850;
  --accent-light: #f4a88a;
  --accent-hover: #c96840;
  --accent-glow: rgba(224, 120, 80, 0.12);

  --gold: #d4a853;
  --terracotta: #c75d3a;
  --coral: #f08080;
  --teal: #2a9d8f;

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  --border: rgba(0,0,0,0.06);
  --border-light: rgba(0,0,0,0.1);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
}

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

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--coral) 100%);
  padding: 10px 16px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  color: white;
}

.header h1 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: white;
}

.header p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.85);
  margin-top: 1px;
  font-weight: 400;
}

.header-back {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-back:hover {
  background: rgba(255,255,255,0.3);
}

/* Page */
.page {
  padding: 12px;
}

/* Hero Section for Home */
.hero {
  text-align: center;
  padding: 32px 0;
  margin-bottom: 8px;
}

.hero-emoji {
  font-size: 3.5rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* D-Day Counter */
.counter {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.counter-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.counter-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

.card:active {
  transform: scale(0.98);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-glow), rgba(240,128,128,0.1));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  flex-shrink: 0;
}

.card-body {
  flex: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.card-arrow {
  color: var(--text-muted);
  font-size: 1.125rem;
  transition: all 0.2s ease;
}

.card:hover .card-arrow {
  color: var(--accent);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  margin: 0 -4px 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  background: white;
  border: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-xl);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

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

/* Stats Grid */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  background: white;
  padding: 16px 12px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat.success .stat-value { color: var(--success); }
.stat.warning .stat-value { color: var(--warning); }
.stat.accent .stat-value { color: var(--accent); }

/* Progress Bar */
.progress-bar {
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Checklist */
.checklist-category {
  margin-bottom: 32px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.category-icon {
  font-size: 1.25rem;
}

.category-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.category-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 10px;
  border-radius: var(--radius-xl);
  font-weight: 600;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: white;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}

.checklist-item.checked {
  opacity: 0.5;
}

.checklist-item.checked .item-name {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.checklist-item.required .item-name::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--error);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  margin-top: 1px;
  background: var(--bg-primary);
}

.checkbox:hover {
  border-color: var(--accent);
}

.checkbox.checked {
  background: var(--success);
  border-color: var(--success);
}

.checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

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

.item-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.item-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

.item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.item-edit,
.item-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-edit:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.item-delete:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.add-item-btn {
  width: 100%;
  padding: 10px;
  border: 2px dashed var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.add-item-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

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

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

textarea.form-input {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(224, 122, 61, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.btn-secondary:hover {
  background: var(--bg-card);
  box-shadow: none;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.8125rem;
}

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

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

/* Journal / Day List */
.day-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.day-item:hover {
  box-shadow: var(--shadow-md);
}

.day-number {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-glow), rgba(240,128,128,0.1));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
}

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

.day-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.day-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.day-status {
  font-size: 1.5rem;
}

.day-edit {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
}

.day-edit:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.photo-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
}

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

.photo-item:hover img {
  transform: scale(1.05);
}

.photo-add {
  background: white;
  border: 2px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.photo-item:hover .photo-delete {
  display: flex;
}

.photo-delete:hover {
  background: var(--error);
}

/* Monitor / Logs */
.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.monitor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.logs-container {
  background: #1e1e1e;
  border-radius: var(--radius-md);
  padding: 14px;
  max-height: 60vh;
  overflow-y: auto;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.7rem;
  line-height: 1.5;
}

.log-line {
  padding: 2px 0;
  white-space: pre-wrap;
  word-break: break-all;
  color: #a0a0a0;
}

.log-line.success { color: var(--success); }
.log-line.warning { color: var(--warning); }
.log-line.error { color: var(--error); }
.log-line.info { color: var(--info); }

/* Alert Rules */
.alert-rules {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.alert-rules .rule {
  background: white;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

/* Found Logs Section */
.found-logs {
  background: white;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.found-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.found-item {
  font-size: 0.75rem;
  padding: 6px 8px;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  color: var(--success);
  word-break: break-all;
}

.found-item:last-child {
  margin-bottom: 0;
}

.no-found {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
}

/* Monitor Actions */
.monitor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
  background: var(--accent-glow);
  transform: scale(1.05);
}

.btn-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Plan Share & Download */
.plan-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-share,
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-share:hover,
.btn-download:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-download {
  border-color: var(--teal);
  color: var(--teal);
}

.btn-download:hover {
  background: rgba(42, 157, 143, 0.1);
  border-color: var(--teal);
  color: var(--teal);
}

/* Shared Plan View */
.shared-header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--coral) 100%);
  padding: 24px 16px;
  text-align: center;
  color: white;
}

.shared-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.shared-header h1 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.shared-header p {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.85);
}

.shared-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

/* Blur effect */
.blurred {
  filter: blur(10px);
  user-select: none;
  pointer-events: none;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  gap: 16px;
}

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

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

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideUp 0.3s ease;
  font-size: 0.8125rem;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--error);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* Plan Content */
.plan-content {
  background: transparent;
  padding: 0;
  line-height: 1.6;
  font-size: 0.8125rem;
}

.plan-content .table-wrapper {
  overflow-x: auto;
  margin: 12px -12px;
  padding: 0 12px;
  -webkit-overflow-scrolling: touch;
}

.plan-content table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  white-space: nowrap;
}

.plan-content th,
.plan-content td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.plan-content th {
  background: var(--accent);
  color: white;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.plan-content td {
  color: var(--text-primary);
  background: white;
}

.plan-content tr:hover td {
  background: var(--accent-glow);
}

.plan-content h1 {
  font-size: 1.125rem;
  margin: 20px 0 12px;
  color: var(--text-primary);
}

.plan-content h2 {
  font-size: 1rem;
  margin: 16px 0 10px;
  color: var(--accent);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.plan-content h3 {
  font-size: 0.875rem;
  margin: 12px 0 8px;
  color: var(--accent-light);
}

.plan-content p {
  margin: 8px 0;
  color: var(--text-secondary);
}

.plan-content ul, .plan-content ol {
  margin: 8px 0 8px 16px;
}

.plan-content li {
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.plan-content code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.plan-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  font-size: 0.75rem;
  margin: 8px 0;
}

.plan-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.plan-content strong {
  color: var(--text-primary);
}

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.history-item {
  padding: 12px 14px;
  background: white;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  box-shadow: var(--shadow-sm);
}

.history-meta {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 6px;
}

.history-summary {
  color: var(--text-secondary);
}

/* Admin Section */
.admin-section {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.admin-section h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

/* 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;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

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

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
}

.modal h2 {
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: var(--error);
}

/* Section Title */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.9375rem;
}

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

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Terminal Fullscreen */
.terminal-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1e1e1e;
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

.terminal-top-bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: #2d2d2d;
  align-items: center;
  flex-shrink: 0;
}

.terminal-top-bar .terminal-status {
  margin-left: auto;
}

.terminal-status {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--warning);
  color: white;
}

.terminal-status.connected {
  background: var(--success);
}

.terminal-status.disconnected {
  background: var(--error);
}

#terminal-container {
  flex: 1;
  background: #1e1e1e;
  overflow: hidden;
}

#terminal-container .xterm {
  padding: 4px;
  height: 100%;
}

#terminal-container .xterm-viewport {
  overflow-y: auto;
}

.terminal-bottom-bar {
  background: #2d2d2d;
  padding: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.terminal-scroll-btns {
  display: flex;
  gap: 4px;
}

.terminal-scroll-btns button {
  flex: 1;
  padding: 10px 4px;
  font-size: 0.75rem;
}

/* Terminal buttons - dark theme */
.terminal-fullscreen .btn-sm {
  background: #3a3a3a;
  border: 1px solid #555;
  color: #e0e0e0;
}

.terminal-fullscreen .btn-sm:active {
  background: #4a4a4a;
}

.terminal-fullscreen .btn-outline {
  background: transparent;
  border: 1px solid #0dbc79;
  color: #0dbc79;
}

.terminal-fullscreen .btn-outline:active {
  background: #0dbc79;
  color: #1e1e1e;
}

.terminal-input-form {
  display: flex;
  gap: 8px;
}

.terminal-input {
  flex: 1;
  padding: 12px;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 16px;
}

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

.terminal-input::placeholder {
  color: #666;
}

/* Responsive */
@media (min-width: 768px) {
  #app {
    max-width: 600px;
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .photo-grid {
    gap: 12px;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Timeline Entries */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.timeline-entry {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: 70px;
  top: 52px;
  bottom: -20px;
  width: 2px;
  background: var(--border-light);
}

.timeline-entry:last-child::before {
  display: none;
}

.timeline-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 58px;
}

.timeline-time input[type="time"] {
  width: 58px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  text-align: center;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.timeline-time input[type="time"]:focus {
  outline: none;
  border-color: var(--accent);
}

.entry-delete {
  width: 24px;
  height: 24px;
  border: none;
  background: var(--error);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

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

.timeline-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-content .photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.timeline-content .photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.timeline-content .photo-upload-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 24px;
  transition: all 0.2s;
}

.timeline-content .photo-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.timeline-comment {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  resize: vertical;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.timeline-comment:focus {
  outline: none;
  border-color: var(--accent);
}

.timeline-comment::placeholder {
  color: var(--text-muted);
}

.add-entry-btn {
  width: 100%;
  padding: 14px;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.add-entry-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.add-entry-btn span {
  font-size: 1.2rem;
  font-weight: 300;
}

/* Preview Timeline */
.preview-page {
  padding-bottom: 40px;
}

.preview-day {
  margin-bottom: 32px;
}

.preview-day-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--coral) 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  color: white;
  flex-wrap: wrap;
}

.preview-day-num {
  font-weight: 700;
  font-size: 1.1rem;
}

.preview-day-title {
  font-weight: 500;
  flex: 1;
}

.preview-day-date {
  font-size: 0.8rem;
  opacity: 0.85;
}

.preview-entries {
  padding-left: 8px;
}

.preview-entry {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 20px;
}

.preview-entry::before {
  content: '';
  position: absolute;
  left: 47px;
  top: 24px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--border-light), transparent);
}

.preview-entry.last::before {
  display: none;
}

.preview-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 56px;
}

.preview-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--border-light);
  z-index: 1;
}

.preview-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.preview-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.preview-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
}

.preview-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.preview-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.preview-photo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s;
}

.preview-photo:hover {
  transform: scale(1.05);
}

.preview-comment {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.preview-comment.blurred {
  color: var(--text-muted);
  font-style: italic;
  filter: none;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Edit Timeline */
.edit-page {
  padding-bottom: 40px;
}

.edit-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 8px;
}

.edit-entry {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 24px;
  max-width: 100%;
}

.edit-entry::before {
  content: '';
  position: absolute;
  left: 35px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-light), transparent);
}

.edit-entry.last::before {
  display: none;
}

.edit-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 72px;
}

.edit-time {
  width: 72px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
}

.edit-time:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.edit-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--accent-light);
}

.edit-card {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: visible;
}

.edit-card-delete {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border: 2px solid white;
  background: var(--error);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
  z-index: 10;
}

.edit-card-delete:hover {
  transform: scale(1.1);
}

.edit-photos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.edit-photos-row {
  display: flex;
  gap: 10px;
  overflow: visible;
}

.edit-photo {
  position: relative;
  flex-shrink: 0;
}

.edit-photo img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.edit-photo-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.2s;
}

.edit-photo-delete:hover {
  background: var(--error);
}

.edit-photo-add {
  height: 40px;
  padding: 0 16px;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}

.edit-photo-add span {
  font-size: 1.1rem;
  line-height: 1;
}

.edit-photo-add small {
  font-size: 0.85rem;
}

.edit-photo-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.edit-comment {
  width: 100%;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  resize: vertical;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
}

.edit-comment:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.edit-comment::placeholder {
  color: var(--text-muted);
}

.edit-photo-more {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.edit-photo-more:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* Photo Gallery Modal */
.photo-gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(0,0,0,0.5);
}

.gallery-count {
  color: white;
  font-size: 1rem;
  font-weight: 500;
}

.gallery-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: white;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-content: start;
}

.gallery-grid > img,
.gallery-item {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.gallery-item {
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.gallery-item-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--error);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

/* Preview +N button */
.preview-photo-more {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.preview-photo-more:hover {
  background: rgba(0,0,0,0.8);
}

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

/* Upload Overlay */
.upload-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-progress {
  background: white;
  padding: 24px 32px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.upload-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

.upload-text {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
}

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

/* Expense Input */
.expense-input-section {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.expense-textarea {
  flex: 1;
  min-height: 50px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  background: white;
}

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

.expense-input-section .btn {
  width: auto;
  padding: 12px 20px;
  flex-shrink: 0;
  align-self: flex-end;
}

.expense-actions {
  margin-bottom: 16px;
}

.expense-actions .btn {
  width: auto;
}

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

.form-row {
  display: flex;
  gap: 12px;
}

.form-group.half {
  flex: 1;
}
