/* Atrium — Ascension Technology Solutions client portal
   Theme tokens extracted from the live ATS.net site so the portal reads as part of Ascension. */
:root {
  --primary: #1272a3;
  --primary-dark: #0d5a82;
  --primary-light: #1a8fc7;
  --accent: #00c9b1;
  --accent2: #f0a500;
  --dark: #0a1628;
  --dark2: #0f2040;
  --mid: #1c3154;
  --light: #e8f4fd;
  --white: #ffffff;
  --gray: #6b7c93;
  --light-gray: #f0f5fa;
  --text: #1a2940;
  --text-light: #4a5e75;
  --border: #dbe6f0;
  --danger: #d64545;
  --warn: #f0a500;
  --ok: #00a58f;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(10, 22, 40, 0.06);
  --shadow-lg: 0 8px 30px rgba(10, 22, 40, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Raleway', system-ui, sans-serif;
  color: var(--text);
  background: var(--light-gray);
  line-height: 1.5;
}
h1, h2, h3, h4, h5 { font-family: 'Montserrat', sans-serif; font-weight: 700; color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── App shell ── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark2) 100%);
  color: rgba(255,255,255,0.85);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: margin-left 0.25s ease; z-index: 40;
}
body.nav-collapsed .sidebar { margin-left: -250px; }
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 1.4rem 1.5rem; border-bottom: 1px solid rgba(18,114,163,0.3);
}
.sidebar-brand img { height: 34px; filter: brightness(0) invert(1) sepia(1) saturate(2) hue-rotate(150deg); }
.sidebar-brand .brand { font-family: 'Montserrat'; font-weight: 800; font-size: 1.05rem; color: #fff; letter-spacing: 2px; text-transform: uppercase; line-height: 1; }
.sidebar-brand .sub { font-size: 0.58rem; letter-spacing: 3px; text-transform: uppercase; color: rgba(0,201,177,0.85); margin-top: 3px; }
.sidebar nav { padding: 1rem 0.75rem; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 0.7rem 0.9rem; margin-bottom: 0.2rem; border-radius: 8px;
  color: rgba(255,255,255,0.75); font-family: 'Montserrat'; font-weight: 500;
  font-size: 0.82rem; letter-spacing: 0.5px; transition: all 0.15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: rgba(0,201,177,0.14); color: var(--accent); }
.sidebar nav a .ico { width: 18px; text-align: center; opacity: 0.9; }
.sidebar-foot { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.72rem; color: rgba(255,255,255,0.5); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 2rem; height: 64px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 1.15rem; }
.topbar .user { display: flex; align-items: center; gap: 0.9rem; font-size: 0.85rem; color: var(--text-light); }
.topbar .user .role-tag { font-size: 0.65rem; }
/* Full-width: content expands to fill; no wasted empty space on the right (operator directive) */
.content { padding: 1.75rem 2rem; width: 100%; }

/* ── Cards ── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 1.25rem 1.4rem; }
.card + .card { margin-top: 1.25rem; }
.card-head { padding: 1rem 1.4rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { font-size: 0.95rem; letter-spacing: 0.5px; }

/* ── Stat tiles ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.stat .n { font-family: 'Montserrat'; font-weight: 800; font-size: 1.9rem; color: var(--primary); line-height: 1; }
.stat .l { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); margin-top: 0.4rem; }
.stat.warn .n { color: var(--warn); }
.stat.danger .n { color: var(--danger); }

/* ── Pipeline board ── */
.board { display: grid; grid-template-columns: repeat(6, minmax(160px, 1fr)); gap: 0.85rem; overflow-x: auto; }
.col { background: var(--light-gray); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem; min-height: 120px; }
.col h3 { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); padding: 0.3rem 0.4rem 0.6rem; display: flex; justify-content: space-between; }
.col h3 .count { background: var(--border); color: var(--text-light); border-radius: 10px; padding: 0 0.45rem; font-size: 0.62rem; }
.pcard { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.8rem; margin-bottom: 0.55rem; box-shadow: var(--shadow); display: block; transition: all 0.12s; }
.pcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.pcard .t { font-family: 'Montserrat'; font-weight: 600; font-size: 0.82rem; color: var(--text); }
.pcard .c { font-size: 0.72rem; color: var(--text-light); margin-top: 0.15rem; }
.pcard .meta { display: flex; gap: 0.35rem; margin-top: 0.5rem; flex-wrap: wrap; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.66rem; font-weight: 600; font-family: 'Montserrat'; text-transform: uppercase; letter-spacing: 0.5px; padding: 0.18rem 0.5rem; border-radius: 20px; }
.badge.gray { background: var(--light-gray); color: var(--text-light); }
.badge.blue { background: rgba(18,114,163,0.12); color: var(--primary); }
.badge.teal { background: rgba(0,201,177,0.14); color: var(--ok); }
.badge.gold { background: rgba(240,165,0,0.15); color: #b57d00; }
.badge.red { background: rgba(214,69,69,0.12); color: var(--danger); }
.badge.cold { background: rgba(214,69,69,0.1); color: var(--danger); }

/* ── Tables ── */
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); }
table.tbl td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--light-gray); font-size: 0.87rem; }
table.tbl tr:hover td { background: #fafcfe; }
table.tbl tr:last-child td { border-bottom: none; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; font-family: 'Montserrat'; font-weight: 600; font-size: 0.78rem; letter-spacing: 0.5px; padding: 0.55rem 1.1rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: all 0.15s; background: var(--primary); color: #fff; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.teal { background: var(--accent); } .btn.teal:hover { background: var(--ok); }
.btn.sm { padding: 0.35rem 0.7rem; font-size: 0.7rem; }
.btn.block { width: 100%; justify-content: center; }

/* ── Forms ── */
.field { margin-bottom: 0.95rem; }
.field label { display: block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Raleway'; font-size: 0.87rem; color: var(--text); background: var(--white);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,114,163,0.1); }
.field textarea { resize: vertical; min-height: 72px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* ── Progress ── */
.progress { height: 8px; background: var(--light-gray); border-radius: 20px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 20px; }

/* ── Notes thread ── */
.thread { display: flex; flex-direction: column; gap: 0.9rem; }
.note { max-width: 78%; padding: 0.8rem 1rem; border-radius: 12px; box-shadow: var(--shadow); }
.note .who { font-size: 0.68rem; font-weight: 700; font-family: 'Montserrat'; letter-spacing: 0.5px; margin-bottom: 0.25rem; }
.note .body { font-size: 0.88rem; white-space: pre-wrap; }
.note .ref { display: inline-block; margin-top: 0.45rem; font-size: 0.76rem; padding: 0.25rem 0.6rem; background: var(--light-gray); border-radius: 6px; }
.note .when { font-size: 0.66rem; color: var(--text-light); margin-top: 0.4rem; }
.note.developer { align-self: flex-start; background: var(--white); border: 1px solid var(--border); }
.note.developer .who { color: var(--primary); }
.note.client { align-self: flex-end; background: rgba(0,201,177,0.08); border: 1px solid rgba(0,201,177,0.25); }
.note.client .who { color: var(--ok); }

/* ── File grid ── */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem; }
.file { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--white); box-shadow: var(--shadow); }
.file .thumb { height: 100px; background: var(--light-gray); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--gray); }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .fi { padding: 0.55rem 0.65rem; }
.file .fn { font-size: 0.74rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .fm { font-size: 0.66rem; color: var(--text-light); margin-top: 0.15rem; }

/* ── Misc ── */
.flash { background: rgba(0,201,177,0.12); border: 1px solid rgba(0,201,177,0.35); color: #0a7c6c; padding: 0.75rem 1.1rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 1.25rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.4rem; }
.muted { color: var(--text-light); }
.row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 1.25rem; } .mb { margin-bottom: 1.25rem; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; align-items: start; }
details.inline-form { margin-top: 0.5rem; }
details.inline-form summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 0.8rem; font-family: 'Montserrat'; }
details.inline-form[open] > summary { margin-bottom: 0.8rem; }

/* ── Collapsible edge notches (tap-friendly, work on touch — no hover) ── */
.notch {
  position: fixed; top: 50%; transform: translateY(-50%);
  z-index: 60; width: 22px; height: 66px; cursor: pointer;
  background: var(--dark2); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem; user-select: none; transition: left 0.25s ease, right 0.25s ease;
}
.notch:hover { background: var(--mid); }
.notch-left { left: 250px; border-radius: 0 8px 8px 0; border-left: none; }
body.nav-collapsed .notch-left { left: 0; }
.notch-right { right: 320px; border-radius: 8px 0 0 8px; border-right: none; }
body.files-collapsed .notch-right { right: 0; }
.notch-right.no-panel { display: none; }

/* ── Right Files panel (project view) — a dark edge-panel mirroring the left sidebar ── */
.workspace { display: block; }
.workspace .center { width: 100%; min-width: 0; }
.right-panel {
  position: fixed; top: 64px; right: 0; width: 320px; height: calc(100vh - 64px);
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark2) 100%);
  color: rgba(255,255,255,0.85); overflow-y: auto; z-index: 30; padding: 1.25rem;
  box-shadow: -6px 0 24px rgba(10,22,40,0.18);
  transition: transform 0.25s ease;
}
body.files-collapsed .right-panel { transform: translateX(100%); }
/* Dark-panel inner styling so the Files card sits ON the navy, not as a floating white box */
.right-panel .card { background: transparent; border: none; box-shadow: none; }
.right-panel .card-head { border-color: rgba(255,255,255,0.12); padding: 0 0 0.75rem; }
.right-panel .card-head h2 { color: #fff; }
.right-panel .card-pad { padding: 0.9rem 0 0; }
.right-panel .badge.gray { background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.82); }
.right-panel .field label { color: rgba(255,255,255,0.55); }
.right-panel .field input { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); color: #fff; }
.right-panel .field input::placeholder { color: rgba(255,255,255,0.4); }
.right-panel form[enctype] { border-bottom-color: rgba(255,255,255,0.12) !important; }
.right-panel .file { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.right-panel .file .thumb { background: rgba(255,255,255,0.05); }
.right-panel .file .fn { color: #fff; }
.right-panel .file .fm { color: rgba(255,255,255,0.55); }
.right-panel .btn.ghost { border-color: rgba(255,255,255,0.28); color: rgba(255,255,255,0.85); }
.right-panel .btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.right-panel .muted { color: rgba(255,255,255,0.55); }
/* Center makes room for the fixed panel; reclaims ALL of it when Files is collapsed */
body.project-view .content { max-width: none; padding-right: 344px; transition: padding-right 0.25s ease; }
body.project-view.files-collapsed .content { padding-right: 2rem; }

/* ── Per-project personnel (in the left sidebar) ── */
.people { padding: 0.5rem 0.75rem 1rem; }
.people h4 { color: rgba(255,255,255,0.45); font-size: 0.6rem; letter-spacing: 1.5px; text-transform: uppercase; margin: 0.9rem 0.4rem 0.5rem; font-weight: 600; }
.person { display: flex; align-items: center; gap: 8px; padding: 0.35rem 0.4rem; font-size: 0.8rem; color: rgba(255,255,255,0.82); }
.person .av { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.66rem; font-weight: 700; font-family: 'Montserrat'; flex-shrink: 0; }
.person .av.client { background: rgba(0,201,177,0.22); color: var(--accent); }
.person .av.dev { background: rgba(18,114,163,0.35); color: #7fc4e8; }
.people .divider { height: 1px; background: rgba(255,255,255,0.08); margin: 0.5rem 0.4rem; }

/* ── Milestones / timeline (client-valued: status + dates) ── */
.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 1.1rem 1.6rem; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li .dot { position: absolute; left: -8px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 2px solid var(--gray); }
.timeline li.done .dot { background: var(--ok); border-color: var(--ok); }
.timeline li.current .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0,201,177,0.18); }
.timeline li .mt-title { font-family: 'Montserrat'; font-weight: 600; font-size: 0.86rem; }
.timeline li.done .mt-title { color: var(--text-light); }
.timeline li .mt-date { font-size: 0.72rem; color: var(--text-light); margin-top: 0.1rem; }
/* Collapsible timeline: collapsed = current + next only; expanded = full path */
.tl-details summary { list-style: none; cursor: pointer; }
.tl-details summary::-webkit-details-marker { display: none; }
.tl-details[open] .tl-mini { display: none; }
.tl-more { display: inline-flex; align-items: center; gap: 6px; font-family: 'Montserrat'; font-weight: 600; font-size: 0.76rem; color: var(--primary); margin-top: 0.3rem; }
.tl-more .chev { transition: transform 0.2s ease; display: inline-block; }
.tl-details[open] .tl-more .chev { transform: rotate(180deg); }
.tl-details[open] .tl-lbl-closed { display: none; }
.tl-details:not([open]) .tl-lbl-open { display: none; }
.tl-full { margin-top: 0.35rem; }

/* ── "What we need from you" action callout ── */
.action-callout { background: rgba(240,165,0,0.09); border: 1px solid rgba(240,165,0,0.35); border-left: 4px solid var(--accent2); border-radius: 8px; padding: 0.9rem 1.1rem; }
.action-callout h3 { font-size: 0.82rem; color: #a06f00; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 6px; }
.action-callout p { font-size: 0.88rem; color: var(--text); }
.action-callout.clear { background: rgba(0,201,177,0.08); border-color: rgba(0,201,177,0.3); border-left-color: var(--ok); }
.action-callout.clear h3 { color: var(--ok); }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; box-shadow: var(--shadow-lg); }
  .notch-left { left: 250px; }
  body.nav-collapsed .notch-left { left: 0; }
  .two-col { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  /* On phones the Files panel becomes a full-width slide-in overlay */
  .right-panel { top: 0; height: 100vh; width: 86%; max-width: 340px; }
  body.project-view .content { padding-right: 1rem; }
  body.project-view.files-collapsed .content { padding-right: 1rem; }
  .notch-right { right: 0; }
  body.files-collapsed .notch-right { right: 0; }
  .content { padding: 1.25rem 1rem; }
}

/* ── Login ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--dark) 0%, var(--mid) 100%); padding: 1.5rem; }
.login-card { background: var(--white); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; padding: 2.25rem; }
.login-card .brand-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 0.4rem; }
.login-card .brand-row img { height: 40px; }
.login-card .brand-row .brand { font-family: 'Montserrat'; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--dark); }
.login-card .tagline { text-align: center; font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 1.75rem; }
.login-card h1 { font-size: 1.2rem; margin-bottom: 1.25rem; text-align: center; }
.err { background: rgba(214,69,69,0.1); border: 1px solid rgba(214,69,69,0.3); color: var(--danger); padding: 0.6rem 0.85rem; border-radius: 8px; font-size: 0.82rem; margin-bottom: 1rem; }
.demo-hint { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: 0.74rem; color: var(--text-light); }
.demo-hint b { color: var(--text); }
