/* Add-entry page (index.html). Loads after css/common.css. */

/* --- Differences from the shared rules ------------------------------------ */
.panel { padding: 26px; }
input, select { transition: border-color .12s ease; }
/* index.html stretches the Save button full width. */
button.primary { width: 100%; margin-top: 24px; }

/* --- Page header and columns ---------------------------------------------- */
.col-head {
  font-size: 13px;
  font-weight: 650;
  margin: 0 0 4px;
}
.col-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

/* Page header (full width, above the columns, so both align) */
.page-header { max-width: 1240px; margin: 0 auto 24px; }
.page-header .subhead { margin-bottom: 0; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 14px; font-weight: 650; }
.panel-note { font-size: 12px; color: var(--ink-soft); }
.pf-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 30px 0 12px;
}

/* Two-column layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: 40px;
  max-width: 1240px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; max-width: 620px; gap: 28px; }
}

/* Tables */
td.date { white-space: nowrap; color: var(--ink-soft); }
td.task { color: var(--ink-soft); line-height: 1.4; }

/* Today panel */
.today-panel { margin-bottom: 20px; padding: 20px 22px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.stat-row:last-child { border-bottom: none; padding-bottom: 0; }
.stat-label { font-size: 13px; color: var(--ink-soft); }
.stat-value {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-value .unit { font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-left: 3px; }
.stat-row.headline .stat-value { font-size: 22px; color: var(--accent); }
.stat-row.headline { padding-bottom: 13px; }
.stat-value.over { color: var(--error); }

/* Reminder setting */
.reminder-setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: 0;
  cursor: default;
}
.reminder-setting .stat-label { font-weight: 400; }
.reminder-input { display: flex; align-items: center; gap: 6px; }
.reminder-input input {
  width: 64px;
  padding: 5px 8px;
  font-size: 13.5px;
  text-align: right;
}
.reminder-input .unit { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.stat-value.warn { color: #b3741f; }
.reminder-panel { margin-top: 16px; padding: 20px 22px; }
.reminder-input input:disabled,
.switch input:disabled + .slider { opacity: .45; cursor: default; }
.remind-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #8a5a17;
  background: #fbf1e3;
  border-radius: 7px;
  padding: 8px 10px;
}

/* Lunch toggle */
.lunch-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: 0;
  cursor: pointer;
}
.lunch-toggle .stat-label { font-weight: 400; }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider {
  position: absolute;
  inset: 0;
  background: #cfd6d2;
  border-radius: 999px;
  transition: background .15s ease;
}
.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .15s ease;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Prefills */
.pf-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pf-list .pf-empty { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .pf-list { grid-template-columns: 1fr; }
}
.pf-btn {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.pf-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.pf-btn .pf-label { display: block; font-weight: 600; }
.pf-btn .pf-detail {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.pf-empty { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
