:root {
  --leaf: #8CC63F;
  --leaf-deep: #5F9E2A;
  --leaf-wash: #F2F7E8;
  --forest: #2C4318;
  --forest-deep: #1C2C0F;
  --ink: #24301C;
  --ink-soft: #5C6B52;
  --ink-faint: #8A9680;
  --paper: #F5F4EE;
  --white: #fff;
  --line: #E2E4D8;
  --danger: #C4432B;
  --shadow: 0 2px 10px -4px rgba(28,44,15,.16);
  --shadow-md: 0 16px 40px -22px rgba(28,44,15,.4);
  --display: 'Fraunces', Georgia, serif;
  --text: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

/* Must beat the display values set by component classes below. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; color: var(--forest); margin: 0; line-height: 1.2; }
h2 { font-size: 1.72rem; }
h3 { font-size: 1.1rem; margin-bottom: 4px; }

img { display: block; max-width: 100%; }

/* ----------------------------- Login ----------------------------- */

.login-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(140,198,63,.16), transparent 46%),
    radial-gradient(circle at 82% 78%, rgba(140,198,63,.2), transparent 50%),
    var(--paper);
}
.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--white);
  border-radius: 22px;
  padding: 40px 36px 34px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.login-card img { height: 88px; width: auto; margin: 0 auto 18px; }
.login-card h1 { font-size: 1.5rem; }
.login-card p { color: var(--ink-soft); font-size: .92rem; margin: 8px 0 26px; }
.login-card label { text-align: left; }
.login-card .btn { width: 100%; margin-top: 18px; }
.login-card .back {
  display: block;
  margin-top: 22px;
  font-size: .85rem;
  color: var(--ink-faint);
  text-decoration: none;
}
.login-card .back:hover { color: var(--leaf-deep); }

/* ----------------------------- Chrome ---------------------------- */

.topbar { background: var(--white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 20; }
.bar-inner {
  max-width: 1080px;
  margin-inline: auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { height: 42px; width: auto; }
.brand b { display: block; font-family: var(--display); font-size: 1.05rem; color: var(--forest); line-height: 1.1; }
.brand span { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.bar-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.tabs {
  max-width: 1080px;
  margin-inline: auto;
  padding: 0 24px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
}
.tab {
  border: 0;
  background: none;
  font-family: var(--text);
  font-size: .89rem;
  font-weight: 700;
  color: var(--ink-faint);
  padding: 13px 16px;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--forest); }
.tab.active { color: var(--forest); border-bottom-color: var(--leaf); }

.wrap { max-width: 1080px; margin-inline: auto; padding: 30px 24px 90px; }

.panel { display: none; }
.panel.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.phead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.phead p { color: var(--ink-soft); font-size: .92rem; margin: 5px 0 0; max-width: 56ch; }

/* ----------------------------- Cards ----------------------------- */

.card {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card.narrow { max-width: 560px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

label {
  display: block;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 16px 0 6px;
}
label:first-child { margin-top: 0; }
label em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-faint); }

input[type=text], input[type=password], input[type=date], textarea, select {
  width: 100%;
  font-family: var(--text);
  font-size: .96rem;
  color: var(--ink);
  background: #FCFCF9;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, textarea:focus {
  outline: 0;
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(140,198,63,.18);
}
textarea { resize: vertical; line-height: 1.55; }

.row { display: flex; gap: 10px; align-items: flex-end; }
.row .grow { flex: 1; }

.check { display: flex; align-items: center; gap: 10px; margin-top: 18px; text-transform: none; letter-spacing: 0; font-size: .92rem; font-weight: 600; color: var(--ink); }
.check input { width: 19px; height: 19px; accent-color: var(--leaf-deep); flex: none; }

.hint { font-size: .82rem; color: var(--ink-faint); margin: 10px 0 0; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--text);
  font-size: .9rem;
  font-weight: 700;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, color .2s, box-shadow .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 9px 16px; font-size: .84rem; }
.btn.full { width: 100%; margin-top: 12px; }
.btn-primary { background: var(--leaf); color: #16240B; }
.btn-primary:hover { background: var(--leaf-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--forest); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--leaf); background: var(--leaf-wash); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px rgba(196,67,43,.3); }
.btn-danger:hover { background: rgba(196,67,43,.08); }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------------------------- Messages --------------------------- */

.msg {
  margin-top: 14px;
  padding: 11px 15px;
  border-radius: 10px;
  font-size: .89rem;
  font-weight: 600;
  background: var(--leaf-wash);
  color: var(--leaf-deep);
}
.msg.error { background: rgba(196,67,43,.1); color: var(--danger); }

.banner {
  padding: 13px 18px;
  border-radius: 12px;
  font-size: .9rem;
  margin-bottom: 22px;
}
.banner.warn { background: #FFF4D6; color: #7A5A10; }

/* ----------------------------- Photo ----------------------------- */

.photo-box {
  border-radius: 12px;
  overflow: hidden;
  background: var(--leaf-wash);
  aspect-ratio: 4/3;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------- Menu editor -------------------------- */

.cat {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.cat-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 20px;
  background: var(--leaf-wash);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.cat-head input { background: var(--white); }
.cat-head .cat-name { flex: 1 1 200px; font-weight: 700; }
.cat-head .cat-blurb { flex: 2 1 280px; }
.cat-body { padding: 8px 20px 20px; }

.item {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 92px auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.item:last-of-type { border-bottom: 0; }
.item .toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .76rem;
  font-weight: 700;
  color: var(--ink-faint);
  cursor: pointer;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}
.item .toggle input { width: 17px; height: 17px; accent-color: var(--leaf-deep); }
.item.off { opacity: .5; }

.icon-btn {
  border: 0;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 8px;
  transition: background .18s, color .18s;
}
.icon-btn:hover { background: rgba(196,67,43,.1); color: var(--danger); }

.item-head {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 92px auto auto;
  gap: 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 12px 0 6px;
}

.cat-foot { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 14px; }

.hour-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }

/* --------------------------- Thumbnails -------------------------- */

.thumb {
  position: relative;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--leaf-wash);
  aspect-ratio: 1;
}
.thumb.wide { aspect-ratio: 16/11; }
/* Checkerboard behind logos so transparency is visible. */
.thumb.checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.checker img { object-fit: contain; padding: 10px; }
.thumb .nologo {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: .8rem; color: var(--ink-faint);
}

.thumb-x {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 1.1rem; line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.thumb-x:hover { background: var(--danger); }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}

/* ----------------------------- Photos ---------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 18px;
}
.photo-slot b { display: block; margin-top: 10px; font-size: .92rem; color: var(--forest); }
.photo-slot span { display: block; font-size: .78rem; color: var(--ink-faint); line-height: 1.45; margin-top: 2px; }
.photo-acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ------------------------------ Boxes ---------------------------- */

.box-edit.off, .client-edit.off { opacity: .55; }
.box-edit-grid { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; padding-top: 16px; }

/* ----------------------------- Clients --------------------------- */

.client-grid-edit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.client-edit {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.client-edit label { font-size: .7rem; margin: 12px 0 5px; }
.client-edit-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.client-edit .toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 700; color: var(--ink-faint);
  text-transform: none; letter-spacing: 0; margin: 0; cursor: pointer;
}
.client-edit .toggle input { width: 17px; height: 17px; accent-color: var(--leaf-deep); }

.notice-preview {
  margin-top: 18px;
  background: var(--forest);
  color: #fff;
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
}

/* --------------------------- Responsive -------------------------- */

@media (max-width: 860px) {
  .grid-2, .box-edit-grid { grid-template-columns: 1fr; }
  .item, .item-head { grid-template-columns: 1fr 1fr; }
  .item-head { display: none; }
  .item { padding: 14px 0; }
  .item .toggle { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .item { grid-template-columns: 1fr; }
  .phead .btn { width: 100%; }
}
