:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #dfe4ea;
  --paper: #ffffff;
  --wash: #f7f8fa;
  --navy: #102a43;
  --blue: #155eef;
  --green: #087443;
  --red: #b42318;
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--wash); line-height: 1.45; }
body { margin: 0; min-height: 100vh; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .6rem; z-index: 50; }

.site-header {
  min-height: 62px;
  padding: 0 max(1rem, calc((100% - 1120px) / 2));
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 750; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: #2dd4bf; color: #062c30; font-size: .75rem; font-weight: 900; }
.site-header nav { display: flex; align-self: stretch; }
.site-header nav a { display: flex; align-items: center; padding: 0 .9rem; color: #cfdae5; text-decoration: none; border-bottom: 3px solid transparent; }
.site-header nav a.active, .site-header nav a:hover { color: #fff; border-color: #2dd4bf; }
.logout-form { margin-left: auto; }

.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.auth-container { min-height: 100vh; display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); padding: 2rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.auth-brand { color: var(--navy); margin-bottom: 1.5rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .3rem; font-size: clamp(1.7rem, 4vw, 2.2rem); }
h2 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.preserve-lines { white-space: pre-wrap; }

.list-page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.list-page-head p { margin-bottom: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.button:hover { border-color: #aab4c0; }
.button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.secondary, .button.ghost { background: transparent; color: inherit; }
.site-header .button { border-color: #ffffff55; color: #fff; }

.filters { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) auto; align-items: end; gap: .65rem; padding: .9rem; margin-bottom: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.filters label, .stack-form label { display: block; margin-bottom: .25rem; font-size: .78rem; font-weight: 700; }
.filters input, .filters select, .stack-form input { width: 100%; min-height: 38px; padding: .48rem .58rem; border: 1px solid #cbd2da; border-radius: 5px; background: #fff; color: var(--ink); }
.filter-actions { display: flex; gap: .4rem; }
.stack-form { display: grid; gap: .75rem; }

.simple-list { border: 1px solid var(--line); border-radius: 7px; overflow-x: auto; background: #fff; }
.list-row { display: grid; grid-template-columns: 44px minmax(160px,1.1fr) minmax(180px,1.5fr) 145px 130px 145px 145px; gap: .6rem; align-items: center; min-width: 1050px; width: 100%; padding: .6rem .7rem; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; }
.list-row:last-child { border-bottom: 0; }
.list-header { padding-top: .65rem; padding-bottom: .65rem; background: #f1f3f6; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.task-row { position: relative; }
.task-open { display: block; min-width: 0; padding: .35rem .25rem; border: 0; background: transparent; text-align: left; cursor: pointer; }
.task-open:hover, .task-open:focus-visible { color: var(--blue); text-decoration: underline; }
.task-open span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.description-cell { color: #475467; }
.row-number { color: var(--muted); text-align: center; }
.inline-field select, .inline-field input { width: 100%; min-height: 34px; padding: .35rem .4rem; border: 1px solid #cbd2da; border-radius: 5px; background: #fff; }
.mobile-label { display: none; }
.save-state { position: absolute; right: .5rem; bottom: .1rem; color: var(--green); font-size: .68rem; }
.list-date { color: var(--muted); font-size: .82rem; }
.list-people { display: grid; gap: .2rem; font-size: .88rem; }
.list-submeta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; color: var(--muted); font-size: .78rem; }
.empty-line { padding: 2rem 1rem; text-align: center; color: var(--muted); }

.badge { display: inline-flex; width: max-content; padding: .2rem .48rem; border-radius: 999px; background: #eef2f6; color: #344054; font-size: .75rem; font-weight: 700; }
.status-completed { background: #e7f6ed; color: var(--green); }
.status-in-progress { background: #eaf1ff; color: #1849a9; }
.status-blocked, .status-cancelled { background: #feeceb; color: var(--red); }

.meeting-list .list-row { grid-template-columns: 170px minmax(280px, 1fr) 130px; }
.meeting-row { cursor: pointer; }
.meeting-row:hover, .meeting-row:focus-visible { background: #f5f8ff; outline: none; }
.meeting-title { display: grid; gap: .2rem; }
.meeting-title small { color: var(--muted); font-size: .8rem; }

.meeting-dialog { width: min(720px, calc(100% - 1.5rem)); max-height: min(82vh, 850px); padding: 0; border: 0; border-radius: 9px; color: var(--ink); box-shadow: 0 20px 70px #10182845; }
.task-dialog { width: min(760px, calc(100% - 1.5rem)); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: 9px; color: var(--ink); box-shadow: 0 20px 70px #10182845; }
.task-dialog::backdrop { background: #10182899; }
.task-dialog-content { display: grid; gap: 1rem; padding: 1.2rem; }
.task-dialog-content label { display: grid; gap: .35rem; font-size: .82rem; font-weight: 700; }
.task-dialog-content input, .task-dialog-content textarea { width: 100%; padding: .6rem; border: 1px solid #cbd2da; border-radius: 5px; color: var(--ink); }
.task-dialog-content textarea { resize: vertical; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-head h3 { margin: 0; }
.task-links { display: grid; gap: .5rem; margin-top: .6rem; }
.task-link-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: .5rem; }
.link-help { margin: .55rem 0 0; font-size: .78rem; }
#task-save-feedback { margin-right: auto; color: var(--green); font-size: .82rem; }
.meeting-dialog::backdrop { background: #10182899; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); }
.dialog-head h2, .dialog-head p { margin-bottom: 0; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 5px; background: #eef1f4; cursor: pointer; font-size: 1.35rem; }
.dialog-loading, #dialog-content { padding: 1.2rem; }
.dialog-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; padding-bottom: .8rem; color: var(--muted); font-size: .85rem; }
#dialog-content section { padding: .85rem 0; border-top: 1px solid var(--line); }
#dialog-content section h3 { margin-bottom: .4rem; font-size: .88rem; text-transform: uppercase; color: var(--muted); }
#dialog-content section p { margin-bottom: 0; }
.update-list { display: grid; gap: .65rem; margin: 0; padding-left: 1.2rem; }
.update-list li span, .update-list li small { display: block; }
.update-list li small { color: var(--muted); margin-top: .15rem; }
.dialog-actions { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: .55rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line); background: #fff; }
#copy-feedback { margin-right: auto; color: var(--green); font-size: .82rem; }

.detail-panel, .timeline-card { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 1rem; }
.detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.timeline { display: grid; gap: .6rem; list-style: none; padding: 0; }
.back-link { display: inline-block; margin-bottom: 1rem; }
footer { padding: 1rem; color: var(--muted); text-align: center; font-size: .78rem; }
.alert { margin-bottom: 1rem; padding: .8rem; border: 1px solid var(--line); background: #fff; }

@media (max-width: 850px) {
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  .site-header { padding: .65rem 1rem; flex-wrap: wrap; gap: .5rem; }
  .brand span:last-child { display: none; }
  .site-header nav { order: 3; width: 100%; min-height: 40px; }
  .site-header nav a { flex: 1; justify-content: center; }
  .container { padding-top: 1.25rem; }
  .list-page-head { align-items: flex-start; flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .filter-actions { grid-column: auto; }
  .list-header, .meeting-header { display: none; }
  .simple-list { overflow: visible; }
  .list-row, .meeting-list .list-row { min-width: 0; grid-template-columns: 34px 1fr; gap: .45rem .7rem; }
  .task-row, .meeting-row { padding: .9rem; }
  .task-row > :not(.row-number):not(.save-state) { grid-column: 2; }
  .task-row .row-number { grid-column: 1; grid-row: 1; }
  .mobile-label { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .72rem; font-weight: 700; }
  .task-link-row { grid-template-columns: 1fr; }
  .list-date { order: -1; }
  .dialog-actions { flex-wrap: wrap; }
  #copy-feedback { width: 100%; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
}

/* Compact editable task list. */
.task-grid { display: grid; grid-template-columns: 42px minmax(250px, 1fr) 160px 145px 145px 145px; gap: .55rem; align-items: center; min-width: 1010px; padding: .48rem .65rem; border-bottom: 1px solid var(--line); }
.task-grid:last-child { border-bottom: 0; }
.task-header { background: #f1f3f6; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.task-row { position: relative; }
.sequence { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.task-summary { min-width: 0; display: flex; gap: .45rem; align-items: baseline; white-space: nowrap; overflow: hidden; }
.task-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; text-decoration: none; }
.task-title:hover, .task-title:focus-visible { text-decoration: underline; }
.task-description { flex: 1 1 auto; min-width: 3rem; overflow: hidden; color: var(--muted); font-size: .82rem; text-overflow: ellipsis; }
.inline-edit { display: flex; min-width: 0; gap: .25rem; }
.inline-edit select, .inline-edit input[type="date"] { width: 100%; min-width: 0; height: 32px; padding: .25rem .35rem; border: 1px solid #cbd2da; border-radius: 5px; background: #fff; color: var(--ink); font-size: .8rem; }
.inline-save { min-height: 32px; padding: .25rem .4rem; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; font-size: .72rem; }
.js .inline-save { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.inline-feedback { min-height: 1.2rem; margin-top: .4rem; color: var(--green); font-size: .8rem; }
.detail-page-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.detail-page-head .eyebrow, .section-head .eyebrow { margin-bottom: .2rem; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .05em; }
.detail-panel + .detail-panel { margin-top: 1rem; }
.stack-form textarea, .link-form input { width: 100%; padding: .55rem .6rem; border: 1px solid #cbd2da; border-radius: 5px; background: #fff; color: var(--ink); }
.stack-form textarea { resize: vertical; }
.link-list { display: grid; gap: .55rem; margin: .8rem 0 1rem; padding: 0; list-style: none; }
.link-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .6rem; align-items: center; padding: .55rem; background: var(--wash); border-radius: 5px; }
.link-list a, .link-list small { min-width: 0; overflow-wrap: anywhere; }
.link-list small { grid-column: 1; color: var(--muted); }
.link-list form { grid-column: 2; grid-row: 1 / span 2; }
.button.danger { color: var(--red); }
.link-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: .6rem; align-items: end; }
.link-form label { display: block; margin-bottom: .25rem; font-size: .78rem; font-weight: 700; }
.count { color: var(--muted); font-size: .8rem; }

@media (max-width: 650px) {
  .task-grid { min-width: 0; grid-template-columns: 30px minmax(0, 1fr); gap: .45rem .6rem; padding: .75rem; }
  .task-header { display: none; }
  .task-row > :not(.sequence) { grid-column: 2; }
  .task-summary { display: grid; gap: .1rem; }
  .task-description { width: 100%; }
  .inline-edit::before { width: 5.5rem; flex: 0 0 5.5rem; color: var(--muted); font-size: .72rem; align-self: center; }
  .inline-edit:nth-of-type(1)::before { content: 'PIC'; }
  .inline-edit:nth-of-type(2)::before { content: 'Status'; }
  .inline-edit:nth-of-type(3)::before { content: 'Diberikan'; }
  .inline-edit:nth-of-type(4)::before { content: 'Deadline'; }
  .link-form { grid-template-columns: 1fr; }
}
