/* PackTrail — style.css */
/* Aesthetic: Refined dark, editorial typography, precise spacing */

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

:root {
  /* Palette */
  --bg-base:      #f2f4ef;
  --bg-surface:   #ffffff;
  --bg-elevated:  #eaede4;
  --bg-input:     #f7f9f5;
  --bg-hover:     #e3e8db;

  --border:       rgba(0,0,0,0.09);
  --border-focus: rgba(74,121,51,0.55);

  --text-primary:   #1e2a18;
  --text-secondary: #4e6040;
  --text-muted:     #8a9a78;
  --text-link:      #3a7828;

  --accent:         #4a7933;
  --accent-hover:   #5a8f3f;
  --accent-dim:     rgba(74,121,51,0.1);

  --danger:         #c0392b;
  --danger-hover:   #e05040;
  --success:        #27a05a;

  --sidebar-w:      260px;
  --radius:         10px;
  --radius-sm:      6px;
  --transition:     150ms ease;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
}

html { font-size: 15px; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

img { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; }

/* ─── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 99px; }

/* ─── BRAND ─────────────────────────────────────────────── */
.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand-icon { font-size: 1.25rem; }

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

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

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #fff; }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ─── FORMS ─────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.form-group label small { font-weight: 400; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.form-group-sm { min-width: 70px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 11px;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(74,121,51,0.12);
}
textarea { resize: vertical; }
select { appearance: none; cursor: pointer; }

.inline-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-primary);
  padding: 3px 6px;
  font-size: 0.85rem;
  text-align: right;
  transition: border-color var(--transition), background var(--transition);
}
.inline-input:hover { background: var(--bg-input); border-color: var(--border); }
.inline-input:focus { background: var(--bg-input); border-color: var(--border-focus); outline: none; }

/* ─── ALERT ─────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.alert-error {
  background: rgba(192,57,43,0.08);
  border: 1px solid rgba(192,57,43,0.25);
  color: #8b1a0e;
}

/* ─── APP LAYOUT ────────────────────────────────────────── */
.app-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
}

.sidebar-section { padding: 16px 0; flex: 1; overflow-y: auto; }

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.list-nav { list-style: none; }
.list-nav-loading, .list-nav-empty {
  padding: 6px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.list-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
}
.list-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.list-nav-item.active {
  background: var(--accent-dim);
  color: var(--text-primary);
  border-right: 2px solid var(--accent);
}
.list-nav-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-nav-badge {
  font-size: 0.65rem;
  background: rgba(74,121,51,0.12);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 99px;
  font-weight: 500;
}

.sidebar-spacer { flex: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 6px 0;
  transition: color var(--transition);
}
.sidebar-footer-link:hover { color: var(--text-primary); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-avatar-link { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.sidebar-username { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; flex: 1; }
.sidebar-logout {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color var(--transition);
}
.sidebar-logout:hover { color: var(--danger); }

/* ─── MAIN CONTENT ──────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

/* ─── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}
.empty-icon { font-size: 3rem; margin-bottom: 8px; }
.empty-state h2 { font-family: var(--font-display); font-weight: 700; color: var(--text-primary); font-size: 1.4rem; }
.empty-state p { color: var(--text-secondary); max-width: 280px; }

/* ─── LIST EDITOR ───────────────────────────────────────── */
.list-editor { max-width: 960px; margin: 0 auto; padding: 32px 28px; width: 100%; }

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.editor-toolbar-left { flex: 1; }
.editor-toolbar-right { display: flex; align-items: center; gap: 10px; }

.list-title-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  padding: 0;
  outline: none;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
}
.list-title-input:focus { border-bottom-color: var(--accent); }
.list-title-input::placeholder { color: var(--text-muted); }

.unit-switcher {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.unit-btn {
  padding: 5px 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.unit-btn.active { background: var(--accent); color: #fff; }
.unit-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text-primary); }

.toolbar-actions { display: flex; align-items: center; gap: 6px; }

/* ─── DROPDOWN ──────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 100;
  overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger:hover { color: var(--danger-hover); }

/* ─── STATS STRIP ───────────────────────────────────────── */
.stats-strip {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}
.chart-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.chart-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.chart-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-primary);
  line-height: 1;
}
.chart-unit { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.stats-details { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.stat-row { display: flex; justify-content: space-between; align-items: center; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-value { font-size: 0.875rem; color: var(--text-primary); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ─── CATEGORIES ────────────────────────────────────────── */
.categories-wrap { display: flex; flex-direction: column; gap: 20px; }

.category-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* overflow: hidden removed — allows quick-add dropdown to overflow */
  position: relative;
}

/* Keep rounded corners on child elements at the edges */
.category-header {
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.cat-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 20px;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.cat-drag-handle:hover { opacity: 1; }
.cat-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.12);
}
.cat-color-dot:hover { transform: scale(1.25); }
.cat-name-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  padding: 0;
  outline: none;
}
.cat-name-input:focus { text-decoration: underline; text-decoration-color: var(--accent); }
.cat-total { font-size: 0.8rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; margin-left: auto; }
.cat-delete-btn { opacity: 0; transition: opacity var(--transition); color: var(--danger); }
.category-header:hover .cat-delete-btn { opacity: 1; }

/* ─── ITEMS TABLE ───────────────────────────────────────── */
.items-table { width: 100%; }

.col-num, .col-qty, .col-weight, .col-total { text-align: right; }
.col-flags, .col-actions { text-align: right; }

.item-row {
  display: grid;
  grid-template-columns: 20px 1fr 60px 80px 80px 60px 70px;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  gap: 4px;
}
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: var(--bg-hover); }

.item-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.item-row:hover .item-drag-handle { opacity: 0.6; }
.item-drag-handle:hover { opacity: 1 !important; }

.col-item {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.item-thumb {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.item-name-wrap { overflow: hidden; }
.item-name, .item-name-link {
  display: block;
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-name-link { color: var(--text-link); }
.item-name-link:hover { color: var(--accent-hover); }
.item-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-qty .inline-input { width: 50px; }
.col-weight .inline-input { width: 72px; }
.total-cell {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.col-flags { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
}
.flag-worn       { background: rgba(37,99,235,0.12); color: #1d58b0; }
.flag-consumable { background: rgba(161,98,7,0.12);  color: #7a5000; }
.flag-starred    { background: rgba(194,65,12,0.12); color: #913300; }

.col-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity var(--transition); }
.item-row:hover .col-actions { opacity: 1; }

/* ─── ADD ITEM / CATEGORY ───────────────────────────────── */
.add-item-row { padding: 6px 14px 10px 36px; }
.btn-add-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 4px 0;
  transition: color var(--transition);
}
.btn-add-item:hover { color: var(--accent); }

.add-category-wrap { margin-top: 16px; text-align: center; }
.btn-add-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 8px 16px;
}
.btn-add-category:hover { color: var(--text-primary); background: var(--bg-surface); }

/* ─── SORTABLE ──────────────────────────────────────────── */
.sortable-ghost { opacity: 0.4; background: var(--accent-dim) !important; border-radius: var(--radius-sm); }

/* ─── MODALS ────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,42,24,0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}
.modal-backdrop.open { display: flex; }

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

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.15s ease;
}
.modal-wide { max-width: 680px; }
.modal-sm   { max-width: 380px; }

@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: 18px 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Share modal */
.share-toggle { margin-bottom: 16px; }
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.toggle-switch {
  width: 36px;
  height: 20px;
  background: var(--bg-hover);
  border-radius: 99px;
  position: relative;
  border: 1px solid var(--border);
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle-label input:checked + .toggle-switch { background: var(--accent); border-color: var(--accent); }
.toggle-label input:checked + .toggle-switch::after { transform: translateX(16px); background: #fff; }
.toggle-label input { display: none; }

.share-url-wrap label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-bottom: 5px; display: block; }
.share-url-row { display: flex; gap: 8px; margin-bottom: 14px; }
.share-url-input { flex: 1; font-size: 0.8rem; }
.share-embed-row { display: flex; flex-direction: column; gap: 5px; }
.share-embed-row textarea { font-size: 0.75rem; font-family: monospace; resize: none; }

/* Item flags in modal */
.item-flags { display: flex; gap: 16px; margin-bottom: 4px; }
.flag-label { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--text-secondary); cursor: pointer; }
.flag-label input { accent-color: var(--accent); }

/* Gear modal */
.gear-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.gear-search { flex: 1; }
.gear-list { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.gear-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
.gear-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  transition: background var(--transition);
}
.gear-item:hover { background: var(--bg-hover); }
.gear-thumb, .gear-thumb-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.gear-thumb-placeholder { background: var(--bg-hover); }
.gear-item-info { flex: 1; overflow: hidden; }
.gear-item-name { display: block; font-size: 0.875rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear-item-desc { display: block; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear-item-weight { font-size: 0.8rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gear-delete-btn { color: var(--text-muted); opacity: 0; transition: opacity var(--transition); }
.gear-item:hover .gear-delete-btn { opacity: 1; }

/* ─── TOAST ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }

/* ─── AUTH PAGES ────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(74,121,51,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 80%, rgba(100,160,70,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.auth-container {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
}
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.1);
}
.auth-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.auth-subtitle { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-form .form-group { margin-bottom: 14px; }
.auth-form .btn { margin-top: 6px; padding: 10px; }
.auth-link { margin-top: 20px; text-align: center; font-size: 0.85rem; color: var(--text-muted); }

/* ─── LANDING / INDEX ───────────────────────────────────── */
.landing-page {
  min-height: 100vh;
  background: var(--bg-base);
}
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
}
.landing-nav-links { display: flex; align-items: center; gap: 10px; }
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 100px 24px 60px;
  position: relative;
}
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(74,121,51,0.09) 0%, transparent 70%);
  pointer-events: none;
}
.landing-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid rgba(74,121,51,0.2);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 20px;
}
.landing-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.04em;
  color: var(--text-primary);
  max-width: 700px;
  line-height: 1.1;
  margin-bottom: 18px;
  position: relative;
}
.landing-hero h1 em { font-style: normal; color: var(--accent); }
.landing-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 32px;
  position: relative;
  line-height: 1.65;
}
.landing-hero-cta { display: flex; gap: 12px; justify-content: center; position: relative; }
.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 40px 40px 80px;
  max-width: 1100px;
  margin: 0 auto;
}
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.feature-icon { font-size: 1.75rem; margin-bottom: 12px; }
.feature-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.feature-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.55; }

/* ─── SHARED LIST PAGE ──────────────────────────────────── */
.share-page { background: var(--bg-base); min-height: 100vh; }
.share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.share-container { max-width: 860px; margin: 0 auto; padding: 36px 24px; }
.share-hero { margin-bottom: 28px; }
.share-hero h1 { font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.03em; margin-bottom: 8px; }
.share-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

.share-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.share-stat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.share-stat-val { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.share-stat-val small { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.share-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.share-chart-wrap { display: flex; justify-content: center; margin-bottom: 32px; }
.share-chart-wrap canvas { max-width: 200px; }

.share-category { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.share-cat-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.share-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.share-cat-name { flex: 1; font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; }
.share-cat-weight { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.share-table { width: 100%; border-collapse: collapse; }
.share-table th, .share-table td { padding: 8px 14px; text-align: left; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.share-table tr:last-child td { border-bottom: none; }
.share-table th { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: rgba(0,0,0,0.03); }
.share-table tr:hover td { background: var(--bg-hover); }
.col-num { text-align: right; }
.share-table .col-flags { display: table-cell; text-align: right; white-space: nowrap; width: 1%; }
.share-item-name a { color: var(--text-link); }
.share-item-name a:hover { color: var(--accent-hover); }
.share-item-desc { font-size: 0.75rem; color: var(--text-muted); }

.share-footer { text-align: center; padding: 32px; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--border); }
.share-footer a { color: var(--accent); }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; transition: left 0.2s ease; }
  .sidebar.open { left: 0; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .items-header { display: none; }
  .item-row { grid-template-columns: 20px 1fr auto auto auto; }
  .col-weight, .col-total, .col-flags { display: none; }
  .list-editor { padding: 20px 16px; }
  .stats-strip { flex-direction: column; gap: 16px; align-items: flex-start; }
  .share-stats { grid-template-columns: repeat(2, 1fr); }
  .landing-nav { padding: 16px 20px; }
  .landing-features { padding: 24px 20px 60px; }
}

/* ─── SETTINGS PAGES ────────────────────────────────────── */
.settings-page { min-height: 100vh; background: var(--bg-base); }

.settings-shell {
  display: flex;
  min-height: 100vh;
}

.settings-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
}
.settings-brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }

.settings-nav { display: flex; flex-direction: column; padding: 12px 0; }
.settings-nav-link {
  padding: 8px 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  border-left: 2px solid transparent;
}
.settings-nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav-link.active { color: var(--text-primary); border-left-color: var(--accent); background: var(--accent-dim); }
.settings-nav-danger { color: var(--danger) !important; }
.settings-nav-danger:hover { background: rgba(239,68,68,0.1); }

.settings-sidebar-footer { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--border); }

.settings-main { flex: 1; overflow-y: auto; padding: 36px 28px; }
.settings-content { max-width: 620px; }

.account-summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.account-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.account-avatar:hover { opacity: 0.85; }
.account-avatar:hover .avatar-overlay { opacity: 1; }
.avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  color: #fff;
  pointer-events: none;
}
.account-info { flex: 1; }
.account-name  { font-weight: 600; font-size: 1rem; color: var(--text-primary); }
.account-email { font-size: 0.8rem; color: var(--text-muted); }
.account-stats { display: flex; gap: 16px; }
.acct-stat { font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.acct-stat strong { display: block; font-size: 1.1rem; color: var(--text-primary); font-family: var(--font-display); font-weight: 700; }

.settings-section { margin-bottom: 36px; }
.settings-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.danger-title { color: var(--danger); }

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.settings-card-danger { border-color: rgba(239,68,68,0.25); }
.rates-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.rates-table th { text-align: left; padding: 6px 8px; color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.rates-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.rates-table tr:last-child td { border-bottom: none; }
.rates-table .rate-input { width: 120px; text-align: right; }

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; display: block; }

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }

.danger-description { margin-bottom: 16px; }
.danger-description h3 { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.danger-description p  { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.55; }

.alert-success {
  background: rgba(39,160,90,0.1);
  border: 1px solid rgba(39,160,90,0.3);
  color: #166f3a;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.875rem;
}

/* ─── DROPDOWN DIVIDER ──────────────────────────────────── */
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ─── LIST DESC INPUT ───────────────────────────────────── */
.list-desc-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0;
  margin-top: 4px;
  outline: none;
  resize: none;
  line-height: 1.5;
  overflow: hidden;
}
.list-desc-input:focus { color: var(--text-primary); }
.list-desc-input::placeholder { color: var(--text-muted); }

/* ─── ITEM IMAGE PREVIEW ────────────────────────────────── */
.item-image-preview {
  margin-top: 8px;
  max-width: 160px;
  max-height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
}

/* ─── IMPORT PAGE ───────────────────────────────────────── */
.file-drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-drop-label { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.file-drop-icon  { font-size: 2rem; }
.file-drop-label span { font-size: 0.9rem; color: var(--text-secondary); }
.file-drop-label small { font-size: 0.75rem; color: var(--text-muted); }
.file-browse-link { color: var(--accent); }

.import-format-hint {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.import-format-hint h4 { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.import-format-hint code {
  display: block;
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(74,121,51,0.08);
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  word-break: break-all;
}
.import-format-hint p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; }

/* ─── LOADING STATE ─────────────────────────────────────── */
body.is-loading::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  animation: loading-bar 1.2s ease infinite;
  z-index: 9999;
}
@keyframes loading-bar {
  0%   { transform: scaleX(0); transform-origin: left; }
  50%  { transform: scaleX(0.7); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; opacity: 0; }
}

/* ─── SIDEBAR USERNAME LINK ─────────────────────────────── */
.sidebar-username {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}
.sidebar-username:hover { color: var(--text-primary); }

/* ─── GEAR THUMB PLACEHOLDER ────────────────────────────── */
.gear-thumb-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: var(--bg-hover);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* ─── STATS TABLE (new layout) ──────────────────────────── */
.stats-strip {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}
.chart-wrap {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  position: relative;
}
.stats-table-wrap { flex: 1; overflow-x: auto; }
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.stats-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 8px 8px 0;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.stats-table th.stats-num { text-align: right; }
.stats-table td { padding: 5px 8px 5px 0; }
.stats-num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.stats-cat-row td { color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.stats-total-row td { font-weight: 700; color: var(--text-primary); border-top: 2px solid var(--border); border-bottom: 1px solid var(--border); padding-top: 8px; }
.stats-sub-row td { color: var(--text-muted); font-size: 0.8rem; }
.stats-base-row td { font-weight: 600; color: var(--text-secondary); }

/* ─── ITEM ROW UPDATES ───────────────────────────────────── */
/* Columns: drag | item | price | weight+unit | qty | flags | actions */
.items-header {
  display: grid;
  grid-template-columns: 20px 1fr 100px 170px 55px 130px 80px 70px;
  padding: 6px 14px;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.03);
}
.items-header span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
}
/* Match exact alignment of each row cell */
/* Price: the € symbol sits left of the input, so offset header right */
.items-header .col-price     { justify-content: flex-end; padding-right: 4px; }
/* Weight: unit label (g/oz) sits right of the input, offset header left */
.items-header .col-weight-h  { justify-content: flex-end; padding-right: 42px; }
.items-header .col-qty-h     { justify-content: center; }
.items-header .col-importance { justify-content: center; }
.items-header .col-flags     { justify-content: flex-end; }
.items-header .col-actions   { justify-content: flex-end; }
.item-row {
  display: grid;
  grid-template-columns: 20px 1fr 100px 170px 55px 130px 80px 70px;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  gap: 4px;
  min-height: 52px;
}

.col-price { display: flex; align-items: center; justify-content: flex-end; }
.price-display { display: flex; align-items: center; gap: 2px; font-size: 0.82rem; color: var(--text-muted); width: 100%; justify-content: flex-end; }
.price-input { width: 72px; text-align: right; }

.col-weight-h { display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.col-weight-h .inline-input { width: 85px; }
.unit-sel {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 3px 4px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  text-align: center;
}
.unit-sel:focus { color: var(--text-primary); border-color: var(--border-focus); }

.col-qty-h { display: flex; align-items: center; justify-content: flex-end; }
.col-qty-h .inline-input { width: 44px; text-align: center; }

.cat-meta { font-size: 0.8rem; color: var(--text-secondary); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ─── GEAR INVENTORY TABLE ───────────────────────────────── */
.gear-inventory-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.gear-inv-header {
  display: grid;
  grid-template-columns: 50px 1fr 110px 160px 80px 140px 90px;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.03);
}
.gear-inv-header span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gear-inv-row {
  display: grid;
  grid-template-columns: 50px 1fr 110px 160px 80px 140px 90px;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  min-height: 56px;
  gap: 6px;
}
.gear-inv-row:last-child { border-bottom: none; }
.gear-inv-row:hover { background: var(--bg-hover); }
.gear-inv-photo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
}
.gear-inv-photo-empty {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color var(--transition);
}
.gear-inv-photo-empty:hover { border-color: var(--accent); }
.gear-inv-name-wrap { overflow: hidden; }
.gear-inv-name {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  padding: 2px 0;
  outline: none;
  transition: border-color var(--transition);
}
.gear-inv-name:focus { border-bottom-color: var(--accent); }
.gear-inv-desc {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 100%;
  padding: 2px 0;
  outline: none;
}
.gear-inv-desc:focus { color: var(--text-secondary); }
.gear-inv-price { display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.gear-inv-price .price-sym { font-size: 0.78rem; color: var(--text-muted); }
.gear-inv-weight { display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.gear-inv-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.gear-inv-num { width: 85px; text-align: right; }
.gear-add-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.gear-inv-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.gear-inv-search { flex: 1; }
.gear-currency-sel {
  width: 64px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 4px 6px;
  font-size: 0.82rem;
}

/* ─── ITEM THUMBNAIL ─────────────────────────────────────── */
.item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.item-thumb-empty {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* ─── STAR BUTTON ────────────────────────────────────────── */
.star-btn {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: transform var(--transition);
  line-height: 1;
}
.star-btn:hover { transform: scale(1.2); }
.star-off    { color: var(--text-muted); }
.star-red    { color: #ef4444; }
.star-yellow { color: #f59e0b; }
.star-blue   { color: #60a5fa; }
.star-green  { color: #10b981; }

/* ─── QUICK ADD ROW ──────────────────────────────────────── */
.quick-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}
.quick-add-name   { flex: 1; }
.quick-add-weight { width: 70px; }
.quick-add-unit   { width: 50px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); padding: 6px 4px; font-size: 0.85rem; }
.quick-add-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-dim); border: 1px solid rgba(74,121,51,0.3);
  color: var(--accent); font-size: 0.82rem; font-weight: 500;
  padding: 5px 10px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--transition);
}
.quick-add-btn:hover { background: var(--accent); color: #fff; }
.gear-pick-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  padding: 5px 10px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.gear-pick-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ─── GEAR ITEM (with price) ─────────────────────────────── */
.gear-item-price {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-right: 4px;
}
.gear-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  transition: background var(--transition);
  margin-bottom: 4px;
}
.gear-picker-item:hover { background: var(--bg-hover); }

/* ─── RESPONSIVE UPDATE ──────────────────────────────────── */
@media (max-width: 768px) {
  .stats-strip { flex-direction: column; }
  .chart-wrap  { width: 140px; height: 140px; margin: 0 auto; }
  .items-header { display: none; }
  .item-row { grid-template-columns: 20px 1fr auto auto; }
  .col-price, .col-weight-h, .col-qty-h { display: none; }
}

/* ─── LIGHTBOX ───────────────────────────────────────────── */
.lightbox-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.15s ease;
}
.lightbox-backdrop.open {
  display: flex;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 32px 80px rgba(0,0,0,0.18);
  animation: slideUp 0.15s ease;
  cursor: default;
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* Make item thumbnails and gear photos show a zoom cursor */
.item-thumb,
.gear-inv-photo {
  cursor: zoom-in;
}

/* ─── SAVE TO INVENTORY BUTTON ───────────────────────────── */
.save-to-inv-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.save-to-inv-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: rgba(74,121,51,0.4); }
.save-to-inv-btn.saved { background: rgba(16,185,129,0.15); color: var(--success); border-color: rgba(16,185,129,0.3); cursor: default; }
.import-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid rgba(74,121,51,0.3);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.import-all-btn:hover { background: var(--accent); color: #fff; }

/* ─── UNIT LABEL (replaces per-item unit selector) ───────── */
.unit-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 4px;
  white-space: nowrap;
  min-width: 20px;
}

/* ─── PRICE SYMBOL SPACING ───────────────────────────────── */
.price-sym-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
}
.price-display {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-end;
}
/* Also fix gear inventory price symbol spacing */
.gear-inv-price .price-sym {
  margin-right: 4px;
}

/* ─── UPLOAD AREA ─────────────────────────────────────────── */
.upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  overflow: hidden;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.upload-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  pointer-events: none;
  padding: 16px;
  text-align: center;
}
.upload-placeholder span { font-size: 0.875rem; color: var(--text-secondary); }
.upload-placeholder small { font-size: 0.75rem; }
.upload-placeholder svg { color: var(--text-muted); }
.upload-preview {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* ─── INVENTORY PAGE ──────────────────────────────────────── */
.inv-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 28px;
  width: 100%;
}
.inv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.inv-toolbar-left { display: flex; align-items: baseline; gap: 12px; }
.inv-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.inv-count { font-size: 0.85rem; color: var(--text-muted); }
.inv-toolbar-right { display: flex; align-items: center; gap: 8px; }
.inv-search { width: 220px; }
.inv-unit-sel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}
#listCurrencySel { min-width: 72px; }

.inv-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* 7-column gear inventory grid: photo | name | price | weight | currency | location | actions */
.gear-inv-row-7 {
  display: grid !important;
  grid-template-columns: 50px 1fr 110px 160px 80px 140px 90px !important;
}

/* Location input in inventory rows */
.gear-inv-location-in {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 4px 6px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.gear-inv-location-in:hover { background: var(--bg-input); border-color: var(--border); }
.gear-inv-location-in:focus { background: var(--bg-input); border-color: var(--border-focus); color: var(--text-primary); }
.gear-inv-location-in::placeholder { color: var(--text-muted); font-style: italic; }

/* ─── LOCATION AUTOCOMPLETE ───────────────────────────────── */
.location-input-wrap { position: relative; }
.location-suggestions {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 50;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.location-suggestions-inline {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 100;
  max-height: 160px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.loc-suggestion {
  padding: 7px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.loc-suggestion:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ─── INVENTORY VIEW TOGGLE ───────────────────────────────── */
.inv-view-toggle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.inv-view-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.inv-view-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.inv-view-btn.active { background: var(--accent-dim); color: var(--text-primary); }

/* ─── LOCATION GROUPS ─────────────────────────────────────── */
.inv-location-group { border-bottom: 2px solid var(--border); }
.inv-location-group:last-child { border-bottom: none; }
.inv-location-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.inv-location-icon { font-size: 0.9rem; }
.inv-location-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  flex: 1;
}
.inv-location-count { font-size: 0.78rem; color: var(--text-muted); }

/* ─── MANAGE LOCATIONS MODAL ─────────────────────────────── */
.location-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.location-manage-row:last-child { border-bottom: none; }
.location-manage-name { flex: 1; font-size: 0.875rem; color: var(--text-primary); }
.location-manage-count { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.location-add-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.location-add-row input { flex: 1; }

/* ─── IMPORTANCE DROPDOWN ────────────────────────────────── */
.importance-sel {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 3px 4px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.importance-sel:hover { background: var(--bg-input); border-color: var(--border); }
.importance-sel:focus { border-color: var(--border-focus); background: var(--bg-input); }

/* Color-code by importance */
.importance-sel[data-val="must_have"]    { color: #ef4444; font-weight: 600; }
.importance-sel[data-val="optional"]     { color: #f59e0b; }
.importance-sel[data-val="nice_to_have"] { color: #10b981; }
.importance-sel[data-val="luxury"]       { color: #8b5cf6; }
.importance-sel[data-val="discarded"]    { color: var(--text-muted); text-decoration: line-through; }

/* Dim discarded item rows */
.item-row.is-discarded {
  opacity: 0.45;
}
.item-row.is-discarded .item-name,
.item-row.is-discarded .item-name-link {
  text-decoration: line-through;
}

/* ─── QUICK-ADD GEAR SEARCH ──────────────────────────────── */
.quick-search-wrap {
  flex: 1;
  position: relative;
}
.quick-add-name {
  width: 100%;
}
.quick-search-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.1);
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 4px;
}
.quick-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition);
  outline: none;
}
.quick-search-item:hover,
.quick-search-item:focus {
  background: var(--bg-hover);
}
.qs-thumb {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.qs-thumb-empty {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: var(--bg-hover);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.qs-info {
  flex: 1;
  overflow: hidden;
}
.qs-name {
  display: block;
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-weight {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Disable state for Add button */
.quick-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── QUICK-ADD SEARCH BAR ───────────────────────────────── */
.quick-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}
.quick-search-wrap {
  flex: 1;
  position: relative;
}
.quick-add-name {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  padding: 7px 12px;
  outline: none;
  transition: border-color var(--transition);
}
.quick-add-name:focus { border-color: var(--border-focus); }
.quick-add-name::placeholder { color: var(--text-muted); }

/* Dropdown results */
.quick-search-dropdown {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 500;
  max-height: 280px;
  overflow-y: auto;
  min-width: 300px;
}
.quick-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition);
  outline: none;
  border-bottom: 1px solid var(--border);
}
.quick-search-item:last-child { border-bottom: none; }
.quick-search-item:hover,
.quick-search-item:focus { background: var(--bg-hover); }

.qs-thumb {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.qs-thumb-empty {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  background: var(--bg-hover);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.qs-info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qs-name {
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-weight {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Quick-add button */
.quick-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), opacity var(--transition);
}
.quick-add-btn:hover:not(:disabled) { background: var(--accent-hover); }
.quick-add-btn:disabled { opacity: 0.4; cursor: default; }

/* ─── IMAGE SOURCE ROW ───────────────────────────────────── */
.image-source-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.image-source-row input { flex: 1; }

/* ─── GLOBAL GEAR SEARCH DROPDOWN ───────────────────────── */
#gearSearchDropdown .quick-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
#gearSearchDropdown .quick-search-item:last-child { border-bottom: none; }
#gearSearchDropdown .quick-search-item:hover { background: var(--bg-hover); }

/* ─── GEAR INVENTORY SUBTITLE ────────────────────────────── */
.gear-inv-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
