:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #19263b;
  background: #f3f6fa;
  font-synthesis: none;
  --navy: #172741;
  --blue: #1c588d;
  --muted: #52647d;
  --line: #dce4ee;
  --surface: #fff;
  --accent: #6dc6ec;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: #0c4877; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .66rem .96rem; border: 1px solid var(--navy); border-radius: 8px;
  background: var(--navy); color: white; font-weight: 650; text-decoration: none;
  min-height: 42px; cursor: pointer; max-width: 100%;
}
button:hover, .button:hover { background: #274166; color: white; }
button:disabled { opacity: .55; cursor: default; }
.secondary, .quiet { color: var(--navy); background: var(--surface); border-color: #ccd8e7; }
.secondary:hover, .quiet:hover { color: var(--navy); background: #edf4fb; }
.quiet { border-color: transparent; }
.small { min-height: 34px; padding: .4rem .62rem; font-size: .88rem; }
:focus-visible { outline: 3px solid #3fa9dc; outline-offset: 2px; }
input, textarea, select {
  min-width: 0; width: 100%; padding: .62rem .72rem; min-height: 42px;
  background: white; color: #172741; border: 1px solid #c9d5e4; border-radius: 8px;
}
input::placeholder, textarea::placeholder { color: #63738a; }
input[readonly] { background: #f4f6fa; }
textarea { line-height: 1.5; resize: vertical; }
label { display: grid; gap: .32rem; font-weight: 600; font-size: .89rem; }
.check { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.check input { width: 1.05rem; min-height: 1.05rem; margin: 0; accent-color: var(--blue); }
.workspace { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  align-self: start; position: sticky; top: 0; min-height: 100vh; display: flex; flex-direction: column;
  gap: 2rem; padding: 1.35rem .9rem; background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: .62rem; text-decoration: none; color: white; padding: .2rem; }
.brand:hover { color: white; }
.brand img { border-radius: 10px; padding: 3px; background: #fff; object-fit: contain; }
.brand strong { display: block; letter-spacing: .04em; font-size: .91rem; }
.brand small, .profile small { display: block; color: #c6d7ed; margin-top: .17rem; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav a {
  display: block; padding: .7rem .72rem; border-radius: 8px; text-decoration: none;
  color: #dae5f4; font-size: .95rem; font-weight: 580;
}
.sidebar nav a:hover { background: #273b59; color: white; }
.sidebar nav [aria-current] { color: #fff; background: #314b70; box-shadow: inset 3px 0 var(--accent); }
.profile { margin-top: auto; display: grid; gap: .6rem; padding: .75rem .25rem 0; border-top: 1px solid #42516a; }
.profile strong { overflow-wrap: anywhere; }
.profile .quiet { min-height: 34px; color: #e3edfb; border: 1px solid #627591; background: transparent; padding: .35rem .68rem; }
.profile .quiet:hover { background: #273b59; }
.page { width: 100%; max-width: 1430px; min-width: 0; padding: clamp(1.2rem, 3vw, 2.65rem); }
.page-head { margin-bottom: 1.4rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.72rem, 3vw, 2.35rem); font-weight: 740; letter-spacing: -.042em; overflow-wrap: anywhere; }
h2 { font-size: 1.14rem; letter-spacing: -.013em; }
h3 { font-size: .97rem; }
p { line-height: 1.5; }
.page-head p, .muted { color: var(--muted); }
.page-head p { margin-top: .28rem; overflow-wrap: anywhere; }
.back { display: inline-block; margin-bottom: .8rem; font-size: .9rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .75rem; margin-bottom: 1.2rem; }
.metric, .panel {
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  box-shadow: 0 2px 6px #314b7008;
}
.metric { display: grid; gap: .35rem; padding: .85rem 1rem; color: var(--muted); text-decoration: none; }
.metric:hover, .metric.selected { border-color: #77b5d9; background: #f5fbff; }
.metric strong { font-size: 1.52rem; line-height: 1.3; color: var(--navy); }
.panel { min-width: 0; padding: 1.12rem; }
.panel > h2 { margin-bottom: .7rem; }
.panel > p { margin-bottom: .65rem; }
.panel.flush { padding: 0; overflow: hidden; }
.panel + .panel, .stack > .panel { margin-top: 0; }
.readable { max-width: 880px; }
.readable + .readable { margin-top: 1rem; }
.stack { display: grid; gap: .8rem; align-content: start; }
.stack > button { justify-self: start; }
.split, .toolbar, .pagination { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.split { justify-content: space-between; }
.toolbar { align-items: flex-end; padding: 1rem; }
.toolbar .grow { flex: 1 1 220px; }
.columns { display: grid; align-items: start; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #f6f8fc; }
th, td { padding: .74rem .9rem; border-top: 1px solid #ecf0f6; vertical-align: middle; }
th { color: var(--muted); font-weight: 650; font-size: .84rem; white-space: nowrap; }
td { font-size: .93rem; }
tr:hover td { background: #fafcff; }
.strong, .table-title { text-decoration: none; }
.strong { font-weight: 700; white-space: nowrap; }
.table-title { color: var(--navy); overflow-wrap: anywhere; }
.table-subtitle { display: block; color: var(--muted); margin-top: .24rem; }
td .strong { white-space: normal; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 1.35rem 1rem; border-top: 1px solid var(--line); }
.pagination { justify-content: flex-end; border-top: 1px solid var(--line); padding: .75rem 1rem; font-size: .9rem; }
.nowrap { white-space: nowrap; }
.status, .delivery {
  display: inline-flex; width: fit-content; align-items: center; border-radius: 99px;
  padding: .27rem .58rem; font-size: .78rem; font-weight: 700; white-space: nowrap;
  background: #ebeff5; color: #394b68;
}
.status.new { color: #215c8b; background: #e6f2fb; }
.status.active { color: #2d4c9a; background: #ecf0ff; }
.status.waiting, .delivery.pending { color: #714d09; background: #fff2d5; }
.status.done, .delivery.sent { color: #17664a; background: #e3f4ec; }
.delivery.failed { color: #932d40; background: #fde9ed; }
.notice { padding: .75rem .9rem; margin-bottom: 1rem; border: 1px solid #b3dfcb; border-radius: 8px; color: #15573f; background: #eaf7f0; overflow-wrap: anywhere; }
.notice.error { color: #922d40; border-color: #ecc1c8; background: #fff0f2; }
.data-list { margin: .55rem 0; display: grid; gap: .42rem; }
.data-list div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: .65rem; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.item { padding-top: .65rem; margin-top: .65rem; border-top: 1px solid var(--line); }
.file-list, .notification-list, .timeline { list-style: none; margin: .65rem 0 0; padding: 0; }
.file-list li, .notification-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; padding: .4rem 0; overflow-wrap: anywhere; }
.file-list small, .notification-list small { color: var(--muted); }
.timeline { display: grid; gap: .55rem; }
.timeline li { padding: .66rem .75rem; border-radius: 8px; border: 1px solid var(--line); background: #f7f9fc; }
.timeline li.manager { background: #f0f6ff; border-color: #d9e8fb; }
.timeline li.client { background: #f1f9f5; border-color: #d5ebdf; }
.timeline small { color: var(--muted); }
.timeline .delivery.failed { color: #932d40; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .35rem 0; }
.imported { max-height: 36rem; overflow-y: auto; }
.file-link { display: inline-block; margin-right: .6rem; }
.compose { border-top: 1px solid var(--line); margin-top: .95rem; padding-top: .95rem; }
.inline { display: inline-flex; vertical-align: middle; }
details { border-top: 1px solid var(--line); padding: .6rem 0; }
summary { cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
details > form { padding-top: .7rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; }
.field-list { display: grid; gap: .65rem; margin-top: .65rem; }
.field-editor { display: grid; gap: .55rem; padding: .75rem; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; }
.spaced { margin-top: .8rem; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(at right top, #daecf8, #f4f7fb 70%); }
.login-wrap { width: min(100%, 420px); }
.login-card { border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 1.5rem; box-shadow: 0 15px 50px #314b7014; }
.login-card h1 { font-size: 1.58rem; margin-bottom: 1rem; }
.login-logo { object-fit: contain; display: block; margin-bottom: .7rem; }
.login-card button { justify-self: stretch; margin-top: .15rem; }
@media (max-width: 950px) {
  .workspace { grid-template-columns: 175px minmax(0, 1fr); }
  .columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .workspace { display: block; }
  .sidebar { min-height: auto; position: static; padding: .68rem .82rem; flex-direction: row; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
  .sidebar nav { display: flex; flex-wrap: wrap; width: 100%; order: 2; }
  .sidebar nav a { padding: .43rem .52rem; }
  .profile { border: 0; margin: 0; padding: 0; }
  .profile > div, .brand small { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .data-list div { grid-template-columns: minmax(0,1fr); gap: .11rem; }
}
