/* Greytree client portal. Colors follow the main site (cassiopeia_greytree); --accent is set per client. */
:root {
  --bar: #2b333c;
  --bar-dark: #181f25;
  --gt-blue: #58c0e5;
  --link: #095197;
  --text: #1a2128;
  --muted: #5d6670;
  --line: #dfe2e5;
  --bg: #f1f2f3;
  --card: #ffffff;
  --ok: #1f7a4a;
  --ok-bg: #e5f4ec;
  --warn: #8a5a00;
  --warn-bg: #fdf2dc;
  --danger: #b3261e;
  --danger-bg: #fbe9e7;
  --info-bg: #e8f4fa;
  --accent: var(--gt-blue);
  --radius: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.5 Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg);
}
main { flex: 1; width: 100%; padding-top: 24px; padding-bottom: 48px; }
a { color: var(--link); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
h1, h2, h3 { color: var(--bar-dark); font-weight: 700; line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; margin-top: 1.2em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.block { display: block; }

/* top bar */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); border-top: 4px solid var(--bar); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.brand:hover { text-decoration: none; }
.gt-logo { height: 30px; width: auto; display: block; }
.brand-sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; border-left: 1px solid var(--line); padding-left: 12px; }
.topnav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: .9rem; }
.topnav a { color: var(--text); font-weight: 700; }
.topnav a.on { color: var(--link); }
.topnav form { margin: 0; }
.who { color: var(--muted); }
.viewing-bar { background: var(--warn-bg); color: var(--warn); text-align: center; padding: 8px 16px; font-size: .9rem; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.viewing-bar form { margin: 0; }

/* client banner */
.hero {
  display: flex; align-items: center; gap: 24px; margin-bottom: 24px; padding: 24px;
  background: var(--card); border-radius: var(--radius); border-left: 6px solid var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.hero h1 { margin: 0 0 .25em; }
.hero-sub { margin: 0; color: var(--muted); }
.client-logo { max-height: 72px; max-width: 200px; width: auto; object-fit: contain; flex: none; }
.client-logo.small { max-height: 40px; max-width: 120px; }

/* layout */
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.col-main, .col-side { display: grid; gap: 24px; min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px 24px; box-shadow: 0 1px 2px rgba(0,0,0,.05); min-width: 0; }
.grid > .card { margin: 0; }
main > .card, main > section.card { margin-bottom: 24px; }
.narrow { max-width: 460px; margin: 40px auto; }
.narrow-wide { max-width: 720px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head form { margin: 0; }
.title-with-logo { display: flex; align-items: center; gap: 14px; }
.crumbs { margin: 0 0 12px; font-size: .9rem; }
.footer { color: var(--muted); font-size: .8rem; padding: 20px 0; border-top: 1px solid var(--line); background: var(--card); }

/* buttons and forms */
.button, .button-small {
  display: inline-block; border: 1px solid var(--bar); background: var(--bar); color: #fff; font: inherit; font-weight: 700;
  border-radius: 4px; cursor: pointer; text-align: center; line-height: 1.2;
}
.button { padding: 10px 18px; }
.button-small { padding: 6px 10px; font-size: .82rem; }
.is-client .button, .is-client .button-small { background: var(--bar); border-color: var(--bar); }
.button:hover, .button-small:hover { background: var(--bar-dark); text-decoration: none; color: #fff; }
.button.ghost, .button-small.ghost { background: transparent; color: var(--bar); }
.button.ghost:hover, .button-small.ghost:hover { background: var(--bg); color: var(--bar-dark); }
.button-small.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.button-small.danger:hover { background: var(--danger-bg); color: var(--danger); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.link-button.danger { color: var(--danger); }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1 1 180px; }
label { display: grid; gap: 4px; font-weight: 700; font-size: .88rem; }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=date], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid #c3c8cd; border-radius: 4px; background: #fff; color: var(--text);
}
input[type=color] { width: 64px; height: 36px; padding: 2px; border: 1px solid #c3c8cd; border-radius: 4px; background: #fff; }
input[type=range] { width: 100%; accent-color: var(--bar); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--gt-blue); outline-offset: 1px; }
textarea { resize: vertical; }
.check-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check-label.end { align-self: center; }
.code-input { font-size: 1.6rem !important; letter-spacing: .3em; text-align: center; max-width: 220px; }
.inline-form { margin: 0; }
details.add { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.add summary { cursor: pointer; font-weight: 700; color: var(--link); margin-bottom: 12px; list-style: none; }
details.add summary::-webkit-details-marker { display: none; }

/* flash */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-info { background: var(--info-bg); color: var(--bar-dark); }

/* sign-in */
.auth h1 { font-size: 1.35rem; }
.steps { padding-left: 20px; display: grid; gap: 12px; }
.secret { font: 700 1.15rem/1.4 Consolas, Menlo, monospace; background: var(--bg); padding: 10px 12px; margin: 8px 0 4px; border-radius: 4px; letter-spacing: .05em; word-break: break-all; }

/* projects */
.project-list, .file-list, .updates, .timeline, .milestones, .team, .events { list-style: none; margin: 0; padding: 0; }
.project-list { display: grid; gap: 12px; }
.hint { margin: -4px 0 12px; }
.project-head strong::after { content: " →"; color: var(--muted); font-weight: 400; }
.project-card { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); border-left: 4px solid var(--accent); }
.project-card:hover { text-decoration: none; background: #fafbfb; border-color: #c9ced3; border-left-color: var(--accent); }
.project-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.project-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); }
progress { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 4px; background: #e6e9ec; overflow: hidden; }
progress::-webkit-progress-bar { background: #e6e9ec; border-radius: 4px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.progress-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.status { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.status-active { background: var(--ok-bg); color: var(--ok); }
.status-planning { background: var(--info-bg); color: var(--link); }
.status-on_hold { background: var(--warn-bg); color: var(--warn); }
.status-complete { background: #eceef0; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 14px; }
.facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.prose { margin-bottom: 1em; }

/* files */
.file-list { display: grid; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.file-row:first-child { border-top: 0; }
.file-main { flex: 1; min-width: 0; display: grid; }
.file-name { font-weight: 700; overflow-wrap: anywhere; }
.file-actions { display: flex; gap: 6px; flex: none; }
.badge-type { display: inline-grid; place-items: center; min-width: 42px; height: 26px; padding: 0 4px; font-size: .68rem; font-weight: 700; color: #fff; background: var(--bar); border-radius: 3px; flex: none; }
.badge-type.big { min-width: 72px; height: 44px; font-size: 1rem; }
.tag-new { display: inline-block; margin-left: 6px; vertical-align: 1px; font-size: .7rem; font-weight: 700; color: #fff; background: var(--accent); padding: 1px 6px; border-radius: 3px; text-transform: uppercase; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; padding: 12px 14px; margin: 4px 0 8px; background: var(--bg); border-radius: var(--radius); }
.filter-bar[hidden], [data-file-row][hidden], [data-file-group][hidden], .filter-empty[hidden] { display: none; }
.filter-bar label { flex: 1 1 150px; font-size: .78rem; }
.filter-bar select, .filter-bar input { padding: 6px 8px; }
.filter-count { align-self: center; }
.filter-empty { padding: 12px 0; }
.file-group { border-top: 1px solid var(--line); }
.file-group:first-of-type { border-top: 0; }
.file-group[hidden] { display: none; }
.file-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 0; margin: 0; border-bottom: 0; user-select: none; }
.file-group > summary::-webkit-details-marker { display: none; }
.file-group > summary:hover .group-name { color: var(--link); }
.file-group[open] > summary { border-bottom: 1px solid var(--line); }
.group-caret { width: 0; height: 0; border-left: 6px solid var(--muted); border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .15s; flex: none; }
.file-group[open] .group-caret { transform: rotate(90deg); }
.group-name { color: var(--bar-dark); }
.group-count { text-transform: none; letter-spacing: 0; font-weight: 400; }
.file-group .tag-new { margin-left: 0; }
.file-group .files-table { margin-bottom: 8px; }
.group-toggles { margin-left: auto; align-self: center; color: var(--muted); white-space: nowrap; }
.see-all { display: grid; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 700; }
.group-title { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 0; }
.upload-box { margin-top: 16px; display: grid; gap: 12px; }
.drop { display: grid; gap: 6px; border: 2px dashed #c3c8cd; border-radius: var(--radius); padding: 18px; font-weight: 400; text-align: center; cursor: pointer; background: #fafbfb; }
.upload-box fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 12px; }
.upload-box.is-preview fieldset { opacity: .5; }
.upload-box.is-preview .drop { cursor: not-allowed; }
.preview-note { margin: 0; padding: 8px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 4px; }
.drop.over { border-color: var(--accent); background: var(--info-bg); }
.drop input[type=file] { justify-self: center; max-width: 100%; }
.file-header { display: flex; justify-content: space-between; align-items: start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.file-title { font-size: 1.25rem; overflow-wrap: anywhere; margin-bottom: .2em; }
.preview-frame { width: 100%; height: 78vh; min-height: 420px; border: 1px solid var(--line); border-radius: 4px; }
.preview-image { text-align: center; background: var(--bg); padding: 16px; border-radius: 4px; }
.preview-image img { max-width: 100%; height: auto; }
.preview-text { max-height: 70vh; overflow: auto; background: var(--bg); padding: 16px; border-radius: 4px; white-space: pre-wrap; font-size: .85rem; }
.no-preview { text-align: center; padding: 40px 16px; color: var(--muted); display: grid; justify-items: center; gap: 12px; }

/* sidebar lists */
.timeline li, .updates li, .events li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child, .updates li:first-child, .events li:first-child { border-top: 0; padding-top: 0; }
.timeline .date { font-weight: 700; font-size: .82rem; color: var(--bar-dark); }
.updates form { margin: 4px 0 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.milestones li { display: flex; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.milestones li:first-child { border-top: 0; }
.milestones li > span:not(.check) { flex: 1; display: grid; }
.milestones li.done > span:not(.check) { color: var(--muted); text-decoration: line-through; }
.milestones form { margin: 0; }
.milestones.editable { margin-bottom: 16px; }
.check { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 2px solid #b7bdc3; border-radius: 50%; font-size: .8rem; font-weight: 700; color: #fff; background: #fff; flex: none; padding: 0; cursor: default; }
button.check { cursor: pointer; }
.done .check { background: var(--accent); border-color: var(--accent); }
.team { display: grid; gap: 14px; }
.team li { display: flex; gap: 12px; align-items: start; }
.team li > span:last-child { display: grid; min-width: 0; overflow-wrap: anywhere; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bar); color: #fff; font-weight: 700; flex: none; }
.team-pick { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* admin tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px 8px 8px 0; }
.table td { border-bottom: 1px solid var(--line); padding: 10px 8px 10px 0; vertical-align: middle; }
.table tr.inactive td { color: var(--muted); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; margin: 0 0 0 4px; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; background: #eceef0; color: var(--muted); text-transform: uppercase; }
.tag-client { background: var(--info-bg); color: var(--link); }

@media (max-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .hero { flex-direction: column; align-items: start; gap: 14px; padding: 18px; }
  .card { padding: 16px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 2px 0; }
  .table .actions { text-align: left; padding-top: 6px; white-space: normal; }
  .table .actions form { margin: 0 4px 4px 0; display: inline-block; }
  .file-row { flex-wrap: wrap; }
  .file-actions { width: 100%; padding-left: 54px; }
  .brand-sub { display: none; }
}
