/* Colors and type matched to the winery website:
   charcoal announcement strip, parchment header, wine-red feature bands,
   thin all-caps Josefin Sans headings, rounded Comfortaa navigation. */
:root {
  --charcoal: #353638;
  --wine: #8f3539;
  --wine-dark: #6f272b;
  --wine-light: #a8474c;
  --parchment: #e6dcc8;
  --parchment-2: #efe7d8;
  --bg: #f5efe4;
  --card: #fffdf9;
  --ink: #2b2622;
  --muted: #6e645b;
  --line: #ddd1bd;
  --gold: #b08a4a;
  --ok: #3f6b45;
  --warn: #93600b;
  --bad: #a3242f;
  --radius: 6px;
  --heading: "Josefin Sans", "Century Gothic", "Avenir Next", sans-serif;
  --round: "Comfortaa", "Varela Round", "Avenir Next", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Faint paper grain, like the site's textured backgrounds. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.27 0 0 0 0 0.17 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--grain), var(--bg);
  color: var(--ink);
  font: 1rem/1.45 var(--body);
}
a { color: var(--wine); }
h1, h2 { font-family: var(--heading); font-weight: 300; text-transform: uppercase; letter-spacing: .04em; line-height: 1.15; }
h1 { font-size: 2rem; margin: .25rem 0 .75rem; }
h2 { font-size: 1.3rem; font-weight: 400; margin: 1.75rem 0 .6rem; }
.card h1 { font-size: 1.7rem; }
.card h2:first-child, .card h1:first-child { margin-top: 0; }
main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; }
.narrow { max-width: 560px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* Charcoal strip + parchment header */
.strip {
  background: var(--charcoal); color: #f2ece2;
  font-family: var(--round); font-size: .8rem; text-align: center; padding: 6px 12px;
}
.strip .sep { margin: 0 8px; opacity: .6; }
.topbar {
  background: var(--grain), linear-gradient(180deg, var(--parchment-2), var(--parchment));
  border-bottom: 1px solid #cdbfa6;
  box-shadow: 0 2px 6px rgba(43, 38, 34, .12);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding: 10px 20px; position: relative; z-index: 3;
}
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; }
.brand img { height: 76px; width: auto; display: block; margin: -4px 0; }
.wordmark { font-family: var(--heading); font-weight: 400; font-size: 1.5rem; letter-spacing: .08em; text-transform: uppercase; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; margin-left: auto; font-family: var(--round); }
.topbar nav a { color: var(--ink); text-decoration: none; padding: 4px 10px; font-size: 1rem; border-left: 1px solid #8a7f72; line-height: 1.1; }
.topbar nav a:first-child { border-left: 0; }
.topbar nav a:hover { color: var(--wine); }
.topbar nav a.on { color: var(--wine); font-weight: 600; }
.topbar nav a.signout { color: var(--muted); font-size: .9rem; }
.badge { background: var(--wine); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .72rem; font-weight: 600; vertical-align: 2px; }

/* Wine-red feature band (sign-in page) */
.hero {
  background: var(--grain), radial-gradient(ellipse at 50% 30%, var(--wine-light), var(--wine) 55%, var(--wine-dark));
  color: #fbf6ee; text-align: center; padding: 48px 16px 64px;
  margin: -20px calc(50% - 50vw) 0; width: 100vw;
}
.hero h1 { font-size: 3rem; color: #fbf6ee; margin: 0 0 6px; }
.hero > p { font-family: var(--round); margin: 0 0 28px; }
.hero .card p:last-child { margin-bottom: 0; }
.hero .card { text-align: left; color: var(--ink); max-width: 420px; margin: 0 auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }

/* Buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--wine); background: var(--wine); color: #fff;
  padding: 8px 18px; border-radius: 3px; min-height: 40px; cursor: pointer; text-decoration: none;
  font-family: var(--round); font-size: .92rem; font-weight: 600; letter-spacing: .01em;
}
.btn:hover { background: var(--wine-dark); border-color: var(--wine-dark); }
.btn.ghost { background: #fffdf9; color: var(--charcoal); border-color: #b9ab95; }
.btn.ghost:hover { border-color: var(--wine); color: var(--wine); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.small { padding: 4px 10px; min-height: 32px; font-size: .84rem; }
.danger-text { color: var(--bad) !important; border-color: transparent !important; background: transparent !important; }
.form label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .92rem; }
.form label.check, label.check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
input, select, textarea {
  font: inherit; width: 100%; padding: 9px 10px; margin-top: 4px;
  border: 1px solid #c9bba4; border-radius: 4px; background: #fff; color: var(--ink);
}
input[type=checkbox] { width: auto; margin-top: 4px; accent-color: var(--wine); }
input[type=color] { width: 44px; padding: 2px; height: 38px; }
input:focus, select:focus, .btn:focus-visible { outline: 3px solid rgba(143, 53, 57, .3); outline-offset: 1px; border-color: var(--wine); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
form.inline { display: inline; }
.inline-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.inline-row input { margin-top: 0; }
.inline-row > span { flex: 1; }
fieldset.repeat { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
fieldset.repeat legend { font-weight: 600; font-size: .92rem; }
fieldset.repeat label { margin: 0; }
.templates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.chip { border: 1px solid #c9bba4; background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-family: var(--round); font-size: .82rem; cursor: pointer; }
.chip:hover { border-color: var(--wine); color: var(--wine); }

/* Cards & messages */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(43, 38, 34, .06); }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.cards.two { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 10px; border: 1px solid; border-left-width: 4px; background: var(--card); }
.flash.success { border-color: #b9cdb9; border-left-color: var(--ok); color: #2c4d31; }
.flash.error { border-color: #e2bcbf; border-left-color: var(--bad); color: #7d1a24; }
.flash.warn { border-color: #e6d0a4; border-left-color: var(--gold); color: #634411; }
.flash.info { border-color: var(--line); border-left-color: var(--charcoal); color: var(--ink); }
.warn-text { color: var(--warn); }
.pill { display: inline-block; font-family: var(--round); font-size: .74rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #ece5d9; }
.pill-ok, .pill-approved { background: #e2ecdf; color: var(--ok); }
.pill-draft, .pill-pending { background: #f5e8cc; color: var(--warn); }
.pill-denied { background: #f4dfe0; color: var(--bad); }
.pill-cancelled { background: #ece5d9; color: var(--muted); }

/* Week header */
.week-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.week-head h1 { margin: 0 0 6px; }
.week-nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.week-nav input[type=date] { margin: 0; width: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }

/* Schedule grid */
.grid-wrap, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.grid { border-collapse: collapse; width: 100%; min-width: 900px; table-layout: fixed; }
.grid th, .grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; vertical-align: top; text-align: left; }
.grid thead th {
  background: var(--wine); color: #fbf6ee; border-color: var(--wine-dark);
  font-family: var(--heading); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; font-size: .95rem;
  position: sticky; top: 0;
}
.grid thead th .muted { color: #ead9d4; font-family: var(--round); text-transform: none; letter-spacing: 0; font-size: .8rem; }
.grid th.who { width: 150px; background: var(--parchment-2); position: sticky; left: 0; z-index: 1; font-size: .92rem; }
.grid thead th.who { z-index: 2; background: var(--wine-dark); }
.grid td { height: 64px; position: relative; padding-bottom: 28px; }
.grid td.today { background: #fbf5e8; }
.grid thead th.today { background: var(--wine-light); }
.grid tr.me th.who { background: #f1e2dc; box-shadow: inset 3px 0 0 var(--wine); }
.grid tr.open-row th.who { font-style: italic; color: var(--muted); }
.grid td.off { background: repeating-linear-gradient(45deg, #fffdf9, #fffdf9 6px, #efe6d6 6px, #efe6d6 12px); }
.hrs { font-size: .8rem; color: var(--muted); font-weight: 400; }
.hrs.over { color: var(--bad); font-weight: 600; }
.shift {
  display: block; text-decoration: none; color: var(--ink);
  border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 11%, #fffdf9);
  border-radius: 4px; padding: 4px 6px; margin-bottom: 4px; font-size: .85rem; line-height: 1.25;
}
a.shift:hover { background: color-mix(in srgb, var(--c) 22%, #fffdf9); }
.shift span, .shift em { display: block; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offtag { font-family: var(--round); font-weight: 600; font-size: .76rem; color: var(--wine); margin-bottom: 4px; }
.reqtag { display: block; font-size: .75rem; color: var(--warn); margin-bottom: 4px; }
.add {
  position: absolute; left: 6px; bottom: 4px; width: 22px; height: 22px; line-height: 20px; text-align: center;
  border: 1px dashed #c4b59c; border-radius: 4px; color: var(--muted); text-decoration: none; font-weight: 700;
  opacity: .55;
}
td:hover .add, .add:focus { opacity: 1; color: var(--wine); border-color: var(--wine); }
.grid tfoot th, .grid tfoot td { background: var(--parchment-2); height: auto; padding-bottom: 6px; font-size: .85rem; }

/* Lists */
table.list { border-collapse: collapse; width: 100%; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { background: var(--parchment-2); font-family: var(--heading); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: .82rem; }
table.list tr.inactive td { color: var(--muted); }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.shift-list { list-style: none; padding: 0; margin: 0; }
.week-label { font-family: var(--heading); font-weight: 600; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 6px; }
.shift-card { display: flex; gap: 14px; align-items: center; border-left: 5px solid var(--c); }
.shift-card.is-today { box-shadow: 0 0 0 2px var(--gold); }
.shift-card .date { text-align: center; min-width: 46px; display: flex; flex-direction: column; line-height: 1.1; font-family: var(--round); font-size: .74rem; color: var(--muted); text-transform: uppercase; }
.shift-card .date strong { font-family: var(--heading); font-weight: 400; font-size: 1.7rem; color: var(--wine); }
.shift-card .area { font-weight: 600; font-size: .9rem; }
.shift-card .note { font-size: .88rem; }
.req .req-head { display: flex; justify-content: space-between; gap: 8px; }
.req > div { margin-bottom: 4px; }
.req-form input { margin: 8px 0 0; }

@media (max-width: 760px) {
  main { padding: 14px 12px 32px; }
  h1 { font-size: 1.6rem; }
  .hero { margin-top: -14px; padding: 32px 12px 44px; }
  .hero h1 { font-size: 2.2rem; }
  .topbar { padding: 8px 12px; }
  .brand img { height: 56px; }
  .topbar nav { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .topbar nav a:first-child { padding-left: 0; }
  .topbar nav a { padding: 4px 8px; font-size: .92rem; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .grid th.who { width: 110px; }
  .cards, .cards.two { grid-template-columns: 1fr; }
}

/* Optional background photo: upload assets/background.jpg and it appears automatically.
   A parchment wash keeps text readable; the sign-in band gets a wine-red wash instead. */
body.has-photo::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(rgba(245, 239, 228, .84), rgba(245, 239, 228, .9)),
    var(--photo) center / cover no-repeat;
}
body.has-photo { background: transparent; }
body.has-photo .hero {
  background:
    linear-gradient(rgba(53, 54, 56, .30), rgba(53, 54, 56, .30)),
    linear-gradient(rgba(143, 53, 57, .55), rgba(111, 39, 43, .72)),
    var(--photo) center 55% / cover no-repeat;
}
