:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1d2433; --muted: #6b7385; --line: #e3e6ec;
  --brand: #1f4e79; --brand-2: #2f6da3; --ok: #1e7b4a; --ok-bg: #e6f4ec;
  --bad: #a3322b; --bad-bg: #fbeaea; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand-2); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 18px; }
main { padding-top: 24px; padding-bottom: 60px; }
h1 { font-size: 1.6rem; margin: 0 0 16px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

header { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 58px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; margin-right: auto; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a, nav button { color: #dfe9f5; text-decoration: none; padding: 7px 11px; border-radius: 6px; background: none; border: 0; font: inherit; cursor: pointer; }
nav a:hover, nav button:hover, nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  nav { display: none; position: absolute; top: 58px; left: 0; right: 0; background: var(--brand); flex-direction: column; padding: 8px 18px 14px; }
  nav.open { display: flex; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.btn { display: inline-block; background: var(--brand-2); color: #fff; border: 0; border-radius: 7px; padding: 9px 15px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand); }
.btn.ghost { background: #fff; color: var(--brand-2); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.cash { background: #00b244; }

label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 4px; }
input, textarea, select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: #fff; }
input[type=checkbox] { width: auto; transform: scale(1.25); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 12px; }
.fields-2 { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .fields-2 { grid-template-columns: 1fr; } }

.auth { max-width: 400px; margin: 60px auto; }
.auth h1 { text-align: center; }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #e8eef6; color: var(--brand); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

.member-card h3 { margin: 0 0 2px; font-size: 1.05rem; }
.member-card .biz { color: var(--muted); margin-bottom: 8px; }
.member-card p { margin: 4px 0; font-size: .925rem; word-break: break-word; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 99px; text-decoration: none; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.tabs a.active { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cal .dow { background: #eef1f5; font-size: .78rem; font-weight: 700; text-align: center; padding: 6px 0; color: var(--muted); }
.cal .day { min-height: 92px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px; font-size: .8rem; }
.cal .day:nth-child(7n+1) { border-left: 0; }
.cal .day.other { background: #fafbfc; color: #b5bac5; }
.cal .day.today .num { background: var(--brand-2); color: #fff; border-radius: 99px; padding: 0 6px; }
.cal .ev { display: block; background: #e8eef6; color: var(--brand); border-radius: 4px; padding: 2px 4px; margin-top: 3px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; width: 100%; text-align: left; font: inherit; }
@media (max-width: 560px) { .cal .day { min-height: 62px; } .cal .ev { font-size: 0; height: 8px; padding: 0; } }

.event-item { display: flex; gap: 14px; align-items: flex-start; }
.date-chip { min-width: 58px; text-align: center; background: var(--brand); color: #fff; border-radius: 8px; padding: 6px 4px; line-height: 1.15; }
.date-chip .m { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.date-chip .d { font-size: 1.4rem; font-weight: 700; }

.modal { position: fixed; inset: 0; background: rgba(20,25,35,.5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 60; }
.toast.err { background: var(--bad); }
.md h2, .md h3 { margin-top: 1.2em; }
.big-status { font-size: 1.3rem; font-weight: 700; }
