*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #faf9f7;
  --card:        #ffffff;
  --ink:         #2c2c2c;
  --muted:       #7a7a7a;
  --leaf:        #5c8a4a;
  --leaf-light:  #e8f2e4;
  --leaf-mid:    rgba(92,138,74,.15);
  --amber:       #b45309;
  --amber-light: #fef3c7;
  --red:         #dc2626;
  --red-light:   #fef2f2;
  --border:      #e7e5e4;
  --radius:      18px;
  --radius-sm:   10px;
  --shadow:      0 1px 4px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ---- Layout ---- */
.wrap     { max-width: 760px; margin: 0 auto; padding: 32px 16px; }
.wrap-sm  { max-width: 440px; margin: 0 auto; padding: 32px 16px; }
.wrap-lg  { max-width: 1000px; margin: 0 auto; padding: 32px 16px; }

/* ---- Card ---- */
.card {
  background: var(--card);
  border: 1px solid rgba(245,213,130,.5);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

/* ---- Header ---- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 18px; font-weight: 700; }
.page-header p  { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .15s, background .15s;
}
.btn:hover       { opacity: .85; }
.btn-primary     { background: var(--leaf); color: #fff; }
.btn-dark        { background: var(--ink);  color: #fff; }
.btn-outline     { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.btn-outline-red { background: #fff; color: var(--red); border: 1px solid #fca5a5; }
.btn-sm          { padding: 7px 16px; font-size: 13px; }
.btn-block       { display: block; width: 100%; text-align: center; padding: 14px; }
.btn:disabled    { opacity: .45; cursor: not-allowed; }

/* ---- Forms ---- */
.form-group       { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: box-shadow .15s;
  background: #fff;
}
.form-control:focus { box-shadow: 0 0 0 3px rgba(92,138,74,.25); border-color: var(--leaf); }
.form-control[readonly] { background: #f5f4f2; color: var(--muted); }
.form-grid { display: grid; gap: 12px; }
@media (min-width: 480px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---- Alerts ---- */
.alert        { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.alert-error  { background: var(--red-light);   color: var(--red); }
.alert-success{ background: var(--leaf-light);  color: #1a4d0e; }
.alert-info   { background: var(--amber-light); color: var(--amber); }

/* ---- Calendar ---- */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-nav .month-title { font-size: 16px; font-weight: 600; }
.cal-wrap {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(245,213,130,.5);
  background: #fff;
  box-shadow: var(--shadow);
}
.cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fffbf0;
  border-bottom: 1px solid var(--border);
}
.cal-head-cell {
  text-align: center;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.cal-body { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 56px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: default;
  user-select: none;
  transition: background .12s;
  background: #fff;
}
.cal-cell.other-month { color: #ccc; }
.cal-cell.past        { color: #ccc; cursor: not-allowed; }
.cal-cell.open-day {
  background: var(--leaf-light);
  color: var(--leaf);
  font-weight: 700;
  cursor: pointer;
}
.cal-cell.open-day:hover { background: #d5ebcc; }
.cal-cell.open-day .day-label {
  font-size: 10px;
  font-weight: 400;
  color: var(--leaf);
  margin-top: 1px;
}
/* admin toggle */
.cal-cell.open-day-admin {
  background: var(--leaf-light);
  color: var(--leaf);
  font-weight: 700;
  cursor: pointer;
}
.cal-cell.open-day-admin:hover { background: #d5ebcc; }
.cal-cell.closed-day {
  cursor: pointer;
  color: var(--ink);
}
.cal-cell.closed-day:hover { background: #f5f4f2; }

/* ---- Legend ---- */
.legend { display: flex; gap: 20px; margin-top: 10px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-dot {
  width: 12px; height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.legend-dot.open  { background: var(--leaf-light); border-color: var(--leaf); }
.legend-dot.closed{ background: #fff; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.35);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
@media (min-width: 600px) { .modal-overlay { align-items: center; } }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.modal-sub   { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; text-align: center; }

/* ---- Table ---- */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th { background: #fffbf0; color: var(--muted); font-size: 13px; font-weight: 600; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; font-size: 14px; border-bottom: 1px solid #f5f4f2; }
tr:last-child td { border-bottom: none; }
.td-empty { text-align: center; padding: 36px; color: var(--muted); }

/* ---- Filter bar ---- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  background: #fff; border: 1px solid rgba(245,213,130,.5);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.filter-bar label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.filter-bar input[type=date] {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none;
}
.filter-bar input[type=date]:focus { box-shadow: 0 0 0 3px rgba(92,138,74,.25); }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; background: #edece9; border-radius: 12px; padding: 4px; width: fit-content; margin-bottom: 20px; }
.tab {
  padding: 8px 20px; border-radius: 9px; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; background: transparent; color: var(--muted);
  text-decoration: none; transition: background .12s, color .12s;
}
.tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.tab:hover:not(.active) { color: var(--ink); }

/* ---- Misc ---- */
.text-muted   { color: var(--muted); }
.text-sm      { font-size: 13px; }
.text-center  { text-align: center; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.flex-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge {
  display: inline-block; padding: 2px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-green  { background: var(--leaf-light);  color: var(--leaf); }
.badge-red    { background: var(--red-light);   color: var(--red); }
.badge-amber  { background: var(--amber-light); color: var(--amber); }
