:root {
  --brand-brown: #51382F;
  --brand-cream: #E7E3DD;
  --brand-berry: #9F496E;
}

html {
  font: 13pt/1.5em helvetica, arial, sans-serif;
}

.bgcolor-blue {
  background: var(--brand-brown); }

.bgcolor-cream {
  background: var(--brand-cream); }

.bgcolor-red {
  background: var(--brand-berry); }
  
.site-navigation {
  position: fixed;
  display: table;
  top: 0;
  right: 0;
  left:0;
  margin: 0;
  padding: 0;
  z-index:10;
  width: 100%;
  background: var(--brand-brown); }

.main-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-start;
}

.menu-item {
  position: relative;
}

.menu-item > a {
  display: block;
  padding: 15px 20px;
  color: white;
  text-decoration: none;
  background-color: var(--brand-brown);
}

.menu-item:hover > a {
  background-color: #A1887F;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  list-style: none;
  background: #A1887F;
  margin: 0;
  padding: 0;
  z-index: 1000;
  min-width: 150px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.menu-item:hover > .dropdown {
  display: block;
}

.dropdown li a {
  display: block;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
}

.dropdown li a:hover {
  background-color: #AA948C;
}

.user-greeting {
  margin-left: auto; /* push to far right if using flex */
  padding: 15px 20px;
  color: white;
  font-weight: bold;
}

.site-footer {
  width: 100%;
  position: fixed;
  bottom: 0;
  right: 0;
  height: 30px;
  margin: 0;
  padding: 0;
  z-index:5;
  overflow:auto;
  text-align: right;
  font-size: 10pt;
  background: var(--brand-brown);
  color: var(--brand-cream);
}

.front-page {
  margin: 120px auto 10px auto; }
  
a:hover {
	text-decoration: underline; }

h1 {
  color: var(--brand-brown);
  font-size: 15pt;
  }

h2 {
  color: var(--brand-brown);
  font-size: 14pt;
  }

h3 {
  color: var(--brand-brown);
  font-size: 13pt;
  }

h4 {
  color: var(--brand-brown);
  font-size: 12pt;
  }

h4.bakinglist {
  margin-left: 15px;
  margin-bottom: 0px;
  color: var(--brand-brown);
  font-size: 12pt;
  }

ul.bakinglist {
  margin-top: 5px;
}

li {
  margin-bottom: 0px;
}

p.bakinglist {
  margin-left: 5px;
  margin-bottom: 0px;
}  

.legacy-form p {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.legacy-form p::after {
    content: none;
}

.legacy-form label {
    flex: 0 0 120px;
    width: 120px;
    padding-top: 6px;
    text-align: left;
}

label.points {
    flex: 0 0 250px;
    width: 250px;
    padding-top: 6px;
    text-align: left;
}

label.radio {
    flex: 0 0 100px;
    width: 100px;
    padding-top: 6px;
    text-align: right;
}

textarea:focus, input:focus {
  border: 1px solid #0000ff;
}

.btnstyle {
  right: 20px;
  bottom: 20px;
  background: var(--brand-cream);
  color: var(--brand-berry);
  font-family: Tahoma, Geneva, sans-serif;
  height: 30px;
  border-radius: 15px;
  border: 1px solid #999;
}

.submitbtn {
  width:100px;
  cursor: pointer;
}

div.forms {
  padding-top: 80px;
  position: relative;	
}

div.lists {
	padding-top: 20px;
	position: relative;
	padding-bottom: 20px;
}

.page-under-fixed-nav {
  padding-top: 50px;
}

form {
  font-family: "Lucida Sans Unicode", "Lucida Grande", arial, helvetica, sans-serif;
  font-size: 14px;
  line-height: 24px;
  margin:auto;
  color: black;
  text-decoration: none;
  padding:5px;
  border-radius: 10px;
  border: inset 1px solid #333;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

form.ingredients {
  width: 100%;
  max-width: 530px;
}

form.login {
  width: 100%;
  max-width: 330px;
}

form.packing {
  width: 100%;
  max-width: 530px;
}

form.sizes {
  width: 100%;
  max-width: 500px;
}

form.cakes {
  width: 100%;
  max-width: 530px;
}

form.bakelist {
  width: 100%;
  max-width: 750px;
}

form.report {
  width: 100%;
  max-width: 400px;
}

form.recipes {
  width: 100%;
  max-width: 530px;
}

form.customers {
  width: 100%;
  max-width: 530px;
}

table {
  border-collapse: collapse;
  width: auto;
  font-size: 14px;
  left: 100px;
  margin: auto;
}

table.front-pg {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  margin: auto;
}

table.custlist {
  border-collapse: collapse;
  width: 75%;
  font-size: 14px;
  margin: auto;
}

th {
  padding: 0 0.5em;
  text-align: left;
}

td {
  border-bottom: 1px solid #CCC;
  padding: 0 0.5em;
}

td.fillcellregular {
    background-color: #ff98e6
}

td.fillcellreturner {
    background-color: #8dfffd
}

td.fillcellcouple {
    background-color: #b3ff96
}

tr.yellow th {
  border-top: 1px solid olive;
  border-bottom: 1px solid olive;
  background: #FFC;
}

#ingredientsList .search {
  display: block;
  margin: 0 auto 10px auto;
  padding: 6px 10px;
  width: 100%;
  max-width: 300px; /* or match your Ingredient column width */
  box-sizing: border-box;
}

.delete-btn {
  background: none;
  border: none;
  color: #c00;
  font-size: 20px;
  cursor: pointer;
}

.delete-btn:hover {
  color: #900;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0;
}

/* Remove default list styles */
.pagination li {
  list-style: none;
}

/* Style the pagination buttons */
.pagination li a {
  display: block;
  padding: 0.4em 0.8em;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f9f9f9;
  color: #333;
  text-decoration: none;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

/* Hover effect */
.pagination li a:hover {
  background-color: #e6e6e6;
}

/* Active (current) page */
.pagination li.active a {
  font-weight: bold;
  background-color: #d0d0d0;
  border-color: #999;
}

/* Index page: allow full-width layout */
.index-page .lists{
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 16px 16px 16px;
  box-sizing: border-box;
}

/* Index toolbar + filters */
.index-toolbar{
  margin: 10px 0 16px 0;
}

.index-filters{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;

  /* cancel your global form styling for this tiny inline form */
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.index-filters label{
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
}

.index-filters select{
  padding: 4px 6px;
}

.index-clear{
  font-size: 13px;
  text-decoration: none;
  padding: 6px 10px;
}

/* Table wrapper (helps when you want it full-width + keeps mobile scroll happy) */
.table-wrap{
  width: 100%;
  overflow-x: auto;
}

/* Notes tooltip (desktop only) */
.note-tip{
  position: relative;
  cursor: help;
}

@media (hover: hover) and (pointer: fine) {
  .note-tip:hover::after{
    content: attr(data-note);
    position: absolute;
    left: 0;
    top: 120%;
    min-width: 240px;
    max-width: 420px;
    white-space: normal;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    z-index: 9999;
  }
}
.status-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}

/* Optional: make the placeholder dash look intentional */
.status-icon.unpaid{
  font-weight: 700;
  opacity: 0.55;
}
.index-summary{
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin: 10px 0 16px 0;
}

.sumcard{
  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.sumlabel{
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 6px;
}

.sumvalue{
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.sumsub{
  font-size: 12px;
  font-weight: 600;
  opacity: 0.6;
  margin-left: 6px;
}

/* Responsive */
@media (max-width: 900px){
  .index-summary{
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}
/* Sticky header (beneath your fixed nav) */
/* Index sticky header */
.index-page { --sticky-top: 0px; } /* you found this is correct for your layout */

.index-page .table-wrap{
  position: relative;   /* create a sane stacking context */
  z-index: 0;
}

.index-page table.front-pg{
  border-collapse: separate; /* safer for sticky headers */
  border-spacing: 0;
}

.index-page .front-pg thead{
  position: sticky;     /* Safari likes thead sticky as well */
  top: var(--sticky-top);
  z-index: 50;
}

.index-page .front-pg thead th{
  position: sticky;
  top: var(--sticky-top);
  z-index: 60;          /* above tbody */
  background: #ffe9a8;  /* MUST be opaque */
  background-clip: padding-box;
  box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}



.table-wrap{
  width: 100%;
  overflow-x: auto;
}

.front-pg thead th{
  position: sticky;
  top: var(--sticky-top);
  z-index: 5;
  background: #ffe9a8; /* match your yellow header vibe */
}

/* Row grouping: clearer “blocks” per order */
.front-pg tr.order-start td{
  border-top: 3px solid rgba(0,0,0,0.15);
}

.front-pg tr.order-cont td{
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* Due highlighting (applies to whole order group) */
.front-pg tr.due-today td{
  background: rgba(255, 221, 120, 0.25);
}

.front-pg tr.overdue td{
  background: rgba(255, 160, 160, 0.22);
}

/* Clickable status buttons */
.status-btn{
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.status-btn:disabled{
  opacity: 0.5;
  cursor: default;
}

.status-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}

/* tiny “saved” pulse */
.status-saved .status-icon{
  transform: scale(1.08);
}
.index-print{
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================
   CUSTOMER PAGE - SPLIT VIEW
   ========================================================== */
   
   .customer-top {
     display: grid;
     grid-template-columns: 1fr;
     gap: 16px;
     max-width: 1200px;
     margin: 0 auto;
     padding: 16px;
     padding-top: 80px;
   }

   /* When editing (we show orders), use 2 columns */
   .customer-top.has-orders {
     grid-template-columns: 1.1fr 0.9fr;
     align-items: start;
   }

   .panel {
     background: rgba(255,255,255,0.55);
     border: 1px solid rgba(0,0,0,0.08);
     border-radius: 14px;
     box-shadow: 0 6px 18px rgba(0,0,0,0.06);
     padding: 14px;
   }

   .panel h2 {
     margin: 0 0 10px 0;
     font-size: 18px;
   }

   .orders-header {
     display: flex;
     justify-content: space-between;
     align-items: baseline;
     gap: 10px;
     margin-bottom: 10px;
   }

   .orders-meta {
     font-size: 13px;
     opacity: 0.85;
     display: flex;
     gap: 12px;
     flex-wrap: wrap;
   }

   .orders-filters {
     display: flex;
     gap: 8px;
     flex-wrap: wrap;
     margin: 10px 0 12px 0;
   }

   .chip {
     border: 1px solid rgba(0,0,0,0.14);
     background: rgba(255,255,255,0.65);
     border-radius: 999px;
     padding: 6px 10px;
     font-size: 13px;
     cursor: pointer;
     user-select: none;
   }
   .chip.active {
     border-color: rgba(0,0,0,0.28);
     background: rgba(255,255,255,0.9);
     font-weight: 600;
   }

   .orders-table {
     width: 100%;
     border-collapse: collapse;
     font-size: 13px;
   }
   .orders-table th, .orders-table td {
     padding: 8px 6px;
     border-bottom: 1px solid rgba(0,0,0,0.08);
     vertical-align: top;
   }
   .orders-table th {
     text-align: left;
     font-size: 12px;
     opacity: 0.8;
   }
   .orders-table a {
     text-decoration: none;
   }
   .orders-empty, .orders-loading, .orders-error {
     font-size: 13px;
     opacity: 0.85;
     padding: 10px 0;
   }

   /* Keep your existing layout blocks but give breathing room */
   .forms, .lists { max-width: 1200px; margin: 0 auto; }
   .lists { padding: 0 16px 16px 16px; }
  

/* ==========================================================
   ORDER PAGE – ORDER + ITEMS SPLIT VIEW
   ========================================================== */

.order-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  padding-top: 80px;
}

.order-top.has-items {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
}

/* ---- Orders split view: make grid items behave and contain floats ---- */
.order-top.has-items > .panel {
  min-width: 0;                 /* important in CSS grid */
}

/* Contain floats inside the left panel so the panel has a proper height */
.order-top.has-items > .panel::after {
  content: "";
  display: block;
  clear: both;
}

/* Ensure the right panel sits in column 2 explicitly */
#orderItemsPanel {
  grid-column: 2;
}

/* OPTIONAL: keep the form from demanding a fixed width that fights the grid */
.order-top.has-items form.recipes {
  width: 100%;
  max-width: 100%;
}

/* Make each <p> in forms contain its floated children */
form p::after {
  content: "";
  display: block;
  clear: both;
}

/* Calendar button - do NOT float (floats will jump to earlier rows) */
.cal-btn {
  float: none !important;
  display: inline-block;
  margin-left: 10px;
  padding: 6px 10px;
  height: auto;
  line-height: normal;
  text-decoration: none;
  vertical-align: middle;
}

.cal-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* --- Required For row: force proper alignment (no float madness) --- */
.legacy-form p.req-row {
  display: flex;
  align-items: center;
  gap: 10px;
  clear: both;
}

/* kill legacy floats for this row only */
.req-row label {
  float: none;
  clear: none;
  width: 120px; /* match your global label width */
}

.req-row-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.req-row .notbutton {
  float: none;
}

.req-row .cal-btn {
  float: none;
  display: inline-block;
  padding: 6px 10px;
  height: auto;        /* override .btnstyle height */
  line-height: normal;
  text-decoration: none;
}

form p {
  margin: 2px 0;   /* adjust to taste: try 4px or 6px */
}

/* ==========================================================
   MOBILE RESPONSIVE OVERRIDES
   ========================================================== */
@media (max-width: 768px) {

  /* Nav: allow wrapping + better touch targets */
  .main-menu {
    flex-wrap: wrap;
  }
  .menu-item > a,
  .user-greeting {
    padding: 12px 14px;
  }

  /* Split panels: collapse to 1 column */
  .customer-top.has-orders,
  .order-top.has-items {
    grid-template-columns: 1fr;
  }

  /* Forms: stack label above input on mobile */
  .legacy-form p {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  label,
  label.points,
  label.radio {
    flex: none;
    float: none;
    clear: none;
    width: auto;
    padding-top: 0;
    display: block;
    margin: 10px 0 4px 0;
    text-align: left;
  }

  .notbutton {
    float: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  select.notbutton,
  input.notbutton,
  textarea.notbutton {
    max-width: 100%;
  }

  /* Make fixed-width forms fluid on mobile */
  form.ingredients,
  form.packing,
  form.sizes,
  form.cakes,
  form.bakelist,
  form.report,
  form.recipes,
  form.customers,
  form.login {
    width: 100%;
    max-width: 100%;
  }

  /* Lists / tables: prevent squish (allow horizontal scroll) */
  .lists table,
  #ingredientsList table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Give space for fixed footer */
  .lists {
    padding-bottom: 70px;
  }
}

/* ==========================================================
   MOBILE NAV TOGGLE (HAMBURGER)
   ========================================================== */

.nav-toggle {
  display: none; /* desktop default */
  background: var(--brand-brown);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px;
  cursor: pointer;
  font-weight: bold;
}

/* Mobile */
@media (max-width: 768px) {
  .nav-toggle { display: inline-block; }

  /* menu hidden until toggled */
  .main-menu {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  nav.site-navigation.nav-open .main-menu {
    display: flex;
  }

  .menu-item > a {
    width: 100%;
    padding: 12px 14px;
  }

  /* dropdowns should not be absolute on mobile */
  .dropdown {
    position: static;
    box-shadow: none;
    min-width: 0;
  }

  /* default closed; JS adds .open on the li */
  .menu-item > .dropdown { display: none; }
  .menu-item.open > .dropdown { display: block; }

  /* user greeting spacing */
  .user-greeting {
    margin-left: 0;
    padding: 10px 14px;
  }
}

/* Index page "front-pg" table: allow horizontal swipe on mobile */
@media (max-width: 768px) {
  table.front-pg {
    display: block;                 /* required for overflow to work */
    overflow-x: auto;               /* enables horizontal scrolling */
    max-width: 100%;
    white-space: nowrap;            /* keep columns from wrapping */
    -webkit-overflow-scrolling: touch; /* smooth iOS scrolling */
  }
}

