/* =========================================================
   Menüradar Dashboard
   Mobile First
   Globale Farben/Breiten kommen aus base.css
   ========================================================= */


/* ---------------------------------------------------------
   Grundlayout
   --------------------------------------------------------- */

.wrap {
  width: 100%;
}

.adminview {
  width: 100%;
  max-width: var(--content-max);

  margin: 0 auto;

  padding:
    20px
    var(--page-padding)
    64px;

  min-width: 0;
}

.dashboard-content {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr);

  gap: 22px;

  align-items: start;
}

.dashboard-left {
  display: flex;
  flex-direction: column;

  gap: 18px;

  min-width: 0;
}

.panel {
  min-width: 0;

  padding: 16px;

  background: var(--card);

  border: 1px solid var(--line);
  border-radius: var(--radius);

  box-shadow: var(--shadow);
}

.panel h3 {
  margin-bottom: 4px;

  font-family:
    "Bricolage Grotesque",
    sans-serif;

  font-size: 17px;
  font-weight: 700;
}

.panel .hint {
  margin-bottom: 16px;

  color: var(--muted);

  font-size: 13px;
  line-height: 1.45;
}

.grp {
  margin-bottom: 4px;
}

.grphead {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 9px;
}

.divider {
  margin: 16px 0;

  border-top:
    1px dashed
    var(--line);
}


/* ---------------------------------------------------------
   Sticky Header
   .bar / .logo kommen bereits aus base.css
   --------------------------------------------------------- */

header {
  position: sticky;
  top: 0;

  z-index: 40;

  background:
    rgba(246, 243, 236, 0.86);

  backdrop-filter: blur(10px);

  border-bottom:
    1px solid
    var(--line);
}


/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  border: 0;
  border-radius: 11px;

  font: inherit;
  font-size: 14px;
  font-weight: 600;

  white-space: nowrap;

  cursor: pointer;

  transition: 0.15s;
}

.btn-primary {
  padding: 12px 20px;

  background: var(--green);

  color: #fff;
}

.btn-primary:hover {
  background: var(--green-dark);
}


/* ---------------------------------------------------------
   Dashboard-Kopf
   --------------------------------------------------------- */

.acctbar {
  display: flex;
  flex-direction: column;

  gap: 14px;

  margin-bottom: 22px;
}

.acctbar .eyebrow {
  margin-bottom: 8px;

  color: var(--green);

  font-size: 12px;
  font-weight: 600;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.acctbar h2 {
  font-family:
    "Bricolage Grotesque",
    sans-serif;

  font-size:
    clamp(
      26px,
      6vw,
      36px
    );

  font-weight: 800;

  line-height: 1.08;

  letter-spacing: -0.02em;
}


/* ---------------------------------------------------------
   Formularelemente
   --------------------------------------------------------- */

.inp {
  width: 100%;
  min-width: 0;

  padding: 12px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: #faf8f2;

  color: var(--ink);

  font: inherit;
  font-size: 14px;

  outline: none;
}

.inp:focus {
  border-color: var(--green);

  background: #fff;
}

.inp.err,
.slotrow input.err,
.slotrow select.err {
  border-color:
    #d64545 !important;

  background-color:
    #fff3f3 !important;

  box-shadow:
    0 0 0 2px
    rgba(214, 69, 69, 0.12);
}

.inp.ok,
.slotrow input.ok,
.slotrow select.ok {
  border-color:
    #70ad78 !important;

  background-color:
    #f1faf2 !important;

  box-shadow:
    0 0 0 2px
    rgba(112, 173, 120, 0.10);
}

input:disabled,
textarea:disabled,
select:disabled {
  box-shadow: none !important;
}

.errmsg,
.rowmsg {
  display: none;

  margin-top: 4px;

  color: #c73535;

  font-size: 12px;
  line-height: 1.3;
}

.errmsg.show,
.rowmsg.show {
  display: block;
}


/* ---------------------------------------------------------
   Wochen
   --------------------------------------------------------- */

.editweeks {
  display: grid;

  gap: 18px;
}

.editweek {
  min-width: 0;
}

.editweek-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 7px;
}

.editweek-label {
  min-width: 0;

  color: var(--muted);

  font-size: 12px;
  font-weight: 700;
}

.week-pdf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: none;

  gap: 5px;

  min-height: 32px;

  padding: 6px 9px;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: #fff;

  color: var(--green);

  font-size: 11px;
  font-weight: 700;

  text-decoration: none;
}

.week-pdf-button:hover {
  border-color: var(--green);

  background: var(--green-soft);
}


/* ---------------------------------------------------------
   Tagesbuttons
   --------------------------------------------------------- */

.editdays {
  display: grid;

  grid-template-columns:
    repeat(
      7,
      minmax(0, 1fr)
    );

  gap: 4px;
}

.eday {
  position: relative;

  min-width: 0;
  min-height: 58px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  padding: 6px 2px;

  border: 1px solid var(--line);
  border-radius: 9px;

  background: #faf8f2;

  color: var(--ink);

  font: inherit;

  text-align: center;

  cursor: pointer;

  transition: 0.15s;
}

.eday .wd {
  max-width: 100%;

  font-size: 10px;
  font-weight: 700;

  line-height: 1.15;

  white-space: nowrap;
}

.eday .dt {
  max-width: 100%;

  margin-top: 2px;

  color: var(--muted);

  font-family:
    "Space Mono",
    monospace;

  font-size: 8.5px;
  line-height: 1.15;

  white-space: nowrap;
}

.closed-label {
  max-width: 100%;

  margin-top: 2px;

  color: #9b3a3a;

  font-size: 6.5px;
  font-weight: 700;

  line-height: 1;

  white-space: nowrap;
}

.eday.on {
  background: var(--green);

  border-color: var(--green);

  color: #fff;
}

.eday.on .dt {
  color:
    rgba(
      255,
      255,
      255,
      0.76
    );
}

.eday.filled::after {
  content: "";

  position: absolute;

  top: 4px;
  right: 4px;

  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: var(--amber);
}

.eday.on.filled::after {
  background: #fff;
}

.eday.past {
  opacity: 0.32;

  cursor: default;
}

.eday.closed {
  opacity: 0.55;

  cursor: default;
}


/* ---------------------------------------------------------
   Tagesmenü-Kopf
   --------------------------------------------------------- */

.menu-day-head {
  margin-bottom: 18px;
}

.menu-day-head h3 {
  margin: 0;
}

.menu-day-head .hint {
  margin-top: 4px;
  margin-bottom: 0;
}


/* ---------------------------------------------------------
   Gruppen +/-
   --------------------------------------------------------- */

.pm {
  display: flex;
  align-items: center;

  gap: 6px;
}

.pmbtn {
  width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  border:
    1px solid
    var(--line);

  border-radius: 8px;

  background: #faf8f2;

  color: var(--ink);

  font: inherit;
  font-size: 16px;
  font-weight: 700;

  line-height: 1;

  cursor: pointer;

  transition: 0.14s;
}

.pmbtn:hover:not(:disabled) {
  border-color: var(--green);

  color: var(--green);
}

.pmbtn:disabled {
  opacity: 0.35;

  cursor: not-allowed;
}

.pmcnt {
  min-width: 16px;

  color: var(--muted);

  font-family:
    "Space Mono",
    monospace;

  font-size: 12px;
  font-weight: 700;

  text-align: center;
}

.slotlbl {
  color: var(--muted);

  font-size: 11px;
  font-weight: 700;

  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.slotlbl.s {
  color: #c08a2e;
}

.slotlbl.d {
  color: #9e6ba8;
}


/* ---------------------------------------------------------
   Menüzeile
   Mobile:
   1. Gericht
      Typ
      Preis
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   Menüzeile
   Mobile:
   1. Gericht
      Typ | Preis | X

   Desktop:
   1. Gericht | Typ | Preis | X
   --------------------------------------------------------- */

.slotitem {
  margin-bottom: 14px;
}

.slotrow {
  display: grid;

  grid-template-columns:
    22px
    minmax(0, 1fr)
    minmax(100px, 0.9fr)
    82px
    34px;

  gap: 8px;

  align-items: center;

  margin-bottom: 4px;
}

.rowidx {
  grid-column: 1;
  grid-row: 1 / span 2;

  align-self: start;

  padding-top: 11px;

  min-width: 0;

  color: var(--faint);

  font-family:
    "Space Mono",
    monospace;

  font-size: 11px;
  font-weight: 700;

  text-align: right;
}

/* Gericht */
.slotrow > .inp:not(.price) {
  grid-column: 2 / -1;
  grid-row: 1;

  width: 100%;
  min-width: 0;
}

/* Menütyp */
.slotrow .dietsel {
  grid-column: 2 / 4;
  grid-row: 2;

  width: 100%;
  min-width: 0;

  padding: 10px 8px;

  border: 1px solid var(--line);
  border-radius: 9px;

  background: #faf8f2;
  color: var(--muted);

  font: inherit;
  font-size: 12px;
  font-weight: 600;

  cursor: pointer;
}

/* Preis */
.slotrow .inp.price {
  grid-column: 4;
  grid-row: 2;

  width: 68px;
  min-width: 68px;

  padding-left: 8px;
  padding-right: 8px;

  font-family: "Space Mono", monospace;
  font-weight: 700;

  text-align: right;
}

/* Löschen */
.rowdel {
  grid-column: 5;
  grid-row: 2;

  width: 34px;
  height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  justify-self: end;

  padding: 0;

  border: 1px solid rgba(176, 85, 59, 0.18);
  border-radius: 8px;

  background: rgba(176, 85, 59, 0.08);

  color: #b0553b;

  font-size: 16px;
  font-weight: 700;

  line-height: 1;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.rowdel:hover {
  background: rgba(176, 85, 59, 0.14);

  border-color: rgba(176, 85, 59, 0.28);

  color: #963f2a;
}


/* ---------------------------------------------------------
   Beschreibung
   --------------------------------------------------------- */

.desc-toggle {
  margin-left: 30px;
  margin-top: 3px;

  padding: 0;

  border: 0;

  background: transparent;

  color: var(--muted);

  font: inherit;
  font-size: 12px;
  font-weight: 600;

  cursor: pointer;
}

.desc-toggle:hover {
  color: var(--green);
}

.desc-wrap {
  position: relative;

  width:
    calc(
      100% - 30px
    );

  margin-left: 30px;
  margin-top: 7px;
}

.desc-input {
  width: 100%;
  min-height: 64px;

  padding-right: 38px;

  resize: vertical;

  font-size: 13px;
  line-height: 1.4;
}

.desc-delete {
  position: absolute;

  top: 8px;
  right: 8px;

  width: 24px;
  height: 24px;

  padding: 0;

  border: 0;
  border-radius: 6px;

  background: transparent;

  color: var(--muted);

  cursor: pointer;
}

.desc-delete:hover {
  background:
    rgba(
      0,
      0,
      0,
      0.05
    );

  color: #b0553b;
}

/* ---------------------------------------------------------
   Savebars
   --------------------------------------------------------- */

.savebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;

  gap: 8px;

  margin-top: 18px;

  padding: 12px 14px;

  border:
    1px solid
    #cbddd1;

  border-radius: 12px;

  background:
    var(--green-soft);
}

.savebar .btn-primary {
  width: 100%;

  justify-content: center;
}

.savebar::after {
  color: var(--muted);

  font-size: 12px;
  line-height: 1.4;

  text-align: left;
}

.savebar.menusave::after {
  content:
    "Speichert Suppen, Menüs und Desserts.";
}

.savebar.daysave::after {
  content:
    "Speichert Suppen, Menüs, Desserts und Angebote dieses Tages.";
}


/* ---------------------------------------------------------
   Kombi-Angebote
   Mobile: alles untereinander
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   Kombi-Angebote
   Mobile First
   --------------------------------------------------------- */

.combo {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    34px;

  gap: 10px;

  width: 100%;
  max-width: 100%;
  min-width: 0;

  margin-bottom: 10px;
  padding: 10px;

  overflow: hidden;

  background: #faf8f2;

  border: 1px solid var(--line);
  border-radius: 11px;
}

/* Alle direkten Eingabeelemente volle Breite */
.combo > select,
.combo .pricewrap,
.combo .csavebox {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Selects */
.combo select {
  display: block;

  width: 100%;
  min-width: 0;

  padding: 10px 34px 10px 10px;

  border: 1px solid var(--line);
  border-radius: 9px;

  background: #fff;

  color: var(--ink);

  font: inherit;
  font-size: 13px;
  font-weight: 600;

  line-height: 1.3;

  cursor: pointer;
}

/* verhindert Überlappen / Herauslaufen */
.combo select option {
  font-size: 13px;
}

/* Preis */
.combo .pricewrap {
  display: flex;
  align-items: center;

  gap: 6px;
}

.combo .pricewrap .pfx {
  flex: none;

  width: auto;

  color: var(--muted);

  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 700;
}

.combo .inp.price {
  flex: 1 1 auto;

  width: 0;
  min-width: 0;
  max-width: 100%;

  margin: 0;

  box-sizing: border-box;

  background: #fff;
  color: var(--ink);

  border: 1px solid var(--line);

  text-align: right;
}

/* Kombipreis */
.combo .csavebox {
  display: block;

  min-width: 0;

  overflow: visible;
}

.combo .save {
  display: block;

  width: 100%;

  color: var(--green);

  font-family: "Space Mono", monospace;
  font-size: 11.5px;
  font-weight: 700;

  line-height: 1.35;

  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

.combo .save.neg {
  color: #b0553b;
}

/* Löschen */
.combo .del {
  justify-self: end;

  width: 34px;
  height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(176, 85, 59, 0.18);
  border-radius: 8px;

  background: rgba(176, 85, 59, 0.08);

  color: #b0553b;

  font-size: 16px;
  font-weight: 700;

  cursor: pointer;
}

.combo .del:hover {
  background: rgba(176, 85, 59, 0.14);
  border-color: rgba(176, 85, 59, 0.28);
}

.combo-warning {
  width: 100%;

  margin-top: 6px;

  color: #a83232;

  font-size: 12px;
  font-weight: 700;
}

.addcombo {
  width: 100%;

  padding: 10px 14px;

  border:
    1px dashed
    var(--green);

  border-radius: 10px;

  background: #fff;

  color: var(--green);

  font: inherit;
  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
}

.addcombo:hover {
  background:
    var(--green-soft);
}

.addcombo:disabled {
  cursor: not-allowed;

  opacity: 0.5;
}

@media (min-width: 700px) {

  .combo {
    grid-template-columns:
      minmax(220px, 1fr)
      120px
      82px
      minmax(130px, auto)
      34px;

    gap: 10px;

    align-items: center;

    overflow: visible;
  }

  /* Kombinationsart */
  .combo > select:not(.modesel) {
    grid-column: 1;
    grid-row: 1;

    width: 100%;
    min-width: 0;
  }

  /* Fixpreis / Ersparnis */
  .combo .modesel {
    grid-column: 2;
    grid-row: 1;

    width: 120px;
    min-width: 0;
  }

  /* Preis */
  .combo .pricewrap {
    grid-column: 3;
    grid-row: 1;

    width: 82px;
    min-width: 0;
  }

  .combo .inp.price {
    width: 100%;
    min-width: 0;

    padding-left: 8px;
    padding-right: 8px;
  }

  /* Berechneter Kombipreis */
  .combo .csavebox {
    grid-column: 4;
    grid-row: 1;

    width: auto;
    min-width: 0;

    overflow: visible;
  }

  .combo .save {
    width: auto;

    white-space: nowrap;
  }

  /* Löschen */
  .combo .del {
    grid-column: 5;
    grid-row: 1;

    justify-self: end;
    align-self: center;
  }
}
/* ---------------------------------------------------------
   Wochenangebot
   --------------------------------------------------------- */

.weekly-offer-textarea {
  display: block;

  width: 100%;
  min-height: 180px;

  resize: vertical;

  line-height: 1.5;

  white-space: pre-wrap;
}

.field-footer {
  display: flex;
  justify-content: space-between;

  gap: 12px;

  margin-top: 6px;
}


/* ---------------------------------------------------------
   Sonstiges
   --------------------------------------------------------- */

.notesarea {
  width: 100%;
  min-height: 96px;

  resize: vertical;

  padding: 12px;

  border:
    1px solid
    var(--line);

  border-radius: 11px;

  background: #faf8f2;

  color: var(--ink);

  font: inherit;
  font-size: 14px;

  line-height: 1.5;

  outline: none;
}

.notesarea:focus {
  border-color: var(--green);

  background: #fff;
}


/* ---------------------------------------------------------
   Live-Vorschau
   --------------------------------------------------------- */

.preview-wrap {
  position: static;

  min-width: 0;

  margin-top: 6px;
}

.preview-wrap .plabel,
.plabel {
  margin-bottom: 10px;

  color: var(--muted);

  font-size: 12px;
  font-weight: 600;

  letter-spacing: 0.06em;

  text-transform: uppercase;
}

.preview-distance {
  max-width: 150px;

  text-align: right;
}

.preview-menu-empty,
.preview-empty {
  padding: 24px 16px;

  color: #64748b;

  font-size: 14px;

  text-align: center;
}


/* ---------------------------------------------------------
   Vorschaukarte
   --------------------------------------------------------- */

.rcard {
  overflow: hidden;

  background: var(--card);

  border:
    1px solid
    var(--line);

  border-radius:
    var(--radius);

  box-shadow:
    var(--shadow);
}

.rcard-top {
  display: flex;
  justify-content: space-between;

  gap: 12px;

  padding:
    16px
    18px
    12px;

  border-bottom:
    1px dashed
    var(--line);
}

.dateflag {
  display: flex;
  align-items: center;

  gap: 6px;

  margin-bottom: 2px;

  color: var(--amber);

  font-size: 11px;
  font-weight: 600;

  letter-spacing: 0.05em;

  text-transform: uppercase;
}

.dateflag .live {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--amber);

  animation:
    pulse
    2s
    infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.rname {
  font-family:
    "Bricolage Grotesque",
    sans-serif;

  font-size: 18px;
  font-weight: 700;

  line-height: 1.15;

  letter-spacing: -0.01em;
}

.rmeta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 8px;

  margin-top: 3px;

  color: var(--muted);

  font-size: 12.5px;
}

.distpill {
  display: flex;
  align-items: center;
  align-self: flex-start;

  flex: none;

  gap: 5px;

  padding: 6px 11px;

  border-radius: 99px;

  background:
    var(--amber-soft);

  color: #9a6512;

  font-family:
    "Space Mono",
    monospace;

  font-size: 13px;
  font-weight: 700;
}


/* ---------------------------------------------------------
   Preview Menü
   --------------------------------------------------------- */

.menu {
  padding:
    6px
    18px
    12px;
}

.mrow {
  display: flex;
  align-items: baseline;

  gap: 10px;

  padding: 9px 0;

  border-bottom:
    1px solid
    var(--line2);
}

.mrow:last-child {
  border-bottom: 0;
}

.mtag {
  flex: none;

  width: 58px;

  padding-top: 2px;

  color: var(--muted);

  font-size: 10.5px;
  font-weight: 700;

  letter-spacing: 0.04em;

  text-transform: uppercase;
}

.mtag.s {
  color: #c08a2e;
}

.mtag.d {
  color: #9e6ba8;
}

.mtext {
  flex: 1;

  min-width: 0;

  font-size: 14.5px;

  line-height: 1.35;

  overflow-wrap: anywhere;
}

.mprice {
  flex: none;

  font-family:
    "Space Mono",
    monospace;

  font-size: 14px;
  font-weight: 700;

  white-space: nowrap;
}

.menu-description {
  display: block;

  margin-top: 3px;

  color: var(--muted);

  font-size: 11px;
  font-weight: 400;

  line-height: 1.35;
}

.tagchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 16px;

  margin-left: 6px;

  padding: 0 5px;

  border-radius: 4px;

  font-size: 9.5px;
  font-weight: 700;

  vertical-align: middle;
}

.tagchip.v {
  background: var(--green-soft);

  color: var(--green-dark);
}

.tagchip.vg {
  background: var(--green);

  color: #fff;
}


/* ---------------------------------------------------------
   Preview Kombi-Angebote
   --------------------------------------------------------- */

.comborow {
  display: flex;
  align-items: center;

  gap: 9px;

  padding: 9px 0;

  border-bottom:
    1px solid
    var(--line2);
}

.comborow:last-child {
  border-bottom: 0;
}

.ctag {
  flex: none;

  padding: 2px 6px;

  border-radius: 5px;

  background: var(--amber);

  color: #fff;

  font-size: 9.5px;
  font-weight: 700;

  letter-spacing: 0.03em;

  text-transform: uppercase;
}

.ctext {
  flex: 1;

  min-width: 0;

  color: var(--muted);

  font-size: 13.5px;
}

.csave {
  flex: none;

  padding: 2px 6px;

  border-radius: 5px;

  background:
    var(--green-soft);

  color: var(--green);

  font-family:
    "Space Mono",
    monospace;

  font-size: 11px;
  font-weight: 700;
}

.cprice {
  flex: none;

  font-family:
    "Space Mono",
    monospace;

  font-size: 14px;
  font-weight: 700;
}


/* ---------------------------------------------------------
   Preview Footer
   --------------------------------------------------------- */

.rcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 12px 18px;

  border-top:
    1px solid
    var(--line);

  background: #faf8f2;
}

.rcard-foot .updated {
  display: flex;
  align-items: center;

  gap: 6px;

  color: var(--muted);

  font-size: 12px;
}

.linklike {
  border: 0;

  background: none;

  color: var(--green);

  font: inherit;
  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
}

.linklike:hover {
  text-decoration: underline;
}

.linklike:disabled {
  cursor: default;

  opacity: 1;
}


/* ---------------------------------------------------------
   Save Toast
   --------------------------------------------------------- */

.save-toast {
  position: fixed;

  top: 16px;
  right: 16px;

  z-index: 9999;

  width:
    min(
      360px,
      calc(100% - 32px)
    );

  padding: 14px 18px;

  border-radius: 10px;

  background: #1f7a4c;

  color: #fff;

  font-size: 14px;
  font-weight: 600;

  box-shadow:
    0 8px 28px
    rgba(0, 0, 0, 0.2);

  opacity: 0;

  transform:
    translateY(-12px);

  pointer-events: none;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.save-toast.show {
  opacity: 1;

  transform:
    translateY(0);
}

.save-toast.error {
  background: #b42318;
}

/* =========================================================
   Tablet
   ========================================================= */

/* Kombi-Angebote: Mobile-Anordnung */
@media (max-width: 699px) {
  /* Die beiden Selects jeweils volle Zeile */
  .combo > select {
    grid-column: 1 / -1;
  }

  /* Preisfeld ebenfalls volle Zeile */
  .combo .pricewrap {
    grid-column: 1 / -1;
  }

  /* Letzte Zeile: Kombipreis links, X rechts */
  .combo .csavebox {
    grid-column: 1;
    display: flex;
    align-items: center;
  }

  .combo .del {
    grid-column: 2;
    justify-self: end;
    align-self: center;
  }

  .combo .save {
    white-space: nowrap;
  }
}

/* =========================================================
   Desktop
   ========================================================= */

@media (min-width: 700px) {

  .adminview {
    padding-top: 28px;
  }


  /* Kopf */

  .acctbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    gap: 18px;
  }


  /* Panels */

  .panel {
    padding: 20px;
  }


  /* Wochenbuttons */

  .editdays {
    gap: 7px;
  }

  .eday {
    min-height: 62px;

    padding: 7px 4px;
  }

  .eday .wd {
    font-size: 11px;
  }

  .eday .dt {
    font-size: 9.5px;
  }

  .closed-label {
    font-size: 8px;
  }


  /* ---------------------------------------------
     Menüzeile Desktop/Tablet

     Nr | Gericht | Typ | Preis
     --------------------------------------------- */

  .slotrow {
    grid-template-columns:
      22px
      minmax(0, 1fr)
      130px
      90px
      34px;

    gap: 10px;
  }

  .rowidx {
    grid-column: 1;
    grid-row: 1;

    align-self: center;

    padding-top: 0;
  }

  .slotrow > .inp:not(.price) {
    grid-column: 2;
    grid-row: 1;
  }

  .slotrow .dietsel {
    grid-column: 3;
    grid-row: 1;
  }

  .slotrow .inp.price {
    grid-column: 4;
    grid-row: 1;

    width: 90px;
  }

  .rowdel {
    grid-column: 5;
    grid-row: 1;

    justify-self: end;
  }
}


  /* Beschreibung so breit wie Gerichtsfeld */

  .desc-toggle {
    margin-left: 32px;
  }

  .desc-wrap {
      width:
        calc(
          100%
          - 32px
          - 130px
          - 90px
          - 34px
          - 30px
        );

      margin-left: 32px;
    }


  /* Savebars */

  .savebar {
    flex-direction: row;
    align-items: center;

    gap: 12px;
  }

  .savebar .btn-primary {
    width: auto;

    flex: none;
  }

  .savebar::after {
    flex: 1;
  }
}


/* =========================================================
   Desktop
   ========================================================= */

@media (min-width: 1050px) {

  .adminview {
    padding-bottom: 72px;
  }

  .dashboard-content {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(320px, 430px);

    gap: 28px;
  }

  .panel {
    padding: 22px;
  }

  .preview-wrap {
    position: sticky;

    top: 88px;

    margin-top: 0;
  }
}


/* =========================================================
   Sehr schmale Displays
   ========================================================= */

@media (max-width: 390px) {

  .panel {
    padding:
      14px
      12px;
  }

  .editdays {
    gap: 3px;
  }

  .eday {
    min-height: 56px;

    padding-left: 1px;
    padding-right: 1px;
  }

  .eday .wd {
    font-size: 9.5px;
  }

  .eday .dt {
    font-size: 8px;
  }

  .closed-label {
    display: none;
  }

  .week-pdf-button {
    padding:
      5px
      7px;
  }
}


/* =========================================================
   Accessibility
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  .eday,
  .pmbtn,
  .week-pdf-button,
  .save-toast {
    transition: none !important;
  }

  .dateflag .live {
    animation: none !important;
  }
}


/* =========================================================
   Stammdaten bearbeiten
   editlokal.html
   Mobile First
   ========================================================= */


/* ---------------------------------------------------------
   Hauptpanel
   --------------------------------------------------------- */

.stammwrap {
  width: 100%;
  min-width: 0;
}


/* ---------------------------------------------------------
   Stammdaten-Felder
   Mobile: alles untereinander
   --------------------------------------------------------- */

.stamm {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr);

  gap: 14px;

  width: 100%;
  min-width: 0;
}

.fld {
  display: flex;
  flex-direction: column;

  gap: 5px;

  min-width: 0;
}

.fld.wide {
  grid-column: auto;
}

.fld label {
  color: var(--muted);

  font-size: 11.5px;
  font-weight: 700;

  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fld input,
.fld textarea {
  display: block;

  width: 100%;
  max-width: 100%;
  min-width: 0;

  padding: 11px 12px;

  box-sizing: border-box;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: #faf8f2;

  color: var(--ink);

  font: inherit;
  font-size: 14px;

  line-height: 1.45;

  outline: none;
}

.fld textarea {
  resize: vertical;
}

.fld input:focus,
.fld textarea:focus {
  border-color: var(--green);

  background: #fff;
}

.fld input:disabled {
  background: #f0ede6;

  color: var(--muted);

  cursor: not-allowed;
}


/* ---------------------------------------------------------
   Validierung
   --------------------------------------------------------- */

.fld input.err,
.fld textarea.err {
  border-color:
    #d64545 !important;

  background-color:
    #fff3f3 !important;

  box-shadow:
    0 0 0 2px
    rgba(214, 69, 69, 0.12);
}

.fld input.ok,
.fld textarea.ok {
  border-color:
    #70ad78 !important;

  background-color:
    #f1faf2 !important;

  box-shadow:
    0 0 0 2px
    rgba(112, 173, 120, 0.10);
}


/* ---------------------------------------------------------
   Öffnungszeiten
   Mobile
   --------------------------------------------------------- */

.hours {
  display: grid;

  gap: 8px;

  width: 100%;

  margin-top: 8px;
}

.hrow {
  display: grid;

  grid-template-columns:
    30px
    minmax(0, 1fr);

  gap: 8px 10px;

  align-items: center;

  width: 100%;
  min-width: 0;

  padding: 10px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: #fff;
}

.hrow.zu {
  background: #faf8f2;
}

.hd {
  grid-column: 1;
  grid-row: 1;

  font-size: 13px;
  font-weight: 700;
}

.htimes {
  grid-column: 2;
  grid-row: 1;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto
    minmax(0, 1fr);

  gap: 6px;

  align-items: center;

  min-width: 0;
}

.htimes input {
  width: 100%;
  min-width: 0;

  padding: 8px 6px;

  box-sizing: border-box;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: #faf8f2;

  color: var(--ink);

  font-family:
    "Space Mono",
    monospace;

  font-size: 12px;
  font-weight: 700;

  text-align: center;

  outline: none;
}

.htimes input:focus {
  border-color: var(--green);

  background: #fff;
}

.bis {
  color: var(--faint);

  font-size: 11px;
}

.zuchk {
  grid-column: 2;
  grid-row: 2;

  display: inline-flex;
  align-items: center;

  gap: 6px;

  justify-self: start;

  color: var(--muted);

  font-size: 12px;

  cursor: pointer;
}

.zuchk input {
  accent-color: var(--green);
}

.hrow.zu .htimes {
  opacity: 0.35;
}


/* ---------------------------------------------------------
   Vorschau Öffnungszeiten
   --------------------------------------------------------- */

.hpreview {
  margin-top: 10px;

  padding: 11px 12px;

  border:
    1px solid
    var(--line);

  border-radius: 10px;

  background: #faf8f2;

  color: var(--muted);

  font-size: 12.5px;

  line-height: 1.5;
}

.hpreview b {
  color: var(--ink);
}


/* ---------------------------------------------------------
   Stammdaten speichern
   --------------------------------------------------------- */

#stammSave {
  display: flex !important;
  flex-direction: column;

  align-items: stretch;

  gap: 8px;

  margin-top: 24px !important;
}

#stammSave .btn-primary {
  width: 100%;

  justify-content: center;
}

#stammmsg {
  margin-left: 0 !important;

  text-align: center;
}


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

.logobox {
  display: flex;
  flex-direction: column;

  align-items: stretch;

  gap: 14px;

  width: 100%;

  margin-top: 10px;
}

.logoprev {
  width: 100%;
  height: 160px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border:
    1px dashed
    var(--line);

  border-radius: 12px;

  background: #faf8f2;
}

.logoprev img {
  width: 100%;
  height: 100%;

  object-fit: contain;

  padding: 10px;
}

.logoprev .ph {
  padding: 12px;

  color: var(--muted);

  font-size: 12px;

  text-align: center;
}

.logoacts {
  display: flex;
  flex-direction: column;

  gap: 8px;

  width: 100%;
  min-width: 0;
}

.filebtn {
  width: 100%;

  min-height: 42px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 14px;

  border:
    1px solid
    var(--green);

  border-radius: 10px;

  background: #fff;

  color: var(--green);

  font: inherit;
  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
}

.filebtn:hover {
  background: var(--green-soft);
}

.logohint {
  color: var(--faint);

  font-size: 12px;

  line-height: 1.45;
}


/* =========================================================
   Tablet / größere Screens
   ========================================================= */

@media (min-width: 700px) {

  /* Stammdaten zweispaltig */
  .stamm {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 14px 16px;
  }

  .fld.wide {
    grid-column: 1 / -1;
  }


  /* Öffnungszeiten wieder kompakter */
  /* Öffnungszeiten Desktop / Tablet */
    .hrow {
      grid-template-columns:
        42px
        auto
        auto;

      justify-content: start;
      align-items: center;

      gap: 10px;

      padding: 9px 12px;
    }

    .hd {
      grid-column: 1;
      grid-row: 1;
    }

    .htimes {
      grid-column: 2;
      grid-row: 1;

      display: flex;
      align-items: center;

      gap: 7px;
    }

    .htimes input {
      width: 92px;
      min-width: 92px;

      padding: 7px 8px;

      font-size: 13px;
    }

    .zuchk {
      grid-column: 3;
      grid-row: 1;

      display: inline-flex;
      align-items: center;

      gap: 6px;

      justify-self: start;

      white-space: nowrap;
    }


  /* Speichern */
  #stammSave {
    flex-direction: row;

    align-items: center;
  }

  #stammSave .btn-primary {
    width: auto;
  }

  #stammmsg {
    text-align: left;
  }


  /* Logo */
  .logobox {
    flex-direction: row;

    align-items: center;

    gap: 18px;
  }

  .logoprev {
    width: 140px;
    height: 110px;

    flex: none;
  }

  .logoacts {
    flex: 1;

    min-width: 0;
  }

  .filebtn {
    width: auto;

    align-self: flex-start;
  }
}

/* =========================================================
   DASHBOARD APP LAYOUT
   ========================================================= */

.dashboard-app {
  min-height: 100dvh;

  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);

  background: var(--bg);
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.dashboard-sidebar {
  min-height: 100dvh;

  display: flex;
  flex-direction: column;

  position: sticky;
  top: 0;

  padding: 18px 14px;

  border-right: 1px solid var(--line);

  background: var(--card, #fff);
}


.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-bottom: 24px;
}


.dashboard-brand-icon {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background: var(--green);
  color: #fff;

  font-size: 13px;
  font-weight: 800;
}


.dashboard-brand-text {
  display: flex;
  flex-direction: column;

  min-width: 0;
}


.dashboard-brand-text strong {
  line-height: 1.2;
}


.dashboard-brand-text span {
  color: var(--muted);

  font-size: 12px;
}


.dashboard-close {
  display: none;

  margin-left: auto;

  border: 0;
  background: none;

  font-size: 25px;
  cursor: pointer;
}


.dashboard-lokal-info {
  display: flex;
  flex-direction: column;

  margin-bottom: 20px;
  padding: 12px;

  border-radius: 10px;

  background: var(--green-soft);
}


.dashboard-lokal-info span,
.dashboard-lokal-info small {
  color: var(--muted);

  font-size: 11px;
}


.dashboard-lokal-info strong {
  margin: 2px 0;

  font-size: 14px;
}


.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}


.dashboard-nav-heading {
  margin: 12px 9px 5px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 800;

  text-transform: uppercase;
  letter-spacing: .07em;
}


.dashboard-nav-link {
  min-height: 44px;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 9px 10px;

  border-radius: 9px;

  color: var(--ink);
  text-decoration: none;

  font-size: 14px;
  font-weight: 600;
}


.dashboard-nav-link:hover {
  background: var(--green-soft);
}


.dashboard-nav-link.is-active {
  background: var(--green);
  color: #fff;
}


.dashboard-nav-icon {
  width: 22px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;
}


.dashboard-sidebar-footer {
  margin-top: auto;

  display: flex;
  flex-direction: column;
  gap: 8px;

  padding-top: 20px;
}


.dashboard-sidebar-footer > a {
  color: var(--green);

  font-size: 13px;
  font-weight: 600;

  text-decoration: none;
}


.dashboard-logout-button {
  width: 100%;
}


/* =========================================================
   MAIN
   ========================================================= */

.dashboard-main {
  min-width: 0;
}


.dashboard-page {
  width: 100%;

  padding: 28px;
}


.dashboard-page-header {
  margin-bottom: 22px;
}


.dashboard-page-header h1 {
  margin: 3px 0 5px;
}


.dashboard-page-header p {
  margin: 0;

  color: var(--muted);
}


.dashboard-eyebrow {
  color: var(--green);

  font-size: 11px;
  font-weight: 800;

  text-transform: uppercase;
  letter-spacing: .07em;
}


/* =========================================================
   MOBILE HEADER
   ========================================================= */

.dashboard-mobile-header {
  display: none;
}


.dashboard-backdrop {
  display: none;
}

@media (max-width: 860px) {

  .dashboard-app {
    display: block;
  }


  .dashboard-sidebar {
    width: min(86vw, 300px);
    height: 100dvh;

    position: fixed;
    z-index: 1001;

    top: 0;
    left: 0;

    transform: translateX(-105%);
    transition: transform .2s ease;

    padding-top:
      calc(
        18px +
        env(safe-area-inset-top, 0px)
      );

    box-shadow:
      14px 0 35px
      rgba(15, 23, 42, .16);
  }


  .dashboard-sidebar.is-open {
    transform: translateX(0);
  }


  .dashboard-close {
    display: block;
  }


  .dashboard-backdrop {
    position: fixed;
    z-index: 1000;

    inset: 0;

    background:
      rgba(15, 23, 42, .38);
  }


  .dashboard-backdrop.is-open {
    display: block;
  }


  .dashboard-mobile-header {
    min-height: 58px;

    display: flex;
    align-items: center;
    gap: 12px;

    position: sticky;
    z-index: 900;

    top: 0;

    padding:
      8px
      14px;

    border-bottom: 1px solid var(--line);

    background:
      rgba(255, 255, 255, .96);

    backdrop-filter: blur(12px);
  }


  .dashboard-menu-button {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    padding: 0;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: #fff;

    color: var(--ink);

    font-size: 20px;

    cursor: pointer;
  }


  .dashboard-mobile-header > div {
    display: flex;
    flex-direction: column;
  }


  .dashboard-mobile-header strong {
    font-size: 14px;
  }


  .dashboard-mobile-header span {
    color: var(--muted);

    font-size: 11px;
  }


  .dashboard-page {
    padding: 16px 12px 24px;
  }


  .dashboard-content {
    grid-template-columns: 1fr;
  }


  .preview-wrap {
    position: static;
  }

}

body.dashboard-menu-open {
  overflow: hidden;
}
