:root {
  color-scheme: light;
  --wingstop-green: #146a34;
  --wingstop-deep: #083f22;
  --wingstop-black: #121412;
  --wingstop-white: #ffffff;
  --paper: #f6f1e7;
  --line: #d8d0c2;
  --muted: #69635b;
  --red: #b2291f;
  --amber: #d88b21;
  --focus: #0b5bd3;
  --shadow: 0 18px 40px rgba(18, 20, 18, 0.16);
  --font-display: "Roc Grotesk", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Roc Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--wingstop-black);
  font-family: var(--font-body);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.is-hidden {
  display: none !important;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--wingstop-deep);
}

.brand-photo {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  object-fit: cover;
  display: block;
  filter: saturate(1.08) contrast(1.03);
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 39, 19, 0.88), rgba(5, 39, 19, 0.34) 54%, rgba(5, 39, 19, 0.08)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.08));
}

.brand-overlay {
  position: absolute;
  left: clamp(24px, 6vw, 76px);
  right: clamp(24px, 10vw, 120px);
  bottom: clamp(36px, 9vh, 112px);
  z-index: 1;
  color: var(--wingstop-white);
}

.brand-overlay h1,
.auth-form h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 7rem);
  line-height: 0.88;
  text-transform: uppercase;
}

.brand-overlay p:last-child {
  max-width: 560px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.25rem;
  line-height: 1.35;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: clamp(28px, 6vw, 76px);
  background: var(--wingstop-white);
}

.auth-form h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  color: var(--wingstop-green);
}

label,
legend {
  color: var(--wingstop-black);
  font-size: 0.88rem;
  font-weight: 800;
}

label {
  display: grid;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--wingstop-white);
  color: var(--wingstop-black);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(11, 91, 211, 0.18);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  margin: 0;
}

.segmented legend {
  grid-column: 1 / -1;
  padding: 0 6px;
  margin-bottom: 8px;
}

.segmented label {
  position: relative;
  display: block;
}

.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.segmented span {
  display: block;
  min-height: 42px;
  border-radius: 4px;
  padding: 11px 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.segmented input:checked + span {
  background: var(--wingstop-green);
  color: var(--wingstop-white);
}

.status-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-options span {
  display: grid;
  align-items: center;
  min-height: 48px;
  padding-inline: 6px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 900;
}

.primary-button {
  min-height: 46px;
  background: var(--wingstop-green);
  color: var(--wingstop-white);
  padding: 0 18px;
}

.primary-button:hover {
  background: var(--wingstop-deep);
}

.secondary-button {
  min-height: 46px;
  background: var(--wingstop-white);
  color: var(--wingstop-green);
  border-color: var(--wingstop-green);
  padding: 0 18px;
}

.ghost-button {
  background: transparent;
  color: var(--wingstop-white);
  border-color: rgba(255, 255, 255, 0.5);
  padding: 9px 13px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--wingstop-white);
  color: var(--wingstop-green);
  border-color: var(--line);
  font-size: 1.1rem;
}

.form-error,
.save-status {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 800;
}

.save-status {
  color: var(--wingstop-green);
}

.app-layout {
  min-height: 100vh;
  background: var(--paper);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px clamp(16px, 3vw, 34px);
  background: var(--wingstop-green);
  color: var(--wingstop-white);
}

.brand-mark {
  border: 2px solid currentColor;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.topbar-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.topbar-title span {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar-title strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 72px);
  padding: 18px;
}

.side-panel,
.calendar-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wingstop-white);
  box-shadow: var(--shadow);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.control-group {
  display: grid;
  gap: 8px;
}

.store-meta {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfaf6;
}

.store-meta:empty {
  display: none;
}

.store-meta strong {
  overflow: hidden;
  color: var(--wingstop-green);
  font-size: 0.98rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-controls {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
}

.month-label {
  display: block;
  color: var(--wingstop-black);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.store-context {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-list > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfaf6;
}

.metric-list span {
  display: block;
  color: var(--wingstop-green);
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.metric-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.closure-form {
  display: grid;
  gap: 14px;
}

.selected-date {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.selected-date span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-date strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 900;
}

.switch-row,
.checkbox-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fbfaf6;
}

.switch-row input,
.checkbox-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--wingstop-green);
}

.status-options {
  transition: opacity 0.16s ease;
}

.status-options.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.hours-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hours-grid.is-disabled {
  opacity: 0.45;
}

.week-editor {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.week-editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.week-editor-head span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.week-editor-head strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 900;
}

.week-rows {
  display: grid;
  gap: 8px;
}

.week-row {
  display: grid;
  grid-template-columns: minmax(54px, 0.65fr) minmax(96px, 1fr) minmax(0, 0.85fr) minmax(0, 0.85fr);
  align-items: end;
  gap: 8px;
}

.week-day-label {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-bottom: 5px;
}

.week-day-label span {
  color: var(--wingstop-black);
  font-size: 0.78rem;
  font-weight: 900;
}

.week-day-label strong {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.week-row select,
.week-row input {
  min-height: 38px;
  padding: 8px;
  font-size: 0.82rem;
}

.button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.calendar-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  border-bottom: 1px solid var(--line);
  background: #fbfaf6;
}

.weekday-row span {
  min-width: 0;
  padding: 12px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-grid {
  min-height: 620px;
}

.day-cell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 112px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--wingstop-white);
  color: var(--wingstop-black);
  padding: 10px;
  text-align: left;
}

.day-cell:nth-child(7n) {
  border-right: 0;
}

.day-cell:hover,
.day-cell.is-selected {
  outline: 3px solid rgba(20, 106, 52, 0.24);
  outline-offset: -3px;
  z-index: 1;
}

.day-cell.is-outside {
  background: #f5f2eb;
  color: #9a9388;
}

.day-cell.is-today .day-number {
  background: var(--wingstop-green);
  color: var(--wingstop-white);
}

.day-cell.is-closed {
  background: #fff9f0;
}

.day-cell.is-half {
  background: #fffdf4;
}

.day-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 900;
}

.day-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.closure-pill {
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--red);
  color: var(--wingstop-white);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.1;
}

.closure-pill.is-half {
  background: var(--amber);
  color: var(--wingstop-black);
}

.reason-text {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hours-text {
  overflow: hidden;
  color: var(--wingstop-green);
  font-size: 0.74rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hours-text.is-baseline {
  color: var(--muted);
  font-weight: 800;
}

/* Regular weekly hours editor */
.regular-hours {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.regular-hours-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.regular-hours-head span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.regular-hours-head strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 900;
}

.regular-hours .week-row {
  grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
}

.regular-closed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.regular-closed input {
  width: auto;
  min-height: 0;
}

/* Downstream sync status strip */
.downstream-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(20, 106, 52, 0.04);
}

.downstream-title {
  width: 100%;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.downstream-channel {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--wingstop-white);
  border: 1px solid var(--line);
  min-width: 84px;
}

.downstream-name {
  font-size: 0.74rem;
  font-weight: 900;
}

.downstream-status {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
}

.downstream-channel.is-ok {
  border-color: var(--wingstop-green);
}

.downstream-channel.is-ok .downstream-status {
  color: var(--wingstop-green);
}

.downstream-channel.is-warn {
  border-color: var(--amber);
}

.downstream-channel.is-warn .downstream-status {
  color: var(--amber);
}

.downstream-channel.is-muted .downstream-status {
  color: var(--muted);
}

@media (max-width: 960px) {
  .auth-layout,
  .workspace {
    grid-template-columns: 1fr;
  }

  .brand-panel,
  .brand-photo {
    min-height: 360px;
  }

  .workspace {
    padding: 12px;
  }

  .side-panel {
    box-shadow: none;
  }

  .calendar-grid {
    min-height: 560px;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand-mark {
    display: none;
  }

  .ghost-button {
    padding: 8px 10px;
  }

  .calendar-panel {
    overflow-x: auto;
  }

  .weekday-row,
  .calendar-grid {
    min-width: 680px;
  }

  .day-cell {
    min-height: 98px;
  }

  .hours-grid,
  .week-row {
    grid-template-columns: 1fr;
  }

  .week-day-label {
    padding-bottom: 0;
  }
}

/* Auth toggle (sign in / create account) */
.auth-toggle {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--muted);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--wingstop-green);
  font-weight: 900;
  text-decoration: underline;
}

/* Top nav */
.topnav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ghost-button.is-active {
  background: rgba(255, 255, 255, 0.18);
}

/* Pending (unassigned) view */
.pending-view {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
  padding: 24px;
}

.pending-card {
  max-width: 480px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wingstop-white);
  padding: 40px;
  box-shadow: var(--shadow);
}

.pending-card h2 {
  margin: 0 0 10px;
  color: var(--wingstop-green);
}

.pending-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

/* Admin panel */
.admin-view {
  min-height: calc(100vh - 72px);
  padding: 18px clamp(16px, 3vw, 34px);
  display: grid;
  gap: 16px;
  align-content: start;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.admin-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  font-weight: 900;
  color: var(--muted);
}

.admin-tab.is-active {
  color: var(--wingstop-green);
  border-bottom-color: var(--wingstop-green);
}

.admin-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.admin-table {
  display: grid;
  gap: 6px;
}

.admin-row {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wingstop-white);
  font-size: 0.85rem;
}

.admin-row-user {
  grid-template-columns: minmax(0, 1.6fr) 130px 150px minmax(0, 1.2fr) 64px 76px;
}

.admin-row-store {
  grid-template-columns: 90px minmax(0, 1fr) 70px 64px;
}

.admin-row-country {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-row-head {
  background: var(--paper);
  border: none;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}

.admin-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.admin-row select,
.admin-row input[type="text"] {
  min-height: 34px;
  padding: 6px 8px;
}

.admin-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-active input {
  width: auto;
  min-height: 0;
}

.admin-muted {
  color: var(--muted);
  font-weight: 700;
}

.admin-store-controls {
  display: grid;
  gap: 10px;
}

.admin-import summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--wingstop-green);
}

.admin-import textarea {
  margin-top: 8px;
}

/* Modal (change password) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 20, 18, 0.5);
}

.modal-card {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 14px;
  background: var(--wingstop-white);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 0;
  color: var(--wingstop-green);
}

/* Apply-scope selector */
.scope-row {
  display: grid;
  gap: 6px;
}

/* Admin: Jira sync panel */
.admin-jira-status {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--wingstop-white);
  margin-bottom: 14px;
}

.admin-jira-status > div {
  display: grid;
  gap: 2px;
}

.admin-jira-status span,
.admin-jira-status strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--wingstop-green);
}

.admin-jira-status p {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-jira-status button {
  margin-left: auto;
  width: auto;
}

.admin-row-jira {
  grid-template-columns: 80px 80px 130px minmax(0, 1fr);
}
