body { font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; }

/* Nav */
#mainNav a { padding: 6px 12px; border-radius: 8px; color: #57534e; white-space: nowrap; }
#mainNav a:hover { background: #fff1f2; color: #be123c; }
#mainNav a.active { background: #ffe4e6; color: #be123c; font-weight: 600; }
#mainNav a i { margin-right: 4px; font-size: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn-primary { background: #be123c; color: #fff; }
.btn-primary:hover { background: #9f1239; }
.btn-ghost { background: #fff; color: #44403c; border-color: #d6d3d1; }
.btn-ghost:hover { background: #fafaf9; border-color: #a8a29e; }
.btn-danger { background: #fff; color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 3px 10px; font-size: 13px; }
.icon-btn { color: #a8a29e; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.icon-btn:hover { color: #be123c; background: #fff1f2; }

/* Cards / inputs */
.card { background: #fff; border: 1px solid #e7e5e4; border-radius: 12px; }
.card-h { padding: 12px 16px; border-bottom: 1px solid #f5f5f4; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-b { padding: 16px; }
.inp { width: 100%; border: 1px solid #d6d3d1; border-radius: 8px; padding: 6px 10px; font-size: 14px; background: #fff; }
.inp:focus { outline: none; border-color: #fb7185; box-shadow: 0 0 0 3px #ffe4e6; }
textarea.inp { resize: vertical; line-height: 1.5; }
.inp-cell { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; font-size: 13px; background: transparent; }
.inp-cell:hover { border-color: #e7e5e4; background: #fff; }
.inp-cell:focus { outline: none; border-color: #fb7185; background: #fff; }
.inp-num { text-align: right; font-variant-numeric: tabular-nums; }
.lbl { display: block; font-size: 12px; font-weight: 600; color: #78716c; margin-bottom: 3px; }

/* Badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.b-rose { background: #ffe4e6; color: #be123c; }
.b-green { background: #dcfce7; color: #15803d; }
.b-blue { background: #dbeafe; color: #1d4ed8; }
.b-amber { background: #fef3c7; color: #b45309; }
.b-slate { background: #f5f5f4; color: #57534e; }
.b-red { background: #fee2e2; color: #b91c1c; }
.b-violet { background: #ede9fe; color: #6d28d9; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: #78716c; background: #fafaf9; padding: 8px 10px; border-bottom: 1px solid #e7e5e4; white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid #f5f5f4; vertical-align: top; }
.tbl tbody tr:hover td { background: #fffafa; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.sec td { background: #fff1f2; font-weight: 600; color: #9f1239; }
.tbl tr.sum td { background: #fafaf9; font-weight: 600; }
.tbl tr.grp td { background: #fafaf9; color: #78716c; font-size: 12px; font-weight: 600; padding-top: 4px; padding-bottom: 4px; }

/* Progress */
.bar { height: 6px; background: #e7e5e4; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #e11d48; border-radius: 999px; }
.bar.green > i { background: #16a34a; }
.bar.amber > i { background: #f59e0b; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e7e5e4; overflow-x: auto; }
.tabs a { padding: 10px 16px; font-weight: 500; color: #78716c; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: #be123c; }
.tabs a.active { color: #be123c; border-bottom-color: #be123c; font-weight: 600; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 13px; border: 1px solid #d6d3d1; background: #fff; cursor: pointer; color: #57534e; }
.chip:hover { border-color: #fb7185; }
.chip.on { background: #be123c; border-color: #be123c; color: #fff; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(28, 25, 23, .45); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 40px 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 820px; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid #f5f5f4; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 16px; }
.modal-body { padding: 16px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.modal-body .span2 { grid-column: span 2; }
.modal-foot { padding: 12px 18px; border-top: 1px solid #f5f5f4; display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
@media (max-width: 520px) { .modal-body { grid-template-columns: 1fr; } .modal-body .span2 { grid-column: span 1; } }

/* Toast */
#toastRoot { position: fixed; bottom: 20px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1c1917; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.error { background: #b91c1c; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid #e7e5e4; border-left: 1px solid #e7e5e4; }
.cal > div { border-right: 1px solid #e7e5e4; border-bottom: 1px solid #e7e5e4; min-height: 104px; padding: 4px; background: #fff; }
.cal .dow { min-height: 0; background: #fafaf9; font-size: 12px; font-weight: 600; color: #78716c; text-align: center; padding: 6px 0; }
.cal .out { background: #fafaf9; color: #a8a29e; }
.cal .today .dnum { background: #be123c; color: #fff; }
.dnum { display: inline-block; min-width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 999px; font-size: 12px; }
.ev { display: block; font-size: 11.5px; line-height: 1.25; padding: 2px 5px; border-radius: 5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ev:hover { filter: brightness(.95); }
@media (max-width: 700px) { .cal > div { min-height: 64px; } .ev { font-size: 10px; } }

/* Gantt */
.gantt-scroll { overflow-x: auto; border: 1px solid #e7e5e4; border-radius: 10px; background: #fff; }
.gantt { position: relative; }
.g-row { display: flex; height: 30px; border-bottom: 1px solid #f5f5f4; }
.g-row.head { height: 26px; background: #fafaf9; font-size: 11px; color: #78716c; font-weight: 600; position: sticky; top: 0; z-index: 3; }
.g-row.grp { background: #fff1f2; font-size: 12px; font-weight: 600; color: #9f1239; }
.g-label { width: 280px; flex: none; position: sticky; left: 0; z-index: 2; background: inherit; background-color: #fff; padding: 5px 10px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid #e7e5e4; }
.g-row.grp .g-label, .g-row.head .g-label { background-color: inherit; }
.g-row.head .g-label { background-color: #fafaf9; }
.g-row.grp .g-label { background-color: #fff1f2; }
.g-track { position: relative; flex: none; background-image: repeating-linear-gradient(to right, #f5f5f4 0, #f5f5f4 1px, transparent 1px, transparent 98px); }
.g-bar { position: absolute; top: 7px; height: 16px; border-radius: 5px; background: #fb7185; font-size: 10px; color: #fff; padding: 0 5px; line-height: 16px; overflow: hidden; white-space: nowrap; cursor: pointer; }
.g-bar.done { background: #4ade80; } .g-bar.doing { background: #60a5fa; } .g-bar.late { background: #ef4444; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #be123c; z-index: 1; pointer-events: none; }
.g-mon { flex: none; border-left: 1px solid #e7e5e4; padding: 5px 6px; overflow: hidden; white-space: nowrap; }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

.pre { white-space: pre-line; }
.scroll-x { overflow-x: auto; }

.signed-out #mainNav, .signed-out #navTools { display: none; }
