:root {
  --navy: #0f1f3d; --navy-2: #172b52; --brass: #c9a24a; --brass-2: #e0bd6a;
  --bg: #f4f5f8; --card: #ffffff; --ink: #1b2233; --muted: #6b7280; --line: #e3e6ec;
  --red: #c0392b; --red-bg: #fdecea; --amber: #b7791f; --amber-bg: #fff6e0; --green: #1e7f4f; --green-bg: #e6f6ec; --blue: #1f4e79; --blue-bg: #e8f0f8;
  --radius: 10px; --shadow: 0 1px 2px rgba(15,31,61,.06), 0 4px 14px rgba(15,31,61,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Lato, system-ui, sans-serif; }
h1, h2, h3, h4 { font-family: Montserrat, system-ui, sans-serif; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
a { color: var(--blue); text-decoration: none; cursor: pointer; }
button, input, select, textarea { font: inherit; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; } .right { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 12px; }

/* layout */
#app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #dfe4ee; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { font-family: Montserrat; font-weight: 800; font-size: 18px; color: #fff; padding: 4px 10px 18px; }
.brand span { color: var(--brass); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #c8d0df; font-weight: 700; font-size: 14px; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.active { background: var(--brass); color: var(--navy); }
.nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #7f8ba3; padding: 14px 10px 4px; }
.side .me { margin-top: auto; padding: 10px; border-top: 1px solid #2a3b62; font-size: 13px; }
.side .me b { color: #fff; display: block; }
.main { padding: 22px 28px 60px; max-width: 1400px; width: 100%; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar h1 { flex: 1; }

/* cards & lists */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.card + .card { margin-top: 14px; }
.card h2, .card h3 { margin-bottom: 10px; }
.grid { display: grid; gap: 14px; } .grid.c2 { grid-template-columns: 1fr 1fr; } .grid.c3 { grid-template-columns: repeat(3, 1fr); } .grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 1000px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { #app { grid-template-columns: 1fr; } .side { position: static; height: auto; } .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } .main { padding: 16px; } }

.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); border-left: 5px solid var(--line); }
.stat .n { font: 800 28px Montserrat; } .stat .l { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.stat.red { border-color: var(--red); } .stat.amber { border-color: var(--amber); } .stat.green { border-color: var(--green); } .stat.blue { border-color: var(--blue); } .stat.brass { border-color: var(--brass); }

.task { display: flex; align-items: flex-start; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .chk { width: 22px; height: 22px; border: 2px solid #b8bfcc; border-radius: 6px; background: #fff; cursor: pointer; flex: none; margin-top: 1px; display: grid; place-items: center; color: #fff; font-size: 14px; }
.task .chk:hover { border-color: var(--green); }
.task.done .chk { background: var(--green); border-color: var(--green); }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task .title { font-weight: 700; cursor: pointer; }
.task .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; align-items: center; }
.task .due { margin-left: auto; text-align: right; flex: none; font-size: 13px; font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--line); color: #444; white-space: nowrap; }
.pill.red { background: var(--red-bg); color: var(--red); } .pill.amber { background: var(--amber-bg); color: var(--amber); } .pill.green { background: var(--green-bg); color: var(--green); } .pill.blue { background: var(--blue-bg); color: var(--blue); } .pill.navy { background: var(--navy); color: #fff; }
.pill.brasspill { background: #f5ead0; color: #7a5a12; }
.pill.hi { background: var(--red-bg); color: var(--red); }
.day-head { font: 700 12px Montserrat; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 6px 4px; border-bottom: 2px solid var(--line); }
.day-head.today { color: var(--brass); border-color: var(--brass); } .day-head.overdue { color: var(--red); border-color: var(--red); }
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* buttons & forms */
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 13px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: #b8bfcc; background: #fafbfd; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); } .btn.primary:hover { background: var(--navy-2); }
.btn.brass { background: var(--brass); color: var(--navy); border-color: var(--brass); }
.btn.danger { color: var(--red); } .btn.sm { padding: 4px 9px; font-size: 12.5px; } .btn.ghost { border-color: transparent; background: transparent; }
label.f { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=color], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brass-2); border-color: var(--brass); }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 12px; }
.days { display: flex; gap: 6px; } .days label { flex: 1; text-align: center; padding: 7px 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 13px; }
.days input { display: none; } .days input:checked + span { display: block; } .days label.on { background: var(--navy); color: #fff; border-color: var(--navy); }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); font-size: 14px; } th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--green); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; } .tabs a { padding: 8px 12px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; } .tabs a.active { color: var(--navy); border-color: var(--brass); }

/* modal */
#modal-root:empty { display: none; }
.overlay { position: fixed; inset: 0; background: rgba(15,31,61,.45); display: grid; place-items: center; z-index: 50; padding: 16px; overflow: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 92vh; overflow: auto; }
.modal.wide { max-width: 860px; }
.modal h2 { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 700; opacity: 0; transition: .2s; pointer-events: none; z-index: 99; }
#toast.show { opacity: 1; } #toast.err { background: var(--red); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .h { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 4px; }
.cal .d { min-height: 96px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font-size: 12px; }
.cal .d.dim { background: transparent; opacity: .5; } .cal .d.today { border-color: var(--brass); border-width: 2px; }
.cal .d .n { font-weight: 700; margin-bottom: 3px; } .cal .item { padding: 1px 5px; border-radius: 4px; margin: 1px 0; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal .item.done { opacity: .45; text-decoration: line-through; } .cal .item.ev { background: var(--brass) !important; color: var(--navy); font-weight: 700; }
.cal .item.over { outline: 2px solid var(--red); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--navy); grid-column: 1 / -1; }
.login .card { width: 380px; }
.client-card { border-top: 5px solid var(--line); cursor: pointer; } .client-card:hover { transform: translateY(-1px); }
.checklist-row { display: grid; grid-template-columns: 1fr 110px 160px 110px 34px; gap: 6px; align-items: center; margin-bottom: 6px; }
.progress-txt { font-size: 12px; color: var(--muted); }
.comment { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kbd { font-size: 11px; background: var(--line); padding: 1px 5px; border-radius: 4px; }
