/* agenda-seb — light & airy, garden-green accent. */
:root {
  --green: #2f8f4e;
  --green-700: #246e3d;
  --green-tint: #eaf6ee;
  --amber: #c98a16;
  --amber-tint: #fdf3e3;
  --blue: #2563eb;
  --blue-tint: #eaf0fd;
  --ink: #1c2430;
  --ink-soft: #475065;
  --muted: #8a93a5;
  --bg: #fbfcfb;
  --panel: #ffffff;
  --line: #e9ecef;
  --line-strong: #dde1e6;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.09);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
a { color: var(--green-700); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 20px 18px 60px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 34px; height: 34px; display: grid; place-items: center; background: var(--green-tint); border-radius: 9px; font-size: 19px; }
.brand h1 { font-size: 17px; margin: 0; font-weight: 700; }
.brand .sub { font-size: 12px; color: var(--muted); }

/* Buttons */
button {
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  border-radius: 8px; padding: 7px 13px; transition: background .14s, border-color .14s, transform .05s;
}
button:hover:not(:disabled) { background: #f4f6f4; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
button.primary:hover:not(:disabled) { background: var(--green-700); border-color: var(--green-700); }
button.danger { color: #b3261e; border-color: #f0c8c5; }
button.danger:hover:not(:disabled) { background: #fdeceb; }
button.small { padding: 4px 9px; font-size: 12px; border-radius: 7px; }

/* Cards / panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pill.green { background: var(--green-tint); color: var(--green-700); }
.pill.amber { background: var(--amber-tint); color: var(--amber); }
.pill.blue { background: var(--blue-tint); color: var(--blue); }
.pill.grey { background: #eef0f2; color: var(--muted); }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; }
.cal-head .title { font-size: 16px; font-weight: 700; min-width: 190px; text-align: center; text-transform: capitalize; }
.dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.dow span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cell { border: 1px solid var(--line); border-radius: 10px; min-height: 78px; padding: 5px; background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.cell.out { background: #fafbfc; opacity: .55; }
.cell .dnum { font-size: 12px; font-weight: 600; color: var(--ink-soft); padding: 0 2px; }
.cell.today .dnum { color: var(--green-700); }
.cell.today { border-color: var(--green); }

/* Half-day chips */
.hd { flex: 1; display: flex; align-items: center; gap: 5px; border: 1px dashed var(--line-strong); border-radius: 7px; padding: 3px 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; background: none; text-align: left; min-height: 26px; transition: background .12s, border-color .12s; }
.hd .tag { font-size: 9.5px; font-weight: 800; color: var(--muted); letter-spacing: .5px; }
.hd:hover { border-color: var(--green); color: var(--green-700); }
.hd.closed { cursor: default; opacity: .6; }
.hd.closed:hover { border-color: var(--line-strong); color: var(--muted); }
.hd.open { border-style: solid; background: var(--green-tint); border-color: #bfe3cb; color: var(--green-700); }
.hd.pending { border-style: solid; background: var(--amber-tint); border-color: #ecd4a3; color: var(--amber); }
.hd.confirmed { border-style: solid; background: var(--blue-tint); border-color: #c3d4fb; color: var(--blue); }
.hd.declined { border-style: solid; background: #fdeceb; border-color: #f0c8c5; color: #b3261e; }
.hd .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; flex-wrap: wrap; }
.item .name { font-weight: 600; }
.item .meta { font-size: 12px; color: var(--muted); }
.item .msg { width: 100%; font-size: 12.5px; color: var(--ink-soft); background: var(--bg); border-radius: 7px; padding: 6px 8px; }
.empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.linkbox { font-size: 12px; font-family: ui-monospace, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; overflow-x: auto; white-space: nowrap; max-width: 100%; }

/* Inputs */
input[type=text], textarea {
  font-family: inherit; font-size: 13.5px; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 143, 78, .12); }
textarea { resize: vertical; min-height: 56px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }

/* Provider add row: inputs grow, button stays compact; stacks on narrow screens. */
.provider-add { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.provider-add input { flex: 1 1 200px; min-width: 0; }
.provider-add button { flex: 0 0 auto; }

/* Legend */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-soft); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-strong); }

/* Dialog */
dialog { border: none; border-radius: 14px; padding: 0; width: 420px; max-width: calc(100vw - 32px); box-shadow: var(--shadow-md); }
dialog::backdrop { background: rgba(20, 32, 24, .4); }
dialog .body { padding: 20px; }
dialog h3 { margin: 0 0 10px; font-size: 16px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b3261e; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .wrap { padding: 14px 11px 48px; }
  .panel { padding: 13px; border-radius: 12px; margin-bottom: 13px; }
  .top { margin-bottom: 14px; }
  .brand h1 { font-size: 16px; }
  .brand .logo { width: 30px; height: 30px; font-size: 17px; }

  /* Calendar: keep the 7-col month, but compact. Chip text moves to the tap
     dialog; the chip colour + AM/PM tag carry the state. */
  .grid, .dow { gap: 4px; }
  .cell { min-height: 62px; padding: 3px; border-radius: 8px; gap: 3px; }
  .cell .dnum { font-size: 11px; padding: 0; }
  .dow span { font-size: 10px; }
  .hd { padding: 2px 3px; min-height: 25px; justify-content: center; gap: 2px; }
  .hd .who { display: none; }
  .hd .tag { font-size: 9px; }
  .cal-head { gap: 10px; }
  .cal-head .title { font-size: 15px; min-width: 140px; }
  .legend { gap: 8px 14px; font-size: 11px; margin-top: 8px; }

  /* List items: name on row 1, action buttons share row 2, message on row 3. */
  .item { gap: 7px 8px; padding: 9px; }
  .item .spacer { flex-basis: 100%; height: 0; }
  .item button.small { flex: 1 1 0; }
  .item .linkbox { order: 9; }

  .provider-add button { flex: 1 1 100%; }
  dialog { width: 100%; }
}

@media (max-width: 380px) {
  .grid, .dow { gap: 3px; }
  .cell { min-height: 56px; }
  .hd .tag { font-size: 8.5px; }
  .cal-head .title { min-width: 120px; font-size: 14px; }
}
