/* ----------------------------------------------------
   DESIGN SYSTEM & CSS VARIABLES
   ---------------------------------------------------- */
:root {
  /* Font Families */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Safe Area Heights for iOS Devices */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Light Theme Colors */
  --bg-gradient: linear-gradient(135deg, #f5f7f3 0%, #e8efe6 100%);
  --bg-color: #f7f9f6;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(255, 255, 255, 0.5);
  --card-shadow: 0 8px 32px 0 rgba(142, 164, 133, 0.15);
  --text-main: #2b3a26;
  --text-muted: #5e6f57;
  --text-inverse: #ffffff;
  
  --primary: hsl(142, 60%, 38%);
  --primary-light: hsl(142, 50%, 93%);
  --primary-glow: rgba(58, 142, 85, 0.25);
  
  --warning: hsl(38, 92%, 48%);
  --warning-light: hsl(38, 90%, 93%);
  --warning-glow: rgba(230, 145, 15, 0.25);
  
  --danger: hsl(3, 76%, 50%);
  --danger-light: hsl(3, 80%, 95%);
  
  --success: hsl(142, 60%, 38%);
  
  --nav-bg: rgba(255, 255, 255, 0.8);
  --nav-border: rgba(255, 255, 255, 0.4);
  --nav-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);

  --modal-bg: rgba(255, 255, 255, 0.95);
  --divider: rgba(0, 0, 0, 0.06);

  /* Stats Item Styles */
  --stat-item-bg: rgba(255, 255, 255, 0.45);
  --stat-item-border: rgba(255, 255, 255, 0.2);
  --stat-lbl-color: var(--text-muted);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-gradient: linear-gradient(135deg, #10160f 0%, #1a2517 100%);
  --bg-color: #10160f;
  --card-bg: rgba(28, 38, 25, 0.7);
  --card-border: rgba(255, 255, 255, 0.05);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --text-main: #e2ebd9;
  --text-muted: #8ea087;
  --text-inverse: #10160f;
  
  --primary: hsl(142, 55%, 52%);
  --primary-light: hsl(142, 50%, 15%);
  --primary-glow: rgba(74, 206, 118, 0.2);
  
  --warning: hsl(38, 92%, 58%);
  --warning-light: hsl(38, 90%, 15%);
  --warning-glow: rgba(245, 160, 20, 0.2);
  
  --danger: hsl(3, 85%, 60%);
  --danger-light: hsl(3, 80%, 18%);
  
  --nav-bg: rgba(22, 30, 20, 0.85);
  --nav-border: rgba(255, 255, 255, 0.05);
  --nav-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);

  --modal-bg: rgba(20, 28, 18, 0.98);
  --divider: rgba(255, 255, 255, 0.07);

  /* Stats Item Styles (Dark Mode) */
  --stat-item-bg: rgba(58, 142, 85, 0.18);
  --stat-item-border: rgba(74, 206, 118, 0.25);
  --stat-lbl-color: #a4cfa9;
}

/* Apply Dark theme automatically if user prefers dark mode and setting is 'system' */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-gradient: linear-gradient(135deg, #10160f 0%, #1a2517 100%);
    --bg-color: #10160f;
    --card-bg: rgba(28, 38, 25, 0.7);
    --card-border: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --text-main: #e2ebd9;
    --text-muted: #8ea087;
    --text-inverse: #10160f;
    
    --primary: hsl(142, 55%, 52%);
    --primary-light: hsl(142, 50%, 15%);
    --primary-glow: rgba(74, 206, 118, 0.2);
    
    --warning: hsl(38, 92%, 58%);
    --warning-light: hsl(38, 90%, 15%);
    --warning-glow: rgba(245, 160, 20, 0.2);
    
    --danger: hsl(3, 85%, 60%);
    --danger-light: hsl(3, 80%, 18%);
    
    --nav-bg: rgba(22, 30, 20, 0.85);
    --nav-border: rgba(255, 255, 255, 0.05);
    --nav-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);

    --modal-bg: rgba(20, 28, 18, 0.98);
    --divider: rgba(255, 255, 255, 0.07);

    /* Stats Item Styles (System Dark Mode) */
    --stat-item-bg: rgba(58, 142, 85, 0.18);
    --stat-item-border: rgba(74, 206, 118, 0.25);
    --stat-lbl-color: #a4cfa9;
  }
}

/* ----------------------------------------------------
   BASE RESET & IOS TWEAKS
   ---------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  width: 100%;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); /* Leave space for bottom nav bar */
  overflow-x: hidden;
  user-select: none; /* Feels more native */
  -webkit-user-select: none;
}

/* ----------------------------------------------------
   HEADER & GENERAL LAYOUT
   ---------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-emoji {
  font-size: 32px;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.logo-area h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.logo-area p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.app-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

/* ----------------------------------------------------
   BOTTOM NAV BAR (iOS Style)
   ---------------------------------------------------- */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding-top: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  transition: width 0.3s, max-width 0.3s;
}

@media (min-width: 600px) {
  .app-nav {
    border-left: 1px solid var(--nav-border);
    border-right: 1px solid var(--nav-border);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }
}


.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  gap: 4px;
  transition: color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item span {
  font-size: 10px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active svg {
  transform: translateY(-2px) scale(1.1);
  stroke: var(--primary);
  fill: var(--primary-light);
}

.nav-item:active {
  transform: scale(0.93);
}

/* ----------------------------------------------------
   UI VIEWS TRANSITIONS
   ---------------------------------------------------- */
.app-view {
  display: none;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-view.active {
  display: block;
}

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

/* ----------------------------------------------------
   CARDS & CONTAINERS
   ---------------------------------------------------- */
.welcome-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 24px;
}

.welcome-card h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.welcome-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.week-stat-bar {
  display: flex;
  gap: 16px;
}

.stat-item {
  flex: 1;
  background: var(--stat-item-bg);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--stat-item-border);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, background-color 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.stat-item:active {
  transform: translateY(0) scale(0.96);
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-lbl {
  font-size: 11px;
  color: var(--stat-lbl-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ----------------------------------------------------
   DASHBOARD SECTIONS & TASK CARDS
   ---------------------------------------------------- */
.dashboard-section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 20px;
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-success {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

/* Relocation Alerts */
.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-card {
  background: var(--warning-light);
  border: 1px solid rgba(230, 145, 15, 0.2);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 15px rgba(230, 145, 15, 0.08);
}

.alert-text h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 2px;
}

.alert-text p {
  font-size: 12px;
  color: var(--text-main);
}

/* Task lists (Dashboard / Calendar) */
.today-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

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

.task-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.task-checkbox-container {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.task-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 26px;
  width: 26px;
  background-color: transparent;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  transition: background-color 0.2s, border-color 0.2s;
}

.task-checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.task-checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.task-checkbox-container .checkmark:after {
  left: 9px;
  top: 5px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-info h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.task-info p {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.frequency-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.frequency-tag.staly {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(46, 125, 50, 0.15);
}

.frequency-tag.rotacyjny {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(230, 81, 0, 0.15);
}

.frequency-tag.zimowy {
  background: rgba(2, 136, 209, 0.08);
  color: #0288d1;
  border: 1px solid rgba(2, 136, 209, 0.15);
}

[data-theme="dark"] .frequency-tag.zimowy {
  background: rgba(74, 180, 245, 0.1);
  color: #4ab4f5;
  border: 1px solid rgba(74, 180, 245, 0.15);
}

/* ----------------------------------------------------
   ACTIVE FERMENTATIONS & PROGRESS BARS
   ---------------------------------------------------- */
.active-fermentations-list, .active-jars-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.active-jar-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.active-jar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.active-jar-header h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}

.active-jar-dates {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.jar-labels-row {
  display: flex;
  gap: 6px;
}

.progress-bar-container {
  margin-bottom: 10px;
}

.progress-bar-linear {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

[data-theme="dark"] .progress-bar-linear {
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

.progress-row-text {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
}

.jar-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.jar-location-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.jar-location-val {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tip Card style */
.tip-card {
  background: var(--primary-light);
  border: 1px solid rgba(58, 142, 85, 0.15);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 14px;
  box-shadow: 0 4px 15px rgba(58, 142, 85, 0.04);
}

.tip-icon {
  font-size: 24px;
}

.tip-content h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.tip-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ----------------------------------------------------
   CALENDAR VIEW
   ---------------------------------------------------- */
.calendar-header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cal-current-info h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.cal-current-info p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.week-summary-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-details {
  display: flex;
}

.summary-details > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.summary-details > div:first-child {
  border-right: 1px solid var(--divider);
}

.summary-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.summary-val {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.card-divider {
  height: 1px;
  background: var(--divider);
}

.calendar-list-section {
  margin-bottom: 24px;
}

.calendar-jars-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-jar-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  box-shadow: var(--card-shadow);
}

.cal-jar-header {
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 8px;
  margin-bottom: 2px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.cal-jar-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.cal-jar-badges {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-jar-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cal-jar-vessel {
  display: flex;
  align-items: center;
}

.cal-vessel-selector-btn {
  cursor: pointer;
  text-decoration: underline;
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
}

.cal-jar-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.cal-jar-actions {
  display: flex;
  gap: 8px;
}

.qty-adjuster {
  display: flex;
  align-items: center;
  background: var(--divider);
  border-radius: 12px;
  padding: 2px;
  flex-shrink: 0;
}

.qty-btn {
  background: none;
  border: none;
  color: var(--text-main);
  width: 28px;
  height: 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-val {
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
  color: var(--text-main);
  white-space: nowrap;
}

/* "Mam" Button on Shopping List */
.btn-mam {
  background: var(--divider);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-mam:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Pantry / Spiżarnia Styles */
.pantry-items-container {
  display: flex;
  flex-direction: column;
}

.pantry-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--divider);
}

.pantry-item-row:last-child {
  border-bottom: none;
}

.pantry-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.btn-skonczylo-sie {
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-skonczylo-sie:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* ----------------------------------------------------
   SHOPPING LIST PREVIEW
   ---------------------------------------------------- */
.shopping-list-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--card-shadow);
}

.shop-section-group {
  margin-bottom: 18px;
}

.shop-section-group:last-child {
  margin-bottom: 0;
}

.shop-section-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 4px;
}

.shop-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  cursor: pointer;
  order: 0;
  transition: order 0.2s ease, opacity 0.2s ease;
}

.shop-item-row.checked {
  order: 1;
}

.shop-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-item-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  border-radius: 4px;
  position: relative;
  transition: background-color 0.2s, border-color 0.2s;
}

.shop-item-row.checked .shop-item-checkbox {
  background-color: var(--primary);
  border-color: var(--primary);
}

.shop-item-row.checked .shop-item-checkbox:after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.shop-item-row.checked .shop-item-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.shop-item-qty {
  font-weight: 700;
  color: var(--text-muted);
}

.shop-item-row.checked .shop-item-qty {
  color: var(--text-muted);
  opacity: 0.5;
}

/* ----------------------------------------------------
   RECIPES VIEW & GRID
   ---------------------------------------------------- */
.recipes-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.search-bar-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 13px;
  color: var(--text-muted);
  font-size: 16px;
}

#recipe-search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px !important; /* Prevents auto-zoom on iOS */
  outline: none;
  transition: border-color 0.2s;
}

#recipe-search-input:focus {
  border-color: var(--primary);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  padding-bottom: 4px;
}


.filter-tab {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.filter-tab.active {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

.recipes-list-container {
  position: relative;
  min-height: 300px;
}

.recipes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 480px) {
  .recipes-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.recipe-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.recipe-card:active {
  transform: scale(0.97);
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.recipe-card-header h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.recipe-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.04);
  color: var(--text-muted);
}

[data-theme="dark"] .card-tag {
  background: rgba(255, 255, 255, 0.05);
}

.recipe-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-top: 1px solid var(--divider);
  padding-top: 10px;
}

.recipe-stars {
  color: var(--warning);
}

/* Fab button style */
.fab-btn {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  height: 50px;
  padding: 0 20px 0 16px;
  border-radius: 25px;
  background: var(--primary);
  color: var(--text-inverse);
  border: none;
  box-shadow: 0 4px 15px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), right 0.3s;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

@media (min-width: 600px) {
  .fab-btn {
    right: calc((100vw - 600px) / 2 + 16px);
  }
}

.fab-btn:active {
  transform: scale(0.95);
}

.fab-btn svg {
  width: 20px;
  height: 20px;
}

/* ----------------------------------------------------
   ACTIVE TRACKER TABS
   ---------------------------------------------------- */
.active-header {
  margin-bottom: 20px;
}

.active-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
}

.active-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.active-jars-tabs {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
  margin-bottom: 20px;
}

.active-jars-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.active-jars-tab.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ----------------------------------------------------
   SETTINGS VIEW
   ---------------------------------------------------- */
.settings-header {
  margin-bottom: 20px;
}

.settings-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
}

.settings-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-group {
  margin-bottom: 24px;
}

.settings-group-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 8px;
}

.settings-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}

.setting-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-info {
  display: flex;
  flex-direction: column;
}

.setting-lbl {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
}

.setting-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 140px;
}

.form-slider {
  flex: 1;
  accent-color: var(--primary);
}

.slider-value {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--primary);
  width: 20px;
  text-align: right;
}

.form-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  background: var(--bg-color);
  color: var(--text-main);
  outline: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
}

.stats-grid {
  display: flex;
  gap: 12px;
}

.stat-card {
  flex: 1;
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--divider);
  padding: 14px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

[data-theme="dark"] .stat-card {
  background: rgba(255,255,255,0.02);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
}

/* Heatmap Grid */
.activity-heatmap-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  transition: transform 0.1s;
}

.heatmap-cell:active {
  transform: scale(1.1);
}

.heatmap-cell.level-0 { background: rgba(0,0,0,0.05); }
.heatmap-cell.level-1 { background: #c8e6c9; }
.heatmap-cell.level-2 { background: #81c784; }
.heatmap-cell.level-3 { background: var(--primary); }

[data-theme="dark"] .heatmap-cell.level-0 { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .heatmap-cell.level-1 { background: #1b5e20; }
[data-theme="dark"] .heatmap-cell.level-2 { background: #2e7d32; }
[data-theme="dark"] .heatmap-cell.level-3 { background: var(--primary); }

.heatmap-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.legend-cells {
  display: flex;
  gap: 4px;
}

.legend-cells .heatmap-cell {
  width: 12px;
  height: 12px;
}

.settings-info-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.version-info {
  margin-top: 30px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

/* ----------------------------------------------------
   MODALS LAYOUT
   ---------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: flex-end; /* Drawer bottom look on mobile */
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content-container {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--modal-bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.modal-overlay.active .modal-content-container {
  transform: translateY(0);
}

@media (min-width: 600px) {
  .modal-overlay {
    align-items: center; /* Center on desktop screen size */
  }
  
  .modal-content-container {
    border-radius: 24px;
    max-height: 80vh;
    width: 90%;
  }
}

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

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 800;
}

.close-modal-btn {
  background: var(--divider);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.close-modal-btn:active {
  transform: scale(0.9);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-body.scrollable::-webkit-scrollbar {
  width: 4px;
}

.modal-body.scrollable::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 2px;
}

/* Form Styles inside Custom Recipe Modal */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.form-help {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.2;
}

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

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

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  background: var(--bg-color);
  color: var(--text-main);
  outline: none;
  font-family: var(--font-body);
  font-size: 16px !important; /* Prevents auto-zoom on iOS */
  transition: border-color 0.2s;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}

/* Global inputs zoom override for all inputs including search and email */
input[type="search"],
input[type="email"],
input[type="password"] {
  font-size: 16px !important; /* Prevents auto-zoom on iOS */
}

/* Buttons style */
.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.95;
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:active {
  transform: scale(0.98);
  background: var(--divider);
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(211, 47, 47, 0.1);
  border-radius: 12px;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.btn-danger:active {
  transform: scale(0.98);
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* Modal Meta details */
.recipe-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.meta-box {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--divider);
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .meta-box {
  background: rgba(255,255,255,0.02);
}

.meta-lbl {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.meta-val {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}

.recipe-preference-card {
  background: var(--primary-light);
  border: 1px solid rgba(58, 142, 85, 0.15);
  border-radius: 16px;
  padding: 14px;
}

.recipe-preference-card h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

.preference-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stars-selector {
  display: flex;
  gap: 4px;
  font-size: 20px;
  cursor: pointer;
}

.stars-selector span {
  filter: grayscale(1);
  transition: filter 0.1s, transform 0.1s;
}

.stars-selector span.active {
  filter: grayscale(0);
}

.stars-selector span:active {
  transform: scale(1.3);
}

/* Brine Calculator */
.brine-calculator-card {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 14px;
}

[data-theme="dark"] .brine-calculator-card {
  background: rgba(255,255,255,0.02);
}

.brine-calculator-card h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 10px;
}

.calc-row input {
  width: 90px;
  padding: 6px 10px;
  text-align: right;
  border-radius: 8px;
}

.calc-results {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--divider);
  padding-top: 10px;
}

.calc-results > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.calc-lbl {
  font-size: 10px;
  color: var(--text-muted);
}

.calc-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

.modal-list-details {
  list-style: none;
  margin-top: 8px;
}

.modal-list-details li {
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
}

.modal-list-details li:last-child {
  border-bottom: none;
}

.modal-list-details.style-tips li {
  flex-direction: column;
  padding: 8px 0;
  color: var(--text-muted);
  line-height: 1.4;
  border-bottom: 1px solid var(--divider);
}

.modal-list-details.style-tips li:before {
  content: "💡";
  margin-right: 6px;
  display: inline-block;
}

.recipe-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.step-item-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  cursor: pointer;
}

.step-num {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--primary);
  font-size: 16px;
  min-width: 20px;
}

.step-item-card.checked {
  opacity: 0.5;
  background: rgba(0,0,0,0.02);
}

.step-item-card.checked .step-num {
  color: var(--text-muted);
}

.step-item-card.checked span:last-child {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Swap Recipe options */
.swap-recipes-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.swap-recipe-option-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.swap-recipe-option-card:active {
  background: var(--primary-light);
}

.swap-recipe-option-card h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
}

/* ----------------------------------------------------
   QR SCANNER SIMULATOR
   ---------------------------------------------------- */
.scanner-view-box {
  width: 260px;
  height: 260px;
  border: 4px solid var(--primary);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
  animation: scan 2s linear infinite;
  z-index: 10;
}

@keyframes scan {
  0%, 100% { top: 10px; }
  50% { top: 250px; }
}

.camera-placeholder {
  color: #888;
  font-size: 12px;
  font-weight: bold;
}

.scanner-instructions {
  font-size: 13px;
  color: var(--text-muted);
}

/* ----------------------------------------------------
   PRINTABLE LABEL CARD
   ---------------------------------------------------- */
.label-print-card {
  width: 240px;
  background: #ffffff;
  border: 2px solid #333333;
  border-radius: 12px;
  padding: 16px;
  color: #111111;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  font-family: sans-serif; /* Keep clean and standard for print */
}

.label-emoji-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.label-emoji-header span:first-child {
  font-size: 24px;
}

.label-emoji-header span:last-child {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.2px;
}

.label-date-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  margin-bottom: 12px;
}

.label-date-info div {
  display: flex;
  justify-content: space-between;
}

.label-divider {
  height: 1px;
  background: #333333;
  margin: 10px 0;
}

.label-qr-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qr-code-canvas-box {
  width: 90px;
  height: 90px;
  border: 1px solid #ddd;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.qr-code-canvas-box img {
  width: 100%;
  height: 100%;
}

.label-code-fallback {
  display: flex;
  flex-direction: column;
}

.code-lbl {
  font-size: 9px;
  color: #666;
  font-weight: bold;
}

.label-uuid-fallback {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.label-footer {
  text-align: center;
  font-size: 8px;
  color: #888;
  font-weight: bold;
  margin-top: 12px;
  letter-spacing: 0.5px;
}

/* ----------------------------------------------------
   UTILITIES & HELPER CLASSES
   ---------------------------------------------------- */
.w-full { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.text-center { text-align: center; }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-small { font-size: 12px; }
.font-code { font-family: monospace; }
.hidden { display: none !important; }
.float-right { float: right; }

.empty-state {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--divider);
  border-radius: 16px;
}

.loading-placeholder {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.icon-btn, .icon-btn-primary {
  background: var(--divider);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.icon-btn:active, .icon-btn-primary:active {
  transform: scale(0.9);
}

.icon-btn svg, .icon-btn-primary svg {
  width: 20px;
  height: 20px;
}

.text-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.card-detail {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 14px;
}

[data-theme="dark"] .card-detail {
  background: rgba(255,255,255,0.02);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-lbl {
  color: var(--text-muted);
}

.detail-val {
  font-weight: 700;
}

.alert-action-card {
  background: var(--warning-light);
  border: 1px solid rgba(230,145,15,0.15);
  padding: 16px;
  border-radius: 16px;
  color: var(--text-main);
}

.alert-action-card h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  color: var(--warning);
  margin-bottom: 4px;
}

.alert-action-card p {
  font-size: 12px;
  line-height: 1.4;
}

/* Photo Gallery styling (Faza 3) */
.photos-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.photo-thumbnail-container {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--divider);
}

.photo-thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

/* Fullscreen photo view overlay (Faza 3) */
.fullscreen-photo-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease-out;
}

.fullscreen-photo-content {
  position: relative;
  max-width: 95%;
  max-height: 95%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-photo-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  object-fit: contain;
}

.close-fullscreen-btn {
  position: absolute;
  top: -45px;
  right: 5px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

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

/* ====================================================
   AUTH SCREEN & UNAUTHENTICATED GATE (Faza 4+)
   ==================================================== */
body.unauthenticated .app-header,
body.unauthenticated .app-content,
body.unauthenticated .app-nav {
  display: none !important;
}

body:not(.unauthenticated) #auth-screen {
  display: none !important;
}

body.unauthenticated {
  padding-bottom: 0 !important;
  overflow: hidden !important;
  height: 100vh !important;
}

#auth-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: var(--bg-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
}

.auth-bg-decor {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: authBlobFloat 20s infinite alternate ease-in-out;
}

.auth-blob-1 {
  width: 250px;
  height: 250px;
  background: var(--primary);
  top: -50px;
  left: -50px;
}

.auth-blob-2 {
  width: 300px;
  height: 300px;
  background: var(--warning);
  bottom: -100px;
  right: -50px;
  animation-delay: -5s;
}

@keyframes authBlobFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.1); }
  100% { transform: translate(-20px, -40px) scale(0.9); }
}

.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 2;
  animation: authCardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authCardEntrance {
  0% { opacity: 0; transform: translateY(30px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo-emoji {
  font-size: 54px;
  margin-bottom: 8px;
  animation: logoBounce 3s ease-in-out infinite;
  display: inline-block;
}

@keyframes logoBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.auth-logo h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.auth-logo p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: var(--divider);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 10px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-tab-btn.active {
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.auth-panel {
  display: flex;
  flex-direction: column;
}

.auth-panel.hidden {
  display: none !important;
}

.auth-gradient-btn {
  background: linear-gradient(135deg, var(--primary) 0%, hsl(142, 60%, 30%) 100%);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.auth-gradient-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 142, 85, 0.4);
}

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

.auth-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: center;
}

.auth-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* Vessel alternatives banner */
.vessel-alerts-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

.vessel-alert-banner {
  background: var(--card-bg);
  border: 1px solid rgba(230, 145, 15, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-main);
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--warning);
}

.vessel-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  color: var(--warning);
}

.vessel-alert-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-main);
  font-weight: 500;
}

.vessel-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.btn-vessel-swap-alt {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(58, 142, 85, 0.2);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-vessel-swap-alt:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

/* ----------------------------------------------------
   WINTER SUPPLIES PLANNING
   ---------------------------------------------------- */
.winter-suggestions-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.winter-suggestion-card {
  background: linear-gradient(135deg, rgba(2, 136, 209, 0.06) 0%, rgba(2, 136, 209, 0.02) 100%);
  border: 1px solid rgba(2, 136, 209, 0.18);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.01);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

[data-theme="dark"] .winter-suggestion-card {
  background: linear-gradient(135deg, rgba(74, 180, 245, 0.06) 0%, rgba(74, 180, 245, 0.02) 100%);
  border: 1px solid rgba(74, 180, 245, 0.15);
}

.winter-suggestion-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 136, 209, 0.06);
}

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

.winter-suggestion-content h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #0288d1;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .winter-suggestion-content h4 {
  color: #4ab4f5;
}

.winter-suggestion-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.winter-suggestion-action {
  flex-shrink: 0;
}

.badge-winter {
  background: rgba(2, 136, 209, 0.08);
  color: #0288d1;
  border: 1px solid rgba(2, 136, 209, 0.2);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

[data-theme="dark"] .badge-winter {
  background: rgba(74, 180, 245, 0.1);
  color: #4ab4f5;
  border: 1px solid rgba(74, 180, 245, 0.2);
}

/* Confirmed pickling tasks styling */
.task-card.confirmed {
  border-color: rgba(46, 125, 50, 0.4) !important;
  background: rgba(46, 125, 50, 0.05) !important;
}

.task-card.confirmed .task-info h4 {
  text-decoration: line-through;
  color: var(--text-muted);
}

.cal-jar-item.confirmed {
  border-color: rgba(46, 125, 50, 0.4) !important;
  background: rgba(46, 125, 50, 0.05) !important;
}

.cal-jar-item.confirmed .cal-jar-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Screen readers only utility class (WCAG) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
