:root {
  --bg: #0b1220;
  --card: #151c2a;
  --card2: #1a2333;
  --border: #2a3548;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --accent: #4f6ef7;
  --nav: #0c1320;
  --prod: #101927;
  --green: #6ee7b7;
  --red: #f0a0a8;
  --amber: #e0c38a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 "Segoe UI", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 10px;
}
.login-card label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.login-card input, .field {
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text);
}
.brand-row { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 6px; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: #2563eb; color: #fff; font-weight: 800; font-size: 14px; line-height: 26px;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px;
}
.primary, button.primary {
  background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px;
  padding: 8px 16px; font-weight: 700;
}
.primary:hover { background: #5b79ff; }
.ghost {
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; color: var(--text);
}
.ghost:hover { border-color: var(--accent); }
.work-upload { background: #4f6ef7; color: #fff; border: 1px solid #4f6ef7; border-radius: 8px; padding: 6px 12px; font-weight: 700; }
.error { color: var(--red); margin: 0; }
.muted { color: var(--muted); font-size: 12px; }
#shell { height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: 68px; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); position: relative;
}
.brand { font-weight: 700; font-size: 14px; }
.grow { flex: 1; }
.chrome-btn {
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
}
.chrome-btn:hover { border-color: var(--accent); }
.chrome-btn .ico, .chrome-btn .tico {
  width: 16px; height: 16px; background: #93c5fd; flex: 0 0 16px;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}
.coll-av {
  width: 22px; height: 22px; border-radius: 11px; background: #2563eb; color: #fff;
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px;
}
#notify-menu, #notify-settings {
  width: min(400px, 92vw); max-height: 78vh; overflow: auto; right: 16px; left: auto; padding: 14px 16px;
  border-radius: 16px; background: #151c2a;
}
#notify-menu.menu button, #notify-settings.menu button {
  display: inline-flex; width: auto; align-items: center;
}
#notify-settings { right: 428px; }
.notify-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.notify-head h3 { margin: 0; font-size: 16px; }
.notify-head .icon-btn {
  background: transparent; border: none; color: #93c5fd; width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.notify-head .icon-btn:hover { background: #1e293b; }
.notify-tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.notify-tabs button {
  background: transparent; border: none; color: #8b9bb4; font-weight: 700;
  padding: 6px 10px; border-radius: 8px;
}
.notify-tabs button.active { background: #233c60; color: #e8f2ff; }
.notify-mark { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.notify-mark button { background: none; border: none; color: #93c5fd; font-weight: 700; font-size: 12px; }
.notify-group { color: #8b9bb4; font-size: 12px; font-weight: 700; margin: 10px 0 4px; }
.notify-row {
  display: flex; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; align-items: flex-start;
}
.notify-row:hover { background: #1a2744; }
.notify-badge {
  width: 34px; height: 34px; border-radius: 17px; display: flex; align-items: center; justify-content: center; flex: 0 0 34px;
}
.notify-badge .ico { width: 16px; height: 16px; background: #fff; }
.notify-row .grow { min-width: 0; }
.notify-row strong { display: block; font-size: 13px; }
.notify-row .muted { font-size: 12px; }
.notify-row .meta { text-align: right; flex: 0 0 48px; }
.notify-dot { width: 8px; height: 8px; border-radius: 4px; background: #60a5fa; margin-left: auto; margin-top: 6px; }
.notify-more {
  width: 100% !important; display: flex !important; justify-content: center; margin-top: 8px;
  background: #1a2333; border: 1px solid #2a3548; border-radius: 10px;
  padding: 8px 12px; font-weight: 700;
}
.notify-type { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.notify-type .grow { min-width: 0; }
.notify-type strong { display: block; font-size: 13px; }
.notify-switch {
  appearance: none; width: 40px; height: 22px; border-radius: 11px; background: #334155; border: none; position: relative; flex: 0 0 40px;
}
.notify-switch:checked { background: #4f6ef7; }
.notify-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 8px; background: #fff;
}
.notify-switch:checked::after { left: 21px; }
.notify-how { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.notify-how label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.login-card { width: 380px; }
.login-card h1 { margin: 0 0 8px; font-size: 18px; }
.publish-card {
  background: #121a28; border: 1px solid #243044; border-left: 4px solid #6ee7b7;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
}
.publish-card .row { display: flex; gap: 12px; }
.publish-cover { width: 72px; height: 102px; border-radius: 6px; flex: 0 0 72px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 28px; }
.fin-page { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
.fin-kpi { display: flex; gap: 10px; }
.fin-kpi .stat-card { flex: 1; }
.fin-charts { display: flex; gap: 10px; }
.fin-charts .full-card, .chart-card { flex: 1; min-height: 220px; }
.chart-empty { height: 160px; display: flex; align-items: center; justify-content: center; color: #8b9bb4; }
.fin-kpi .stat-card { min-height: 104px; }
.fin-dock {
  width: 340px; flex: 0 0 340px; background: #151c2a; border: 1px solid #2a3548; border-radius: 14px; padding: 14px 16px;
}
.btn-success { background: #1f6b4a; border: 1px solid #2d8a60; color: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 700; }
.overview { color: var(--muted); font-size: 12px; padding: 4px 16px; background: #101827; }
.body { flex: 1; display: flex; min-height: 0; }
.nav {
  width: 220px; background: var(--nav); border-right: 1px solid var(--border);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 6px;
}
.nav button {
  text-align: left; padding: 10px 14px; border: none; border-radius: 10px;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; min-height: 42px;
  display: flex; align-items: center; gap: 10px;
}
.nav button .ico, .row-tools button .ico, #bell-btn .ico {
  width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}
.row-tools { display: flex; gap: 4px; }
.row-tools button {
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: 6px; background: #1a2639; border: 1px solid #33445e;
  display: flex; align-items: center; justify-content: center; color: #d7e2f3; font-size: 16px; line-height: 1;
}
.chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 8px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.chart .col b { display: block; width: 100%; background: #4f6ef7; border-radius: 4px 4px 0 0; min-height: 2px; }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.tabs button { background: transparent; border: none; color: var(--muted); font-weight: 700; padding: 8px 14px; border-radius: 8px; }
.tabs button.active { background: var(--accent); color: #fff; }
.kpi { display: flex; gap: 12px; margin-bottom: 12px; }
.kpi .card { background: #111e2e; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; min-width: 140px; }
.kpi .val { font-size: 25px; font-weight: 700; }
.notify-item { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
.notify-item.unread { background: #18263b; }
.nav button:hover { color: var(--text); background: #162033; }
.nav button.active { background: var(--accent); color: #fff; }
.main { flex: 1; overflow: auto; padding: 12px 24px 16px; min-height: 0; display: flex; flex-direction: column; }
.main > .title-detail { flex: 1; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: 0.2px; margin: 0 0 4px; }
.bar { height: 6px; background: #334158; border-radius: 3px; overflow: hidden; max-width: 220px; }
.bar > i { display: block; height: 100%; background: #9d8fe8; }
.form-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; align-items: center; margin: 12px 0; }
.form-grid label { color: var(--muted); font-size: 12px; }
.form-grid input, .form-grid select, .form-grid textarea {
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%;
}
.ch-pick { margin: 12px 0; padding: 10px; background: #121926; border: 1px solid var(--border); border-radius: 10px; }
.ch-pick select { min-width: 220px; background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.due-big { font-size: 20px; text-align: center; }
.due-hint { font-size: 17px; text-align: center; }
.people-row { display: flex; gap: 8px; flex-wrap: wrap; }
.person { width: 56px; text-align: center; font-size: 11px; color: var(--muted); }
.avatar {
  width: 32px; height: 32px; border-radius: 16px; background: #233249;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #93c5fd; overflow: hidden;
}
.avatar img { width: 32px; height: 32px; object-fit: cover; }
.ring {
  width: 44px; height: 44px; border-radius: 22px; padding: 6px; margin: 0 auto 2px;
  background: conic-gradient(var(--col) calc(var(--pct) * 1%), #405069 0);
  display: flex; align-items: center; justify-content: center;
}
.people-grid { display: flex; gap: 8px; align-items: flex-start; min-height: 72px; overflow-x: auto; }
.plan-board { display: grid; grid-template-columns: 140px repeat(7, 1fr); gap: 0; border: 1px solid #22364b; }
.plan-board .cell { min-height: 72px; border: 1px solid #22364b; padding: 4px; background: #0d1b2a; }
.plan-board .head { color: #afc7df; font-size: 12px; background: #102237; min-height: 28px; }
.plan-chip { font-size: 11px; background: #15263a; border-radius: 5px; padding: 2px 6px; margin: 2px 0; }
.heading { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.heading .grow { min-width: 0; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select {
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; min-width: 120px;
}
.filters input { flex: 2; min-width: 180px; }
.panel { background: var(--prod); border: 1px solid #29364a; border-radius: 9px; padding: 12px 10px; }
.lanes { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; justify-content: flex-end; }
.lanes button {
  background: transparent; border: 1px solid transparent; padding: 4px 8px; font-size: 12px; min-height: 20px; color: var(--muted);
}
.lanes button.active { background: #263653; border-color: #4a6085; color: #e3ebfc; }
.row-card {
  background: #121c2b; border: 1px solid #29364a; border-radius: 7px; padding: 10px 12px; margin-bottom: 8px;
}
.row-card:hover { border-color: #536889; }
.row-card h3 { margin: 0 0 4px; font-size: 14px; }
.reason { font-size: 13px; color: var(--muted); }
.reason.risk { color: #eda9b1; }
.reason.warn { color: #e0c38a; }
.badge { display: inline-block; background: #202b40; border-radius: 5px; padding: 6px 10px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 2fr auto 2fr 1fr 1fr auto; gap: 12px; align-items: center; }
.work-page { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
.work-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.work-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#work-list { flex: 1; overflow: auto; min-height: 0; }
.work-ident { display: flex; gap: 10px; min-width: 240px; }
.work-ident .cover img { width: 64px; height: 88px; object-fit: cover; border-radius: 6px; }
.work-prog { min-width: 170px; max-width: 290px; }
.work-footer { display: flex; gap: 12px; flex: 0 0 200px; min-height: 0; }
.work-sum { flex: 1; background: #101927; border: 1px solid #29364a; border-radius: 9px; padding: 8px 10px; overflow: auto; }
.work-sum-head { display: flex; align-items: center; margin-bottom: 6px; }
.work-sum-h, .work-sum-row { display: grid; grid-template-columns: 78px 1fr 44px 80px 102px; gap: 10px; align-items: center; padding: 7px 8px; font-size: 13px; }
.work-sum-h { color: #92a6be; font-size: 12px; }
.work-sum-row { border-bottom: 1px solid #26364a; cursor: pointer; }
.work-sum-row:hover { background: #192a3e; }
.attn-mark { width: 28px; height: 28px; border-radius: 6px; background: #422730; color: #ee969e; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.row-tools { display: flex; gap: 6px; }
.people { font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
.title-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.title-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer;
}
.title-card:hover { background: #162033; }
.cover {
  width: 64px; height: 88px; border-radius: 6px; background: #233249; display: flex; align-items: center;
  justify-content: center; font-weight: 800; color: #93c5fd;
}
.menu {
  position: absolute; right: 16px; top: 58px; background: var(--card2); border: 1px solid var(--border);
  border-radius: 8px; min-width: 200px; z-index: 20; padding: 6px;
}
.menu button { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 8px 10px; border-radius: 6px; }
.menu button:hover { background: #162033; }
.modal {
  position: fixed; inset: 0; background: rgba(5, 8, 16, 0.65); display: flex; align-items: center; justify-content: center; z-index: 30;
}
.modal-card {
  width: min(760px, 94vw); max-height: 86vh; overflow: auto; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.progress { height: 8px; background: #2c3648; border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; }
.xfer { margin-top: 10px; font-size: 12px; color: var(--muted); }
.note { background: #122033; border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; color: var(--muted); font-size: 12px; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .nav { width: 64px; padding: 10px 6px; }
  .nav button { font-size: 0; padding: 10px; }
  .grid2 { grid-template-columns: 1fr; }
}

/* Codex: native dark controls and readable desktop summary panels. */
:root { color-scheme: dark; }
* { scrollbar-width: thin; scrollbar-color: #43536c #101927; }
.main, .nav, .work-sum { min-width: 0; }
.topbar { flex-shrink: 0; }
.nav { flex-shrink: 0; }
.work-sum-h, .work-sum-row {
  grid-template-columns: 78px minmax(96px, 1fr) 44px 70px minmax(108px, 1fr);
  gap: 8px;
}
.work-sum-h > *, .work-sum-row > * { min-width: 0; }
.work-sum-row .hist-user { min-width: 0; }
.work-person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#work-attention .work-sum-row {
  grid-template-columns: 28px minmax(120px, 1fr) 100px 32px;
  gap: 12px;
}
#work-attention .reason { overflow-wrap: anywhere; }
.work-small .tico { flex: 0 0 17px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #93b4ff;
  outline-offset: 2px;
}

#fin-overview { display: flex; flex-direction: column; gap: 12px; }
.fin-charts .chart-empty { width: 100%; }

.fin-charts .chart-card { display: flex; flex-direction: column; }
.fin-charts .chart { flex: 1; min-height: 160px; }
.fin-charts .chart-empty { height: 100%; min-height: 160px; }

/* Codex: notification controls must stay inside the popover. */
#notify-menu .ch-filters { flex-wrap: wrap; }
#notify-menu .ch-filters input, #notify-menu .ch-filters select { min-width: 0; }
#notify-menu button.ghost-sm { width: auto; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #2a3548; background: #1a2333; white-space: nowrap; }
#notify-menu #n-policy { display: grid; grid-template-columns: auto 90px auto 90px auto 70px; align-items: center; }
#notify-menu #n-save-policy { grid-column: 1 / -1; justify-self: end; }
#notify-menu #n-ping-text { flex: 1; }
#notify-menu .notify-actions { flex-wrap: wrap; }

#modal-card .actions { justify-content: flex-end; align-items: center; }
#modal-card .actions > button { width: auto; flex: 0 0 auto; min-height: 36px; padding: 8px 16px; }
#modal-card h2 { margin-top: 0; font-weight: 700; }

.chat-page { display: grid; grid-template-columns: 320px 1fr; min-height: calc(100vh - 88px); margin: -8px -16px -16px; }
.chat-side { background: #101827; border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; padding: 12px; }
.chat-main { background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.chat-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.chat-search-row input { flex: 1; background: #152033; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.chat-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.chat-tabs button { flex: 1; background: #152033; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; color: var(--muted); font-weight: 700; }
.chat-tabs button.active { background: #243656; color: var(--text); }
.chat-sec { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .6px; padding: 8px 8px 4px; }
.chat-thread { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; width: 100%; text-align: left; background: transparent; border: none; border-radius: 10px; padding: 8px 10px; align-items: center; }
.chat-thread.active { background: #1e3a5f; }
.chat-thread img, .chat-av { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #243656; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.chat-unread { background: #4f6ef7; color: #fff; border-radius: 9px; padding: 1px 6px; font-size: 11px; font-weight: 800; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-head .grow { flex: 1; }
.chat-feed { flex: 1; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { background: #1a2333; border-radius: 10px; padding: 8px 10px; max-width: 70%; }
.chat-msg.mine { align-self: flex-end; background: #1e3a5f; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; gap: 8px; }
.chat-compose { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: center; }
.chat-compose input { flex: 1; background: #152033; border: 1px solid var(--border); border-radius: 22px; padding: 10px 16px; }
.chat-send { width: 36px; height: 36px; border-radius: 18px; background: var(--accent); border: none; color: #fff; font-weight: 800; }
