:root {
  --brand-blue: #00adf1;
  --brand-yellow: #fabc55;
  --brand-red: #d55a5f;
  --brand-black: #21201e;
  --brand-ink: #25282e;
  font-family:
    system-ui,
    -apple-system,
    Arial,
    sans-serif;
  color: #25282e;
  background: #f5f7fa;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  background: #21201e;
  color: white;
  padding: 22px max(18px, calc((100vw - 1100px) / 2));
}
header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.06em;
}
header p {
  margin: 4px 0 0;
  color: #ced3da;
}
.wrap {
  max-width: 1100px;
  margin: auto;
  padding: 18px;
}
.tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.tabs button {
  white-space: nowrap;
  background: #eaf1f7;
  color: #28465d;
}
.tabs button.active {
  background: #00adf1;
  color: white;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
.card {
  background: white;
  border: 1px solid #e0e6ed;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 4px 18px #20242b08;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
h2 {
  font-size: 20px;
  margin: 0 0 14px;
}
h3 {
  font-size: 16px;
  margin: 0 0 12px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin: 8px 0 5px;
}
input,
select,
textarea {
  width: 100%;
  font: inherit;
  border: 1px solid #cbd5df;
  border-radius: 9px;
  padding: 10px;
  background: white;
  color: #25282e;
}
textarea {
  min-height: 74px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #757575;
  opacity: 1;
}
input[data-event="guests"] {
  color: #757575;
  font-weight: 400;
}
input[data-event="guests"]:focus,
input[data-event="guests"]:focus::placeholder {
  color: #25282e;
}
button {
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  background: #00adf1;
  color: white;
}
button.secondary {
  background: #eaf4fb;
  color: #245471;
}
button.danger {
  background: #fcebed;
  color: #a5373f;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.muted {
  color: #66717e;
  font-size: 13px;
  line-height: 1.5;
}
.hint {
  background: #fff6e4;
  border-left: 3px solid #fabc55;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.item {
  padding: 13px 0;
  border-bottom: 1px solid #e5eaf0;
}
.item:last-child {
  border-bottom: 0;
}
.itemhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.itemhead strong {
  font-size: 16px;
}
.small {
  font-size: 12px;
}
.stat {
  padding: 15px;
  background: #edf6fc;
  border-radius: 12px;
}
.stat strong {
  display: block;
  font-size: 22px;
}
.stat span {
  font-size: 12px;
  color: #596d7d;
}
.dark {
  background: #21201e;
  color: white;
}
.dark span {
  color: #d5e9f6;
}
.docline {
  display: grid;
  grid-template-columns: 2fr 0.65fr 0.75fr 0.85fr auto;
  gap: 7px;
  align-items: end;
  margin: 10px 0;
}
.docline button {
  margin-bottom: 1px;
}
.docline label {
  margin-top: 0;
}
.docsum {
  margin-left: auto;
  max-width: 370px;
}
.docsum .row {
  border-bottom: 1px solid #e5eaf0;
  padding: 9px 0;
}
.docsum .grand {
  font-size: 22px;
  font-weight: 750;
}
.pill {
  background: #fff0cd;
  color: #77501c;
  border-radius: 30px;
  padding: 3px 9px;
  font-size: 12px;
}
.printonly {
  display: none;
}
a {
  color: #066c9b;
}
.savedentry {
  padding: 12px;
  border: 1px solid #e0e6ed;
  border-radius: 10px;
  margin-bottom: 9px;
}
@media (max-width: 700px) {
  .grid,
  .grid3 {
    grid-template-columns: 1fr;
  }
  .docline {
    grid-template-columns: 1fr 1fr;
  }
  .docline > div:first-child {
    grid-column: 1/-1;
  }
  .wrap {
    padding: 12px;
  }
  .card {
    padding: 15px;
  }
}
@media print {
  header,
  .tabs,
  .panel,
  .noprint {
    display: none !important;
  }
  body {
    background: white;
  }
  .wrap {
    padding: 0;
  }
  .printonly {
    display: block;
  }
  .printpage {
    padding: 28px;
    font-size: 12px;
    color: #25282e;
  }
  .printpage h1 {
    font-size: 28px;
  }
  .printpage table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
  }
  .printpage th,
  .printpage td {
    padding: 9px;
    border-bottom: 1px solid #ddd;
    text-align: left;
  }
  .printpage .totals {
    text-align: right;
    font-size: 16px;
    margin-top: 15px;
  }
  .printpage .notes {
    white-space: pre-wrap;
    margin-top: 22px;
  }
}

/* Profesionalna A4 ponudba / račun */
.printpage {
  font-family: Arial, sans-serif;
  color: #25282e;
  background: #fff;
  padding: 42px 48px;
  max-width: 794px;
  margin: auto;
  line-height: 1.5;
}
.printpage .brandbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid #12618a;
  padding-bottom: 22px;
  margin-bottom: 32px;
  gap: 20px;
}
.printpage .logomark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.printpage .monogram {
  background: #12618a;
  color: #fff;
  border-radius: 12px;
  padding: 12px 11px;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -2px;
}
.printpage .brandname {
  font-size: 25px;
  letter-spacing: 2px;
  font-weight: 900;
  line-height: 1.1;
}
.printpage .brandtag {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #a07839;
  margin-top: 7px;
}
.printpage .docname {
  text-align: right;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #12618a;
}
.printpage .docnum {
  text-align: right;
  font-size: 12px;
  color: #66717e;
  margin-top: 5px;
}
.printpage .parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin-bottom: 27px;
}
.printpage .eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 800;
  color: #a07839;
  margin-bottom: 8px;
}
.printpage .party {
  font-size: 12px;
  white-space: pre-line;
}
.printpage .party strong {
  font-size: 13px;
}
.printpage .meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  background: #f3f6fa;
  padding: 14px 17px;
  border-radius: 8px;
  margin: 20px 0 27px;
}
.printpage .meta b {
  display: block;
  font-size: 12px;
}
.printpage .subject {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 14px;
}
.printpage table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 12px;
}
.printpage th {
  background: #12618a;
  color: white;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 9px;
  text-align: left;
}
.printpage td {
  padding: 13px 9px;
  border-bottom: 1px solid #e5eaf0;
  vertical-align: top;
}
.printpage td:nth-child(n + 2),
.printpage th:nth-child(n + 2) {
  text-align: right;
}
.printpage tr:nth-child(even) td {
  background: #fafbfd;
}
.printpage .totalbox {
  margin-left: auto;
  width: 270px;
  border-top: 2px solid #12618a;
  padding-top: 12px;
}
.printpage .totalrow {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
}
.printpage .totalrow.final {
  font-size: 19px;
  font-weight: 900;
  color: #12618a;
  border-top: 1px solid #cbd5df;
  margin-top: 7px;
  padding-top: 13px;
}
.printpage .docnotes {
  white-space: pre-line;
  font-size: 11px;
  color: #66717e;
  margin-top: 35px;
}
.printpage .docfooter {
  margin-top: 42px;
  padding-top: 13px;
  border-top: 1px solid #dce3eb;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #6b7682;
  font-size: 10px;
}
@media print {
  @page {
    size: A4;
    margin: 12mm;
  }
  body {
    background: white;
  }
  .printpage {
    padding: 0;
    max-width: none;
  }
  .printpage .brandbar,
  .printpage .meta,
  .printpage .totalbox,
  .printpage .docfooter {
    break-inside: avoid;
  }
  .printpage th {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .printpage .monogram,
  .printpage .meta {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
.printpage .eventinfo {
  border-left: 3px solid #d55a5f;
  background: #fff7ed;
  padding: 10px 14px;
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.65;
}
.printpage .eventinfo strong {
  display: block;
  margin-bottom: 3px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}
.app-brand img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 10px;
  background: #21201e;
}
.app-phones {
  font-size: 13px;
  color: #fabc55 !important;
  margin-top: 9px !important;
}
.printpage .brandbar {
  border-bottom-color: #d55a5f;
  align-items: center;
}
.printpage .logomark {
  display: flex;
  align-items: center;
  gap: 14px;
}
.printpage .print-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  background: #21201e;
  border-radius: 4px;
}
.printpage .print-brand-contact {
  font-size: 12px;
  line-height: 1.9;
  color: #343434;
  white-space: nowrap;
}
.printpage .docname {
  color: #b0494c;
}
.printpage th {
  background: #21201e;
}
.printpage .totalbox {
  border-top-color: #d55a5f;
}
.printpage .totalrow.final {
  color: #b0494c;
}
.printpage .eyebrow {
  color: #b0494c;
}
@media (max-width: 600px) {
  .app-brand img {
    width: 64px;
    height: 64px;
  }
  .app-brand {
    gap: 10px;
  }
  .app-brand h1 {
    font-size: 22px;
  }
  .app-phones {
    line-height: 1.5;
  }
}
@media print {
  .printpage .print-logo {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .printpage .brandbar {
    break-inside: avoid;
  }
}
.printpage .maplink {
  margin-top: 8px;
  font-weight: 700;
}
.printpage .maplink a {
  color: #a5373f;
  text-decoration: underline;
}
@media print {
  .printpage .maplink a {
    color: #a5373f;
  }
}

/* Preserve the existing layout while allowing long customer and event data. */
[hidden] {
  display: none !important;
}
input[aria-invalid="true"] {
  border: 2px solid #b0494c;
  background: #fff0f1;
}
.grid > div,
.grid3 > div,
.row > div,
.itemhead > strong {
  min-width: 0;
}
.itemhead strong,
.savedentry,
.printpage {
  overflow-wrap: anywhere;
}
#backupList {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
}
@media (max-width: 700px) {
  .savedentry > .row {
    align-items: flex-start;
    flex-direction: column;
  }
  .itemhead {
    flex-wrap: wrap;
  }
  .docline button {
    justify-self: start;
  }
  .stat strong {
    font-size: 20px;
  }
}
@media print {
  #storageStatus {
    display: none !important;
  }
  .printpage table {
    table-layout: fixed;
  }
  .printpage th:first-child {
    width: 42%;
  }
  .printpage thead {
    display: table-header-group;
  }
  .printpage tr,
  .printpage .parties,
  .printpage .eventinfo {
    break-inside: avoid;
  }
  .printpage td,
  .printpage th {
    overflow-wrap: anywhere;
  }
  .printpage .docnotes {
    orphans: 3;
    widows: 3;
  }
  .printpage .docname {
    font-size: 25px;
  }
}

.cost-stats {
  margin-top: 16px;
}
.map-toggle {
  display: flex;
  gap: 9px;
  align-items: center;
}
.map-toggle input {
  width: auto;
}

/* Keep each menu dish on its own line in the printed service description. */
.printpage tbody td:first-child {
  white-space: pre-line;
}

.offer-information {
  margin-top: 16px;
}
.offer-info-section {
  margin-top: 16px;
}
.offer-info-section h3 {
  margin-bottom: 6px;
}
.offer-info-section ul {
  padding-left: 18px;
  margin: 6px 0;
}
.offer-info-section li {
  margin: 4px 0;
}
.printpage .offer-info-section {
  break-inside: avoid;
  font-size: 11px;
}
.printpage .offer-info-section h3 {
  font-size: 12px;
  color: #b0494c;
}
.printpage .offer-info-section p {
  margin: 6px 0;
  color: #66717e;
}

.recipe-tools {
  margin: 12px 0;
}
[data-recipe-panel] {
  background: #f1f7fc;
  border: 1px solid #dce6ef;
  border-radius: 10px;
  padding: 14px;
  margin: 10px 0;
}
[data-recipe-preview] {
  margin-top: 14px;
}
.recipe-originals {
  padding-left: 22px;
  line-height: 1.6;
  max-height: 240px;
  overflow: auto;
}
.ingredient-row {
  display: grid;
  grid-template-columns: 2fr 1fr 0.7fr 1fr;
  gap: 10px;
  border-bottom: 1px solid #e0e6ed;
  padding: 12px 0;
}
.ingredient-row > div {
  min-width: 0;
}
.ingredient-total {
  font-weight: 700;
  color: #12618a;
  margin: 10px 0;
}
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.table-wrap table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
}
.table-wrap th,
.table-wrap td {
  border: 1px solid #cbd5df;
  padding: 9px;
  text-align: left;
  vertical-align: top;
}
.table-wrap th {
  background: #edf6fc;
}
.ingredient-warning {
  color: #a5373f;
  font-size: 12px;
  line-height: 1.4;
}
@media (max-width: 700px) {
  .ingredient-row {
    grid-template-columns: 1fr 1fr;
  }
  .ingredient-row > div:first-child {
    grid-column: 1/-1;
  }
}

[data-field="vatRate"][readonly],
[data-field="vatNote"][readonly] {
  background: #f3f6fa;
}

.cost-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .cost-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .cost-stats {
    grid-template-columns: 1fr;
  }
}

.purchase-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .purchase-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .purchase-fields {
    grid-template-columns: 1fr;
  }
}

.time-menus { display: flex; gap: 8px; }
.time-menus select { min-width: 0; }
.event-date-field { position: relative; align-self: start; }
#eventDateButton { width: 100%; text-align: left; background: white; border: 1px solid #cbd5df; color: #25282e; font-weight: 400; }
#eventCalendar { position: absolute; top: 100%; left: 0; z-index: 20; width: 310px; max-width: calc(100vw - 64px); padding: 16px; margin-top: 6px; background: #fff; border: 1px solid #e0e6ed; border-radius: 18px; box-shadow: 0 16px 40px #20242b24; }
#eventCalendar .actions { display: flex; justify-content: space-between; align-items: center; margin: 0 0 14px; gap: 8px; flex-wrap: nowrap; }
#calendarMonth { font-weight: 650; text-transform: capitalize; font-size: 15px; }
#calendarPrevious, #calendarNext { background: #edf6fc; color: #245471; padding: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 24px; }
.calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.calendar-days > span { color: #72808c; font-size: 12px; padding: 6px 0; }
.calendar-days button { padding: 0; aspect-ratio: 1; background: transparent; color: #334454; font-size: 14px; font-weight: 400; border-radius: 50%; }
.calendar-days button:hover { background: #e8f6fd; }
.calendar-days button[aria-current="date"] { box-shadow: inset 0 0 0 1px #00adf1; font-weight: 650; }
.calendar-days button[aria-pressed="true"] { background: #00adf1; color: white; font-weight: 650; }
#eventCalendar button:focus-visible { outline: 2px solid #00adf1; outline-offset: 2px; }
.calendar-footer { display: flex; justify-content: space-between; border-top: 1px solid #e8edf3; margin-top: 12px; padding-top: 10px; }
.calendar-footer button { background: transparent; color: #12618a; font-size: 13px; padding: 6px 10px; }

/* Colors sampled from the original ŽAN & SINE logo. */
header {
  background: var(--brand-black);
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--brand-blue) 0% 34%, var(--brand-yellow) 34% 68%, var(--brand-red) 68%) 1;
}
.app-brand img {
  width: 112px;
  height: 112px;
  border-radius: 0;
  background: transparent;
  mix-blend-mode: lighten;
}
header h1 { color: #fff8e8; }
header .app-phones { color: #fabc55 !important; }
header .app-phones strong { color: #f6eee0; }
button { color: var(--brand-black); }
button:hover:not(:disabled) { filter: brightness(0.96); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 3px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-blue); }
input[type="checkbox"] { accent-color: #0879ad; }
.tabs { padding: 4px 0 6px; gap: 8px; }
.tabs button { background: white; color: #536170; border: 1px solid #dce3eb; }
.tabs button.active { background: var(--brand-blue); border-color: var(--brand-blue); color: var(--brand-black); }
.tabs button[data-tab="offer"].active { background: var(--brand-yellow); border-color: var(--brand-yellow); }
.tabs button[data-tab="invoice"].active { background: var(--brand-red); border-color: var(--brand-red); color: var(--brand-black); }
#saveOrder, #save, [data-save-dish] { background: var(--brand-yellow); color: var(--brand-black); }
button.danger { background: #fcebed; color: #a5373f; }
.card h2 { color: #234b64; }
.stat { border-top: 3px solid var(--brand-blue); }
.stat.dark { background: var(--brand-black); border-top-color: var(--brand-yellow); color: #fff8e8; }
.stat.dark span { color: #fabc55; }
.calendar-days button[aria-pressed="true"] { background: var(--brand-blue); color: var(--brand-black); }
.calendar-days button[aria-current="date"] { box-shadow: inset 0 0 0 1px var(--brand-yellow); }
@media (max-width: 600px) {
  .app-brand img { width: 82px; height: 82px; flex-shrink: 0; }
  .app-brand > div { min-width: 0; }
  header p { line-height: 1.5; font-size: 12px; }
}
