:root {
  --accent: #1f6f8b; --ink: #1f2933; --muted: #6b7680; --line: #e3e6e8; --bg: #f5f5f3;
  --good: #1e7b4f; --bad: #b42318;
  --c-confirmed: #2f8f5b; --c-awaiting: #d9a23a; --c-pending: #8aa9c4; --c-conflict: #b42318; --c-ext: #6c7cb4; --c-man: #9aa1a8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 12px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 56px; flex-wrap: wrap; }
.brand { font-size: 17px; }
.prop-name { color: var(--muted); }
.top nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--ink); padding: 6px 10px; border-radius: 6px; }
.top nav a.on { background: #eef4f6; color: var(--accent); }
.top nav a.logout { color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.good { color: var(--good); } .bad { color: var(--bad); }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash-ok { background: #e7f4ec; color: #14532d; } .flash-error { background: #fdecea; color: var(--bad); }

.btn, .btn-ghost, .btn-danger { font: inherit; border-radius: 8px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn { background: var(--accent); color: #fff; border: 0; font-weight: 600; }
.btn-ghost { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost.small { padding: 5px 10px; font-size: 13px; }
.btn-danger { background: #fff; color: var(--bad); border: 1px solid var(--bad); }
.link-danger { background: none; border: 0; color: var(--bad); cursor: pointer; font: inherit; text-decoration: underline; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid #cfd4d8; border-radius: 7px; background: #fff; }
input.short { width: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.form-grid .wide, .row-form .wide { grid-column: 1 / -1; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.row-form label.wide { flex: 1 1 100%; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 600; padding: 0 6px; }
.inline { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
label.radio { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--ink); font-size: 14px; }
label.copy { margin-top: 8px; } label.copy input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
textarea.code { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.subnav { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; font-size: 14px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 6px 8px; }
.tbl td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
.kv { border-collapse: collapse; font-size: 14px; width: 100%; }
.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 12px 6px 0; width: 170px; vertical-align: top; }
.kv td { padding: 6px 0; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 20px; vertical-align: middle; background: #eee; }
.st-confirmed { background: #e3f3ea; color: var(--good); } .st-awaiting_transfer { background: #fbf0d9; color: #8a5a00; }
.st-conflict { background: #fdecea; color: var(--bad); } .st-cancelled, .st-expired { background: #eee; color: var(--muted); }
.feeds, .events { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.feeds li, .events li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { margin: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal .wd { text-align: center; font-size: 12px; color: var(--muted); }
.day { min-height: 64px; border-radius: 6px; background: #fafafa; border: 1px solid #eee; padding: 4px 5px; position: relative; font-size: 12px; overflow: hidden; }
.day.out { opacity: .45; }
.day.today { border-color: var(--accent); }
.day .dn { font-weight: 600; font-size: 12.5px; }
.day .lbl { display: block; margin-top: 4px; color: #fff; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day.busy { color: #fff; border-color: transparent; }
.day .warn { position: absolute; top: 3px; right: 5px; background: var(--bad); color: #fff; border-radius: 50%; width: 16px; height: 16px; text-align: center; line-height: 16px; font-weight: 700; }
.dir-confirmed, .sw.dir-confirmed { background: var(--c-confirmed); }
.dir-awaiting_transfer, .sw.dir-awaiting_transfer { background: var(--c-awaiting); }
.dir-pending, .sw.dir-pending { background: var(--c-pending); }
.dir-conflict, .sw.dir-conflict { background: var(--c-conflict); }
.ext, .sw.ext { background: var(--c-ext); }
.man, .sw.man { background: var(--c-man); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -8px; vertical-align: middle; }
.tbl .sw { margin-right: 0; }
.multi-sw { background: var(--bad); color: #fff; font-size: 10px; text-align: center; line-height: 12px; border-radius: 50%; }

.login { display: grid; place-items: center; min-height: 100vh; }
.login-card { width: 340px; display: flex; flex-direction: column; gap: 12px; }
