/* Ureshii Kazoku - warm, plain, and readable on a phone.
   Admin screens deliberately use larger text and bigger tap targets. */

:root {
  --bg: #fdf8f3;
  --surface: #ffffff;
  --ink: #2a2118;
  --ink-soft: #6b5d4f;
  --line: #e8ddd0;
  --accent: #b4441f;
  --accent-soft: #fbeee7;
  --ok: #2f6b3d;
  --ok-soft: #e8f3ea;
  --warn: #8a5a12;
  --warn-soft: #fdf1da;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(42, 33, 24, .08), 0 4px 14px rgba(42, 33, 24, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px 56px; }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin-bottom: 24px;
}
.site-header .wrap {
  padding-bottom: 0;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { font-size: 1.35rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.brand small { display: block; font-size: .8rem; font-weight: 400; color: var(--ink-soft); }
.site-header nav { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-quiet { color: var(--ink-soft); font-weight: 500; }
.btn-danger { color: var(--accent); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-big { padding: 16px 22px; font-size: 1.1rem; border-radius: 14px; }

/* ---------- cards & grid ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-body { padding: 16px; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card p { margin: 0 0 12px; color: var(--ink-soft); font-size: .95rem; }

.photo {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  background: var(--accent-soft);
}
.photo-empty {
  width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 2rem;
}

/* ---------- pills & flashes ---------- */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; background: var(--accent-soft); color: var(--accent);
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-muted { background: #eee8e0; color: var(--ink-soft); }

.flash {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px;
  background: var(--ok-soft); color: var(--ok); border: 1px solid #cfe3d4; font-weight: 600;
}
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: #ecd9b4; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=password], input[type=date],
textarea, select {
  width: 100%; padding: 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 18px; }
.hint { font-weight: 400; font-size: .85rem; color: var(--ink-soft); margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- nutrition ---------- */
.nutrition { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.nutrition h4 { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.nutrition dl { display: grid; grid-template-columns: 1fr auto; margin: 0; padding: 8px 16px 14px; }
.nutrition dt { padding: 5px 0; color: var(--ink-soft); }
.nutrition dd { padding: 5px 0; margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- admin ---------- */
.admin { font-size: 1.05rem; }
.admin .wrap { max-width: 880px; }
.admin h1 { font-size: 1.7rem; }
.admin .tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 26px; }
.tile {
  display: block; padding: 20px; text-align: center; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); font-weight: 700; box-shadow: var(--shadow);
}
.tile:hover { border-color: var(--accent); }
.tile .num { display: block; font-size: 2rem; color: var(--accent); line-height: 1.2; }
.tile .sub { display: block; font-weight: 500; font-size: .9rem; color: var(--ink-soft); }

.stock-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stock-form input[type=number] { width: 92px; }

.suggestion {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.suggestion .headline { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.suggestion .why { color: var(--ink-soft); font-size: .93rem; }

/* Chart: plain CSS bars, no library needed. */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 150px;
         padding: 14px; background: var(--surface); border: 1px solid var(--line);
         border-radius: var(--radius); overflow-x: auto; }
.chart .bar { flex: 1 0 8px; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.chart .bar.empty { background: var(--line); }

.muted { color: var(--ink-soft); }
.stack > * + * { margin-top: 14px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.inline-form { display: inline; }

@media (max-width: 560px) {
  .site-header .wrap { gap: 10px; }
  .site-header nav { width: 100%; margin-left: 0; }
  .btn-big { width: 100%; text-align: center; }
}
