:root {
  color-scheme: light;
  --navy: #101e35;
  --navy-deep: #0a1527;
  --ink: #14223a;
  --muted: #54647b;
  --paper: #f3f5f8;
  --line: #dce3ed;
  --orange: #f87726;
  font: 15px/1.55 "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: #254f86; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #201307;
  background: var(--orange);
  border: 0;
  padding: .68rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
}
button:hover, .button:hover { background: #ff984e; }
:focus-visible { outline: 3px solid #2876c1; outline-offset: 3px; }
.admin { padding-left: 242px; }
#sidebar[hidden] { display: none; }
.admin > .publicbar { display: none; }
#sidebar nav button {
  width: 100%;
  justify-content: flex-start;
  gap: .75rem;
  color: #ccdaeb;
  background: transparent;
  border-left: 3px solid transparent;
  font-weight: 600;
}
#sidebar nav button span { width: 1.2rem; color: #a8bad0; }
#sidebar nav button:hover, #sidebar nav button[aria-current="page"] { background: #1a2c47; color: white; }
#sidebar nav button[aria-current="page"] { border-left-color: var(--orange); }
#sidebar nav button[aria-current="page"] span { color: #ff9e62; }
#sidebar .profile { display: grid; gap: .65rem; }
#sidebar .profile button { justify-self: start; }
#sidebar .menu-toggle { display: none; }
@media (max-width: 770px) {
  #sidebar nav { display: none; overflow: visible; }
  #sidebar .menu-toggle { display: inline-flex; align-self: flex-start; margin-bottom: .5rem; }
  #sidebar .menu-toggle[aria-expanded="true"] + nav { display: grid; }
  #sidebar .profile { display: flex; }
}
aside {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 242px;
  background: var(--navy-deep);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1rem 1rem;
  overflow: auto;
}
.brand { display: flex; align-items: center; gap: .8rem; line-height: 1.27; font-size: .96rem; }
aside .brand { margin: 0 .4rem 2rem; }
.brand b { color: #ffa26a; }
.brandmark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--orange);
  color: var(--navy-deep);
  font-size: 1.6rem;
  font-weight: 850;
}
nav { display: grid; gap: .28rem; }
nav a {
  color: #ccdaeb;
  text-decoration: none;
  padding: .72rem .75rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
nav a span { display: inline-block; width: 1.55rem; color: #a8bad0; }
nav a:hover, nav a.selected { background: #1a2c47; color: white; }
nav a.selected { border-left-color: var(--orange); }
nav a.selected span { color: #ff9e62; }
.profile { margin-top: auto; padding: 1rem .75rem 0; color: #cbd6e7; }
.profile button, .publicbar button { background: #213550; color: white; border: 1px solid #465f7d; }
.profile form, .publicbar form { margin: .35rem 0 0; }
.workspace, .publicbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem clamp(1rem, 3.5vw, 3.5rem);
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  background: white;
  font-weight: 650;
}
.publicbar { background: var(--navy-deep); color: #fff; }
.demo { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: #6f410e; }
.demo i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
main { max-width: 1540px; margin: auto; padding: 2rem clamp(1rem, 3.5vw, 3.5rem) 3rem; }
.public main { max-width: 1040px; }
.public main > .panel:only-of-type { max-width: 520px; }
h1 { margin: 0 0 .7rem; font-size: clamp(1.85rem, 3vw, 2.65rem); line-height: 1.15; letter-spacing: -.045em; }
h2 { font-size: 1.1rem; margin: 0 0 1rem; letter-spacing: -.015em; }
p { margin: 0 0 .9rem; }
.muted, .intro p, small, time { color: var(--muted); }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.intro p { margin: 0; }
.actions, .filters { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.filters { margin: 1rem 0; }
.filters a { align-self: center; }
.button.secondary { background: #e4ecf7; color: #24476e; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 8px; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: 1rem; min-height: 1rem; }
.record-details { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr; gap: .4rem 1rem; }
.record-details dd { margin: 0; overflow-wrap: anywhere; }
.record-details dt { font-weight: 650; }
.event p { margin: .4rem 0; }
.form-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%, 240px),1fr)); align-items: start; }
.form-grid fieldset, .form-grid button { grid-column: 1 / -1; }
.invite button { margin: .4rem 0 .8rem; }
button:disabled { opacity: .55; cursor: default; }
details summary { cursor: pointer; font-weight: 650; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.metric, .panel, .details { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.metric { padding: 1.15rem; display: grid; gap: .25rem; }
.metric > span { color: #994300; background: #fff0e3; border-radius: 8px; width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.2rem; margin-bottom: .4rem; }
.metric > strong { font-size: 2rem; letter-spacing: -.04em; }
.panel { min-width: 0; padding: 1.25rem; margin: 0 0 1.1rem; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f1f5f9; color: #45556b; font-size: .83rem; white-space: nowrap; }
td, th { padding: .78rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
td small { display: block; margin-top: .15rem; white-space: nowrap; }
td form { margin: 0; }
.badge { display: inline-block; padding: .2rem .63rem; border-radius: 6px; font-size: .81rem; font-weight: 650; white-space: nowrap; }
.blue { color: #224674; background: #e7f0fd; }
.amber { color: #784008; background: #fff0da; }
.green { color: #235542; background: #dfefe9; }
.gray { color: #37445b; background: #e9edf3; }
.details { display: flex; flex-wrap: wrap; gap: 1.2rem; padding: 1rem 1.2rem; margin-bottom: 1.1rem; }
.details small, .details strong { display: block; }
.details p { flex-basis: 100%; margin: 0; }
.deal-grid { display: grid; grid-template-columns: 1.12fr 1fr; gap: 1.1rem; align-items: start; }
.operations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.chat { background: #f3f6fa; border-radius: 9px; padding: 1rem; min-height: 145px; max-height: 440px; overflow: auto; display: flex; flex-direction: column; align-items: flex-start; }
.event { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: .64rem .8rem; margin-bottom: .6rem; overflow-wrap: anywhere; }
.event.mine { align-self: flex-end; background: #e8effa; border-color: #d0dff3; }
.event small, .event time, .event strong { display: block; }
.event div { white-space: pre-wrap; }
.event time { font-size: .74rem; margin-top: .3rem; }
form { display: grid; gap: .72rem; margin: .8rem 0 0; }
form button { justify-self: start; }
label { display: grid; gap: .23rem; font-size: .88rem; font-weight: 650; }
input, textarea, select { color: var(--ink); background: #fff; border: 1px solid #aebdd0; border-radius: 7px; padding: .56rem .68rem; width: 100%; min-width: 0; min-height: 42px; }
textarea { resize: vertical; min-height: 76px; }
.invite, .alert { background: #fff3e6; border: 1px solid #f6caa6; border-radius: 8px; padding: .75rem; margin-bottom: .9rem; color: #713607; }
.invite p { margin: .3rem 0; }
@media (max-width: 1100px) {
  .operations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 770px) {
  .admin { padding-left: 0; }
  aside { position: static; width: auto; padding: 1rem; }
  aside .brand { margin: 0 0 .75rem; }
  nav { display: flex; overflow: auto; }
  .profile { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0 0; }
  .deal-grid, .operations { grid-template-columns: 1fr; gap: 0; }
  .intro { align-items: flex-start; flex-direction: column; }
}
