:root {
  color: #172026;
  background: #f6faf9;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  background: #118a7f;
  border: 1px solid #118a7f;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 13px;
}

button.secondary {
  background: #ffffff;
  border-color: #c9d3d6;
  color: #26343b;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:hover {
  filter: brightness(0.96);
}

a {
  color: #118a7f;
  text-decoration: none;
}

code {
  background: #e8edef;
  border: 1px solid #ccd6d9;
  border-radius: 6px;
  color: #26343b;
  padding: 4px 7px;
  overflow-wrap: anywhere;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #dbe3e6;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 16px;
}

.brand {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 10px;
  margin-bottom: 26px;
}

.brand-mark {
  background: #ffffff;
  border-radius: 6px;
  display: block;
  height: 34px;
  object-fit: contain;
  width: 34px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #6a787d;
  font-size: 13px;
}

.brand strong {
  color: #172026;
}

.nav {
  display: grid;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-group-title {
  color: #6a787d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0 0;
}

.nav-link + .nav-link {
  margin-top: 4px;
}

.nav-link + .nav-group-title {
  margin-top: 12px;
}

.nav-link {
  border-radius: 6px;
  color: #334349;
  font-weight: 650;
  line-height: 1.2;
  padding: 9px 10px;
}

.nav-button {
  background: #10545c;
  border: 1px solid #10545c;
  color: #eefbf8;
  font-size: 12px;
  font-weight: 500;
  min-height: 36px;
  padding: 8px 10px;
  text-align: center;
}

.nav-button:hover {
  background: #118a7f;
  border-color: #118a7f;
  color: #ffffff;
}

.nav-button.active {
  background: #def4f0;
  border-color: #def4f0;
  color: #10545c;
  font-weight: 500;
}

.nav-groups {
  overflow: visible;
}

.nav-group-toggle {
  align-items: center;
  background: #f4f7f8;
  border-color: #d8e2e5;
  color: #334349;
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  margin-top: 0;
  min-height: 32px;
  padding: 6px 9px;
  width: 100%;
}

.nav-dropdown {
  position: relative;
}

.nav-groups .nav-dropdown:not(:first-child) {
  margin-top: 12px;
}

.nav-dropdown-menu {
  background: #ffffff;
  border: 1px solid #cfd9dc;
  border-radius: 6px;
  box-shadow: 0 14px 34px rgb(28 43 48 / 16%);
  display: grid;
  gap: 2px;
  left: 0;
  min-width: 190px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 4px);
  z-index: 80;
}

.nav-dropdown-menu .nav-link {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  min-height: 30px;
  padding: 6px 8px;
  white-space: nowrap;
}

.nav-link.active,
.nav-link:hover {
  background: #def4f0;
  color: #10545c;
}

.session-box {
  border-top: 1px solid #dbe3e6;
  display: grid;
  flex-shrink: 0;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
}

.session-box span {
  color: #435258;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.session-box button {
  background: #10545c;
  border-color: #10545c;
  color: #eefbf8;
  font-size: 12px;
  font-weight: 500;
  min-height: 34px;
  width: 100%;
}

.settings-field {
  gap: 5px;
}

.settings-field span,
.session-box small {
  color: #65757b;
  font-size: 12px;
  font-weight: 700;
}

.settings-field select {
  background: #10545c;
  border: 1px solid #10545c;
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  min-height: 34px;
  padding: 4px 8px;
}

.main {
  overflow: auto;
  min-width: 0;
  padding: 28px 28px 64px;
  position: relative;
}

.app-window {
  background: #ffffff;
  border: 1px solid #cfd9dc;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgb(28 43 48 / 18%);
  overflow: hidden;
  position: fixed;
}

.app-window-title {
  align-items: center;
  background: #eef8f6;
  border-bottom: 1px solid #dbe3e6;
  cursor: move;
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  touch-action: none;
}

.app-window-actions {
  display: flex;
  gap: 6px;
}

.app-window-body {
  height: calc(100% - 49px);
  overflow: auto;
  padding: 18px;
}

.app-window-resize {
  border-bottom: 12px solid #8fa0a6;
  border-left: 12px solid transparent;
  bottom: 5px;
  cursor: nwse-resize;
  height: 0;
  position: absolute;
  right: 5px;
  touch-action: none;
  width: 0;
}

.icon-button {
  min-height: 30px;
  padding: 2px 10px;
}

.taskbar {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #cfd9dc;
  bottom: 0;
  display: flex;
  gap: 8px;
  left: 244px;
  min-height: 48px;
  overflow-x: auto;
  padding: 7px 12px;
  position: fixed;
  right: 0;
  z-index: 2000;
}

.taskbar-button {
  background: #10545c;
  border-color: #10545c;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  min-height: 32px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taskbar-button.minimized {
  background: #def4f0;
  border-color: #c8ebe6;
  color: #10545c;
}

.page-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-header h1 {
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 6px;
}

.page-header p,
.muted {
  color: #65757b;
  margin: 0;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9e1e4;
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 18px;
}

.panel.compact {
  padding: 15px 18px;
}

.sub-panel {
  border-top: 1px solid #dbe3e6;
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
}

.sub-panel h2 {
  font-size: 18px;
  margin: 0;
}

.data-row {
  align-items: center;
  border: 1px solid #dbe3e6;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(70px, 0.6fr));
  padding: 9px 10px;
}

.data-row small {
  color: #65757b;
}

.quote-line {
  border: 1px solid #dbe3e6;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(76px, 0.5fr)) 130px;
  padding: 12px;
}

.quote-line:has(.position-summary) {
  align-items: center;
  gap: 10px;
}

.position-table-header {
  align-items: center;
  color: #65757b;
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(76px, 0.5fr)) 130px;
  padding: 0 12px;
  text-transform: uppercase;
}

.position-table-header.compact {
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(76px, 0.5fr)) 130px;
}

.position-summary {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-column: span 5;
  grid-template-columns: subgrid;
}

.position-summary.compact {
  grid-column: span 5;
}

.position-summary span {
  color: #435258;
  font-size: 14px;
}

.position-summary strong {
  overflow-wrap: anywhere;
}

.position-actions {
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
}

.form-panel {
  max-width: 720px;
}

.form-panel.wide {
  max-width: 1040px;
}

.workspace-split {
  display: grid;
  gap: 16px;
  grid-template-columns: 280px minmax(420px, 1fr);
}

.list-panel,
.detail-panel {
  margin-bottom: 0;
}

.list-row {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid transparent;
  color: #26343b;
  display: grid;
  font-weight: 400;
  gap: 3px;
  margin-bottom: 5px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.list-row:hover,
.list-row.selected {
  background: #def4f0;
  border-color: #c6d9d8;
  filter: none;
}

.list-row strong {
  font-size: 13px;
}

.list-row span {
  font-weight: 650;
}

.list-row small {
  color: #65757b;
}

.split-row,
.section-title,
.button-row,
.form-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.split-row,
.section-title {
  justify-content: space-between;
}

.section-title {
  margin-bottom: 14px;
}

.section-title h2,
.split-row h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

form {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.check-row span {
  color: #435258;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #cbd5d9;
  border-radius: 6px;
  color: #172026;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.readonly-value {
  align-items: center;
  background: #f6faf9;
  border: 1px solid #cbd5d9;
  border-radius: 6px;
  color: #172026;
  display: flex;
  min-height: 38px;
  padding: 8px 10px;
}

.list-search {
  margin-bottom: 10px;
}

textarea {
  resize: vertical;
}

.field.full-width {
  grid-column: 1 / -1;
}

select[multiple] {
  min-height: 128px;
}

.search-select {
  display: grid;
  gap: 6px;
  position: relative;
}

.search-select-current {
  color: #435258;
  font-size: 13px;
  line-height: 1.25;
}

.search-select-options {
  background: #ffffff;
  border: 1px solid #dbe3e6;
  border-radius: 6px;
  box-shadow: 0 14px 28px rgba(15, 37, 45, 0.16);
  display: grid;
  gap: 4px;
  left: 0;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
}

.search-option {
  background: #ffffff;
  border: 1px solid transparent;
  color: #26343b;
  display: grid;
  gap: 2px;
  min-height: 0;
  padding: 7px 8px;
  text-align: left;
}

.search-option span {
  color: #65757b;
  font-size: 12px;
}

.search-option strong {
  font-size: 13px;
}

.search-option:hover,
.search-option.selected {
  background: #def4f0;
  border-color: #c6d9d8;
  filter: none;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 9px;
}

.check-row input {
  min-height: 16px;
  width: 16px;
}

.check-row.compact {
  gap: 6px;
}

.check-row.compact span {
  font-size: 13px;
}

.role-checks {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.form-actions,
.button-row {
  flex-wrap: wrap;
  margin-top: 4px;
}

.form-status {
  border-radius: 6px;
  display: block;
  min-height: 20px;
  padding: 0;
}

.form-status.info,
.form-status.success,
.form-status.error {
  padding: 10px 12px;
}

.form-status.info {
  background: #eef8f6;
  color: #334349;
}

.form-status.success {
  background: #e6f4ea;
  color: #1f5d38;
}

.form-status.error {
  background: #fdeceb;
  color: #8a2521;
}

.data-table {
  border: 1px solid #e0e7ea;
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.data-table.two-cols {
  grid-template-columns: minmax(0, 1fr) 220px;
}

.data-table.registrations {
  grid-template-columns: minmax(140px, 1.2fr) minmax(170px, 1fr) 140px 180px;
}

.data-table.users {
  grid-template-columns: minmax(180px, 1fr) 140px minmax(260px, 1.2fr) 130px;
}

.data-table > * {
  border-bottom: 1px solid #edf1f3;
  min-width: 0;
  padding: 12px 14px;
}

.table-head {
  background: #eef8f6;
  color: #526268;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill {
  background: #def4f0;
  border-radius: 999px;
  color: #118a7f;
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  height: 28px;
  line-height: 28px;
  margin: 8px 12px;
  padding: 0 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  margin: 0 0 16px;
}

.detail-grid dt,
.detail-grid dd {
  border-bottom: 1px solid #edf1f3;
  margin: 0;
  padding: 10px 0;
}

.detail-grid dt {
  color: #65757b;
  font-weight: 800;
}

.empty {
  background: #f7f9fa;
  border: 1px dashed #cbd5d9;
  border-radius: 8px;
  color: #65757b;
  margin: 0;
  padding: 18px;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    border-bottom: 1px solid #dbe3e6;
    border-right: 0;
    max-height: none;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-y: visible;
  }

  .main {
    padding: 18px;
  }

  .taskbar {
    left: 0;
  }

  .form-grid,
  .workspace-split,
  .data-table.two-cols,
  .data-table.registrations,
  .data-table.users,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .split-row,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }
}
