/**
 * Common CSS Styles
 * Main stylesheet for Esskultur application
 * 
 * Component imports handle: variables, buttons, forms, popups, toast, theme-toggle, navigation, header-footer
 */

/* ========== Component Imports ========== */
@import url("components/variables.css");
@import url("components/buttons.css");
@import url("components/forms.css");
@import url("components/popup.css");
@import url("components/toast.css");
@import url("components/theme-toggle.css");
@import url("components/navigation.css");
@import url("components/static.css");
@import url("components/header-footer.css");

*,
*:before,
*:after {
  box-sizing: border-box;
}

body {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 12px;
  text-decoration: none;
  color: var(--text-primary);
  line-height: 20px;
  background-color: var(--bg-primary);
  margin: 0px;
  padding: 0px;
  width: 100%;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

table {
  font-size: 12px;
  line-height: 20px;
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: var(--text-primary);
  line-height: 20px;
}

.underline {
  border-bottom: dotted 1px #000000;
}

h2 {
  font-size: 16px;
  line-height: 24px;
}

h3 {
  font-size: 24px;
  line-height: 36px;
}

.orange {
  color: var(--accent-orange);
}

/* NOTE: Theme toggle base styles are in components/theme-toggle.css */

.bg_grey {
  background-color: var(--bg-card-alt);
}

.bg_lightgrey {
  background-color: #f2f1f0;
  border: 2px solid #c8c8c8;
}

.bg_orange {
  background-color: #ff8947;
}

.bg_red {
  background-color: #e00000;
}

.bg_none {
  background-color: #fdfdfd;
}

.gesperrt {
  /* Required for IE 5, 6, 7 */
  /* ...or something to trigger hasLayout, like zoom: 1; */
  width: 100%;

  /* This works in IE 8 & 9 too */
  /* ... but also 5, 6, 7 */
  filter: alpha(opacity=60);

  /* Older than Firefox 0.9 */
  -moz-opacity: 0.6;

  /* Safari 1.x (pre WebKit!) */
  -khtml-opacity: 0.6;

  /* Modern!
	/* Firefox 0.9+, Safari 2?, Chrome any?
	/* Opera 9+, IE 9+ */
  opacity: 0.6;
  /* Keep text readable - only background is faded */
  color: #101010;
  font-weight: normal;
}

/* NOTE: Navigation styles (a.pfeile, week-navigation, week-dates, footer-links) 
   are now in components/navigation.css */

/* ---------- Header Table Layout ---------- */

.mobile-header {
  width: 800px;
  max-width: 100%;
  margin: 0 auto;
}

.mobile-header td[align="right"] {
  text-align: right !important;
}

/* NOTE: #login base styles are now in components/forms.css */

/* ---------- Essen ---------- */

/* ---------- Big Link ---------- */

a.big-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 137, 71, 0.3);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

a.big-link:hover {
  text-decoration: none;
}

/* ---------- Essen Box ---------- */

#essen {
  min-height: 240px;
  height: 240px;
  width: 155px;
  padding: 12px;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  margin-top: 4px;
  box-sizing: border-box;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid #d0d0d0;
  -webkit-tap-highlight-color: rgba(255, 137, 71, 0.3);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Content wrapper to ensure equal spacing */
#essen b {
  display: block;
  margin-bottom: 6px;
  color: #333;
}

/* Push order counts to bottom */
#essen .order-counts {
  margin-top: auto;
}

* html #essen {
  height: 160px;
}

a.big-link:hover #essen,
#essen:hover {
  border-color: #ff8947;
  box-shadow: 0 6px 12px rgba(255, 137, 71, 0.25);
  transform: translateY(-3px);
}

/* ---------- Order Counts Display (Admin View) ---------- */

.order-counts {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.15);
  font-size: 11px;
  line-height: 1.4;
}

.count-total {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: #333;
}

.count-total strong {
  font-size: 14px;
  color: #ff8947;
}

.count-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.count-item {
  display: inline-flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  color: #555;
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: help;
}

.bg_orange .order-counts {
  border-top-color: rgba(255, 255, 255, 0.3);
}

.bg_orange .count-total {
  color: rgba(255, 255, 255, 0.9);
}

.bg_orange .count-total strong {
  color: white;
}

.bg_orange .count-item {
  background-color: rgba(255, 255, 255, 0.25);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.bg_red .order-counts {
  border-top-color: rgba(255, 255, 255, 0.3);
}

.bg_red .count-total,
.bg_red .count-item {
  color: white;
}

.bg_red .count-item {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---------- Order Status Tags (User View) ---------- */

.order-status-tag {
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.order-tag-bestellt {
  background: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.order-tag-storniert {
  background: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ---------- Meal Status Icon (User View) ---------- */

.meal-status-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
}

.meal-status-icon.ordered {
  background: rgba(255, 255, 255, 0.35);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.meal-status-icon.locked {
  background: rgba(0, 0, 0, 0.08);
  color: #888;
  font-size: 12px;
  border: none;
}

/* Make #essen position relative for icon positioning */
#essen {
  position: relative;
}

/* ---------- Holiday Tag (Admin View) ---------- */

.holiday-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
  background: rgba(251, 191, 36, 0.15);
  color: #b45309;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Holiday icon tag - icon only, positioned bottom right */
.holiday-icon-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 50%;
  cursor: help;
}

.bg_orange .holiday-tag,
.bg_red .holiday-tag {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

.bg_orange .holiday-icon-tag,
.bg_red .holiday-icon-tag {
  background: rgba(255, 255, 255, 0.2);
}

.empty-slot .holiday-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
}

.empty-slot .holiday-icon-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
}

/* Empty slot styling for admin view */
.empty-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 80px !important;
  border: 2px dashed #c0c0c0;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.empty-slot-text {
  color: #888;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

a.big-link:hover .empty-slot {
  border-color: #ff8947;
  background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
}

a.big-link:hover .empty-slot-text {
  color: #ff8947;
}

#essen_salat {
  min-height: 60px;
  width: 148px;
  padding: 2px;
  margin-bottom: 6px;
  margin-top: 2px;
}

* html #essen_salat {
  height: 60px;
}

#essen_spacer {
  display: none; /* Hide empty spacer cards on all screen sizes */
  min-height: 240px;
  height: 240px;
  width: 155px;
  padding: 2px;
  background-color: #f2f1f0;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  margin-top: 4px;
  border: 2px dashed #d8d8d8;
}

* html #essen_spacer {
  height: 240px;
}

/* No meals / Holiday indication */
.no-meals {
  min-height: 100px;
  width: 155px;
  padding: 20px 10px;
  background-color: #f5f5f5;
  border-radius: 10px;
  margin-bottom: 8px;
  margin-top: 4px;
  border: 2px dashed #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.no-meals.holiday-notice {
  background-color: #fff8e1;
  border-color: #ffcc02;
}

.holiday-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 8px;
  background-color: #fff8e1;
  border: 1px solid #ffcc02;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #8b6914;
}

.holiday-banner .holiday-icon {
  font-size: 16px;
}

.holiday-banner .holiday-text {
  font-size: 12px;
}

.holiday-icon {
  font-size: 32px;
}

.holiday-text {
  font-size: 14px;
  font-weight: 600;
  color: #8b6914;
}

.no-meals-icon {
  font-size: 24px;
  color: #ccc;
}

.no-meals-text {
  font-size: 13px;
  color: #999;
}

/* ---------- Main ---------- */

#main {
  z-index: 1;
  position: relative;
  top: 0px;
  left: 0px;
  width: 100%;
  margin-top: 10px;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Logo ---------- */

.site-logo {
  max-width: 180px;
  height: auto;
  transition: transform 0.2s ease;
}

.site-logo:hover {
  transform: scale(1.02);
}

/* ---------- Deckel & Popup ---------- */
/* NOTE: Popup/modal styles are now in components/popup.css */
/* The component handles all popup centering and responsive behavior */

/* ---------- Mobile Responsiveness ---------- */

/* === Tablet and smaller desktops (901px - 1024px) === */
@media only screen and (max-width: 1024px) and (min-width: 901px) {
  #essen {
    width: 150px;
    min-height: 240px;
    height: 240px;
    padding: 12px;
    font-size: 11px;
    line-height: 18px;
    border-radius: 10px;
  }

  #essen_spacer {
    width: 150px;
    min-height: 240px;
    height: 240px;
  }

  .week-dates {
    font-size: 16px;
    padding: 0 18px;
  }

  .week-navigation {
    padding: 12px 18px;
    gap: 12px;
  }

  a.pfeile {
    font-size: 20px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px;
  }

  .meal-table {
    max-width: 100%;
    border-spacing: 8px 0;
  }

  /* Hide day header container on tablets (use plain layout) */
  .day-header-container {
    display: none;
  }

  /* Weekday headers on tablets */
  .meal-table h2 {
    font-size: 15px;
    padding: 10px 6px;
    border-radius: 8px;
  }

  /* Today highlighting on tablets */
  .meal-table h2.today {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
  }

  .meal-table td[align="center"] {
    padding: 0 4px;
  }

  /* Login on tablets */
  #login {
    padding: 12px 16px;
    border-radius: 12px;
  }

  #login input {
    width: 120px;
    height: 34px;
    font-size: 12px;
    border-radius: 8px;
  }

  #login button {
    height: 34px;
    font-size: 12px;
    min-width: 85px;
    border-radius: 8px;
  }

  /* Logo on tablets */
  .site-logo {
    max-width: 160px;
  }

  /* Compact order counts for tablets */
  .order-counts {
    font-size: 10px;
    padding-top: 6px;
    margin-top: 6px;
  }

  .count-item {
    font-size: 9px;
    padding: 1px 4px;
  }

  .count-total {
    font-size: 11px;
  }
}

/* === Mobile devices (up to 900px) === */
@media only screen and (max-width: 900px) {
  /* Hide day header container on mobile (uses mobile-day-header instead) */
  .day-header-container {
    display: none;
  }

  /* Make main container fit mobile screens */
  #main {
    margin-top: 5px;
    width: 100%;
    max-width: 100vw;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    padding: 0 5px;
  }

  /* Show logo as faded background on mobile */
  .mobile-hide-logo {
    display: block !important;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
  }

  .mobile-hide-logo img,
  .mobile-hide-logo .site-logo {
    opacity: 0.25;
    max-width: 200px;
    filter: grayscale(30%);
  }

  /* Mobile header layout */
  .mobile-header {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 5px 10px;
    box-sizing: border-box;
    position: relative;
  }

  .mobile-header td {
    display: block;
    width: 100% !important;
    text-align: center !important;
  }

  /* Fix all tables to not overflow */
  table {
    max-width: 100vw !important;
    width: 100% !important;
    table-layout: fixed;
  }

  /* Mobile popup styles now in components/popup.css */

  /* === MOBILE MEAL CARDS === */
  #essen {
    min-height: auto;
    height: auto;
    width: 100% !important;
    max-width: 100%;
    padding: 16px;
    font-size: 14px;
    line-height: 22px;
    margin-bottom: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  #essen:last-child {
    margin-bottom: 0;
  }

  #essen b {
    font-size: 15px;
    display: block;
    margin-bottom: 6px;
  }

  #essen_spacer {
    display: none;
  }

  /* Order counts on mobile */
  .order-counts {
    margin-top: 12px;
    padding-top: 10px;
    font-size: 12px;
  }

  .count-total {
    font-size: 13px;
  }

  .count-total strong {
    font-size: 16px;
  }

  .count-details {
    gap: 6px;
    margin-top: 6px;
  }

  .count-item {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
  }

  /* Week navigation - horizontal alignment with proper spacing */
  .week-navigation {
    width: 100%;
    max-width: 100vw;
    text-align: center;
    padding: 12px 5px;
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
    border-radius: 10px;
    margin: 5px 0 10px 0;
  }

  /* Increase touch target size for arrows */
  a.pfeile {
    font-size: 28px;
    padding: 12px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 50px;
    text-align: center;
    position: relative;
    z-index: 10;
    cursor: pointer;
    flex-shrink: 0;
    background: rgba(255, 137, 71, 0.1);
    border-radius: 50%;
    margin: 0 5px;
  }

  a.pfeile:active {
    background: rgba(255, 137, 71, 0.3);
    transform: scale(0.95);
  }

  /* Week dates display - don't break line */
  .week-dates {
    font-size: 14px;
    display: inline-block;
    vertical-align: middle;
    padding: 0 12px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: bold;
    color: #333;
  }

  /* Make login form mobile-friendly - compact single row */
  #login {
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 32px;
    padding: 8px 10px;
    line-height: 20px;
    box-sizing: border-box;
    margin: 8px auto;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f7f6 0%, #eeedec 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    float: none;
    position: relative;
    \n\t\tz-index: 10;
  }

  #login form {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
  }

  #login input {
    flex: 0 1 auto;
    width: 90px;
    min-width: 70px;
    max-width: 100px;
    height: 28px;
    font-size: 11px;
    border-radius: 6px;
    padding: 4px 8px;
    border: 1px solid #d0d0d0;
    background: white;
  }

  #login input:focus {
    border-color: #ff8947;
    box-shadow: 0 0 0 2px rgba(255, 137, 71, 0.15);
    outline: none;
  }

  #login button {
    width: auto;
    min-width: 65px;
    height: 28px;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    font-weight: 600;
  }

  #login a {
    display: inline-block;
    padding: 4px 8px;
    min-height: 28px;
    line-height: 20px;
    touch-action: manipulation;
    position: relative;
    z-index: 10;
    font-size: 11px;
    color: #ff8947;
  }

  /* Mobile styles for Heute button */
  button.heute-btn {
    min-width: 80px;
    padding: 10px 18px;
    font-size: 14px;
    touch-action: manipulation;
  }

  /* Better heading sizing on mobile */
  h1 {
    font-size: 16px;
    white-space: normal;
    word-wrap: break-word;
    margin: 8px 0;
  }

  h2 {
    font-size: 16px;
    margin: 8px 0;
  }

  /* NOTE: Footer links mobile styles are now in css/components/header-footer.css */

  /* Prevent text selection on all interactive elements */
  a,
  button,
  .bg_orange,
  .bg_grey,
  .bg_lightgrey {
    -webkit-tap-highlight-color: rgba(255, 137, 71, 0.2);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
  }

  /* === Mobile Meal Cards - Vertical Stacking === */

  /* Hide the horizontal table layout on mobile */
  .meal-table {
    display: none !important;
  }

  /* Show the mobile vertical layout */
  .mobile-meal-container {
    display: block !important;
    width: 100%;
    padding: 0;
  }

  /* Day section styling */
  .mobile-day-section {
    margin-bottom: 20px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    background: white;
  }

  .mobile-day-section:last-child {
    margin-bottom: 10px;
  }

  /* Day header - distinct color from ordered meals (which are orange) */
  .mobile-day-header {
    background: linear-gradient(135deg, #5a6c7d 0%, #3d4f5f 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 0;
    margin-bottom: 0;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    box-sizing: border-box;
    padding-right: 44px;
  }

  .mobile-day-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    gap: 2px; /* small gap between day name and date */
  }

  .mobile-day-header.today {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
  }

  .mobile-day-date {
    font-size: 13px;
    font-weight: normal;
    opacity: 0.9;
    display: block;
    white-space: nowrap;
  }

  /* Ferien icon in mobile day header */
  .mobile-day-ferien {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 16px;
    line-height: 1;
    margin: 0;
    pointer-events: none;
  }

  /* Meal cards container */
  .mobile-meals-wrapper {
    background-color: #fafafa;
    padding: 12px;
    border-radius: 0;
  }

  /* Mobile meal card */
  .mobile-meal-card {
    background-color: #fdfdfd;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  }

  .mobile-meal-card:last-child {
    margin-bottom: 0;
  }

  .mobile-meal-card.bg_orange {
    background: linear-gradient(135deg, #ff8947 0%, #ff6b2b 100%);
    color: white;
    border-color: #ed7e43;
    box-shadow: 0 3px 10px rgba(255, 137, 71, 0.3);
  }

  .mobile-meal-card.bg_grey {
    background-color: #e8e8e8;
  }

  .mobile-meal-card.bg_lightgrey {
    background-color: #f5f4f3;
    border: 2px solid #d8d8d8;
  }

  .mobile-meal-card.bg_red {
    background: linear-gradient(135deg, #e00000 0%, #c00000 100%);
    color: white;
  }

  a.big-link .mobile-meal-card:active,
  .mobile-meal-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  }

  /* Hide line images on mobile */
  .mobile-meal-container img[src*="linie.png"],
  .mobile-meal-container img[src*="transparent.gif"] {
    display: none;
  }

  /* Admin download link styling on mobile */
  .mobile-download-link {
    text-align: center;
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(180deg, #f9f9f9 0%, #f0f0f0 100%);
  }

  .mobile-download-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff8947 0%, #ed7e43 100%);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(255, 137, 71, 0.3);
    transition: all 0.2s ease;
    min-width: 180px;
  }

  .mobile-download-link a:hover,
  .mobile-download-link a:active {
    background: linear-gradient(135deg, #ed7e43 0%, #d96f35 100%);
    box-shadow: 0 3px 10px rgba(255, 137, 71, 0.4);
    transform: translateY(-1px);
  }
}

/* === Extra small mobile devices (up to 480px) === */
@media only screen and (max-width: 480px) {
  body {
    font-size: 13px;
    line-height: 20px;
  }

  #essen {
    padding: 14px;
    font-size: 13px;
    border-radius: 10px;
  }

  #essen b {
    font-size: 14px;
  }

  .mobile-day-header {
    font-size: 15px;
    padding: 10px 14px;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-day-date {
    font-size: 12px;
  }

  .mobile-meal-card {
    padding: 14px;
  }

  #popup_nutzer {
    width: 95vw;
    padding: 15px;
    font-size: 13px;
  }

  #popup_nutzer a {
    padding: 8px 16px;
    font-size: 15px;
  }

  /* Order counts on small mobile */
  .order-counts {
    font-size: 11px;
  }

  .count-item {
    font-size: 10px;
    padding: 2px 6px;
  }

  /* Login adjustments for small screens */
  #login {
    padding: 6px 8px;
    gap: 4px;
  }

  #login input {
    width: 70px;
    max-width: 80px;
    height: 26px;
    font-size: 10px;
    padding: 4px 6px;
  }

  #login button {
    height: 26px;
    font-size: 10px;
    min-width: 50px;
    padding: 4px 8px;
  }

  .week-navigation {
    padding: 10px 5px;
  }

  a.pfeile {
    font-size: 24px;
    padding: 10px 14px;
    min-width: 44px;
    min-height: 44px;
  }

  .week-dates {
    font-size: 13px;
    padding: 0 8px;
  }
}

/* === Very small mobile devices (up to 360px) === */
@media only screen and (max-width: 360px) {
  #essen {
    padding: 12px;
    font-size: 12px;
    line-height: 18px;
  }

  #essen b {
    font-size: 13px;
  }

  .mobile-day-header {
    font-size: 14px;
    padding: 8px 12px;
  }

  #login {
    padding: 4px 6px;
    gap: 3px;
  }

  #login input {
    width: 60px;
    height: 24px;
    font-size: 9px;
    padding: 3px 5px;
  }

  #login button {
    min-width: 45px;
    height: 24px;
    font-size: 9px;
    padding: 3px 6px;
  }

  #login a {
    font-size: 9px;
    height: 24px;
    padding: 3px 6px;
  }

  .count-details {
    flex-direction: column;
    gap: 4px;
  }

  .count-item {
    width: 100%;
    justify-content: center;
  }
}

/* === Desktop: Hide mobile layout, show table === */
@media only screen and (min-width: 901px) {
  .mobile-meal-container {
    display: none !important;
  }

  /* Header aligned with content */
  .mobile-header {
    width: 800px;
    max-width: 100%;
    margin: 0 auto;
  }

  .meal-table {
    display: table !important;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 auto !important;
    width: auto !important;
    max-width: 100%;
    box-sizing: border-box;
    table-layout: fixed;
  }

  /* Fixed width day columns to ensure symmetrical centering */
  .meal-table td[align="center"] {
    width: 175px;
    max-width: 175px;
    vertical-align: top;
    padding: 0 2px;
  }

  /* Target spacer columns (&nbsp;) - reduced width as requested */
  .meal-table td:not([align="center"]) {
    width: 4px;
    padding: 0;
    font-size: 0;
  }

  /* Hide line images on desktop too */
  .meal-table img[src*="linie.png"] {
    display: none;
  }

  .meal-table img[src*="transparent.gif"] {
    display: none;
  }

  /* Desktop improvements for meal cards */
  #essen {
    transition: all 0.25s ease;
    min-height: 240px;
    height: 240px;
  }

  /* Better hover effects on desktop */
  a.big-link:hover #essen {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 16px rgba(255, 137, 71, 0.25);
  }

  /* Admin view - make cards slightly taller to accommodate counts */
  .order-counts {
    margin-top: auto;
  }

  /* Weekday headers on desktop - styled inside container */
  .meal-table h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    letter-spacing: 0.3px;
    text-transform: capitalize;
    position: relative;
    background: none;
  }

  /* Day header container visible on desktop */
  .day-header-container {
    display: block;
  }

  /* Date below weekday name on desktop */
  .day-date {
    display: block;
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 0;
  }

  /* Day column - equal width and centered content */
  .meal-table td[align="center"] {
    vertical-align: top;
    padding: 0 4px;
  }

  /* Container for meal cards - flexbox for equal heights */
  .meal-table td > div {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  /* Stretch day headers to the full column width so they line up with the cards */
  .day-header-container {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 6px;
  }

  /* Ensure empty/holiday placeholders span the full column like meal cards */
  .no-meals,
  .no-meals.holiday-notice {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Equal height rows for meal cards */
  .meal-table tr {
    vertical-align: top;
  }

  /* Header container - right align login */
  .desktop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 20px;
  }

  /* Week navigation on desktop */
  .week-navigation {
    padding: 12px 20px;
    gap: 15px;
    border-radius: 14px;
  }

  .week-dates {
    font-size: 16px;
    padding: 0 20px;
  }

  a.pfeile {
    font-size: 20px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px;
  }

  /* Bestellübersicht link styling on desktop */
  .meal-table a[href*="besteller.php"] {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ff8947 0%, #ed7e43 100%);
    color: white;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(255, 137, 71, 0.25);
    transition: all 0.2s ease;
    margin-top: 4px;
  }

  .meal-table a[href*="besteller.php"]:hover {
    background: linear-gradient(135deg, #ed7e43 0%, #ff8947 100%);
    box-shadow: 0 3px 8px rgba(255, 137, 71, 0.35);
    transform: translateY(-1px);
  }
}

/* === Large desktop screens (1200px+) === */
@media only screen and (min-width: 1200px) {
  /* Header width to match content */
  .mobile-header {
    width: 950px;
  }

  #essen {
    width: 180px;
    min-width: 175px;
    min-height: 250px;
    height: 250px;
    padding: 14px;
    font-size: 12px;
    line-height: 19px;
    border-radius: 12px;
  }

  #essen_spacer {
    width: 180px;
    min-width: 175px;
    min-height: 250px;
    height: 250px;
  }

  /* Fixed min-width for weekday columns */
  .meal-table td[align="center"] {
    min-width: 185px;
  }

  .day-header-container {
    min-width: 180px;
  }

  /* Today highlighting on desktop - green like mobile */
  .meal-table h2.today {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
  }

  .count-details {
    gap: 5px;
  }

  .count-item {
    font-size: 10px;
    padding: 2px 6px;
  }

  /* Larger weekday headers */
  .meal-table h2 {
    font-size: 16px;
    padding: 12px 14px;
    border-radius: 10px;
  }

  /* Login area for large screens - still compact */
  #login {
    padding: 10px 14px;
    border-radius: 10px;
  }

  #login input {
    width: 110px;
    height: 28px;
    font-size: 12px;
    border-radius: 6px;
  }

  #login button {
    height: 28px;
    min-width: 80px;
    font-size: 12px;
    border-radius: 6px;
  }

  /* Logo on large screens */
  .site-logo {
    max-width: 180px;
  }

  /* Week navigation on large screens */
  .week-navigation {
    padding: 6px 24px;
    gap: 18px;
    border-radius: 16px;
  }

  .week-dates {
    font-size: 18px;
    padding: 0 22px;
  }

  a.pfeile {
    font-size: 22px;
    min-width: 48px;
    min-height: 48px;
    padding: 10px 16px;
  }

  /* Table spacing for large screens */
  .meal-table {
    border-spacing: 10px 0;
  }

  .meal-table td[align="center"] {
    padding: 0 6px;
  }

  /* Bestellübersicht button on large screens */
  .meal-table a[href*="besteller.php"] {
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 8px;
  }
}

/* === Extra large desktop screens (1400px+) === */
@media only screen and (min-width: 1400px) {
  /* Header width to match content */
  .mobile-header {
    width: 1100px;
  }

  #essen {
    width: 200px;
    min-width: 195px;
    min-height: 260px;
    height: 260px;
    padding: 16px;
    font-size: 13px;
    line-height: 20px;
    border-radius: 14px;
  }

  #essen_spacer {
    width: 200px;
    min-width: 195px;
    min-height: 260px;
    height: 260px;
    border-radius: 14px;
  }

  /* Fixed min-width for weekday columns */
  .meal-table td[align="center"] {
    min-width: 205px;
    padding: 0 8px;
  }

  .day-header-container {
    min-width: 200px;
  }

  /* Today highlighting on extra large screens */
  .meal-table h2.today {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
  }

  .meal-table {
    border-spacing: 12px 0;
  }

  .meal-table h2 {
    font-size: 18px;
    padding: 14px 16px;
    border-radius: 12px;
  }

  .week-navigation {
    padding: 6px 28px;
    gap: 20px;
    border-radius: 18px;
  }

  .week-dates {
    font-size: 20px;
    padding: 0 28px;
  }

  a.pfeile {
    font-size: 24px;
    min-width: 52px;
    min-height: 52px;
    padding: 12px 18px;
  }

  #login {
    padding: 12px 16px;
    border-radius: 12px;
  }

  #login input {
    width: 120px;
    height: 30px;
    font-size: 12px;
    border-radius: 8px;
  }

  #login button {
    height: 30px;
    min-width: 85px;
    font-size: 12px;
    border-radius: 8px;
  }

  .site-logo {
    max-width: 200px;
  }

  .footer-links {
    max-width: 1000px;
    padding: 20px 15px;
    border-radius: 12px;
  }

  .footer-links a {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Bestellübersicht button on extra large screens */
  .meal-table a[href*="besteller.php"] {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 8px;
  }
}

/* ========== Bestellübersicht Preview Modal ========== */
.besteller-preview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.besteller-preview-modal.active {
  display: flex;
}

.besteller-preview-dialog {
  background: var(--bg-card, #ffffff);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.besteller-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #5a6c7d 0%, #3d4f5f 100%);
  color: white;
}

.besteller-preview-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.besteller-preview-header .preview-date {
  font-size: 14px;
  opacity: 0.9;
}

.besteller-preview-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.besteller-preview-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

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

.besteller-preview-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-secondary, #f5f5f5);
}

.besteller-preview-footer button,
.besteller-preview-footer a {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-preview-close {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #ccc);
  color: var(--text-primary, #333);
}

.btn-preview-close:hover {
  background: var(--bg-secondary, #f0f0f0);
}

.btn-preview-download {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  border: none;
  color: white;
}

.btn-preview-download:hover {
  background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
  transform: translateY(-1px);
}

/* Preview content styling */
.preview-content {
  font-size: 13px;
  color: var(--text-primary, #333);
}

.preview-summary {
  background: var(--bg-secondary, #f8f8f8);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.summary-total {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-primary, #333);
}

.summary-meals,
.summary-locations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.meal-badge {
  background: linear-gradient(135deg, #ff8947 0%, #ff6b2b 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.location-badge {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #ddd);
  color: var(--text-secondary, #666);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.preview-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Make table horizontally scrollable on small viewports instead of wrapping */
.preview-table {
  min-width: 640px;
}

/* Sticky table header for easier scanning */
.preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-secondary, #f0f0f0);
}

/* Dark theme: ensure header background matches dark cards */
[data-theme="dark"] .preview-table thead th {
  background: var(--bg-card, #333);
}

/* Ausgaben collapsible toggle */
.ausgabe-header td {
  padding: 0;
}
.ausgabe-header .ausgabe-header-content {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.ausgabe-header .ausgabe-title {
  font-weight: 600;
}
.ausgabe-header .ausgabe-toggle-icon {
  margin-left: 8px;
  font-size: 14px;
}
.ausgabe-header:hover .ausgabe-header-content {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.03));
}
/* Sticky per-ausgabe header (sticks below the table header) */
.ausgabe-header {
  position: sticky;
  top: 42px; /* space for the sticky table header */
  /* ensure header separators are visible above the table header */
  z-index: 4;
  background: var(--bg-secondary, #f0f0f0);
  /* subtle top border/shadow for clearer separation when collapsed */
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .ausgabe-header {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

/* Make the preview table wrapper behave nicely on very small screens */
@media only screen and (max-width: 480px) {
  .preview-table-wrapper {
    max-height: 55vh;
  }
  .preview-table {
    min-width: 520px;
  }
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.preview-table th {
  background: var(--bg-secondary, #f0f0f0);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color, #ddd);
  color: var(--text-primary, #333);
}

.preview-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light, #eee);
  color: var(--text-primary, #333);
}

.preview-table .type-cell {
  font-size: 11px;
  white-space: nowrap;
}

.preview-table .allergy-cell {
  font-size: 11px;
  color: var(--text-secondary, #666);
}

.preview-table .ausgabe-header td {
  background: linear-gradient(135deg, #5a6c7d 0%, #3d4f5f 100%);
  color: white;
  padding: 10px 12px;
  font-size: 13px;
  /* stronger bottom border to match table header */
  border-bottom: 2px solid var(--border-color, #ddd);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  /* subtle inset shadow to emphasize separation when sticky */
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.preview-table .order-row:hover {
  background: var(--bg-secondary, #f8f8f8);
}

.preview-table .order-row.has-allergy {
  background: #fff8e1;
}

.preview-table .order-row.has-allergy:hover {
  background: #fff3cd;
}

.preview-table .order-row.has-allergy .allergy-cell {
  color: #b36200;
  font-weight: 500;
}

/* Summary improvements */
.preview-summary .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-summary .summary-section {
  font-size: 12px;
  color: var(--text-secondary, #666);
  margin-bottom: 6px;
  margin-top: 10px;
}

.btn-allergiker-filter {
  background: #fff8e1;
  border: 1px solid #ffc107;
  color: #b36200;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-allergiker-filter:hover {
  background: #fff3cd;
}

.btn-allergiker-filter.active {
  background: #ffc107;
  color: #333;
}

[data-theme="dark"] .btn-allergiker-filter {
  background: rgba(255, 193, 7, 0.2);
  border-color: rgba(255, 193, 7, 0.5);
  color: #ffc107;
}

[data-theme="dark"] .btn-allergiker-filter:hover {
  background: rgba(255, 193, 7, 0.3);
}

[data-theme="dark"] .btn-allergiker-filter.active {
  background: #ffc107;
  color: #333;
}

[data-theme="dark"] .preview-table .order-row.has-allergy {
  background: rgba(255, 193, 7, 0.15);
}

[data-theme="dark"] .preview-table .order-row.has-allergy:hover {
  background: rgba(255, 193, 7, 0.25);
}

[data-theme="dark"] .preview-table .order-row.has-allergy .allergy-cell {
  color: #ffc107;
}

.no-orders-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #888);
  font-size: 14px;
}

/* Loading state */
.preview-loading {
  text-align: center;
  padding: 40px 20px;
}

.preview-loading::after {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid var(--border-color, #e0e0e0);
  border-top-color: var(--accent-orange, #ff8947);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Mobile adjustments for preview modal */
@media only screen and (max-width: 768px) {
  .besteller-preview-dialog {
    max-height: 90vh;
    margin: 10px;
  }

  .besteller-preview-header {
    padding: 12px 16px;
  }

  .besteller-preview-header h3 {
    font-size: 16px;
  }

  .besteller-preview-body {
    padding: 16px;
  }

  .preview-table th,
  .preview-table td {
    padding: 6px 8px;
    font-size: 11px;
  }

  .besteller-preview-footer {
    flex-direction: column;
    gap: 8px;
  }

  .besteller-preview-footer button,
  .besteller-preview-footer a {
    width: 100%;
    justify-content: center;
  }
}

/* ========== Improved Meal Card Styling ========== */
/* Better visual indicators for ordered vs not ordered */
.bg_orange {
  background: linear-gradient(135deg, #ff8947 0%, #ff6b2b 100%);
  color: white;
  border-color: #e67335;
}

.bg_orange b {
  color: white;
}

.bg_lightgrey {
  background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
  border: 2px solid #d8d8d8;
}

.bg_grey {
  background: linear-gradient(135deg, #e8e8e8 0%, #dcdcdc 100%);
  border: 1px solid #c8c8c8;
}

/* ========== Comprehensive Dark Theme Styles ========== */

/* Dark theme - Week navigation */
[data-theme="dark"] .week-navigation {
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-card) 100%
  );
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .week-dates {
  color: var(--text-primary);
}

[data-theme="dark"] a.pfeile {
  background: rgba(255, 137, 71, 0.15);
  color: var(--accent-orange);
}

[data-theme="dark"] a.pfeile:hover {
  background: rgba(255, 137, 71, 0.25);
}

/* Dark theme - Login area */
[data-theme="dark"] #login {
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-card) 100%
  );
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] #login input {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] #login input::placeholder {
  color: var(--text-muted);
}

[data-theme="dark"] #login button {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #e67335 100%);
}

[data-theme="dark"] #login a {
  color: var(--text-primary);
}

[data-theme="dark"] .login-separator {
  color: var(--text-muted);
}

/* NOTE: Dark theme footer-links styles are now in css/components/header-footer.css */

/* Dark theme - Meal table headers */
[data-theme="dark"] .meal-table h2 {
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-card) 100%
  );
  color: var(--text-primary);
}

[data-theme="dark"] .meal-table h2.today {
  background: linear-gradient(
    135deg,
    var(--accent-green) 0%,
    var(--accent-green-dark) 100%
  );
  color: white;
}

[data-theme="dark"] .day-date {
  color: var(--text-secondary);
}

/* Dark theme - Mobile sections */
[data-theme="dark"] .mobile-day-section {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .mobile-day-header {
  /* Dark-mode mobile header should also use the header gradient variables */
  background: linear-gradient(
    135deg,
    var(--header-gradient-start),
    var(--header-gradient-end)
  );
  color: var(--text-primary);
}

[data-theme="dark"] .mobile-day-header .mobile-day-date {
  color: var(--text-secondary);
}

/* Mobile "today" should keep the green accent and readable text */
[data-theme="dark"] .mobile-day-header.today {
  background: linear-gradient(
    135deg,
    var(--accent-green),
    var(--accent-green-dark)
  );
  color: white;
}
[data-theme="dark"] .mobile-day-header.today .mobile-day-date {
  color: white;
}
/* Improve contrast for mobile "today" header date in dark theme */
[data-theme="dark"] .mobile-day-header.today,
[data-theme="dark"] .mobile-day-header.today .mobile-day-date {
  color: white;
}
[data-theme="dark"] .mobile-day-header.today {
  background: linear-gradient(
    135deg,
    var(--accent-green) 0%,
    var(--accent-green-dark) 100%
  );
  color: white;
}

[data-theme="dark"] .mobile-meals-wrapper {
  background: var(--bg-card);
}

/* Dark-mode: mobile download link styling */
[data-theme="dark"] .mobile-download-link {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
}

[data-theme="dark"] .mobile-download-link a {
  background: linear-gradient(135deg, #ff8947 0%, #ed7e43 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mobile-download-link a:hover,
[data-theme="dark"] .mobile-download-link a:active {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

/* Dark theme - Meal cards text contrast fix */
[data-theme="dark"] #essen {
  color: var(--text-primary);
}

[data-theme="dark"] #essen i {
  color: var(--text-secondary);
  opacity: 1;
}

[data-theme="dark"] .order-counts {
  border-top-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .count-total {
  color: var(--text-primary);
}

[data-theme="dark"] .count-item {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Dark theme - Order status tags */
[data-theme="dark"] .order-tag-bestellt {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .order-tag-storniert {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Dark theme - Meal status icon */
[data-theme="dark"] .meal-status-icon.ordered {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .meal-status-icon.locked {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* Dark theme - Holiday tag */
[data-theme="dark"] .holiday-tag {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}

[data-theme="dark"] .holiday-icon-tag {
  background: rgba(251, 191, 36, 0.2);
}

[data-theme="dark"] .bg_orange .holiday-tag,
[data-theme="dark"] .bg_red .holiday-tag {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .bg_orange .holiday-icon-tag,
[data-theme="dark"] .bg_red .holiday-icon-tag {
  background: rgba(255, 255, 255, 0.15);
}

/* Dark theme - Holiday notice centered */
[data-theme="dark"] .no-meals {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .no-meals-text,
[data-theme="dark"] .holiday-text {
  color: var(--text-primary);
}

/* Dark theme - Gesperrt */
[data-theme="dark"] .gesperrt {
  color: var(--text-muted);
}

/* Dark theme - Popup/Deckel */
[data-theme="dark"] #popup {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] #deckel {
  background: rgba(0, 0, 0, 0.7);
}

/* Dark theme - Forms in popups */
[data-theme="dark"] #popup input,
[data-theme="dark"] #popup select,
[data-theme="dark"] #popup textarea {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] #popup input::placeholder {
  color: var(--text-muted);
}

[data-theme="dark"] #popup label {
  color: var(--text-primary);
}

[data-theme="dark"] #popup h2,
[data-theme="dark"] #popup h3 {
  color: var(--text-primary);
}

[data-theme="dark"] #popup p {
  color: var(--text-secondary);
}

/* Dark theme - Popup buttons */
[data-theme="dark"] #popup button,
[data-theme="dark"] #popup input[type="submit"] {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #e67335 100%);
  color: white;
}

[data-theme="dark"] #popup .btn-secondary,
[data-theme="dark"] #popup button.secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* Dark theme - meal cards */
[data-theme="dark"] .bg_grey {
  background: linear-gradient(135deg, #404040 0%, #363636 100%);
  border-color: #555;
}

[data-theme="dark"] .bg_lightgrey {
  background: linear-gradient(135deg, #484848 0%, #3d3d3d 100%);
  border-color: #666;
}

[data-theme="dark"] #essen b {
  color: var(--text-primary);
}

[data-theme="dark"] .bg_orange b {
  color: white;
}

[data-theme="dark"] #essen_spacer {
  background-color: var(--bg-card);
  border-color: #555;
}

/* ========== Desktop Day Header Container (like mobile) ========== */
.day-header-container {
  position: relative;
  background: linear-gradient(135deg, #5a6c7d 0%, #3d4f5f 100%);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.day-header-container h2 {
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: bold;
  color: white;
  background: none !important;
}

.day-header-container .day-date {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

/* Ferien (holiday) icon in day header - positioned top right corner */
.day-header-ferien {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 14px;
  line-height: 1;
}

/* Holiday corner icon for non-admin users (when there are meals on a holiday) */
.holiday-corner-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 14px;
  line-height: 1;
  z-index: 1;
}

.day-header-container.today {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.day-header-container.today h2 {
  color: white;
}

/* Dark theme - Day header container */
[data-theme="dark"] .day-header-container {
  /* Use header gradient variables for a dark-but-not-pure-black container */
  background: linear-gradient(
    135deg,
    var(--header-gradient-start),
    var(--header-gradient-end)
  );
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
}

[data-theme="dark"] .day-header-container h2 {
  color: var(--text-primary);
}

[data-theme="dark"] .day-header-container .day-date {
  color: var(--text-secondary);
}

[data-theme="dark"] .day-header-container.today {
  background: linear-gradient(
    135deg,
    var(--accent-green) 0%,
    var(--accent-green-dark) 100%
  );
}

[data-theme="dark"] .day-header-container.today h2 {
  color: white;
}

/* Ensure the date below the weekday header is visible on the green "today" background in dark mode */
[data-theme="dark"] .day-header-container.today .day-date {
  color: white;
}
/* ========== Meal Card Structured Rows ========== */
.meal-name {
  font-weight: bold;
  margin-bottom: 6px;
  line-height: 1.4;
}

.meal-beilage {
  margin-bottom: 6px;
  line-height: 1.4;
  color: inherit;
}

.meal-zusatzstoffe {
  margin-bottom: 6px;
  line-height: 1.4;
  font-size: 11px;
}

.meal-dessert {
  margin-bottom: 6px;
  line-height: 1.4;
  font-size: 11px;
}

.meal-dessert i {
  color: #666;
}

[data-theme="dark"] .meal-dessert i {
  color: var(--text-secondary);
}

.bg_orange .meal-dessert i {
  color: rgba(255, 255, 255, 0.85);
}

.meal-zusatzstoffe i {
  color: #666;
}

[data-theme="dark"] .meal-zusatzstoffe i {
  color: var(--text-secondary);
}

.bg_orange .meal-zusatzstoffe i {
  color: rgba(255, 255, 255, 0.85);
}

/* ========== Dark Theme - Popup Improvements ========== */
[data-theme="dark"] #popup_bestellung,
[data-theme="dark"] #popup_nutzer {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] #popup_bestellung h2,
[data-theme="dark"] #popup_bestellung h3,
[data-theme="dark"] #popup_nutzer h2,
[data-theme="dark"] #popup_nutzer h3 {
  color: var(--text-primary);
}

[data-theme="dark"] #popup_bestellung p,
[data-theme="dark"] #popup_nutzer p {
  color: var(--text-secondary);
}

[data-theme="dark"] #popup_bestellung a,
[data-theme="dark"] #popup_nutzer a {
  color: var(--accent-orange);
}

[data-theme="dark"] #popup_bestellung input,
[data-theme="dark"] #popup_bestellung select,
[data-theme="dark"] #popup_bestellung textarea,
[data-theme="dark"] #popup_nutzer input,
[data-theme="dark"] #popup_nutzer select,
[data-theme="dark"] #popup_nutzer textarea {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 8px 10px;
}

[data-theme="dark"] #popup_bestellung input:focus,
[data-theme="dark"] #popup_nutzer input:focus {
  border-color: var(--accent-orange);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 137, 71, 0.2);
}

[data-theme="dark"] #popup_bestellung label,
[data-theme="dark"] #popup_nutzer label {
  color: var(--text-primary);
}

/* Dark theme - Popup buttons */
[data-theme="dark"] #popup_bestellung button:not(.dialog-close),
[data-theme="dark"] #popup_nutzer button:not(.dialog-close),
[data-theme="dark"] #popup_bestellung input[type="submit"],
[data-theme="dark"] #popup_nutzer input[type="submit"] {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #e67335 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 500;
}

[data-theme="dark"] #popup_bestellung button:not(.dialog-close):hover,
[data-theme="dark"] #popup_nutzer button:not(.dialog-close):hover {
  background: linear-gradient(135deg, #ff9a5c 0%, var(--accent-orange) 100%);
}

/* Password change popup styling */
[data-theme="dark"] #popup_nutzer table {
  color: var(--text-primary);
}

[data-theme="dark"] #popup_nutzer td {
  color: var(--text-primary);
  padding: 4px 8px;
}

/* ========== Holiday Notice Centered ========== */
.no-meals.holiday-notice {
  background-color: #fff8e1;
  border-color: #ffcc02;
  text-align: center;
  margin: 0 auto;
}

[data-theme="dark"] .no-meals.holiday-notice {
  background-color: rgba(255, 204, 2, 0.15);
  border-color: rgba(255, 204, 2, 0.5);
}

[data-theme="dark"] .holiday-banner {
  background-color: rgba(255, 204, 2, 0.15);
  border-color: rgba(255, 204, 2, 0.5);
  color: #ffc107;
}

[data-theme="dark"] .holiday-text {
  color: #ffc107;
}

/* ========== Bestellübersicht Preview Dark Theme Fix ========== */
[data-theme="dark"] .besteller-preview-modal {
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .besteller-preview-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .besteller-preview-header {
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-card) 100%
  );
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .besteller-preview-header h3 {
  color: var(--text-primary);
}

[data-theme="dark"] .preview-date {
  color: var(--text-secondary);
}

[data-theme="dark"] .besteller-preview-body {
  background: var(--bg-card);
}

[data-theme="dark"] .preview-summary {
  background: var(--bg-secondary);
}

[data-theme="dark"] .summary-total {
  color: var(--text-primary);
}

[data-theme="dark"] .location-badge {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

[data-theme="dark"] .besteller-preview-footer {
  background: var(--bg-secondary);
  border-top-color: var(--border-color);
}

/* ========== Comprehensive Dark Mode Fixes ========== */

/* Admin footer dark mode */
[data-theme="dark"] .admin-footer {
  background: var(--bg-secondary);
  border-top-color: var(--border-color);
  color: var(--text-muted);
}

/* Gesperrt (locked/reduced opacity) dark mode text contrast fix */
[data-theme="dark"] .gesperrt {
  color: var(--text-secondary);
  opacity: 0.7;
}

[data-theme="dark"] .gesperrt b,
[data-theme="dark"] .gesperrt .meal-name {
  color: var(--text-primary);
}

/* Weekday headers - distinct readable color in dark mode */
[data-theme="dark"] h2,
[data-theme="dark"] .mobile-day-header,
[data-theme="dark"] .day-header-container h2 {
  color: var(--text-primary);
}

/* Dark mode - ensure meal cards have proper contrast */
[data-theme="dark"] .mobile-meal-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .mobile-meal-card.bg_orange {
  background: linear-gradient(135deg, #d9682e 0%, #c55520 100%);
  color: white;
}

/* Dark mode - desktop ordered meal card darker bg */
[data-theme="dark"] #essen.bg_orange,
[data-theme="dark"] .bg_orange {
  background: linear-gradient(135deg, #d9682e 0%, #c55520 100%);
  color: white;
  border-color: #b84a18;
}

[data-theme="dark"] .mobile-meals-wrapper {
  background: var(--bg-secondary);
}

/* ========== Light Mode Popup Fixes ========== */
/* Unified popup styling for both light and dark mode */
#popup_bestellung,
#popup_nutzer {
  background-color: var(--bg-card, #ffffff);
  color: var(--text-primary, #333333);
  border: 1px solid var(--border-color, #e0e0e0);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

#popup_bestellung h2,
#popup_bestellung h3,
#popup_nutzer h2,
#popup_nutzer h3 {
  color: var(--text-primary, #333333);
  margin-bottom: 12px;
}

#popup_bestellung p,
#popup_nutzer p {
  color: var(--text-secondary, #555555);
  margin: 8px 0;
  line-height: 1.6;
}

#popup_bestellung b,
#popup_nutzer b {
  color: var(--text-primary, #333333);
}

/* Popup inputs for light and dark mode */
#popup_bestellung input,
#popup_bestellung select,
#popup_bestellung textarea,
#popup_nutzer input,
#popup_nutzer select,
#popup_nutzer textarea {
  background-color: var(--bg-secondary, #f5f5f5);
  border: 1px solid var(--border-color, #d0d0d0);
  color: var(--text-primary, #333333);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

#popup_bestellung input:focus,
#popup_nutzer input:focus,
#popup_bestellung select:focus,
#popup_nutzer select:focus {
  border-color: var(--accent-orange, #ff8947);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 137, 71, 0.15);
}

#popup_bestellung input::placeholder,
#popup_nutzer input::placeholder {
  color: var(--text-muted, #999999);
}

/* Semi-transparent backdrop instead of opaque */
#deckel {
  background-color: rgba(0, 0, 0, 0.5) !important;
  opacity: 1 !important;
}

[data-theme="dark"] #deckel {
  background-color: rgba(0, 0, 0, 0.7) !important;
}

/* NOTE: Popup button styles (.popup-btn, .popup-btn-*, .popup-actions) 
   are now in components/popup.css */

/* NOTE: Toast notification styles (.toast, .toast-*, toastSlideIn/Out) 
   are now in components/toast.css */

/* ========== Header & Theme Toggle Layout Fix ========== */
/* Common container for credentials + theme toggle */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

/* Theme toggle always stays to the right */
.theme-toggle {
  flex-shrink: 0;
  order: 2;
}

/* Credentials container */
#login {
  order: 1;
  flex-shrink: 1;
}

/* Mobile sticky header */
@media only screen and (max-width: 900px) {
  .header-controls-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-primary, #fdfdfd);
    padding: 8px 10px;
    margin: 0 -10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  [data-theme="dark"] .header-controls-sticky {
    background: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  /* Keep theme toggle visible and not moving */
  .theme-toggle {
    position: relative;
    right: 0;
  }

  /* Input field width fixes */
  #login input {
    min-width: 80px;
  }

  #login input::placeholder {
    font-size: 10px;
  }
}

/* ========== "Keine Angebote" Centered ========== */
.no-meals,
.no-meals-text {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ========== Bestellübersicht Popup - Allergiker Sorting ========== */
/* Visual indicator for Allergiker at top */
.preview-table .order-row.has-allergy {
  order: -1;
}

/* Hide Excel button when no orders */
.besteller-preview-footer .btn-preview-download.hidden {
  display: none;
}

/* ========== Admin 2 Bestellungen Week Selector Mobile Fix ========== */
@media only screen and (max-width: 600px) {
  .week-nav {
    flex-wrap: nowrap;
    overflow-x: hidden;
    gap: 5px;
  }

  .week-nav .btn {
    padding: 8px 12px;
    font-size: 16px;
    min-width: 40px;
  }

  /* Hide text labels on mobile, show only icons */
  .week-nav .btn-text {
    display: none;
  }

  .week-nav .btn-icon {
    display: inline;
  }

  .week-nav .week-label {
    font-size: 13px;
    min-width: auto;
    white-space: nowrap;
  }
}

/* ========== Ferien Tag on Meal Cards ========== */
.ferien-tag {
  display: inline-block;
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #333;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .ferien-tag {
  background: linear-gradient(
    135deg,
    rgba(255, 193, 7, 0.8) 0%,
    rgba(255, 152, 0, 0.8) 100%
  );
  color: #1a1a1a;
}

/* ========== Order Status "Bestellt" Tag ========== */
.order-status-tag {
  display: inline-block;
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-status-tag.cancelled {
  background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
}
/* ========== Login Error Message ========== */
.login-error-message {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border: 1px solid #ef5350;
  border-left: 4px solid #e53935;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  color: #c62828;
  font-size: 13px;
  line-height: 1.4;
  max-width: 350px;
  float: right;
  clear: both;
  animation: slideIn 0.3s ease;
}

.login-error-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.login-error-text {
  flex: 1;
  font-weight: 500;
}

[data-theme="dark"] .login-error-message {
  background: linear-gradient(
    135deg,
    rgba(229, 57, 53, 0.15) 0%,
    rgba(229, 57, 53, 0.25) 100%
  );
  border-color: rgba(229, 57, 53, 0.5);
  color: #ef5350;
}

@keyframes slideIn {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ========== Header User Info Alignment ========== */
.header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
  position: relative;
}

#login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

#login span,
#login a {
  white-space: nowrap;
}

.login-separator {
  color: var(--text-muted, #888);
  margin: 0 2px;
}

/* Keep theme toggle fixed position on right */
.theme-toggle {
  flex-shrink: 0;
  order: 999;
}

/* Responsive header controls */
@media only screen and (max-width: 900px) {
  .header-controls {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    background: transparent;
    padding: 8px 0;
  }

  #login {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: 10px;
  }

  [data-theme="dark"] #login {
    background: rgba(45, 45, 45, 0.85);
  }

  .login-error-message {
    float: none;
    max-width: 100%;
    margin: 10px auto;
  }
}

@media only screen and (max-width: 480px) {
  .header-controls {
    flex-direction: column;
    align-items: center;
  }

  #login {
    width: auto;
    max-width: 95%;
  }
}

/* ========== Dark Mode - Ordered Meal Card in Admin Panel ========== */
[data-theme="dark"] .order-meal.current-order {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  border-color: #4caf50;
  color: white;
}

[data-theme="dark"] .order-meal.current-order .meal-name {
  color: white;
}

[data-theme="dark"] .order-meal.current-order .meal-type {
  color: rgba(255, 255, 255, 0.8);
}

/* ========== Improved Dark Mode Text Contrast for Locked/Ordered Meals ========== */
.gesperrt {
  opacity: 0.7;
}

.gesperrt b,
.gesperrt .meal-name,
.gesperrt .meal-beilage {
  color: inherit;
}

[data-theme="dark"] .gesperrt {
  opacity: 0.65;
}

[data-theme="dark"] .gesperrt b,
[data-theme="dark"] .gesperrt .meal-name {
  color: var(--text-primary);
}

/* Dark mode - ordered meal (orange bg) that is locked should have readable whitish text */
[data-theme="dark"] .bg_orange.gesperrt {
  /* Reduce background opacity, not text */
  background: rgba(255, 137, 71, 0.5);
}

[data-theme="dark"] .bg_orange.gesperrt b,
[data-theme="dark"] .bg_orange.gesperrt .meal-name,
[data-theme="dark"] .bg_orange.gesperrt .meal-beilage,
[data-theme="dark"] .bg_orange.gesperrt .meal-zusatzstoffe {
  color: rgba(255, 255, 255, 0.9);
  opacity: 1;
}

/* ========== Keine Angebote Centered ========== */
.no-meals {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  width: 100%;
}

.no-meals-text,
.holiday-text {
  text-align: center;
}

/* ========== Password Validation Message ========== */
.pwd-validation-msg {
  font-size: 13px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
  min-height: 20px;
}

.pwd-validation-msg.valid {
  color: #2e7d32;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.pwd-validation-msg.invalid {
  color: #c62828;
  background: rgba(211, 47, 47, 0.1);
  border: 1px solid rgba(211, 47, 47, 0.3);
}

[data-theme="dark"] .pwd-validation-msg.valid {
  color: #81c784;
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.4);
}

[data-theme="dark"] .pwd-validation-msg.invalid {
  color: #ef9a9a;
  background: rgba(211, 47, 47, 0.15);
  border-color: rgba(211, 47, 47, 0.4);
}

/* NOTE: Popup/dialog styles are in css/components/popup.css */

/* NOTE: Site header, user dropdown, and avatar styles are now in css/components/header-footer.css */

/* ========== Content Wrapper ========== */
.content-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Page-wide container for consistent width */
.page-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Center the week navigation and desktop meal table */
.meal-desktop-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  overflow: visible;
}

.meal-desktop-wrapper .meal-table {
  margin: 0 auto;
}

@media only screen and (max-width: 900px) {
  .meal-desktop-wrapper {
    align-items: stretch;
  }
}

/* NOTE: Mobile header styles are now in css/components/header-footer.css */
@media only screen and (max-width: 768px) {
  .content-wrapper {
    padding: 12px;
  }
}

/* NOTE: Unified popup styling (backdrop, buttons, dialogs) is now in css/components/popup.css */
/* NOTE: Password validation styling is now in css/components/popup.css */
/* NOTE: Toast notification styles are now in css/components/toast.css */

/* ========== Bestellübersicht Preview - Sticky Headers ========== */
.preview-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 60vh;
  -webkit-overflow-scrolling: touch;
}

.preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-secondary, #f0f0f0);
  border-bottom: 2px solid var(--border-color, #ddd);
}

[data-theme="dark"] .preview-table thead th {
  background: var(--bg-card, #333);
}

/* Mobile: Add separator line */
@media only screen and (max-width: 768px) {
  .preview-table thead th {
    border-bottom: 2px solid var(--border-color, #ccc);
  }
}

/* NOTE: Week navigation styles are in components/navigation.css */
/* NOTE: Old login container and login form styles have been removed.
   Login is now handled by popup_login.inc.php with styles in css/components/popup.css.
   The login-trigger-btn replaces the old mobile-login-btn and desktop login form. */

/* NOTE: Header layout, theme toggle in header, and mobile header styles 
   are now in css/components/header-footer.css */

/* NOTE: Theme switch slider styles (.dropdown-theme-toggle, .theme-switch-inline, .slider-inline)
   are now in css/components/header-footer.css */

/* ========== Week Navigation - Smaller Buttons on Mobile ========== */
@media only screen and (max-width: 480px) {
  .week-navigation {
    gap: 6px;
    padding: 6px 12px;
    max-width: 100%;
    margin: 8px auto;
    overflow: hidden;
  }

  a.pfeile {
    font-size: 20px;
    padding: 8px 10px;
    min-width: 38px;
    min-height: 38px;
    margin: 0;
    flex-shrink: 0;
  }

  .week-dates {
    font-size: 12px;
    padding: 0 4px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media only screen and (max-width: 360px) {
  .week-navigation {
    gap: 4px;
    padding: 8px 10px;
  }

  a.pfeile {
    font-size: 18px;
    padding: 6px 8px;
    min-width: 32px;
    min-height: 32px;
  }

  .week-dates {
    font-size: 11px;
    padding: 0 2px;
  }
}

/* ========== Dark Mode - Ordered Meal Card (Orange BG) ========== */
/* Make ordered meal bg darker in dark mode so white text is visible */
[data-theme="dark"] #essen.bg_orange,
[data-theme="dark"] .bg_orange:not(.btn-primary):not(.popup-btn-primary) {
  background: linear-gradient(135deg, #c75e24 0%, #a84d1a 100%);
  color: white;
  border-color: #8b4015;
}

[data-theme="dark"] .bg_orange b,
[data-theme="dark"] .bg_orange .meal-name {
  color: white;
}

/* ========== Dark Mode - Warning Text Visibility ========== */
/* Make warning paragraphs visible in dark mode (same color as warning header) */
[data-theme="dark"] .dialog-body p.warning-text,
[data-theme="dark"] .dialog-message-warning,
[data-theme="dark"] #popup_nutzer p[style*="color"] {
  color: #fbbf24 !important;
}

/* Warning/blocked dialog styling in dark mode */
[data-theme="dark"] .dialog-body .warning-message,
[data-theme="dark"] #popup_nutzer .warning-message,
[data-theme="dark"] .warning-message {
  color: #f59e0b;
}

/* ========== Dark Mode - Essen hinzufügen Hover ========== */
/* Make empty slot hover less bright in dark mode */
[data-theme="dark"] .empty-slot {
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-card-alt) 100%
  );
  border-color: var(--border-color);
}

[data-theme="dark"] .empty-slot-text {
  color: var(--text-muted);
}

[data-theme="dark"] a.big-link:hover .empty-slot {
  border-color: var(--accent-orange);
  background: linear-gradient(
    135deg,
    rgba(255, 137, 71, 0.06) 0%,
    rgba(255, 137, 71, 0.1) 100%
  );
}

[data-theme="dark"] a.big-link:hover .empty-slot-text {
  color: rgba(255, 137, 71, 0.8);
}
