:root {
  --navy: #1f3c88;
  --navy-dark: #152a60;
  --red: #c62828;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #1e2430;
  --muted: #6b7280;
  --line: #e3e7ee;
  --ok: #2e7d32;
  --warn: #ef6c00;
  --err: #c62828;
  --blue: #1976d2;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* sidebar layout */
body.with-sidebar { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: 0 0 240px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { display: block; padding: 18px 28px 6px; }
.sidebar .logo img { width: 100%; display: block; }
.sidebar .app-name { text-align: center; font-weight: 700; color: var(--navy-dark); font-size: 13px; padding: 0 12px 14px; border-bottom: 1px solid var(--line); line-height: 1.35; }
.sidebar .app-name span { font-weight: 400; color: var(--muted); font-size: 11px; }
.sidebar nav { display: flex; flex-direction: column; padding: 10px; gap: 2px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.sidebar nav a .ic { width: 18px; text-align: center; color: var(--navy); font-size: 14px; }
.sidebar nav a:hover { background: #eef2ff; text-decoration: none; }
.sidebar nav a.active { background: var(--navy); color: #fff; }
.sidebar nav a.active .ic { color: #fff; }
.sidebar nav a .badge { margin-left: auto; }
.sidebar .nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px 12px 4px; }
.sidebar .who { padding: 12px 14px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar .who .name { font-weight: 700; color: var(--navy-dark); }
.sidebar .who .role { color: var(--muted); font-size: 12px; }
.content { flex: 1; min-width: 0; padding: 20px 24px; }
@media (max-width: 800px) {
  body.with-sidebar { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .sidebar .logo { padding: 10px 0 0; }
  .sidebar .logo img { max-width: 160px; margin: 0 auto; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
}
.badge { display: inline-block; min-width: 20px; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; text-align: center; }
.badge.red { background: var(--red); color: #fff; }
.badge.grey { background: #e5e7eb; color: #374151; }
.badge.blue { background: #e3f2fd; color: #0d47a1; }
.badge.green { background: #e8f5e9; color: #1b5e20; }
.badge.orange { background: #fff3e0; color: #e65100; }
.badge.navy { background: var(--navy); color: #fff; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; color: var(--navy-dark); }
.page-head .sub { color: var(--muted); font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 12px; color: var(--navy-dark); display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .grid.c2, .grid.c3, .grid.c6 { grid-template-columns: 1fr 1fr; } }

.stat { text-align: center; padding: 14px 8px; }
.stat .n { font-size: 26px; font-weight: 700; color: var(--navy); }
.stat .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.link:hover { background: #f7f9ff; text-decoration: none; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: #fafbfd; }
tr:hover td { background: #fafbff; }
td.num, th.num { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

.btn { display: inline-block; border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: 7px 14px; border-radius: 7px; font-size: 13px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--navy-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: #eef2ff; }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.warn { background: var(--warn); border-color: var(--warn); }
.btn.err { background: var(--err); border-color: var(--err); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

form.inline { display: inline; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=email], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd6e2; border-radius: 7px; font-size: 14px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c5d3ff; border-color: var(--navy); }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters .field { margin: 0; min-width: 150px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.flash.err { background: #ffebee; border-color: #ef9a9a; color: #b71c1c; }

/* stage progress */
.stages { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 16px; }
.stage { border: 2px solid var(--line); border-radius: 9px; padding: 10px; background: #fff; position: relative; }
.stage .no { font-size: 11px; color: var(--muted); font-weight: 700; }
.stage .nm { font-weight: 700; font-size: 13px; margin: 2px 0 4px; color: var(--navy-dark); }
.stage .st { font-size: 12px; color: var(--muted); }
/* project tabs */
.ptabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 0 0 14px; position: sticky; top: 0; z-index: 5; background: var(--bg);
  overflow-x: auto; }
.ptab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 16px; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.ptab:hover { color: var(--navy); background: #eef2ff; border-radius: 8px 8px 0 0; }
.ptab.on { color: var(--navy); border-bottom-color: var(--navy); }
.tabpane[hidden] { display: none; }

/* tasks: parent (stage) / children (default steps + ad-hoc items) */
.tk, .tk-kids { list-style: none; margin: 0; padding: 0; }
.tk > li { border-bottom: 1px solid var(--line); }
.tk > li:last-child { border-bottom: 0; }
.tk-parent > summary { list-style: none; }
.tk-parent > summary::-webkit-details-marker { display: none; }
.tk-prow { display: flex; align-items: center; gap: 10px; padding: 9px 4px; cursor: pointer; border-radius: 6px; }
.tk-prow:hover { background: #f7f9ff; }
.tk-parent[open] > summary .caret { transform: rotate(90deg); }
.tk-pdot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  border: 2px solid #cfd6e2; color: var(--muted); background: #fff; }
.tk-parent.is-done .tk-pdot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tk-parent.is-active .tk-pdot { background: var(--navy); border-color: var(--navy); color: #fff; }
.tk-parent.is-active.is-late .tk-pdot { background: var(--err); border-color: var(--err); }
.tk-ptitle { flex: 1; min-width: 0; font-weight: 700; color: var(--navy-dark); }
.tk-parent.is-pending .tk-ptitle { color: var(--muted); font-weight: 600; }
.tk-due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tk-due.late { color: var(--err); font-weight: 700; }
.tk-due.warn { color: var(--warn); }
.tk-count { font-size: 12px; color: var(--muted); min-width: 34px; text-align: right; }
.tk-kids { margin: 0 0 8px 20px; border-left: 2px solid #e1e6f0; }
.tk-row { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 14px; min-height: 34px; position: relative; font-size: 13.5px; }
.tk-row::before { content: ""; position: absolute; left: 0; top: 50%; width: 9px; border-top: 2px solid #e1e6f0; }
.tk-row:hover { background: #fafbff; }
.tk-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cfd6e2; display: grid; place-items: center; font-size: 10px; color: #fff; background: #fff; }
.tk-row.is-done .tk-dot { background: var(--ok); border-color: var(--ok); }
.tk-row.is-cur .tk-dot { border-color: var(--navy); color: var(--navy); font-size: 11px; }
.tk-check { flex: none; width: 18px; height: 18px; border-radius: 4px; border: 2px solid #b8c1d1; background: #fff; cursor: pointer; padding: 0;
  color: #fff; font-size: 11px; font-weight: 700; line-height: 14px; }
.tk-check:hover { border-color: var(--ok); }
.tk-row.is-item.is-done .tk-check { background: var(--ok); border-color: var(--ok); }
.tk-name { flex: 1 1 140px; min-width: 110px; overflow-wrap: anywhere; }
.tk-row.is-cur .tk-name { font-weight: 700; color: var(--navy); }
.tk-row.is-todo .tk-name, .tk-row.is-todo .tk-who { color: #9aa3b2; }
.tk-row.is-item.is-done .tk-name { text-decoration: line-through; color: var(--muted); }
.tk-row.is-item.is-late .tk-name { color: var(--err); }
.tk-note { color: var(--muted); font-size: 12px; }
.tk-who { flex: 0 1 130px; min-width: 60px; font-size: 12px; color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-info { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); justify-content: flex-end; flex-wrap: wrap; }
.tk-act { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tk-act input[type=date], .tk-act select { width: auto; padding: 3px 6px; font-size: 12px; }
.tk-ret { color: var(--warn); font-size: 11.5px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-del { color: #b0b7c3; }
.tk-row.is-add .linkbtn { font-weight: 600; font-size: 12.5px; }
@media (max-width: 700px) { .tk-who { display: none; } }

/* file-type icons */
.ficon { position: relative; flex: none; display: inline-grid; place-items: end center; width: 26px; height: 32px; border-radius: 3px 8px 3px 3px;
  background: #fff; border: 1.5px solid var(--fc, #9aa5b8); vertical-align: middle; box-sizing: border-box; }
.ficon::before { content: ""; position: absolute; top: -1.5px; right: -1.5px; width: 9px; height: 9px; background: linear-gradient(225deg, #f3f5f9 50%, var(--fc, #9aa5b8) 50%);
  border-radius: 0 6px 0 2px; }
.ficon > span { display: block; width: calc(100% + 3px); margin: 0 -1.5px -1.5px; background: var(--fc, #9aa5b8); color: #fff; font-size: 8.5px; font-weight: 800;
  letter-spacing: .2px; text-align: center; line-height: 12px; border-radius: 0 0 3px 3px; font-family: "Segoe UI", Arial, sans-serif; }
.ft-pdf { --fc: #d93025; } .ft-doc { --fc: #2b5797; } .ft-xls { --fc: #1e7e45; } .ft-ppt { --fc: #d24726; }
.ft-cad { --fc: #7b3fb8; } .ft-img { --fc: #0f8b8d; } .ft-zip { --fc: #b7791f; } .ft-gis { --fc: #2f855a; }
.ft-vid { --fc: #c2185b; } .ft-txt { --fc: #6b7280; } .ft-other { --fc: #8a94a6; }
.ftypes-legend { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.ftypes-legend .ficon { transform: scale(.7); margin: -4px -3px; }

/* folder tree */
.fold-ico { flex: none; vertical-align: middle; }
.fold-ico .fold-back { fill: #e0a800; }
.fold-ico .fold-front { fill: #fbc02d; }
.fold-ico.is-open .fold-front { fill: #ffd54f; transform: skewX(-12deg) translate(2px, 1px); transform-origin: bottom; }
.tree-tools { display: flex; gap: 6px; margin-bottom: 10px; }
.tree-tools input { flex: 1; }
.ftree, .ftree ul { list-style: none; margin: 0; padding: 0; }
.ftree .tbranch { padding-left: 14px; }
.ftree .tbranch > li { position: relative; padding-left: 16px; }
.ftree .tbranch > li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid #cfd6e2; }
.ftree .tbranch > li:last-child::before { bottom: auto; height: 19px; }
.ftree .tbranch > li::after { content: ""; position: absolute; left: 0; top: 19px; width: 12px; border-top: 1px solid #cfd6e2; }
.trow { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; min-height: 30px; }
.trow.is-folder { font-weight: 600; cursor: pointer; }
.trow.is-folder:hover, .trow.is-file:hover { background: #f3f6ff; }
.trow.is-current .tname { color: var(--navy); }
.trow .tname { color: var(--navy-dark); word-break: break-word; }
.trow .tlabel { color: var(--muted); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.trow .tcount { font-size: 11px; font-weight: 700; background: var(--navy); color: #fff; border-radius: 999px; padding: 1px 7px; }
.trow .tcount.zero { background: #e5e7eb; color: #6b7280; }
.trow .topen { font-weight: 700; color: var(--muted); padding: 0 4px; }
.trow .topen:hover { color: var(--navy); text-decoration: none; }
details.tfolder > summary { list-style: none; }
details.tfolder > summary::-webkit-details-marker { display: none; }
.caret { width: 0; height: 0; border-left: 5px solid #8a94a6; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; flex: none; }
details.tfolder[open] > summary .caret { transform: rotate(90deg); }
.fold-opened { display: none; } .fold-closed { display: inline-flex; }
details.tfolder[open] > summary .fold-opened { display: inline-flex; }
details.tfolder[open] > summary .fold-closed { display: none; }
.trow.is-file { font-weight: 400; align-items: flex-start; }
.trow.is-file.is-final { background: #f4fbf2; }
.tfile { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; padding-top: 1px; }
.tfile .tname { font-weight: 600; overflow-wrap: anywhere; }
.tmeta { font-size: 11.5px; color: var(--muted); }
.tstar { background: none; border: 0; cursor: pointer; font-size: 17px; color: #b8c1d1; padding: 0 2px; line-height: 1; }
.tstar:hover, .tstar.on { color: #f4b400; }
.froot > .trow { font-size: 14px; }

/* project members */
.member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.member { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.member img, .member .ava { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.member .ava { display: grid; place-items: center; background: #e3e8f5; color: var(--navy); font-weight: 700; }
.member-body { flex: 1; min-width: 0; font-size: 13px; }
.member-add { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.member-add select { flex: 1; min-width: 220px; }
.member-add .hint { flex-basis: 100%; }

/* Google Drive settings */
.drive-steps { display: flex; flex-direction: column; gap: 10px; }
.drive-step { display: flex; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.drive-step.done { border-color: #a5d6a7; background: #f6fbf4; }
.drive-step.bad { border-color: #ef9a9a; background: #fff6f6; }
.drive-step .num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: #e3e8f5; color: var(--navy); }
.drive-step.done .num { background: var(--ok); color: #fff; }
.drive-step .body { flex: 1; min-width: 0; }
.drive-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.drive-row input[type=text] { flex: 1; min-width: 240px; }
.drive-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.drive-modes label { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  cursor: pointer; font-weight: 400; color: var(--text); font-size: 13px; margin: 0; }
.drive-modes label.on { border-color: var(--navy); background: #f3f6ff; }
@media (max-width: 800px) { .drive-modes { grid-template-columns: 1fr; } }
.check-table { width: auto; margin-top: 6px; }
.check-table td { padding: 3px 12px 3px 0; border: 0; }

/* stage deadline + work items */
.rm-due { font-size: 12px; margin-top: 6px; color: var(--muted); }
.rm-due.late, .rm-due.late summary { color: var(--err); font-weight: 600; }
.rm-due summary { cursor: pointer; list-style: none; color: var(--navy); }
.rm-due summary::-webkit-details-marker { display: none; }
.rm-due-form { display: flex; flex-direction: column; gap: 4px; align-items: center; margin-top: 4px; }
.rm-due-form input[type=date] { width: 132px; padding: 4px 6px; font-size: 12px; }
.items-stage { margin-bottom: 12px; }
.items-head { font-weight: 700; font-size: 13px; color: var(--navy-dark); margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: #fff; }
.item.late { border-color: #ef9a9a; background: #fff5f5; }
.item.done { background: #f6f7f9; }
.item.done .item-title { text-decoration: line-through; color: var(--muted); }
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 600; }
.item-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #b8c1d1; background: #fff; cursor: pointer; color: #fff; font-weight: 700; padding: 0; line-height: 18px; }
.item-check:hover { border-color: var(--ok); }
.item.done .item-check { background: var(--ok); border-color: var(--ok); }
dialog.item-dialog { border: 0; border-radius: 14px; padding: 20px 22px; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.item-dialog::backdrop { background: rgba(15, 25, 50, .45); }

/* users & RBAC */
.assign-card { border-color: #c5d3ff; background: #f7f9ff; }
.assign-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.assign-row .field { margin-bottom: 6px; }
.assign-row .btn { white-space: nowrap; }
.assign-row textarea { min-height: 42px; }
table.users tr.row-invited td { background: #f5f8ff; }
table.users tr.row-denied td { background: #fff5f5; }
.table-wrap { overflow-x: auto; }
.table-wrap table.users { min-width: 900px; }
.tabs-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tabs-row .tab { padding: 7px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 13px; }
.tabs-row .tab:hover { text-decoration: none; background: #eef2ff; }
.tabs-row .tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs-row .tab.warn:not(.on) { border-color: #ffb74d; }
table.users td { vertical-align: middle; }
table.users tr.row-warn td { background: #fffaf0; }
table.users tr.row-off td { opacity: .6; }
.who-cell { display: flex; gap: 10px; align-items: center; }
.who-cell img, .who-cell .ava { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.who-cell .ava { display: grid; place-items: center; background: #e3e8f5; color: var(--navy); font-weight: 700; }
.rbac-form { display: flex; gap: 8px; align-items: center; }
.rbac-form select { width: auto; min-width: 170px; padding: 5px 8px; }
.row-actions { display: flex; gap: 14px; margin-top: 4px; align-items: flex-start; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--navy); font-size: 12px; cursor: pointer; font-family: inherit; }
.linkbtn:hover { text-decoration: underline; }
details.inline-edit > summary { list-style: none; }
details.inline-edit > summary::-webkit-details-marker { display: none; }

/* roadmap: each stage is a point, connected by arrows */
.roadmap-wrap { overflow-x: auto; }
.roadmap { display: flex; min-width: 760px; padding: 6px 0 2px; }
.rm-step { flex: 1 1 0; position: relative; text-align: center; padding: 0 8px; color: var(--text); }
.rm-step:hover { text-decoration: none; }
.rm-step:hover .rm-name { text-decoration: underline; }
.rm-dot { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; font-weight: 700; font-size: 16px;
  border: 3px solid #cfd6e2; background: #fff; color: var(--muted); position: relative; z-index: 1; }
.rm-conn { position: absolute; top: 20px; left: calc(50% + 28px); right: calc(-50% + 28px); height: 3px; background: #cfd6e2; border-radius: 2px; }
.rm-conn::after { content: ""; position: absolute; right: -3px; top: -6px; border-left: 11px solid #cfd6e2; border-top: 7.5px solid transparent; border-bottom: 7.5px solid transparent; }
.rm-conn.done { background: var(--ok); }
.rm-conn.done::after { border-left-color: var(--ok); }
.rm-no { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.rm-name { font-weight: 700; color: var(--navy-dark); font-size: 13px; margin: 2px 0 4px; line-height: 1.3; }
.rm-meta { font-size: 12px; color: var(--muted); line-height: 1.45; }
.rm-step.done .rm-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.rm-step.active .rm-dot { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 6px #dfe6ff; }
.rm-step.active .rm-meta b { color: var(--navy); }
.rm-step.active.late .rm-dot { background: var(--err); border-color: var(--err); box-shadow: 0 0 0 6px #ffcdd2; }
.rm-step.pending .rm-name { color: var(--muted); }
a.rm-dot:hover { text-decoration: none; filter: brightness(1.08); }
.rm-step { display: flex; flex-direction: column; }
.rm-files { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; }
.rm-files form { margin: 0; }
.rm-upload { cursor: pointer; white-space: nowrap; }
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .detail-cols { grid-template-columns: 1fr; } }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 20px; }
.info-grid label { margin-bottom: 2px; }
.info-grid .wide { grid-column: 1 / -1; }
.form-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.form-grid.c4 .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .info-grid, .form-grid.c4 { grid-template-columns: 1fr 1fr; } .stages.c3 { grid-template-columns: 1fr 1fr; } }
.stage.done { border-color: #a5d6a7; background: #f1f8e9; }
.stage.active { border-color: var(--navy); background: #eef2ff; box-shadow: 0 0 0 3px #dfe6ff; }
.stage.pending { opacity: .75; }
.stage.overdue { border-color: var(--err); }

.steps { display: flex; gap: 4px; margin: 10px 0; flex-wrap: wrap; }
.step { padding: 5px 10px; border-radius: 999px; font-size: 12px; background: #eef0f4; color: var(--muted); }
.step.cur { background: var(--navy); color: #fff; font-weight: 600; }
.step.done { background: #e8f5e9; color: #1b5e20; }

.task-box { border: 1px solid #c5d3ff; background: #f7f9ff; border-radius: 9px; padding: 12px; margin-bottom: 10px; }
.task-box .t { font-weight: 700; color: var(--navy-dark); }
.task-box .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: end; }
.task-box .actions .field { margin: 0; flex: 1; min-width: 180px; }
.overdue-txt { color: var(--err); font-weight: 600; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(8, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; }
.kcol { background: #e9edf5; border-radius: 9px; padding: 8px; min-height: 200px; }
.kcol h3 { font-size: 12px; text-transform: uppercase; margin: 4px 4px 8px; color: var(--navy-dark); display: flex; justify-content: space-between; }
.kcard { background: #fff; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line); font-size: 13px; }
.kcard .c { font-weight: 700; color: var(--navy); }
.kcard .n { margin: 2px 0; }
.kcard .m { color: var(--muted); font-size: 12px; }

/* documents */
.folder { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.folder > summary { padding: 8px 12px; cursor: pointer; font-weight: 600; background: #fafbfd; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.folder > summary .k { font-family: Consolas, monospace; font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.folder table { font-size: 13px; }
.folder .empty { padding: 8px 12px; color: var(--muted); font-size: 12px; }
.tree { font-family: Consolas, monospace; font-size: 12px; white-space: pre; background: #fafbfd; padding: 10px; border-radius: 8px; border: 1px solid var(--line); overflow: auto; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy); }
.timeline .when { color: var(--muted); font-size: 12px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy) 0%, #2d55b8 100%); }
.login-box { background: #fff; padding: 28px; border-radius: 14px; width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
/* login page (ChatGPT-style) */
body.auth-page { background: #f3f5f9; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 24px; padding: 36px 40px 28px; box-shadow: 0 12px 48px rgba(20, 30, 60, .12); text-align: center; }
.auth-logo { width: 96px; display: block; margin: 0 auto 8px; }
.auth-title { font-size: 28px; font-weight: 500; margin: 4px 0 8px; color: #111; }
.auth-sub { color: #444; font-size: 15px; margin: 0 0 24px; line-height: 1.45; }
.auth-flash { text-align: left; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; border: 1px solid #d9d9e3; border-radius: 999px;
  background: #fff; color: #111; font-size: 17px; font-weight: 500; text-decoration: none; transition: background .15s; }
.auth-btn:hover { background: #f4f5f7; text-decoration: none; }
.auth-or { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: #666; font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid #e3e3e8; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .auth-input { width: 100%; height: 54px; border: 1px solid #d9d9e3; border-radius: 999px; padding: 0 22px; font-size: 16px; font-family: inherit; background: #fff; }
.auth-form .auth-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px #dfe6ff; }
.auth-submit { height: 56px; border: 0; border-radius: 999px; background: #0d0d0d; color: #fff; font-size: 17px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.auth-submit:hover { background: #2b2b2b; }
.auth-foot { color: #888; font-size: 12px; margin: 20px 0 0; }
@media (max-width: 480px) { .auth-card { padding: 28px 20px 22px; border-radius: 18px; } }
.login-box .logo { display: block; width: 180px; margin: 0 auto 6px; }
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #fff; color: #1f2937; border-color: #cfd6e2; padding: 10px; font-size: 14px; }
.btn.google:hover { background: #f5f7fb; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 6px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-box .sub { color: var(--muted); margin-bottom: 18px; font-size: 13px; text-align: center; }
details.box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; background: #fff; }
details.box summary { cursor: pointer; font-weight: 600; color: var(--navy-dark); }
.hint { font-size: 12px; color: var(--muted); }
.tag-role { font-size: 11px; background: #eef2ff; color: var(--navy); padding: 2px 7px; border-radius: 999px; }
