:root {
  --ink: #2A2823;
  --paper: #FBF9F4;
  --accent: #3E5641;
  --line: #E4DFD2;
  --muted: #8A8578;
  --closed: #B0AB9C;
  --temp: #B7773A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--accent); }

/* ---------- ログイン画面 ---------- */
.login-body {
  display: flex;
  min-height: 100vh;
}

.login-left {
  width: 40%;
  min-width: 280px;
  background: var(--accent);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--paper);
}

.login-left-copy h1 {
  font-family: 'Shippori Mincho', serif;
  font-weight: 500;
  font-size: 34px;
  line-height: 1.45;
  margin: 0 0 16px;
}

.login-left-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: rgba(251, 249, 244, 0.82);
  max-width: 320px;
}

.login-left-foot {
  border-top: 1px solid rgba(251, 249, 244, 0.25);
  padding-top: 20px;
  font-size: 13px;
  color: rgba(251, 249, 244, 0.68);
}

.login-right {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-form h2 {
  font-family: 'Shippori Mincho', serif;
  font-weight: 500;
  font-size: 24px;
  margin: 0 0 6px;
}

.login-form .sub { margin: 0; font-size: 13px; color: var(--muted); }

.login-form .field { display: flex; flex-direction: column; gap: 8px; }
.login-form label { font-size: 13px; color: #5A564A; }

.login-form input[type="text"],
.login-form input[type="password"] {
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.login-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.login-form button[type="submit"] {
  height: 50px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.login-form .hint { margin: 0; font-size: 12px; color: var(--closed); text-align: center; }
.login-form .error { margin: 0; font-size: 13px; color: #B23B3B; background: #F8EAEA; padding: 10px 12px; border-radius: 6px; }

/* ---------- 予約カレンダー画面 ---------- */
.cal-body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.cal-header {
  flex-shrink: 0;
  height: 56px;
  box-sizing: border-box;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand { display: flex; align-items: center; gap: 9px; font-family: 'Shippori Mincho', serif; font-weight: 500; font-size: 16px; }
.brand .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); display: inline-block; }

.staff { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.staff a { text-decoration: none; }

.cal-nav {
  flex-shrink: 0;
  height: 40px;
  box-sizing: border-box;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.navbtn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5A564A;
  font-size: 13px;
  text-decoration: none;
  flex-shrink: 0;
}

.cal-nav .range { font-size: 13px; font-weight: 500; }

.cal-scroll { flex-grow: 1; overflow: auto; position: relative; -webkit-overflow-scrolling: touch; }
.cal-inner { position: relative; }

.cal-daysrow { display: flex; position: sticky; top: 0; z-index: 3; background: var(--paper); }

.corner {
  width: 44px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--paper);
}

.dayhead {
  width: 86px;
  flex-shrink: 0;
  box-sizing: border-box;
  border-right: 1px solid #EFEAE0;
  border-bottom: 1px solid var(--line);
  text-align: center;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dayhead .wd { font-size: 11px; color: var(--muted); }
.dayhead .dd { font-size: 15px; font-weight: 500; }
.dayhead.closed .wd, .dayhead.closed .dd { color: var(--closed); }
.dayhead.temp-closed .wd, .dayhead.temp-closed .dd { color: var(--temp); }
.dayhead.today { background: var(--accent); border-radius: 8px 8px 0 0; }
.dayhead.today .wd { color: rgba(251, 249, 244, 0.75); }
.dayhead.today .dd { color: var(--paper); font-weight: 600; }

.cal-bodyrow { display: flex; }

.timecol {
  width: 44px;
  flex-shrink: 0;
  box-sizing: border-box;
  border-right: 1px solid var(--line);
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--paper);
}

.hourlabel { position: absolute; right: 4px; font-size: 11px; color: var(--muted); }

.daycol {
  width: 86px;
  flex-shrink: 0;
  box-sizing: border-box;
  border-right: 1px solid #EFEAE0;
  position: relative;
  background-image:
    repeating-linear-gradient(to bottom, #E9E4D7 0, #E9E4D7 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(to bottom, #F1EDE2 0, #F1EDE2 1px, transparent 1px, transparent 32px);
}

.daycol.closed-col { background: repeating-linear-gradient(135deg, #EFEAE0 0 8px, #F5F1E7 8px 16px); }
.daycol.temp-closed-col { background: repeating-linear-gradient(135deg, rgba(183,119,58,0.12) 0 8px, rgba(183,119,58,0.03) 8px 16px); }

.closed-label {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  font-size: 11px; color: var(--closed); white-space: nowrap;
}
.temp-closed-col .closed-label { color: var(--temp); }

.irregular-add, .add-slot {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 24px;
  border-radius: 999px;
  border: 1px dashed var(--closed);
  background: transparent;
  color: var(--muted);
  font-size: 14px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}

.temp-closed-col .irregular-add { border-color: var(--temp); color: var(--temp); }

.add-slot {
  position: sticky;
  top: 8px;
  border: 1px dashed var(--line);
  color: var(--accent);
}

.resv-card {
  position: absolute;
  left: 2px; right: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  box-sizing: border-box;
  padding: 3px 5px;
  font-size: 9px;
  overflow: hidden;
}

.resv-time { font-weight: 500; }
.irr-badge { margin-left: 4px; font-size: 8px; color: var(--temp); font-weight: 500; }
.resv-meta { display: flex; align-items: center; justify-content: space-between; color: #5A564A; gap: 4px; }
.resv-meta .tag { font-size: 8px; padding: 1px 5px; border-radius: 999px; white-space: nowrap; }

.resv-delete {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px;
  border: none; background: transparent;
  color: var(--muted); font-size: 11px; line-height: 1;
  cursor: pointer; padding: 0;
}
.resv-delete:hover { color: #B23B3B; }

.resv-buffer {
  position: absolute; left: 2px; right: 2px;
  border-radius: 3px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bc) 16%, transparent) 0 5px, transparent 5px 10px);
}

.cal-legend {
  flex-shrink: 0;
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  overflow-x: auto;
}
.legend-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-item i { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }

/* ---------- 予約追加モーダル ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(42, 40, 35, 0.4);
  align-items: center; justify-content: center;
  z-index: 10;
  padding: 16px;
  display: none;
}
.modal-backdrop:not([hidden]) {
  display: flex;
}
.modal {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
}
.modal h3 { margin: 0 0 16px; font-family: 'Shippori Mincho', serif; font-weight: 500; font-size: 18px; }
.modal .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.modal .field.checkbox { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.modal label { font-size: 13px; color: #5A564A; }
.modal input[type="text"], .modal input[type="time"], .modal input[type="number"], .modal select {
  height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit;
}
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions button { flex: 1; height: 44px; border-radius: 6px; font-size: 14px; font-family: inherit; cursor: pointer; }
#cancelBtn { border: 1px solid var(--line); background: #fff; color: var(--ink); }
#resvForm button[type="submit"] { border: none; background: var(--accent); color: var(--paper); }
.form-error { font-size: 12px; color: #B23B3B; background: #F8EAEA; padding: 8px 10px; border-radius: 6px; margin: 0 0 14px; }

/* ---------- 設定画面 ---------- */
.settings-body { background: var(--paper); min-height: 100vh; }

.settings-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.page-title {
  font-family: 'Shippori Mincho', serif;
  font-weight: 500;
  font-size: 22px;
  margin: 8px 0 20px;
}

.flash-ok, .flash-error {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.flash-ok { background: #EAF1EA; color: #35502F; }
.flash-error { background: #F8EAEA; color: #B23B3B; }

.settings-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.settings-card h2 {
  font-family: 'Shippori Mincho', serif;
  font-weight: 500;
  font-size: 17px;
  margin: 0 0 6px;
}

.card-desc { font-size: 13px; color: var(--muted); margin: 0 0 16px; line-height: 1.7; }

.settings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.settings-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.settings-table td { padding: 8px; border-bottom: 1px solid #F1EDE2; vertical-align: middle; }
.settings-table .empty { color: var(--closed); font-size: 13px; padding: 12px 8px; }

.swatch { width: 10px; height: 10px; border-radius: 999px; display: inline-block; margin-right: 6px; }

.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form select {
  height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-family: inherit;
}
.inline-form button {
  height: 34px; padding: 0 14px; border: none; border-radius: 6px;
  background: var(--accent); color: var(--paper); font-size: 12px; cursor: pointer; font-family: inherit;
}

.link-btn {
  border: none; background: transparent; color: #B23B3B; font-size: 12px; cursor: pointer; padding: 0; font-family: inherit;
}

.menu-group { margin-bottom: 20px; }
.menu-group h3 {
  font-size: 14px; font-weight: 500; display: flex; align-items: center; margin: 0 0 8px;
}

.add-form { border-top: 1px dashed var(--line); padding-top: 16px; margin-top: 8px; }
.add-form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.add-form .field { display: flex; flex-direction: column; gap: 6px; }
.add-form label { font-size: 12px; color: #5A564A; }
.add-form input, .add-form select {
  height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-family: inherit; min-width: 120px;
}
.add-btn {
  height: 38px; padding: 0 16px; border: none; border-radius: 6px;
  background: var(--accent); color: var(--paper); font-size: 13px; cursor: pointer; font-family: inherit; white-space: nowrap;
}