:root{
  --ink:#2d2118;
  --muted:#796653;
  --gold:#b98710;
  --gold2:#d6aa3c;
  --paper:#fffdf7;
  --cream:#fbf7ee;
  --line:#e4d2b6;
  --danger:#b42318;
  --shadow:0 22px 60px rgba(59,38,10,.13);
  --radius:28px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:linear-gradient(135deg,#f8f1e6,#fffaf2);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  overflow-x:hidden;
}
button,input,textarea,select{font:inherit}
button{touch-action:manipulation}
.app-shell{
  display:grid;
  grid-template-columns:300px minmax(0,1fr);
  min-height:100vh;
}
.left-panel{
  width:300px;
  padding:20px;
  background:#fffaf1;
  border-right:1px solid var(--line);
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
  z-index:10;
}
.brand-mini{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
  box-shadow:0 10px 35px rgba(0,0,0,.06);
}
.brand-mini img{
  width:82px;
  height:58px;
  object-fit:cover;
  border-radius:12px;
}
.brand-mini strong{display:block;font-weight:900;line-height:1.1}
.brand-mini span{font-size:12px;color:var(--muted)}
.side-card{
  margin-top:16px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  padding:16px;
  box-shadow:0 12px 28px rgba(0,0,0,.05);
}
.gold-card{background:linear-gradient(135deg,#fff6dd,#fff)}
.eyebrow{
  text-transform:uppercase;
  letter-spacing:.16em;
  font-size:12px;
  font-weight:900;
  color:#8a5c03;
  margin:0 0 8px;
}
.steps-list{margin:8px 0 0 18px;padding:0;font-size:14px;line-height:1.9;color:#543f2a}
.side-btn,.big-btn{
  width:100%;
  border:1px solid var(--line);
  background:#fff;
  color:#2b2118;
  border-radius:16px;
  padding:14px 16px;
  margin-top:12px;
  font-weight:900;
  font-size:15px;
  cursor:pointer;
  transition:.2s ease;
}
.side-btn:hover,.big-btn:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(0,0,0,.08)}
.primary{background:linear-gradient(135deg,var(--gold),#d6aa3c);border-color:#b98710;color:#fff}
.danger{border-color:#f0b7ae;color:var(--danger);background:#fff7f5}
.saved-card h3{margin:0 0 10px;font-size:16px}
.saved-list{display:grid;gap:8px}
.saved-item{padding:10px;border:1px solid var(--line);border-radius:12px;background:#fff;cursor:pointer;font-size:12px;line-height:1.45}
.workspace{
  min-width:0;
  width:100%;
  padding:clamp(12px,2vw,24px);
  max-width:1480px;
  margin:0 auto;
}
.control-panel,.invoice-paper{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:clamp(14px,2vw,22px);
  margin-bottom:22px;
  box-shadow:var(--shadow);
}
.section-title{display:flex;gap:14px;align-items:flex-start}
.section-title>span{
  display:grid;
  place-items:center;
  flex:0 0 42px;
  width:42px;
  height:42px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--gold),#d8b44f);
  color:white;
  font-weight:900;
}
.section-title h2{
  font-family:'Playfair Display',serif;
  font-size:clamp(23px,3vw,30px);
  line-height:1.1;
  margin:0;
}
.section-title p{margin:4px 0 0;color:var(--muted);font-weight:600}
.form-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-top:18px;
}
.form-grid label,.entry-grid label{
  font-weight:900;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:#6a4707;
}
.form-grid input,.entry-grid input,.entry-grid textarea,select{
  width:100%;
  min-width:0;
  margin-top:7px;
  border:1px solid #d7bd92;
  border-radius:14px;
  background:#fff;
  padding:13px 14px;
  font-size:16px;
  color:#2d2118;
  outline:none;
}
.form-grid input:focus,.entry-grid input:focus,.entry-grid textarea:focus{
  border-color:var(--gold);
  box-shadow:0 0 0 4px rgba(185,135,16,.13);
}
.wide{grid-column:span 2}
.excel-helper{
  margin:18px 0;
  padding:14px 16px;
  border:1px dashed var(--gold);
  background:#fff8e8;
  border-radius:18px;
  color:#4c350e;
  font-size:15px;
  line-height:1.5;
}
.entry-grid{
  display:grid;
  grid-template-columns:minmax(130px,.8fr) minmax(180px,1.1fr) minmax(260px,2fr) minmax(90px,.6fr) minmax(130px,.8fr) minmax(140px,.8fr);
  gap:12px;
  align-items:end;
}
.entry-grid label span{
  display:block;
  text-transform:none;
  letter-spacing:0;
  font-size:12px;
  color:#92795f;
  margin-top:3px;
  line-height:1.25;
}
.field-particulars textarea{min-height:64px;resize:vertical}
.food-toggle{
  min-height:72px;
  display:flex!important;
  align-items:center;
  gap:10px;
  justify-content:center;
  border:1px solid #d7bd92;
  border-radius:16px;
  background:#fff;
  text-transform:none!important;
  letter-spacing:0!important;
  font-size:14px!important;
  color:#4c350e!important;
  padding:12px;
}
.food-toggle input{width:20px!important;height:20px;margin:0!important;flex:0 0 auto}
.action-row{display:flex;gap:12px;margin:16px 0;flex-wrap:wrap}
.action-row .big-btn{width:auto;min-width:160px;margin:0}
.editable-table-wrap{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
}
.editable-table{width:100%;border-collapse:collapse;min-width:980px}
.editable-table th{
  background:#7b5608;
  color:#fff;
  padding:12px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  text-align:left;
  position:sticky;
  top:0;
  z-index:1;
}
.editable-table td{border-bottom:1px solid #eadcc5;padding:8px;vertical-align:top}
.editable-table td input,.editable-table td textarea{width:100%;border:1px solid #e1c9a7;border-radius:10px;padding:9px;font-size:14px;background:#fff}
.editable-table textarea{resize:vertical;min-height:48px}
.icon-btn{border:none;border-radius:9px;padding:8px 9px;font-weight:900;cursor:pointer}
.delete{background:#fff1ef;color:var(--danger)}
.totals-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.warning{display:none;margin-top:12px;padding:12px 14px;border:1px solid #f0b7ae;background:#fff3f1;color:#8f1d14;border-radius:14px;font-weight:800}
.warning.show{display:block}

/* Invoice header image: responsive for the uploaded Coco & Corks wide logo */
.logo-box{
  width:100%;
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
  margin-bottom:22px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.45);
}
.logo-box img{
  display:block;
  width:100%;
  height:auto;
  max-height:190px;
  object-fit:contain;
  object-position:center;
  background:#fff;
}
.invoice-topline{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  border-bottom:2px solid #2c241c;
  padding-bottom:16px;
}
.invoice-topline h1{
  font-family:'Playfair Display',serif;
  font-size:clamp(28px,4vw,38px);
  line-height:1.1;
  margin:0;
}
.status-pill{border:1px solid var(--gold);border-radius:99px;padding:10px 22px;color:#7c5204;font-weight:900}
.guest-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin:20px 0;
}
.guest-summary div{border-bottom:1px solid #bda98c;padding:8px 0;min-width:0}
.guest-summary span{display:block;font-size:12px;text-transform:uppercase;font-weight:900;color:#6e5941}
.guest-summary strong{display:block;margin-top:6px;min-height:22px;word-break:break-word}
.print-table{
  width:100%;
  border-collapse:collapse;
  margin-top:12px;
  table-layout:fixed;
}
.print-table th,.print-table td{border:1px solid #1f1f1f;padding:8px 9px;vertical-align:top;word-break:break-word}
.print-table th{background:#f1eadf;text-align:left;font-weight:900}
.print-table th:nth-child(1){width:12%}
.print-table th:nth-child(2){width:17%}
.print-table th:nth-child(3){width:35%}
.print-table th:nth-child(4){width:8%}
.print-table th:nth-child(5){width:14%}
.print-table th:nth-child(6){width:14%}
.print-table td:nth-child(4),.print-table td:nth-child(5),.print-table td:nth-child(6){text-align:right}
.summary-box{margin-left:auto;margin-top:16px;width:min(520px,100%);border:1px solid #1f1f1f}
.summary-box div{display:flex;justify-content:space-between;gap:18px;border-bottom:1px solid #1f1f1f;padding:9px 12px}
.summary-box div:last-child{border-bottom:none}
.summary-box .grand{background:#f1eadf;font-size:20px;font-weight:900}
.summary-box em{font-size:12px;color:#755d40}
.invoice-footer{text-align:center;margin-top:46px}
.invoice-footer p{font-style:italic}
.invoice-footer h3{font-family:'Playfair Display',serif;font-size:24px;margin:20px 0 4px}
.invoice-footer h2{font-size:22px;letter-spacing:.12em;margin:0;color:#6f4b03}

/* Large tablet */
@media(max-width:1200px){
  .app-shell{grid-template-columns:260px minmax(0,1fr)}
  .left-panel{width:260px;padding:14px}
  .form-grid,.totals-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .entry-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .field-particulars{grid-column:span 2}
  .wide{grid-column:span 2}
}

/* iPad and small laptop */
@media(max-width:900px){
  .app-shell{display:block}
  .left-panel{
    width:100%;
    height:auto;
    position:relative;
    border-right:none;
    border-bottom:1px solid var(--line);
    display:grid;
    grid-template-columns:1.2fr 1fr 1fr;
    gap:12px;
    align-items:start;
  }
  .left-panel .side-card{margin-top:0}
  .left-panel .side-btn{margin-top:0}
  .saved-card{grid-column:1/-1}
  .workspace{padding:14px}
  .logo-box img{max-height:150px}
  .guest-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Phones */
@media(max-width:640px){
  :root{--radius:20px}
  .left-panel{
    display:block;
    padding:12px;
  }
  .brand-mini img{width:76px;height:54px}
  .side-card{margin-top:12px}
  .side-btn{margin-top:10px}
  .workspace{padding:10px}
  .control-panel,.invoice-paper{padding:12px;border-radius:20px;margin-bottom:14px}
  .section-title{gap:10px}
  .section-title>span{width:34px;height:34px;flex-basis:34px}
  .form-grid,.totals-grid,.entry-grid{grid-template-columns:1fr;gap:12px}
  .field-particulars,.wide{grid-column:auto}
  .action-row{display:grid;grid-template-columns:1fr;gap:10px}
  .action-row .big-btn{width:100%;min-width:0}
  .editable-table{min-width:860px}
  .logo-box{border-radius:12px;margin-bottom:14px}
  .logo-box img{max-height:none;width:100%;height:auto}
  .invoice-topline{display:block}
  .guest-summary{grid-template-columns:1fr;gap:8px;margin:14px 0}
  .print-table{
    font-size:11px;
    table-layout:auto;
  }
  .print-table th,.print-table td{padding:5px 4px}
  .summary-box{font-size:12px}
  .summary-box .grand{font-size:16px}
  .invoice-footer{margin-top:24px}
  .invoice-footer h3{font-size:19px}
  .invoice-footer h2{font-size:16px}
}

/* Very narrow phones: keep invoice readable */
@media(max-width:430px){
  .print-table th:nth-child(1),.print-table td:nth-child(1){display:none}
  .print-table th,.print-table td{font-size:10.5px}
  .print-table th:nth-child(2){width:20%}
  .print-table th:nth-child(3){width:38%}
  .print-table th:nth-child(4){width:8%}
  .print-table th:nth-child(5){width:16%}
  .print-table th:nth-child(6){width:18%}
}

/* Print / PDF: full-page logo, no left/right blank wastage */
@media print{
  @page{size:A4;margin:7mm}
  html,body{width:210mm;background:white!important}
  body{margin:0;color:#000;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .no-print,.left-panel{display:none!important}
  .app-shell,.workspace{
    display:block!important;
    padding:0!important;
    margin:0!important;
    max-width:none!important;
    width:100%!important;
  }
  .invoice-paper{
    box-shadow:none!important;
    border:none!important;
    border-radius:0!important;
    margin:0!important;
    padding:0!important;
    background:white!important;
    width:100%!important;
  }
  .logo-box{
    border:none!important;
    border-radius:0!important;
    margin:0 0 7mm!important;
    width:100%!important;
    overflow:hidden!important;
    background:#fff!important;
  }
  .logo-box img{
    width:100%!important;
    height:auto!important;
    max-height:34mm!important;
    object-fit:contain!important;
    object-position:center!important;
  }
  .invoice-topline{padding-bottom:8px}
  .invoice-topline h1{font-size:25px}
  .eyebrow{font-size:9px}
  .guest-summary{grid-template-columns:repeat(3,1fr);gap:6px;margin:8px 0;font-size:11px}
  .guest-summary div{padding:4px 0}
  .guest-summary span{font-size:9px}
  .guest-summary strong{min-height:14px}
  .print-table{font-size:10px;table-layout:fixed}
  .print-table th,.print-table td{padding:4px 5px}
  .summary-box{margin-top:7px;font-size:11px;width:88mm}
  .summary-box div{padding:4px 7px}
  .summary-box .grand{font-size:14px}
  .invoice-footer{margin-top:14mm;font-size:11px}
  .invoice-footer h3{font-size:17px}
  .invoice-footer h2{font-size:15px}
}
