/* ═══════════════════════════════════════════════════════════════════════════
   Einkaufsliste – Stylesheet
   Warm, handcrafted feel. Nunito für UI, Caveat für den Einkaufszettel.
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:          #f5f0e8;
  --bg2:         #ede8df;
  --bg3:         #e4ddd2;
  --surface:     #fdfaf5;
  --surface2:    #f8f4ed;
  --border:      #d5cfc4;
  --border2:     #c8c0b3;
  --text:        #2c2416;
  --text2:       #6b5f4e;
  --text3:       #9c9080;
  --accent:      #e85d2e;
  --accent2:     #ff7a4d;
  --accent-bg:   #fdeee8;
  --green:       #3a7d44;
  --green-bg:    #e8f5eb;
  --blue:        #2563a8;
  --blue-bg:     #e8f0fb;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   18px;
  --font:        'Nunito', sans-serif;
  --font-hand:   'Caveat', cursive;
  --sidebar-w:   260px;
  --topbar-h:    60px;
  --transition:  0.18s ease;
}

html, body { height: 100%; }
body { overflow: hidden; }
body.page-scrollable { overflow-y: auto; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ─── Auth Pages ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
  overflow: auto;
}

.auth-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-logo-icon { font-size: 32px; }
.auth-logo-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.auth-info {
  color: var(--text2);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.auth-error {
  background: #fdecea;
  border: 1.5px solid #f5c6c2;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 18px;
}

/* ── Profile page ── */
.profile-page {
  min-height: 100vh;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 32px 16px 48px;
  background: var(--bg);
}
.profile-card {
  width: 100%;
  max-width: 460px;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.profile-avatar {
  width: 48px; height: 48px;
  font-size: 20px; font-weight: 800;
  background: var(--accent); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-heading {
  font-size: 20px; font-weight: 800; margin: 0;
}
.profile-username {
  font-size: 13px; color: var(--text3);
}
.profile-back {
  margin-left: auto;
  font-size: 13px; color: var(--text2);
  text-decoration: none; white-space: nowrap;
}
.profile-back:hover { color: var(--accent); }
.profile-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin: 0 0 14px;
}
.auth-hint {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text3);
  text-align: center;
}
.auth-hint code {
  background: var(--bg2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 700; color: var(--text2); }
.form-group input {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,93,46,.15);
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover { background: var(--accent2); }
.btn-primary:active { transform: scale(.97); }
.btn-full { width: 100%; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  color: var(--text2);
  transition: background var(--transition), color var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg2); color: var(--accent); }

/* ─── App Layout ──────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition);
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1.5px solid var(--border);
}
.sidebar-logo { font-size: 22px; }
.sidebar-title { font-size: 17px; font-weight: 800; flex: 1; }
.app-version { font-size: 10px; font-weight: 600; color: var(--text3);
  vertical-align: super; margin-left: 4px; letter-spacing: .02em; }
.sidebar-close {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--text3);
  padding: 4px 6px; border-radius: var(--radius-sm);
}
.sidebar-close:hover { background: var(--bg2); color: var(--text); }

.sidebar-section {
  padding: 14px 12px 8px;
  border-bottom: 1.5px solid var(--border);
}
.sidebar-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 4px;
  margin-bottom: 8px;
}

.household-list, .store-type-list {
  display: flex; flex-direction: column; gap: 3px;
}

.household-btn, .store-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 600;
  color: var(--text2);
  text-align: left;
  width: 100%;
  transition: background var(--transition), color var(--transition);
}
.household-btn:hover, .store-btn:hover {
  background: var(--bg2);
  color: var(--text);
}
.household-btn.active, .store-btn.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.household-icon, .store-icon { font-size: 18px; flex-shrink: 0; }
.household-name, .store-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.store-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

/* Sidebar scrollable section */
.sidebar-section:nth-child(2) { flex: 1; overflow-y: auto; border-bottom: none; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
}
.user-info { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
  background: none; border: none; cursor: pointer;
  font-size: 20px; padding: 6px; border-radius: var(--radius-sm);
  color: var(--text3); text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.btn-logout:hover { background: var(--bg2); color: var(--accent); }

/* ─── Main area ───────────────────────────────────────────────────────────── */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 22px; padding: 6px; color: var(--text2);
  border-radius: var(--radius-sm);
}
.menu-toggle:hover { background: var(--bg2); }

.topbar-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sep { margin: 0 6px; color: var(--text3); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.ws-indicator {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border2);
  transition: background .3s;
  flex-shrink: 0;
}
.ws-indicator.connected    { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.ws-indicator.disconnected { background: #ef4444; box-shadow: 0 0 0 3px #fee2e2; }

.btn-mode {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  color: var(--text2);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-mode:hover { background: var(--bg2); border-color: var(--accent); color: var(--accent); }
.btn-mode.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-mode-icon { font-size: 17px; }
.btn-mode-label { white-space: nowrap; }

/* ─── Content ─────────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  overflow: hidden;
  padding: 20px;
  position: relative;
}

.normal-view, .shopping-view {
  height: 100%;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ─── Two-Column Layout ───────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: 100%;
}

/* ─── Panels ──────────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  padding: 14px 16px 12px;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}
.panel-title {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}
.list-count {
  font-size: 12px;
  color: var(--text3);
  font-weight: 600;
  background: var(--bg2);
  padding: 2px 8px;
  border-radius: 20px;
}

/* ─── Suggestions ─────────────────────────────────────────────────────────── */
.btn-collapse {
  display: none;
  transition: transform var(--transition);
}
.panel-suggestions.collapsed .btn-collapse .collapse-icon {
  transform: rotate(-90deg);
  display: inline-block;
}
.panel-suggestions.collapsed .suggestions-grid {
  max-height: 60px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
}

/* Adjust grid layout when suggestions are collapsed on mobile */
@media (max-width: 900px) {
  .btn-collapse {
    display: flex;
  }
  .two-col:has(.panel-suggestions.collapsed) {
    grid-template-rows: auto 1fr;
  }
}

.panel-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.panel-search input {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.panel-search input:focus { border-color: var(--accent); }

.btn-add-suggestion {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1.5px solid #f7c4b0;
  font-size: 20px;
  padding: 4px 9px;
  flex-shrink: 0;
}
.btn-add-suggestion:hover { background: var(--accent); color: #fff; }

.suggestions-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: flex-start;
}

.suggestion-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition), box-shadow var(--transition);
  color: var(--text);
}
.suggestion-chip:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.suggestion-chip:active { cursor: grabbing; transform: scale(1.04); }
.suggestion-chip.dragging { opacity: .5; }

.suggestion-chip-del {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text3);
  padding: 0 2px; margin-left: 2px;
  display: flex; align-items: center;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
}
.suggestion-chip:hover .suggestion-chip-del { opacity: 1; }
.suggestion-chip-del:hover { color: #ef4444; }

.suggestion-chip-add {
  background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--text3);
  padding: 0 2px;
  display: flex; align-items: center;
  transition: color var(--transition);
}
.suggestion-chip-add:hover { color: var(--green); }

/* ─── Panel Temp Add (in header) ──────────────────────────────────────────── */
.panel-temp-add {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.panel-temp-add input {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--accent-bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.panel-temp-add input:focus {
  border-color: var(--accent);
  border-style: solid;
  background: var(--surface);
}
.btn-add-temp {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1.5px solid #f7c4b0;
  font-size: 20px;
  padding: 4px 9px;
  flex-shrink: 0;
}
.btn-add-temp:hover {
  background: var(--accent);
  color: #fff;
}

/* ─── Shopping List Items ─────────────────────────────────────────────────── */
.list-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
  animation: slideIn .18s ease;
}
.list-item:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.list-item-name {
  flex: 1;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-by {
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
}

.list-item-temporary {
  background: var(--accent-bg);
  border-color: #f7c4b0;
}

.list-item-name-edit {
  width: 100%;
  font-size: 14.5px;
  font-weight: 700;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  outline: none;
  padding: 1px 0;
  transition: border-color var(--transition), color var(--transition);
}
.list-item-name-edit:focus {
  border-bottom-color: var(--accent);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.qty-btn.qty-minus:hover { background: #fee2e2; border-color: #f87171; color: #ef4444; }

.qty-display {
  min-width: 34px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.list-item-del {
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: var(--text3);
  padding: 4px; border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  display: flex; align-items: center;
  opacity: 0;
}
.list-item:hover .list-item-del { opacity: 1; }
.list-item-del:hover { color: #ef4444; background: #fee2e2; }

/* ── Drag Handle ──────────────────────────────────────────── */
.drag-handle {
  cursor: grab;
  padding: 2px 6px;
  color: var(--text3);
  font-size: 16px;
  line-height: 1;
  touch-action: none;
  transition: color var(--transition);
  margin-left: -4px;
}
.drag-handle:hover { color: var(--accent); }
.drag-handle:active { cursor: grabbing; }

/* ── Sortable States ──────────────────────────────────────── */
.sortable-ghost {
  opacity: 0.4;
  background: var(--accent-bg);
  border-color: var(--accent);
}
.sortable-chosen {
  box-shadow: var(--shadow-md);
}
.sortable-drag {
  opacity: 0.8;
  box-shadow: var(--shadow-lg);
}

.list-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.list-item-note {
  width: 100%;
  font-size: 12px;
  font-family: var(--font);
  color: var(--text3);
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  outline: none;
  padding: 1px 0;
  transition: border-color var(--transition), color var(--transition);
}
.list-item-note:focus {
  border-bottom-color: var(--accent);
  color: var(--text);
}
.list-item-note::placeholder { color: var(--border2); font-style: italic; }

.empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text3);
  padding: 40px 20px;
  text-align: center;
}
.empty-list-icon { font-size: 40px; opacity: .4; }
.empty-list-text { font-size: 14px; font-weight: 600; }

/* ─── Shopping Mode (Einkaufszettel) ─────────────────────────────────────── */
.shopping-view {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}

.paper-wrapper {
  padding: 10px 20px 40px;
  width: 100%;
  max-width: 520px;
}

.paper {
  background: #fffef9;
  border-radius: 3px;
  box-shadow:
    0 2px 4px rgba(0,0,0,.12),
    4px 4px 0 #e8dfc8,
    8px 8px 0 #ddd3b8;
  position: relative;
  overflow: hidden;
  /* Torn paper top effect */
}

/* Ruled lines background */
.paper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 33px,
    #e8dfc8 33px,
    #e8dfc8 34px
  );
  pointer-events: none;
  z-index: 0;
}

/* Red margin line */
.paper::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 58px;
  width: 1.5px;
  background: rgba(220, 120, 100, .5);
  pointer-events: none;
  z-index: 0;
}

.paper-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 20px 6px 68px;
  border-bottom: 1.5px solid #e8dfc8;
  margin-bottom: 4px;
}

.paper-store {
  font-family: var(--font-hand);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 34px;
}

.paper-date {
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--text3);
}

.paper-lines {
  position: relative;
  z-index: 1;
  padding: 0 16px 0 68px;
  min-height: 300px;
}

.paper-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 34px;
  padding: 2px 0;
  cursor: pointer;
  transition: opacity var(--transition);
  user-select: none;
}
.paper-item:hover { opacity: .8; }

.paper-item-note {
  font-family: var(--font-hand);
  font-size: 17px;
  color: var(--text3);
  font-style: italic;
}

.paper-item-name {
  font-family: var(--font-hand);
  font-size: 21px;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
  position: relative;
  line-height: 34px;
}

.paper-item-qty {
  font-family: var(--font-hand);
  font-size: 17px;
  color: var(--text3);
  white-space: nowrap;
  line-height: 34px;
}

/* Durchstreichen */
.paper-item.checked .paper-item-name {
  color: var(--text3);
}
.paper-item.checked .paper-item-name::after {
  content: '';
  position: absolute;
  left: -2px; right: -2px;
  top: 50%;
  height: 2px;
  background: var(--text2);
  transform: translateY(-50%) rotate(-.3deg);
  transform-origin: left center;
  animation: strikeThrough .25s ease forwards;
}

@keyframes strikeThrough {
  from { transform: scaleX(0) translateY(-50%) rotate(-.3deg); transform-origin: left; }
  to   { transform: scaleX(1) translateY(-50%) rotate(-.3deg); transform-origin: left; }
}

.paper-item.checked .paper-item-qty { color: #bbb; }

.paper-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 16px 20px 24px;
  border-top: 1.5px solid #e8dfc8;
  margin-top: 8px;
}

.btn-exit-mode {
  background: none;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-exit-mode:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #ef4444;
}

/* ─── Toast ───────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  animation: toastIn .22s ease;
  white-space: nowrap;
}
.toast.toast-success { background: var(--green); }
.toast.toast-error   { background: #ef4444; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}

@media (max-width: 680px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .menu-toggle { display: flex; }

  .content { padding: 12px; }
  .paper-wrapper { padding: 8px 10px 30px; }
  .paper::after { left: 46px; }
  .paper-lines { padding-left: 54px; }
  .paper-header { padding-left: 54px; }

  .btn-mode-label { display: none; }
}
