:root {
  color-scheme: light;
  --navy: #17324d;
  --navy-2: #244a68;
  --blue: #3276a5;
  --blue-soft: #eaf3f8;
  --sky: #d9ebf5;
  --ink: #18242e;
  --muted: #62717d;
  --line: #d8e0e6;
  --panel: #ffffff;
  --canvas: #f3f6f8;
  --critical: #a63232;
  --high: #c76d24;
  --medium: #806d2c;
  --low: #4c748c;
  --green: #287653;
  --shadow: 0 16px 45px rgba(30, 51, 68, .12);
  font-family: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: var(--navy); color: white; border-bottom: 4px solid #64a6c9; }
.topbar h1 { margin: 1px 0 0; font-size: 22px; letter-spacing: -.02em; }
.eyebrow, .section-kicker { margin: 0; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; font-size: 10px; }
.eyebrow { color: #b9d7e8; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.sync-state { font-size: 12px; color: #d7e7f0; }
.button { border: 1px solid transparent; background: var(--blue); color: white; padding: 10px 14px; border-radius: 6px; font-weight: 700; font-size: 13px; }
.button:hover { background: #27678f; }
.button.secondary { background: white; color: var(--navy); border-color: #b9ccd8; }
.button.danger { background: white; border-color: #d7adad; color: var(--critical); margin-right: auto; }
main { padding: 18px 22px 28px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metrics article { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid #82b8d3; padding: 13px 16px; min-height: 76px; }
.metrics span { display: block; color: var(--muted); font-size: 12px; }
.metrics strong { display: block; margin-top: 6px; font-size: 25px; color: var(--navy); }
.workspace { display: grid; grid-template-columns: 390px minmax(0, 1fr); min-height: calc(100vh - 208px); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.project-panel { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.panel-heading, .project-header, .section-title, .dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading { padding: 18px 18px 12px; }
.panel-heading h2, .project-header h2 { margin: 2px 0 0; color: var(--navy); }
.panel-heading h2 { font-size: 18px; }
.section-kicker { color: var(--blue); }
.count { min-width: 31px; padding: 5px 8px; border-radius: 99px; text-align: center; background: var(--blue-soft); color: var(--navy); font-size: 12px; font-weight: 700; }
.filters { padding: 0 18px 14px; border-bottom: 1px solid var(--line); }
label > span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 5px; }
input, select, textarea { width: 100%; border: 1px solid #bfcbd3; border-radius: 5px; background: white; color: var(--ink); padding: 9px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(50,118,165,.13); }
.search input { padding: 10px 11px; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.filter-grid select { padding: 7px 8px; font-size: 12px; }
.project-list { overflow: auto; max-height: calc(100vh - 390px); }
.project-card { width: 100%; text-align: left; border: 0; border-bottom: 1px solid #e4e9ed; background: white; padding: 13px 18px; }
.project-card:hover { background: #f6fafc; }
.project-card.active { background: var(--blue-soft); box-shadow: inset 4px 0 var(--blue); }
.project-card strong { display: block; color: var(--navy); font-size: 13px; margin-bottom: 5px; }
.project-card .meta-line { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.task-flags { display: flex; gap: 5px; margin-top: 7px; }
.mini-badge { border-radius: 3px; padding: 3px 5px; font-size: 10px; background: #eef2f4; color: #52616b; }
.mini-badge.critical { background: #f7e2e2; color: var(--critical); }
.mini-badge.blocked { background: #faeddc; color: #89501f; }
.detail-panel { min-width: 0; }
.empty-state { min-height: 540px; display: grid; place-content: center; text-align: center; padding: 30px; color: var(--muted); }
.empty-state h2 { color: var(--navy); margin: 16px 0 6px; }
.empty-state p { max-width: 430px; margin: 0; }
.empty-mark { margin: auto; display: grid; place-content: center; width: 74px; height: 74px; border: 1px solid #aacada; color: var(--blue); font-weight: 800; letter-spacing: .13em; background: var(--blue-soft); }
.project-header { padding: 20px 24px 16px; }
.project-header h2 { font-size: 24px; }
.muted { color: var(--muted); }
.project-header .muted { margin: 6px 0 0; font-size: 12px; }
.tabs { padding: 0 24px; display: flex; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 11px 15px; color: var(--muted); font-weight: 700; font-size: 12px; }
.tab.active { color: var(--navy); border-color: var(--blue); }
.tab-panel { padding: 18px 24px 28px; }
.task-toolbar { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 12px; }
.task-toolbar select { min-width: 155px; padding: 7px; font-size: 12px; }
.task-list { border-top: 1px solid var(--line); }
.task-card { display: grid; grid-template-columns: 8px minmax(220px, 1.6fr) 120px 120px 130px 100px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 8px 13px 0; background: white; }
.task-card:hover { background: #f9fbfc; }
.priority-bar { height: 100%; min-height: 50px; background: var(--medium); }
.priority-bar.Critical { background: var(--critical); }.priority-bar.High { background: var(--high); }.priority-bar.Low { background: var(--low); }
.task-title { border: 0; background: none; padding: 0; text-align: left; color: var(--navy); font-weight: 700; }
.task-sub { margin-top: 5px; font-size: 11px; color: var(--muted); }
.status-pill { display: inline-block; width: fit-content; border-radius: 99px; padding: 5px 8px; background: #edf2f4; font-size: 10px; font-weight: 700; color: #4d5a63; }
.status-pill.Completed { background: #e2f2e8; color: var(--green); }
.status-pill.WaitingBlocked { background: #faeadc; color: #8b511f; }
.task-data { color: #4c5b65; font-size: 11px; }
.task-data strong { display: block; color: var(--ink); font-size: 12px; margin-top: 3px; }
.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.overview-item { padding: 13px; border: 1px solid var(--line); background: #fafcfd; }
.overview-item span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.overview-item strong { display: block; margin-top: 5px; font-size: 13px; }
.activity-entry, .update-entry { padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity-entry strong, .update-entry strong { color: var(--navy); font-size: 12px; }
.activity-entry p, .update-entry p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
dialog { width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 30px 90px rgba(10, 28, 42, .3); }
dialog::backdrop { background: rgba(15, 31, 43, .6); }
#taskForm { display: flex; flex-direction: column; max-height: calc(100vh - 30px); }
.dialog-header { padding: 17px 22px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 2px 0 0; color: var(--navy); font-size: 21px; }
.icon-button, .remove-line { border: 0; background: transparent; color: var(--muted); font-size: 25px; line-height: 1; }
.dialog-body { padding: 20px 22px; overflow: auto; background: #f8fafb; }
.form-section { margin-bottom: 17px; padding: 17px; border: 1px solid var(--line); background: white; }
.form-section h3 { margin: 0 0 13px; color: var(--navy); font-size: 15px; }
.section-title h3 { margin-bottom: 0; }
.hint { margin: 3px 0 12px; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; gap: 12px; }.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }.form-grid .wide { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: center; gap: 8px; margin-top: 21px; }.checkbox input { width: auto; }.checkbox span { margin: 0; }
.text-button { border: 0; background: none; color: var(--blue); font-weight: 700; font-size: 12px; }
.line-items { display: grid; gap: 8px; }
.line-row { display: flex; align-items: end; gap: 8px; padding: 10px; background: #f6f8f9; border-left: 3px solid #a9cbdc; }
.line-row label { min-width: 105px; }.line-row .grow { flex: 1; min-width: 160px; }.line-row input, .line-row select { padding: 7px; font-size: 12px; }
.line-total { padding: 8px 4px; min-width: 70px; color: var(--navy); font-weight: 700; font-size: 12px; text-align: right; }
.cost-summary { display: flex; justify-content: flex-end; gap: 24px; padding-top: 12px; color: var(--muted); font-size: 12px; }.cost-summary strong { margin-left: 5px; color: var(--navy); }
.dialog-footer { padding: 13px 22px; border-top: 1px solid var(--line); background: white; }
.save-message { margin-left: auto; font-size: 12px; color: var(--green); }
.report-dialog { width: min(1500px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.report-controls { display: grid; grid-template-columns: repeat(4,minmax(130px,1fr)) auto auto; gap: 9px; align-items: end; padding: 13px 20px; border-bottom: 1px solid var(--line); background: #f5f8fa; }
.report-controls select { padding: 7px; font-size: 12px; }
.report-output { padding: 24px; overflow: auto; max-height: calc(100vh - 170px); background: white; }
.report-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; border-bottom: 2px solid var(--navy); padding-bottom: 14px; }
.report-title p { margin: 0; color: var(--blue); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 700; }.report-title h2 { margin: 4px 0; color: var(--navy); }.report-title > div > span { color: var(--muted); font-size: 11px; }
.report-summary { display: flex; gap: 22px; text-align: right; }.report-summary > span { color: var(--navy); font-weight: 700; font-size: 17px; }.report-summary small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; font-size: 9px; text-transform: uppercase; }
.report-section { margin: 0 0 28px; break-before: auto; }.report-section h3 { margin: 0 0 9px; color: var(--navy); font-size: 15px; }.report-empty { margin: 0; padding: 14px; border: 1px dashed var(--line); color: var(--muted); font-size: 11px; }
.report-table-wrap { overflow: auto; }.report-table { width: 100%; min-width: 1100px; border-collapse: collapse; font-size: 10px; }.report-table.task-report { min-width: 1500px; }.report-table th { padding: 8px; background: var(--navy); color: white; text-align: left; white-space: nowrap; }.report-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.4; }.report-table td:first-child { min-width: 150px; }.report-table td span,.report-table td b { display: block; }.report-table td b { margin-top: 7px; color: var(--navy); }.report-table tfoot th { background: #e5eef3; color: var(--navy); border-top: 2px solid var(--navy); font-weight: 700; }
.empty-list { padding: 40px 15px; text-align: center; color: var(--muted); border: 1px dashed #cbd6dd; }
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .task-card { grid-template-columns: 7px minmax(170px,1fr) 105px 105px; }.task-card > :nth-last-child(-n+2) { display: none; }
  .line-row { flex-wrap: wrap; }.line-row label { flex: 1 1 135px; }
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 82px; padding: 14px 16px; align-items: flex-start; }.sync-state { display: none; }.top-actions { flex-wrap: wrap; justify-content: flex-end; }
  main { padding: 10px; }.metrics { grid-template-columns: repeat(2, 1fr); }.metrics article:last-child { grid-column: 1 / -1; }
  .workspace { display: block; }.project-panel { border-right: 0; }.project-list { max-height: 310px; }.detail-panel { border-top: 4px solid var(--canvas); }
  .project-header { align-items: flex-start; padding: 16px; }.project-header h2 { font-size: 19px; }.tabs, .tab-panel { padding-left: 16px; padding-right: 16px; }
  .task-card { grid-template-columns: 7px minmax(0, 1fr) 105px; }.task-card > :nth-child(n+4) { display: none; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }.form-grid .wide { grid-column: auto; }.overview-grid { grid-template-columns: 1fr 1fr; }
}
@media print {
  html,body { height: auto !important; overflow: visible !important; }
  body * { visibility: hidden !important; }
  #reportDialog, #reportDialog * { visibility: visible !important; }
  #reportDialog { position: static !important; inset: auto !important; display: block !important; width: 100% !important; max-width: none !important; height: auto !important; max-height: none !important; margin: 0 !important; overflow: visible !important; box-shadow: none; border: 0; transform: none !important; }
  .report-header,.report-controls { display: none !important; }
  .report-output { height: auto !important; max-height: none !important; overflow: visible !important; padding: 0; }
  .report-title { break-inside: avoid; }
  .report-table { min-width: 0; font-size: 8px; }
  .report-table th { background: #17324d !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-table tr { break-inside: avoid; }
  .report-section { break-before: page; }.report-section:first-of-type { break-before: auto; }
  @page { size: landscape; margin: .4in; }
}
