@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap");

:root {
    --ink: #5d596c;
    --muted: #6f6b7d;
    --line: #dbdade;
    --paper: #f8f7fa;
    --white: #fff;
    --orange: #fb601d;
    --orange-dark: #e95213;
    --orange-soft: #fff1eb;
    --green: #28c76f;
    --green-soft: #ddf6e8;
    --amber: #ff9f43;
    --amber-soft: #fff0e1;
    --purple: #7367f0;
    --purple-soft: #e9e7fd;
    --blue: #00cfe8;
    --blue-soft: #d9f8fc;
    --shadow: 0 4px 18px rgba(47, 43, 61, .10);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--muted); font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.topbar { height: 70px; padding: 0 max(24px, calc((100% - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--white); box-shadow: 0 2px 8px rgba(47, 43, 61, .08); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; color: var(--ink); }
.brand-logo { display: block; width: auto; height: 42px; }
.brand-logo-minimal { display: block; width: auto; height: 64px; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 80px; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; }
.hero h1, .detail-heading h1 { margin: 7px 0 8px; color: var(--ink); font-size: clamp(32px, 4vw, 46px); font-weight: 500; letter-spacing: -.025em; line-height: 1.12; }
.hero p, .detail-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.eyebrow { color: var(--orange); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.date-card { min-width: 138px; padding: 15px 18px; background: var(--white); color: var(--ink); border-left: 3px solid var(--orange); border-radius: 6px; box-shadow: var(--shadow); }
.date-card span { display: block; color: var(--muted); font-size: 12px; }
.date-card strong { display: block; margin-top: 4px; font-size: 17px; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 38px; }
.stat-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 20px; background: var(--white); border: 1px solid transparent; border-radius: 6px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover, .job-card:hover { transform: translateY(-2px); box-shadow: 0 7px 24px rgba(47, 43, 61, .14); }
.stat-card strong { color: var(--ink); font-size: 28px; font-weight: 500; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.waiting .status-dot, .status-dot.waiting { background: var(--amber); }
.submission_pipeline .status-dot, .status-dot.submission_pipeline { background: var(--amber); }
.amendments .status-dot, .status-dot.amendments { background: var(--purple); }
.completed .status-dot, .status-dot.completed { background: var(--blue); }

.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title > div { display: flex; align-items: baseline; gap: 12px; }
.section-title h2 { margin: 0; color: var(--ink); font-size: 22px; font-weight: 500; }
.section-title span { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; padding: 16px; background: var(--white); border-radius: 6px; box-shadow: var(--shadow); }

input, select, textarea { width: 100%; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #d8d6de; border-radius: 6px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
input::placeholder, textarea::placeholder { color: #b7b4be; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(251, 96, 29, .15); }
.toolbar input { max-width: 390px; }
.toolbar select { width: 170px; }
.primary-button, .secondary-button, .icon-button { cursor: pointer; border-radius: 6px; font-weight: 500; transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.primary-button { padding: 10px 17px; color: white; background: var(--orange); border: 1px solid var(--orange); box-shadow: 0 2px 4px rgba(165, 163, 174, .3); }
.primary-button:hover { background: var(--orange-dark); border-color: var(--orange-dark); box-shadow: 0 4px 9px rgba(251, 96, 29, .3); }
.secondary-button { padding: 9px 16px; color: var(--ink); background: #f1f1f2; border: 1px solid #f1f1f2; }
.secondary-button:hover { background: #e7e7e9; }
.icon-button { width: 36px; height: 36px; color: var(--muted); background: transparent; border: 0; font-size: 22px; }
.icon-button:hover { color: var(--orange); background: var(--orange-soft); }

.job-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.job-card { padding: 22px; background: var(--white); border: 1px solid transparent; border-radius: 6px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.job-card.needs-action { border: 2px solid var(--orange); background: linear-gradient(135deg, var(--orange-soft), var(--white) 48%); box-shadow: 0 5px 24px rgba(251, 96, 29, .25); }
.action-badge { display: inline-block; margin-top: 14px; padding: 5px 9px; color: white; background: var(--orange); border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.job-card-top, .job-meta { display: flex; align-items: center; justify-content: space-between; }
.tmp-number { color: var(--orange); font-size: 13px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; color: #199c55; background: var(--green-soft); border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .035em; }
.badge.waiting { color: #c76c13; background: var(--amber-soft); }
.badge.submission_pipeline { color: #c76c13; background: var(--amber-soft); }
.badge.amendments { color: #6256d9; background: var(--purple-soft); }
.badge.completed { color: #008fa1; background: var(--blue-soft); }
.job-card h3 { min-height: 52px; margin: 20px 0; color: var(--ink); font-size: 20px; font-weight: 500; line-height: 1.35; }
.progress-track { height: 5px; overflow: hidden; border-radius: 4px; background: #eeeef0; }
.progress-track span { height: 100%; display: block; background: var(--orange); border-radius: inherit; }
.job-meta { margin-top: 14px; justify-content: flex-start; gap: 15px; color: var(--muted); font-size: 12px; }
.job-meta b { color: var(--ink); font-weight: 600; }
.job-meta .arrow { margin-left: auto; color: var(--orange); font-size: 20px; }

.flash { margin: -14px 0 24px; padding: 13px 16px; color: #199c55; background: var(--green-soft); border-radius: 6px; font-weight: 500; }
.flash.error { color: #d13f35; background: #fce5e4; }
.back-link { display: inline-block; margin-bottom: 26px; color: var(--orange); font-weight: 500; }
.detail-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; margin-bottom: 28px; }
.time-summary { display: flex; align-items: end; gap: 28px; padding: 19px 20px; margin: -10px 0 22px; color: var(--muted); background: var(--white); border-left: 3px solid var(--orange); border-radius: 6px; box-shadow: var(--shadow); }
.assignment-panel { margin-bottom: 30px; padding: 20px; background: var(--white); border-radius: 6px; box-shadow: var(--shadow); }
.assignment-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.assignment-heading h2 { margin: 3px 0 0; color: var(--ink); font-size: 21px; font-weight: 500; }
.assignment-heading > span, .assignment-empty { font-size: 13px; }
.assignment-list { display: grid; gap: 9px; margin-bottom: 15px; }
.assignment-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; background: var(--paper); border-left: 3px solid var(--line); border-radius: 6px; }
.assignment-row.is-mine { border-left-color: var(--orange); background: var(--orange-soft); }
.assignment-row strong { color: var(--ink); }
.assignment-row p { margin: 4px 0; }
.assignment-row small { font-size: 11px; }
.assign-control summary { width: fit-content; color: var(--orange); cursor: pointer; font-weight: 600; }
.assign-form { display: grid; grid-template-columns: 210px 1fr auto; align-items: end; gap: 12px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.action-alerts { position: fixed; right: 24px; bottom: 24px; z-index: 20; width: min(390px, calc(100% - 32px)); display: grid; gap: 10px; }
.action-toast { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--white); border: 1px solid rgba(251, 96, 29, .35); border-left: 4px solid var(--orange); border-radius: 8px; box-shadow: 0 12px 38px rgba(47, 43, 61, .24); animation: toast-in .25s ease-out; }
.action-toast > div { flex: 1; min-width: 0; }
.action-toast strong { color: var(--ink); }
.action-toast p { margin: 4px 0; font-size: 13px; line-height: 1.35; }
.action-toast small { font-size: 11px; }
.action-toast .secondary-button { flex: 0 0 auto; padding: 7px 10px; font-size: 12px; }
.action-toast form { flex: 0 0 auto; }
.action-toast form .primary-button { padding: 7px 10px; font-size: 12px; }
.completion-toast { border-color: rgba(45, 145, 103, .35); border-left-color: #2d9167; }
.toast-pulse { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); animation: action-pulse 1.6s infinite; }
@keyframes action-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(251, 96, 29, .45); } 50% { box-shadow: 0 0 0 9px rgba(251, 96, 29, 0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.time-summary > div:first-child { min-width: 145px; }
.time-summary span, .time-summary label, .time-summary small { display: block; color: var(--muted); font-size: 12px; }
.time-summary strong { display: block; margin-top: 3px; color: var(--ink); font-size: 24px; font-weight: 500; }
.time-summary form { min-width: 260px; }
.date-filter { display: flex; gap: 7px; align-items: center; margin-top: 6px; }
.date-filter input { color-scheme: light; background: white; color: var(--ink); border-color: var(--line); }
.date-filter .secondary-button { color: var(--ink); background: #f1f1f2; border-color: #f1f1f2; }
.clear-link { color: var(--orange); font-size: 12px; }
.since-result { padding-left: 24px; border-left: 1px solid var(--line); }
.since-result small { margin-top: 4px; }
.status-control { min-width: 170px; }
.field label, .status-control label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 12px; font-weight: 500; }
.field label span { color: var(--muted); font-weight: 400; }
.status-select.active { background: var(--green-soft); }
.status-select.waiting { background: var(--amber-soft); }
.status-select.submission_pipeline { background: var(--amber-soft); }
.status-select.amendments { background: var(--purple-soft); }
.status-select.completed { background: var(--blue-soft); }

.add-item { display: flex; align-items: flex-end; gap: 12px; padding: 20px; margin-bottom: 34px; background: var(--white); border: 0; border-radius: 6px; box-shadow: var(--shadow); }
.grow { flex: 1; }
.add-item .field:not(.grow) { width: 170px; }
.item-list { display: grid; gap: 12px; }
.todo-row { display: block; padding: 17px 18px; background: var(--white); border: 0; border-left: 3px solid var(--green); border-radius: 6px; box-shadow: var(--shadow); }
.todo-summary { display: flex; align-items: center; gap: 14px; }
.todo-row.waiting { border-left-color: var(--amber); }
.todo-row.completed { border-left-color: var(--blue); }
.todo-row.completed strong { color: var(--muted); text-decoration: line-through; }
.todo-copy { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.todo-copy strong { color: var(--ink); font-weight: 500; }
.todo-copy p { margin: 2px 0; color: var(--muted); line-height: 1.45; }
.todo-copy small { color: var(--muted); }
.item-time { width: fit-content; margin-top: 3px; padding: 4px 7px; color: var(--orange); background: var(--orange-soft); border-radius: 4px; font-size: 11px; font-weight: 600; }
.inline-actions select { width: 135px; }
.edit-button { padding: 8px 10px; color: var(--orange); background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-weight: 500; }
.edit-button:hover { background: var(--orange-soft); }
.item-editor { display: grid; grid-template-columns: 1fr 1fr 150px; align-items: end; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.item-editor[hidden] { display: none; }
.time-tracker { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.time-tracker summary { width: fit-content; color: var(--orange); cursor: pointer; font-size: 13px; font-weight: 500; }
.live-timer { display: flex; align-items: center; gap: 18px; margin-top: 14px; padding: 13px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; }
.live-timer.running { border-color: var(--green); background: #f2faf6; }
.live-timer.paused { border-color: var(--amber); background: var(--amber-soft); }
.live-timer > div { min-width: 126px; }
.timer-label { display: block; color: var(--muted); font-size: 11px; }
.timer-display { display: block; margin-top: 2px; color: var(--ink); font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: .04em; text-decoration: none !important; }
.timer-controls { flex: 1; display: flex; align-items: center; gap: 7px; }
.timer-controls input { min-width: 130px; flex: 1; }
.timer-button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 11px; border: 0; border-radius: 6px; color: var(--white); cursor: pointer; font-weight: 600; }
.timer-button.play { background: var(--green); }
.timer-button.pause { color: var(--ink); background: var(--amber); }
.timer-button.stop { background: #a33b35; }
.manual-time-label { margin: 15px 0 -5px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.time-form { display: grid; grid-template-columns: 90px 90px 155px 1fr auto; align-items: end; gap: 10px; margin-top: 14px; }
.time-entry-list { display: grid; gap: 5px; margin-top: 13px; }
.time-entry { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--muted); background: var(--paper); border-radius: 6px; font-size: 12px; }
.time-entry strong { color: var(--ink); text-decoration: none !important; }
.reminder-tracker { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.reminder-tracker summary { width: fit-content; color: var(--orange); cursor: pointer; font-size: 13px; font-weight: 500; }
.reminder-form { display: grid; grid-template-columns: 190px 210px 1fr auto; align-items: end; gap: 10px; margin-top: 14px; }
.reminder-list { display: grid; gap: 6px; margin-top: 12px; }
.reminder-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--orange-soft); border-radius: 6px; }
.reminder-row > div { flex: 1; display: grid; gap: 2px; }
.reminder-row strong { color: var(--ink); font-size: 12px; text-decoration: none !important; }
.reminder-row small { font-size: 11px; }
.reminder-toast { border-left-color: var(--purple); }
.reminder-toast form { margin: 0; }
.reminder-toast .primary-button { padding: 7px 10px; font-size: 12px; }
.time-note { flex: 1; }
.icon-button.small { width: 26px; height: 26px; font-size: 17px; }
.editor-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); background: var(--white); border: 1px dashed #c9c7ce; border-radius: 6px; }
.empty-state h3 { margin: 12px 0 4px; color: var(--ink); font-weight: 500; }
.empty-state p { margin: 0 0 20px; }
.empty-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: auto; color: var(--orange); background: var(--orange-soft); border-radius: 50%; font-size: 25px; }
dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 12px 50px rgba(47, 43, 61, .28); }
dialog::backdrop { background: rgba(47, 43, 61, .48); backdrop-filter: blur(2px); }
.dialog-card { padding: 26px; display: grid; gap: 18px; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { margin: 4px 0 0; color: var(--ink); font-size: 26px; font-weight: 500; }
.dialog-actions { justify-content: flex-end; gap: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.account-nav { display: flex; align-items: center; gap: 10px; }
.account-nav form { margin: 0; }
.account-nav > span { color: var(--ink); font-size: 13px; font-weight: 500; }
.sound-status { padding: 7px 9px; color: #9a4b08 !important; background: var(--amber-soft); border: 0; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.sound-status.enabled { color: #286447 !important; background: #e8f6ef; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(440px, 100%); }
.auth-card, .panel { padding: 30px; background: var(--white); border-radius: 8px; box-shadow: var(--shadow); }
.auth-brand { width: 100%; margin-bottom: 34px; justify-content: center;}
.auth-card h1, .panel h2 { margin: 7px 0 8px; color: var(--ink); font-size: 28px; font-weight: 500; }
.auth-card > p { margin: 0 0 24px; line-height: 1.55; }
.auth-card .flash { margin: 0 0 18px; }
.auth-form { display: grid; gap: 17px; }
.field small { display: block; margin-top: 6px; font-size: 11px; }
.admin-grid { display: grid; grid-template-columns: minmax(280px, 390px) 1fr; align-items: start; gap: 20px; }
.user-panel { display: grid; gap: 22px; }
.user-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.user-row { display: flex; justify-content: space-between; gap: 20px; padding: 15px; background: var(--white); }
.user-copy { display: grid; gap: 3px; }
.user-copy strong { color: var(--ink); font-weight: 600; }
.user-copy span, .user-copy small { font-size: 12px; }
.user-row summary { color: var(--orange); cursor: pointer; font-size: 13px; }
.manage-user { min-width: 250px; display: grid; gap: 8px; margin-top: 10px; }
.manage-user form { display: flex; gap: 7px; }
.manage-user .secondary-button { white-space: nowrap; }

@media (max-width: 720px) {
    .topbar { padding-inline: 16px; }
    .topbar .brand-logo { height: 42px; }
    .shell { padding-top: 28px; }
    .hero, .detail-heading { align-items: flex-start; }
    .date-card { display: none; }
    .stats { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { padding: 16px; }
    .job-grid { grid-template-columns: 1fr; }
    .toolbar, .add-item, .detail-heading, .time-summary { flex-direction: column; }
    .toolbar input, .toolbar select, .add-item .field:not(.grow), .status-control { width: 100%; max-width: none; }
    .toolbar .secondary-button, .add-item .primary-button { width: 100%; }
    .todo-summary { flex-wrap: wrap; }
    .todo-copy { min-width: calc(100% - 35px); }
    .inline-actions { margin-left: 23px; flex: 1; }
    .inline-actions select { width: 100%; }
    .item-editor { grid-template-columns: 1fr; }
    .time-summary { align-items: stretch; gap: 16px; }
    .time-summary form { min-width: 0; }
    .since-result { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
    .time-form { grid-template-columns: 1fr 1fr; }
    .time-form .grow, .time-form .primary-button { grid-column: 1 / -1; }
    .live-timer, .timer-controls { align-items: stretch; flex-direction: column; }
    .timer-controls input { width: 100%; }
    .timer-button { justify-content: center; }
    .reminder-form { grid-template-columns: 1fr; }
    .topbar { height: auto; min-height: 70px; padding-block: 10px; }
    .account-nav > span { display: none; }
    .account-nav { gap: 6px; }
    .account-nav .secondary-button, .account-nav .primary-button { padding: 8px 9px; font-size: 12px; }
    .sound-status { width: 34px; overflow: hidden; color: transparent !important; }
    .sound-status::first-letter { color: #9a4b08; }
    .admin-grid { grid-template-columns: 1fr; }
    .assign-form { grid-template-columns: 1fr; }
    .assignment-row { align-items: flex-start; flex-direction: column; }
    .action-alerts { right: 16px; bottom: 16px; }
    .user-row { flex-direction: column; }
    .manage-user { min-width: 0; }
    .manage-user form { flex-direction: column; }
}
