/*
 * kitchencrate.css
 * Single source of truth for all KitchenCrate styles.
 * Replaces: style.css, elite_gold.css, and all inline <style> blocks.
 *
 * Brand colors:
 *   --kc-green:       #198754  (primary — navbar, buttons, accents)
 *   --kc-green-dark:  #146c43  (hover states)
 *   --kc-green-light: #d1e7dd  (backgrounds, tints)
 */

/* ============================================================
   1. CSS VARIABLES
   ============================================================ */
:root {
  --kc-green:        #198754;
  --kc-green-dark:   #146c43;
  --kc-green-light:  #d1e7dd;
  --kc-green-tint:   #f0fdf4;

  --kc-danger:       #dc3545;
  --kc-warning:      #ffc107;
  --kc-info:         #0dcaf0;

  --kc-gray-50:      #f8f9fa;
  --kc-gray-100:     #f3f4f6;
  --kc-gray-200:     #e5e7eb;
  --kc-gray-300:     #d1d5db;
  --kc-gray-400:     #9ca3af;
  --kc-gray-500:     #6b7280;
  --kc-gray-600:     #4b5563;
  --kc-gray-700:     #374151;
  --kc-gray-800:     #1f2937;
  --kc-gray-900:     #111827;

  --kc-white:        #ffffff;
  --kc-bg:           #f8f9fa;

  --kc-radius:       8px;
  --kc-radius-lg:    12px;
  --kc-shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --kc-shadow:       0 2px 8px rgba(0,0,0,0.10);
  --kc-shadow-lg:    0 4px 20px rgba(0,0,0,0.12);
  --kc-transition:   all 0.2s ease;
}


/* ============================================================
   2. BASE / RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--kc-bg);
  color: var(--kc-gray-800);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  color: var(--kc-green);
}


/* ============================================================
   3. NAVBAR
   ============================================================ */
.navbar {
  background-color: var(--kc-green) !important;
  background-image: none !important;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 0.6rem 0 !important;
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.35rem 0 !important;
  }
  .navbar-brand {
    font-size: 1.1rem !important;
  }
}

.navbar-brand,
.navbar-brand:hover {
  color: var(--kc-white) !important;
  font-weight: 700;
  font-size: 1.3rem;
}

.nav-link {
  color: rgba(255,255,255,0.9) !important;
  font-weight: 500;
  padding: 0.4rem 0.8rem !important;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.nav-link:hover {
  color: var(--kc-white) !important;
  background: rgba(255,255,255,0.15);
}

.nav-link.active,
.nav-link.fw-bold {
  color: var(--kc-white) !important;
  font-weight: 700 !important;
}

.navbar-toggler {
  border: none;
  color: var(--kc-white);
}

.dropdown-menu {
  border: none;
  box-shadow: var(--kc-shadow-lg);
  border-radius: var(--kc-radius);
}

.dropdown-item {
  padding: 0.55rem 1.25rem;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: var(--kc-gray-100);
}


/* ============================================================
   4. BUTTONS
   ============================================================ */
.btn-success,
.btn-primary {
  background-color: var(--kc-green) !important;
  border-color: var(--kc-green) !important;
  color: var(--kc-white) !important;
}

.btn-success:hover,
.btn-primary:hover,
.btn-success:focus,
.btn-primary:focus {
  background-color: var(--kc-green-dark) !important;
  border-color: var(--kc-green-dark) !important;
}

.btn-outline-success,
.btn-outline-primary {
  color: var(--kc-green) !important;
  border-color: var(--kc-green) !important;
  background: transparent !important;
}

.btn-outline-success:hover,
.btn-outline-primary:hover {
  background-color: var(--kc-green) !important;
  color: var(--kc-white) !important;
}


/* ============================================================
   5. TEXT / COLOR UTILITIES
   ============================================================ */
.text-success {
  color: var(--kc-green) !important;
}

.bg-success {
  background-color: var(--kc-green) !important;
}


/* ============================================================
   6. FORMS
   ============================================================ */
.form-control:focus,
.form-select:focus {
  border-color: var(--kc-green);
  box-shadow: 0 0 0 3px rgba(25,135,84,0.15);
  outline: none;
}

.form-check-input:checked {
  background-color: var(--kc-green);
  border-color: var(--kc-green);
}


/* ============================================================
   7. CARDS
   ============================================================ */
.card {
  border: 1px solid var(--kc-gray-200);
  border-radius: var(--kc-radius-lg);
  box-shadow: var(--kc-shadow-sm);
  background: var(--kc-white);
  margin-bottom: 1.25rem;
}

.card-header {
  background-color: var(--kc-gray-50) !important;
  background-image: none !important;
  border-bottom: 1px solid var(--kc-gray-200);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
}


/* ============================================================
   8. BADGES
   ============================================================ */
.badge.bg-success {
  background-color: var(--kc-green) !important;
}


/* ============================================================
   9. ALERTS
   ============================================================ */
.alert-success {
  background-color: var(--kc-green-tint);
  border-color: var(--kc-green-light);
  color: #0f5132;
}


/* ============================================================
   10. NAV PILLS (create.html tabs)
   ============================================================ */
.nav-pills .nav-link {
  color: var(--kc-green) !important;
  background: var(--kc-gray-50);
  border: 2px solid var(--kc-green);
  margin: 0 5px;
  border-radius: 50px;
  font-weight: 500;
}

.nav-pills .nav-link:hover {
  background: #e8f5e9;
}

.nav-pills .nav-link.active {
  background-color: var(--kc-green) !important;
  color: var(--kc-white) !important;
}


/* ============================================================
   11. PANTRY PAGE
   ============================================================ */
.pantry-tbl > thead > tr > th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 700;
  color: var(--kc-gray-500);
  border-bottom-width: 2px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.pantry-tbl > tbody > tr > td {
  font-size: .85rem;
  vertical-align: middle;
  padding-top: 8px;
  padding-bottom: 8px;
}

.row-depleted         { background: rgba(107,114,128,0.06) !important; opacity:.65; }
.row-depleted td      { color: #9ca3af !important; }
.row-depleted:hover   { background: rgba(107,114,128,0.10) !important; }
.row-expired          { background: rgba(220,53,69,0.06) !important; }
.row-expiring-soon    { background: rgba(255,193,7,0.10) !important; }
.row-expiring         { background: rgba(255,193,7,0.05) !important; }
.row-expired:hover    { background: rgba(220,53,69,0.10) !important; }
.row-expiring-soon:hover { background: rgba(255,193,7,0.14) !important; }
.row-expiring:hover   { background: rgba(255,193,7,0.09) !important; }

.ing-results {
  position: absolute;
  width: 100%;
  background: var(--kc-white);
  border: 1px solid var(--kc-gray-200);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 220px;
  overflow-y: auto;
  display: none;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.ing-result-item {
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background .1s;
}

.ing-result-item:last-child { border-bottom: none; }
.ing-result-item:hover      { background: var(--kc-green-tint); }

.pantry-group .card-header:hover {
  background: var(--kc-gray-50) !important;
}

@media (max-width: 575px) {
  .pantry-tbl > tbody > tr > td { font-size: .8rem;  padding: 6px 4px; }
  .pantry-tbl > thead > tr > th { font-size: .6rem;  padding: 6px 4px; }
}


/* ============================================================
   12. VIEW RECIPE PAGE
   ============================================================ */
.rating-stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 5px;
}

.rating-stars label:hover,
.rating-stars label:hover ~ label,
.rating-stars input:checked ~ label {
  color: #ffc107 !important;
}

.chevron-icon {
  transition: transform .3s;
}

.collapsed .chevron-icon,
[aria-expanded="false"] .chevron-icon {
  transform: none;
}

[data-bs-toggle="collapse"][aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.photo-thumb:hover { opacity: .85; }


/* ============================================================
   13. RECIPES GALLERY PAGE
   ============================================================ */
.object-fit-cover    { object-fit: cover; }
.cursor-pointer      { cursor: pointer; }
.cursor-pointer:hover { background-color: var(--kc-gray-50); }
.hover-dark:hover    { color: #0d4a2e !important; }

@media (max-width: 767px) {
  .recipe-card .col-4 {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
  }
}


/* ============================================================
   14. EDIT RECIPE — MEDIA DRAWER
   ============================================================ */
.media-drawer {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 2rem;
  overflow: hidden;
  background: var(--kc-white);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.media-drawer summary {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}

.media-drawer[open] summary    { border-bottom-color: #e2e8f0; }
.media-drawer summary::-webkit-details-marker { display: none; }
.media-drawer summary::before  { content: '📎'; font-size: 1.2rem; }

.media-drawer summary .chevron {
  margin-left: auto;
  transition: transform .2s;
  color: #94a3b8;
  font-size: .85rem;
}

.media-drawer[open] summary .chevron { transform: rotate(90deg); }

.drawer-body      { padding: 1.5rem; }
.drawer-section   { margin-bottom: 2rem; }
.drawer-section:last-child { margin-bottom: 0; }
.drawer-section h3 {
  font-size: .95rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.drawer-divider { height: 1px; background: #e2e8f0; margin: 1.5rem 0; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.photo-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  transition: border-color .2s, box-shadow .2s;
  background: #f8fafc;
  aspect-ratio: 1;
}

.photo-card:hover      { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(59,130,246,.15); }
.photo-card.is-cover   { border-color: var(--kc-green); box-shadow: 0 0 0 2px rgba(25,135,84,.2); }
.photo-card img        { width: 100%; height: 100%; object-fit: cover; }

.photo-badge {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--kc-green);
  color: var(--kc-white);
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.photo-actions {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  padding: 8px 6px 6px;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity .2s;
}

.photo-card:hover .photo-actions { opacity: 1; }

.photo-btn {
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.photo-btn.delete { background: rgba(239,68,68,.9);  color: var(--kc-white); }
.photo-btn.delete:hover { background: #dc2626; }
.photo-btn.cover  { background: rgba(25,135,84,.9);  color: var(--kc-white); }
.photo-btn.cover:hover  { background: #157347; }

.upload-drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #fafbfc;
}

.upload-drop-zone:hover,
.upload-drop-zone.dragover {
  border-color: var(--kc-green);
  background: var(--kc-green-tint);
}

.upload-drop-zone input[type="file"] { display: none; }
.upload-drop-zone-icon  { font-size: 2rem; margin-bottom: .5rem; }
.upload-drop-zone-text  { color: #64748b; font-size: .9rem; }
.upload-drop-zone-text strong { color: #334155; }

.upload-progress          { margin-top: .75rem; display: none; }
.upload-progress.active   { display: block; }
.progress-bar-track       { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-bar-fill        { height: 100%; background: var(--kc-green); border-radius: 3px; transition: width .3s; width: 0; }
.upload-status            { font-size: .8rem; color: #64748b; margin-top: .4rem; }
.empty-photos-state       { text-align: center; padding: 1.5rem; color: #94a3b8; font-size: .9rem; }

.pdf-current {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.pdf-current .pdf-icon   { font-size: 1.5rem; }
.pdf-current .pdf-name   { flex: 1; font-size: .9rem; font-weight: 500; color: #334155; word-break: break-all; }
.pdf-current .pdf-actions { display: flex; gap: .5rem; }

.pdf-action-btn {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pdf-action-btn.view   { background: #f1f5f9; color: #475569; }
.pdf-action-btn.view:hover   { background: #e2e8f0; }
.pdf-action-btn.remove { background: #fef2f2; color: #dc2626; }
.pdf-action-btn.remove:hover { background: #fee2e2; }
.pdf-action-btn.upload { background: var(--kc-green-tint); color: #157347; }
.pdf-action-btn.upload:hover { background: #dcfce7; }

.media-toast {
  position: fixed;
  top: 1rem; right: 1rem;
  padding: .75rem 1.25rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateX(120%);
  transition: transform .3s ease;
  max-width: 400px;
}

.media-toast.show     { transform: translateX(0); }
.media-toast.success  { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.media-toast.error    { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.flagged-highlight { animation: flagHighlight 2s ease-out; }

@keyframes flagHighlight {
  0%   { background-color: #fff3cd; box-shadow: 0 0 0 3px rgba(255,193,7,.4); }
  100% { background-color: transparent; box-shadow: none; }
}

/* Edit recipe ingredient rows */
.ingredient-row .form-control-sm,
.ingredient-row .form-select-sm {
  height: 31px;
  font-size: .875rem;
}

.ingredient-row .select2-container--bootstrap-5 .select2-selection--single {
  min-height: 31px !important;
  height: 31px !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
  font-size: .875rem !important;
}

.ingredient-row .modifier-btn {
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modifier-btn .fa-spinner       { display: none; }
.modifier-btn.loading .fa-spinner { display: inline-block; }
.modifier-btn.loading .fa-tags    { display: none; }

@media (max-width: 767.98px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .75rem; }
  .photo-actions { opacity: 1; padding: 6px 4px 4px; }
  .drawer-body { padding: 1rem; }

  .ingredient-card { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 10px; padding: 12px; }
  .ingredient-card .row { display: flex; flex-wrap: wrap; }
  .field-qty      { order: 1; }
  .field-unit     { order: 2; }
  .field-pkg-qty  { order: 3; }
  .field-pkg-unit { order: 4; }
  .field-ingredient { order: 5; }
  .field-modifier   { order: 6; }
  .field-remove     { order: 7; }
  .ingredient-card .d-md-none.form-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 2px;
  }
  .field-remove {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding-bottom: 2px;
  }
}


/* ============================================================
   15. SHOPPING PAGE
   ============================================================ */
.sl-toast {
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 9999;
  padding: .7rem 1.2rem;
  border-radius: .5rem;
  color: var(--kc-white);
  font-size: .85rem;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  animation: slToastIn .3s ease, slToastOut .3s ease 2.5s forwards;
  max-width: 90vw;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.sl-toast-success { background: #16a34a; }
.sl-toast-error   { background: #dc2626; }
.sl-toast-info    { background: #2563eb; }

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

.progress-section {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: .75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.progress-ring-wrap   { flex-shrink: 0; position: relative; }
.progress-ring-text   { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; color: #16a34a; }
.progress-info h6     { margin: 0 0 .15rem; font-weight: 700; color: #14532d; font-size: .95rem; }
.progress-info p      { margin: 0; color: #4ade80; font-size: .8rem; font-weight: 500; }

.add-bar              { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 0; align-items: stretch; }
.add-bar .add-search  { flex: 1 1 220px; min-width: 0; }
.add-bar .add-qty     { flex: 0 0 70px; }
.add-bar .add-unit-col { flex: 0 0 90px; }
.add-bar .add-btn-col { flex: 0 0 auto; }
.add-bar .form-control:focus,
.add-bar .form-select:focus { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }

.modifier-panel {
  margin-bottom: 1rem;
  padding: .75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  animation: modPanelIn .2s ease;
}

@keyframes modPanelIn { from { opacity:0; max-height:0; } to { opacity:1; max-height:400px; } }

.mod-group             { margin-bottom: .5rem; }
.mod-group:last-child  { margin-bottom: 0; }
.mod-group-label       { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: .3rem; }
.mod-pills             { display: flex; flex-wrap: wrap; gap: .3rem; }
.mod-pill              { font-size: .78rem; padding: .25rem .65rem; border-radius: 999px; border: 1px solid #cbd5e1; background: var(--kc-white); color: #334155; cursor: pointer; transition: all .15s; font-weight: 500; user-select: none; }
.mod-pill:hover        { border-color: #94a3b8; background: #f1f5f9; }
.mod-pill.selected     { background: #1e293b; color: var(--kc-white); border-color: #1e293b; }
.mod-pill.is-default   { border-color: #86efac; background: var(--kc-green-tint); }
.mod-pill.is-default.selected { background: #16a34a; border-color: #16a34a; color: var(--kc-white); }
.mod-panel-hint        { font-size: .72rem; color: #94a3b8; margin-top: .4rem; font-style: italic; }

.filter-pills          { display: flex; gap: .375rem; overflow-x: auto; padding-bottom: .5rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill           { white-space: nowrap; font-size: .75rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--kc-gray-300); background: var(--kc-white); color: var(--kc-gray-700); cursor: pointer; transition: all .15s; flex-shrink: 0; font-weight: 500; }
.filter-pill:hover     { background: var(--kc-gray-100); }
.filter-pill.active    { background: #1f2937; color: var(--kc-white); border-color: #1f2937; }

.dept-card             { border: 1px solid var(--kc-gray-200); border-radius: .75rem; overflow: hidden; margin-bottom: .75rem; background: var(--kc-white); box-shadow: 0 1px 3px rgba(0,0,0,.04); transition: opacity .2s; }
.dept-card.filtered-out { display: none; }
.dept-toggle           { width: 100%; padding: .65rem 1rem; background: #f9fafb; border: none; border-bottom: 1px solid var(--kc-gray-200); display: flex; align-items: center; gap: .5rem; cursor: pointer; text-align: left; transition: background .15s; }
.dept-toggle:hover     { background: var(--kc-gray-100); }
.dept-toggle .dept-emoji { font-size: 1.1rem; }
.dept-toggle .dept-name  { font-weight: 600; font-size: .85rem; color: var(--kc-gray-700); flex: 1; }
.dept-toggle .dept-badge { font-size: .7rem; font-weight: 600; color: var(--kc-gray-500); background: var(--kc-gray-200); padding: .15rem .5rem; border-radius: 999px; }
.dept-toggle .dept-badge.all-done { background: #dcfce7; color: #16a34a; }
.dept-toggle .chevron  { transition: transform .2s; color: #9ca3af; font-size: .7rem; }
.dept-toggle.collapsed .chevron { transform: rotate(-90deg); }
.dept-mini-progress    { height: 3px; background: var(--kc-gray-100); margin: 0 .75rem .5rem; border-radius: 99px; overflow: hidden; }
.dept-mini-progress-fill { height: 100%; background: #22c55e; border-radius: 99px; transition: width .35s ease; }

.dept-items            { display: flex; flex-direction: column; }
.shop-item             { display: flex; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--kc-gray-100); transition: background .12s, opacity .25s; order: 0; }
.shop-item:last-child  { border-bottom: none; }
.shop-item:hover       { background: #fafafa; }
.shop-item.is-checked  { order: 1; opacity: .5; }
.shop-item.is-checked .item-name { text-decoration: line-through; color: #9ca3af; }
.shop-item.search-hidden { display: none; }
.shop-item.just-checked  { animation: checkPulse .35s ease; }

@keyframes checkPulse { 0% { background: var(--kc-green-tint); } 100% { background: transparent; } }

.check-btn             { flex-shrink: 0; width: 1.65rem; height: 1.65rem; border-radius: 50%; border: 2px solid var(--kc-gray-300); background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-right: .75rem; transition: all .2s; padding: 0; color: transparent; }
.check-btn:hover       { border-color: #22c55e; background: rgba(34,197,94,.08); }
.check-btn.checked     { background: #22c55e; border-color: #22c55e; color: var(--kc-white); }
.check-btn .fa-check   { font-size: .6rem; }
.item-name             { flex: 1; font-size: .875rem; color: var(--kc-gray-800); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; transition: color .2s; }
.del-btn               { flex-shrink: 0; background: transparent; border: none; cursor: pointer; color: var(--kc-gray-300); padding: .35rem; border-radius: .25rem; font-size: .7rem; opacity: 0; transition: all .15s; margin-left: .25rem; }
.shop-item:hover .del-btn { opacity: 1; }
.del-btn:hover         { color: #ef4444; background: #fef2f2; }

.bottom-actions        { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 0; margin-top: .5rem; border-top: 1px solid var(--kc-gray-200); }

.empty-state           { text-align: center; padding: 4rem 1rem; }
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: .9; }
.empty-state h4        { font-weight: 700; color: var(--kc-gray-800); margin-bottom: .5rem; }
.empty-state p         { color: var(--kc-gray-500); font-size: .9rem; max-width: 26rem; margin: 0 auto 1.5rem; }

.complete-state        { text-align: center; padding: 2.5rem 1rem; margin-bottom: 1rem; background: linear-gradient(135deg,#f0fdf4,#ecfdf5); border: 1px solid #bbf7d0; border-radius: .75rem; display: none; }
.complete-state.show   { display: block; animation: completePop .4s ease; }
@keyframes completePop { 0% { transform:scale(.95); opacity:0; } 100% { transform:scale(1); opacity:1; } }
.complete-state .complete-icon { font-size: 3rem; margin-bottom: .5rem; }
.complete-state h5     { font-weight: 700; color: #16a34a; }
.complete-state p      { color: #4ade80; font-size: .85rem; }

.store-top-bar         { display: none; position: sticky; top: 0; z-index: 100; background: var(--kc-white); border-bottom: 2px solid #22c55e; padding: .75rem 1rem; align-items: center; justify-content: space-between; }
body.store-mode .store-top-bar    { display: flex !important; }
body.store-mode .hide-in-store    { display: none !important; }
body.store-mode #shopSubheader    { display: none !important; }
body.store-mode .shop-item        { padding: .85rem 1rem; }
body.store-mode .check-btn        { width: 2.25rem; height: 2.25rem; margin-right: 1rem; }
body.store-mode .check-btn .fa-check { font-size: .8rem; }
body.store-mode .item-name        { font-size: 1.05rem; }
body.store-mode .del-btn          { display: none; }
body.store-mode .dept-toggle      { padding: .85rem 1rem; }
body.store-mode .dept-toggle .dept-name  { font-size: .95rem; }
body.store-mode .dept-toggle .dept-emoji { font-size: 1.3rem; }

.store-progress-ring   { position: relative; display: inline-block; }
.store-progress-text   { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; color: #16a34a; }
.store-remaining       { font-size: .85rem; color: var(--kc-gray-500); font-weight: 500; }

@media (max-width: 640px) {
  .progress-section      { flex-direction: column; text-align: center; padding: 1rem; }
  .bottom-actions        { justify-content: stretch; }
  .bottom-actions .btn   { flex: 1; justify-content: center; }
  .add-bar .add-qty      { flex: 0 0 60px; }
  .add-bar .add-unit-col { flex: 0 0 80px; }
}

@media (pointer: coarse) {
  .del-btn         { opacity: .35; }
  .del-btn:active  { opacity: 1; color: #ef4444; }
}


/* ============================================================
   16. ACTIVITY PAGE
   ============================================================ */
.act-item   { display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid #eee; }
.act-icon   { font-size: 1.4rem; flex-shrink: 0; width: 2.2rem; text-align: center; }
.act-body   { flex-grow: 1; }
.act-time   { font-size: .8rem; color: #888; }
.act-badge  { display: inline-block; font-size: .65rem; padding: .1rem .4rem; border-radius: 4px; text-transform: uppercase; font-weight: 600; }
.ab-cook          { background: #fff3cd; color: #856404; }
.ab-favorite      { background: #f8d7da; color: #842029; }
.ab-recipe_added  { background: #d1e7dd; color: #0f5132; }
.ab-rating        { background: #cff4fc; color: #055160; }


/* ============================================================
   17. ADMIN INGREDIENTS PAGE
   ============================================================ */
.ingredient-card {
  background: var(--kc-white);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
  transition: all .2s;
}

.ingredient-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  border-color: var(--kc-green);
}

.category-section {
  background: var(--kc-gray-50);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
}

.category-header {
  color: var(--kc-green);
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--kc-green-light);
}

.btn-action {
  padding: 5px 10px;
  font-size: 14px;
}


/* ============================================================
   18. TOM SELECT OVERRIDES (shopping page)
   ============================================================ */
.ts-wrapper.single .ts-control { border-radius: .375rem; border-color: var(--kc-gray-300); min-height: 38px; padding: 6px 12px; font-size: .875rem; background: var(--kc-white); }
.ts-wrapper.single .ts-control:hover { border-color: #9ca3af; }
.ts-wrapper.single.focus .ts-control { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.ts-wrapper .ts-control > input { font-size: .875rem !important; }
.ts-dropdown { border-color: var(--kc-gray-300); box-shadow: 0 10px 30px rgba(0,0,0,.1); border-radius: .5rem; margin-top: 2px; max-height: 320px; }
.ts-dropdown .optgroup-header { font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--kc-gray-500); padding: .6rem .75rem .2rem; background: transparent; border: none; }
.ts-dropdown .option { padding: .4rem .75rem; font-size: .85rem; cursor: pointer; }
.ts-dropdown .option.active { background: var(--kc-green-tint); color: #166534; }
.ts-dropdown .option .ts-opt-dept { float: right; font-size: .7rem; color: #9ca3af; font-weight: 500; margin-left: .5rem; }
.ts-dropdown .create { border-top: 1px dashed var(--kc-gray-200); color: var(--kc-gray-500); font-style: italic; padding: .55rem .75rem; font-size: .85rem; }
.ts-dropdown .create strong { color: var(--kc-gray-800); font-style: normal; }
.ts-dropdown .no-results { padding: .75rem; text-align: center; color: #9ca3af; font-size: .85rem; }
.ts-wrapper.single .ts-control .item { font-size: .875rem; }


/* ============================================================
   19. UTILITIES / MISC
   ============================================================ */
.loading-spinner {
  display: inline-block;
  width: 22px; height: 22px;
  border: 3px solid var(--kc-gray-300);
  border-top-color: var(--kc-green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.fade-in { animation: fadeIn .4s ease; }

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


/* ============================================================
   20. DIETARY FILTER PILLS (recipes page)
   ============================================================ */
.diet-cb {
  display: none;
}

.diet-pill {
  display: inline-block;
  padding: .3rem .75rem;
  border-radius: 999px;
  border: 2px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}

.diet-pill:hover {
  border-color: #198754;
  background: #f0fdf4;
  color: #198754;
}

.diet-cb:checked + .diet-pill {
  background: #198754;
  border-color: #198754;
  color: #fff;
}
