/* Moose Marketing brand: tokens taken from moosemkt.com */
:root {
  --bg: #f7f6f2; --panel: #ffffff; --panel2: #eef3f1; --text: #151716; --muted: #566260; --faint: #788482;
  --border: #e1e8e6; --accent: #3f7178; --accent-soft: #e5f0f1; --accent-text: #ffffff;
  --grad: linear-gradient(135deg, #3f7178, #2c5b61);
  --danger: #c9453f; --ok: #2f8f6a; --warn: #c98a2b;
  --shadow: 0 1px 2px rgba(15,28,27,.04), 0 10px 26px -14px rgba(15,28,27,.16);
  --side-bg: linear-gradient(170deg, #091114 0%, #0f2226 55%, #163238 100%);
  --side-text: #e3eeed; --side-muted: #86a09f; --side-hover: rgba(255,255,255,.06); --side-active: rgba(106,152,158,.22);
  --serif: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1214; --panel: #101c1f; --panel2: #15272b; --text: #e9f1f0; --muted: #93a8a6; --faint: #6f8685;
    --border: #223c41; --accent: #7fb0b7; --accent-soft: #163035; --accent-text: #ffffff;
    --danger: #ef7b74; --ok: #4cc795; --warn: #e6b04f;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .brand span, .login h1 { font-family: var(--serif); letter-spacing: -.01em; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; opacity: .7; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }

#app { display: flex; height: 100%; }
aside { width: 248px; flex: none; background: var(--side-bg); color: var(--side-text); border-right: 0; display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto; }
aside .brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 16px; }
aside .brand .tile { background: #f7f6f2; border-radius: 12px; padding: 4px 8px; display: flex; align-items: center; }
aside .brand img { height: 34px; display: block; }
aside .brand span { font-weight: 700; font-size: 17px; color: #fff; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 10px; color: var(--side-text); font-weight: 500; text-decoration: none; border: 0; background: none; width: 100%; text-align: left; }
.nav-item:hover { background: var(--side-hover); }
.nav-item.active { background: var(--side-active); font-weight: 700; color: #fff; }
.nav-item .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.nav-item .badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; }
.nav-h { display: flex; justify-content: space-between; align-items: center; color: var(--side-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 16px 10px 4px; }
.nav-h button { border: 0; background: none; color: var(--side-muted); font-size: 16px; padding: 0 4px; }
.spacer { flex: 1; }
main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { padding: 22px 28px 0; background: var(--bg); }
.topbar h1 { margin: 0; font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.topbar h1 .dot { width: 14px; height: 14px; border-radius: 4px; }
.topbar .sub { color: var(--muted); margin-top: 2px; }
.tabs { display: flex; gap: 4px; margin-top: 12px; border-bottom: 1px solid var(--border); align-items: center; }
.tab { border: 0; background: none; padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.tools { margin-left: auto; display: flex; gap: 8px; padding-bottom: 6px; }
.content { flex: 1; overflow: auto; padding: 20px 28px 40px; }

.btn { white-space: nowrap; border: 1px solid var(--border); background: var(--panel); padding: 7px 16px; border-radius: 999px; font-weight: 600; transition: filter .15s, background .15s; }
.btn:hover { background: var(--panel2); }
.btn.primary { background: var(--grad); color: var(--accent-text); border-color: transparent; font-weight: 700; box-shadow: 0 8px 20px -10px rgba(44,91,97,.7); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 3px 11px; font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 7px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
.search { width: 200px; }

/* board */
.board { display: flex; gap: 14px; align-items: flex-start; min-height: 100%; }
.col { width: 292px; flex: none; background: var(--panel2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; max-height: 100%; }
.col-h { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 15px; padding: 3px 4px 9px; }
.col-h .count { color: var(--muted); font-weight: 400; }
.col-h .done-mark { color: var(--ok); font-size: 12px; }
.cards { display: flex; flex-direction: column; gap: 8px; min-height: 30px; padding-bottom: 4px; }
.cards.over { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 8px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer; }
.card:hover { border-color: var(--accent); }
.card.dragging { opacity: .4; }
.card .t { font-weight: 500; word-break: break-word; }
.card.done .t { text-decoration: line-through; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; color: var(--muted); font-size: 12px; }
.meta .grow { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.chip.overdue { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.chip.soon { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.prio { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.prio.high { background: var(--danger); } .prio.medium { background: var(--warn); } .prio.low { background: var(--ok); }
.avatar { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.quick { margin-top: 4px; background: transparent; border: 1px dashed var(--border); }
.add-col { width: 240px; flex: none; }

/* list */
.group { margin-bottom: 22px; }
.group h3 { margin: 0 0 8px; font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-family: var(--sans); display: flex; gap: 8px; }
.rows { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--panel2); }
.row .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.done .title { text-decoration: line-through; color: var(--muted); }
.row .proj { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.row .proj i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.check { width: 18px; height: 18px; accent-color: var(--ok); flex: none; cursor: pointer; }
.empty { color: var(--muted); padding: 30px; text-align: center; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-head h2 { margin: 0; font-size: 16px; min-width: 160px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cal .dow { padding: 6px 8px; font-size: 12px; color: var(--muted); background: var(--panel2); border-bottom: 1px solid var(--border); }
.cal .day { min-height: 104px; padding: 4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.other { background: color-mix(in srgb, var(--panel2) 60%, transparent); }
.cal .day.today .n { background: var(--accent); color: var(--accent-text); }
.cal .n { display: inline-block; min-width: 22px; text-align: center; border-radius: 11px; font-size: 12px; margin: 2px; }
.cal .ev { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--accent); background: var(--panel2); border-radius: 4px; padding: 1px 6px; margin-top: 2px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.done { text-decoration: line-through; opacity: .6; }

/* modal */
#modal-root .overlay { position: fixed; inset: 0; background: rgba(10,12,20,.5); display: flex; justify-content: center; align-items: flex-start; padding: 5vh 16px; overflow: auto; z-index: 20; }
.modal { background: var(--panel); border-radius: 18px; width: 100%; max-width: 720px; box-shadow: 0 12px 48px rgba(0,0,0,.35); }
.modal.narrow { max-width: 460px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-h h2 { margin: 0; font-size: 18px; flex: 1; }
.modal-b { padding: 16px 18px 20px; }
.x { border: 0; background: none; font-size: 20px; color: var(--muted); line-height: 1; }
.title-input { font-size: 18px; font-weight: 600; border-color: transparent; background: transparent; padding: 4px 6px; margin-left: -6px; }
.title-input:hover { border-color: var(--border); }
.fields { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; align-items: center; margin: 14px 0; }
.fields label, .lbl { color: var(--muted); font-size: 12px; }
.sec { margin-top: 20px; }
.sec h4 { margin: 0 0 8px; font-size: 13px; }
.sub-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.sub-row span { flex: 1; }
.sub-row .done { text-decoration: line-through; color: var(--muted); }
.comment { display: flex; gap: 10px; margin-bottom: 12px; }
.comment .b { flex: 1; min-width: 0; }
.comment .who { font-weight: 600; } .comment .when { color: var(--muted); font-size: 12px; margin-left: 6px; }
.comment .txt { white-space: pre-wrap; word-break: break-word; }
.comment .txt b { color: var(--accent); font-weight: 600; }
.att { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.att span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; gap: 10px; }
.err { color: var(--danger); min-height: 18px; font-size: 13px; }
.progress { height: 5px; background: var(--panel2); border-radius: 3px; overflow: hidden; width: 70px; display: inline-block; }
.progress i { display: block; height: 100%; background: var(--accent); }
.notif { padding: 10px 6px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 8px; }
.notif:hover { background: var(--panel2); }
.notif.unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.notif .when { color: var(--muted); font-size: 12px; }
table.users { width: 100%; border-collapse: collapse; }
table.users td, table.users th { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--border); }
table.users select { padding: 3px 6px; }
.colrow { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }

body.auth { background: linear-gradient(140deg, #091114 0%, #0f2226 45%, #1c4147 100%); }
.login { margin: auto; width: 380px; max-width: calc(100% - 32px); background: var(--panel); border: 1px solid var(--border); border-radius: 22px; padding: 30px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.55); }
.login .logo { background: #f7f6f2; border-radius: 14px; padding: 8px 12px; display: inline-block; margin-bottom: 18px; } .login .logo img { height: 40px; display: block; }
.login h1 { margin: 0 0 4px; font-size: 26px; } .login p { color: var(--muted); margin: 0 0 18px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #0f2226; color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
#toast.show { opacity: 1; }

@media (max-width: 760px) {
  #app { flex-direction: column; }
  aside { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; border-right: 0; border-bottom: 1px solid var(--border); max-height: 38vh; }
  aside .nav-h, aside .brand { display: none; }
  .nav-item { width: auto; }
  .topbar, .content { padding-left: 14px; padding-right: 14px; }
  .search { width: 130px; }
  .fields { grid-template-columns: 1fr; }
  .cal .day { min-height: 70px; }
}
