/* Ops That Work palette and type, from static-site/STYLE-GUIDE.md */
:root {
    --teal: #006b5e; --teal-dark: #004039; --teal-light: #00897b; --blue: #3c6a99;
    --slate: #5c7a84; --yellow: #fdcc2c; --text: #2D4243; --bg-light: #f2f5f7; --white: #fff;
    --danger: #a3341f;
    --font-heading: 'Akatab', sans-serif;
    --font-body: 'Afacad', sans-serif;
    --font-accent: 'Overpass Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); font-size: 17px; color: var(--text); background: var(--bg-light); line-height: 1.55; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--teal-light); }
h1, h2, h3 { font-family: var(--font-heading); color: var(--teal-dark); line-height: 1.2; }
h1 { font-size: 2rem; margin-bottom: 1rem; } h2 { font-size: 1.35rem; margin: 1.5rem 0 .6rem; } h3 { font-size: 1.1rem; }

.nav { background: var(--white); border-bottom: 1px solid rgba(0,0,0,.08); padding: 0 1.25rem; min-height: 64px;
       display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-heading); font-size: 1.4rem; color: var(--blue); font-weight: 600; }
.brand img { width: 38px; height: 38px; }
.nav-links { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.nav-links a, .nav-links button { font-family: var(--font-heading); text-transform: uppercase; font-size: .95rem; font-weight: 700;
       color: var(--blue); background: none; border: 0; cursor: pointer; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.active, .nav-links button:hover { color: var(--teal); border-bottom-color: var(--teal-light); }

main { max-width: 1600px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.card { background: var(--white); border-radius: 10px; padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.eyebrow { font-family: var(--font-accent); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); }
.muted { color: var(--slate); font-size: .9rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.btn, button.btn { display: inline-block; font-family: var(--font-heading); font-weight: 600; font-size: 1rem; cursor: pointer;
       background: var(--teal-dark); color: var(--white); border: 0; border-radius: 6px; padding: .55rem 1.1rem; }
.btn:hover { background: var(--teal); color: var(--white); }
.btn.secondary { background: var(--white); color: var(--teal-dark); border: 1px solid var(--teal-dark); }
.btn.secondary:hover { background: var(--bg-light); }
.btn.danger { background: var(--danger); } .btn.small { font-size: .85rem; padding: .3rem .7rem; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
input, select, textarea { font: inherit; width: 100%; padding: .45rem .6rem; border: 1px solid #c5d0d5; border-radius: 6px; background: var(--white); color: var(--text); }
input[type=checkbox] { width: auto; } textarea { resize: vertical; }
.field { margin-bottom: .9rem; } .helptext { color: var(--slate); font-size: .82rem; } .errorlist { color: var(--danger); list-style: none; font-size: .88rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--font-accent); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--slate); padding: .4rem .5rem; border-bottom: 2px solid var(--bg-light); }
td { padding: .5rem; border-bottom: 1px solid var(--bg-light); vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.badge { font-family: var(--font-accent); font-size: .72rem; text-transform: uppercase; padding: .15rem .5rem; border-radius: 99px; background: var(--bg-light); color: var(--slate); }
.badge.paid { background: #d8efe9; color: var(--teal-dark); } .badge.sent { background: #dfe9f3; color: var(--blue); }

.messages { list-style: none; margin-bottom: 1rem; }
.messages li { padding: .6rem .9rem; border-radius: 6px; background: #dfe9f3; margin-bottom: .4rem; }
.messages li.error { background: #f6dcd6; color: var(--danger); } .messages li.success { background: #d8efe9; }

.clock-running { background: var(--teal-dark); color: var(--white); }
.clock-running h2, .clock-running .eyebrow { color: var(--white); }
.timer { font-family: var(--font-accent); font-size: 2.6rem; font-weight: 600; }
.edit-table input, .edit-table select { min-width: 5.5rem; padding: .3rem .4rem; font-size: .92rem; }
.edit-table td.desc input { min-width: 14rem; }
.deleted-row { opacity: .45; }
@media (max-width: 640px) { main { padding: 1rem .9rem 3rem; } h1 { font-size: 1.6rem; } .timer { font-size: 2rem; } }

/* Invoice editor: Delete stays pinned to the right edge so it never scrolls out of view. */
.edit-table th.del, .edit-table td.del { position: sticky; right: 0; background: var(--white); text-align: center; box-shadow: -1px 0 0 rgba(0,0,0,.08); }
.edit-table .del-toggle { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .55rem; border: 1px solid var(--danger); border-radius: 6px; color: var(--danger); font-size: .85rem; cursor: pointer; white-space: nowrap; }
.edit-table .del-toggle input { min-width: 0; width: auto; padding: 0; }
.edit-table .del-toggle:has(input:checked) { background: var(--danger); color: var(--white); }

/* Progress of clocked hours against expected hours (project and subproject rows). */
.bar { height: .45rem; background: var(--bg-light); border-radius: 99px; margin-top: .3rem; overflow: hidden; min-width: 6rem; }
.bar > span { display: block; height: 100%; background: var(--teal-dark); }
.bar.over > span { background: var(--danger); }

/* Date and time cells stay on one line so the columns beside them do not squeeze and clip. */
td.nw, th.nw { white-space: nowrap; }

/* Entry tables: compact so ten-plus columns fit. */
table.entries { font-size: .92rem; }
table.entries td, table.entries th { padding: .45rem .5rem; }
table.entries tr.busy { opacity: .55; }

/* In-place entry editor. The row becomes a panel the width of the table, grouped by what is being decided. */
table.entries tr.editing > td { padding: 0; border-bottom: 1px solid var(--teal-dark); }
.inline-entry-form { background: var(--bg-light); border-left: 4px solid var(--teal); padding: 1rem 1.25rem 1.1rem; display: grid; gap: 1rem; }
.inline-entry-form fieldset { border: 0; display: grid; gap: .75rem 1rem; align-items: start; min-width: 0; }
.inline-entry-form fieldset.when { grid-template-columns: repeat(2, minmax(12rem, 16rem)); }
.inline-entry-form fieldset.what { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.inline-entry-form legend { font-family: var(--font-heading); font-weight: 600; color: var(--teal-dark); font-size: 1rem; margin-bottom: .35rem; padding: 0; }
.inline-entry-form label { font-size: .85rem; font-weight: 600; color: var(--slate); margin-bottom: .15rem; }
.inline-entry-form input, .inline-entry-form select { font-size: 1rem; padding: .4rem .55rem; }
.inline-entry-form input:focus-visible, .inline-entry-form select:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; }
.inline-entry-form .actions { display: flex; gap: .6rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.inline-entry-form .actions .muted { margin-right: auto; }
.inline-entry-form .errorlist { margin: 0; }
@media (max-width: 640px) { .inline-entry-form fieldset.when { grid-template-columns: 1fr; } }

/* The saved row shows what changed: one soft highlight that fades. */
@keyframes just-saved { from { background: #d8efe9; } to { background: transparent; } }
table.entries tr.just-saved td { animation: just-saved 1.4s ease-out; }
@media (prefers-reduced-motion: reduce) { table.entries tr.just-saved td { animation: none; } }
