:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #19334d;
  background: #f3f6fa;
  font-size: 16px;
  --navy: #123b65;
  --blue: #1769b2;
  --sky: #50b8df;
  --muted: #61758a;
  --line: #dce5ee;
  --white: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #50b8df;
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #50b8df;
  outline-offset: 1px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 2rem;
  letter-spacing: -0.04em;
  margin-bottom: 0.45rem;
}
h2 {
  font-size: 1.1rem;
  letter-spacing: -0.015em;
}
h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}
p {
  line-height: 1.55;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.brand {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  color: var(--navy);
}
.brand span {
  display: block;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 4px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  padding: 34px 24px;
  background: white;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 35px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.navlink {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #65788c;
  padding: 14px;
  border-radius: 10px;
  min-height: 48px;
  font-size: 0.95rem;
}
.navlink.active {
  background: #eaf3fc;
  color: #145f9d;
  font-weight: 650;
}
.navlink svg {
  width: 21px;
  height: 21px;
}
.sidebar .foot {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}
.topbar {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 38px;
  background: #ffffffbd;
  gap: 12px;
}
.topbar .mobile-brand {
  display: none;
}
.workspace {
  margin-left: 238px;
}
.content {
  max-width: 1280px;
  padding: 34px 38px 70px;
  margin: auto;
}
.status {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 7px;
}
.status:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #258768;
}
.status.offline:before {
  background: #bf861f;
}
.status.pending:before {
  background: #d09833;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  border-radius: 9px;
  min-height: 46px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.btn.secondary {
  background: #e9f4fa;
  border-color: #d2e9f4;
  color: #14527e;
}
.btn.danger {
  color: #a93737;
}
.btn.icon {
  padding: 10px;
  min-width: 46px;
}
.btn svg {
  width: 18px;
  height: 18px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 25px;
}
.page-head p {
  margin-bottom: 0;
}
.search {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  padding: 15px 18px;
  border-radius: 10px;
  min-height: 51px;
}
.search-wrap {
  margin-bottom: 24px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 24px 0 30px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.stat strong {
  display: block;
  font-size: 1.9rem;
  letter-spacing: -0.05em;
  margin-top: 12px;
}
.stat .symbol {
  padding: 9px;
  border-radius: 9px;
  color: #248dbd;
  background: #eff8fc;
}
.symbol svg {
  width: 20px;
  height: 20px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 24px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 23px;
  min-width: 0;
  margin-bottom: 22px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.panel-head h2 {
  margin: 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px;
  min-width: 0;
}
.card:hover {
  border-color: #9fbdd6;
}
.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: #edf4fa;
  color: #2b6d9f;
  border: 1px solid #e1ebf3;
  border-radius: 10px;
  font-weight: 700;
}
.row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 0;
  border-bottom: 1px solid #edf1f6;
  min-width: 0;
}
.row:last-child {
  border-bottom: 0;
}
.row .grow {
  flex: 1;
  min-width: 0;
}
.row strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}
.pill {
  display: inline-block;
  padding: 5px 9px;
  font-size: 0.78rem;
  border-radius: 6px;
  background: #edf5fc;
  color: #296a9e;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.pill.selected {
  background: #e9f6ef;
  color: #307457;
}
.empty {
  padding: 26px 12px;
  text-align: center;
  color: var(--muted);
}
.empty svg {
  width: 33px;
  height: 33px;
  color: #83a4bc;
  margin-bottom: 12px;
}
.empty p {
  font-size: 0.9rem;
  max-width: 310px;
  margin: 0 auto 17px;
}
.quick {
  background: var(--navy);
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 22px;
}
.quick .eyebrow {
  color: #91d3ef;
}
.quick h2 {
  font-size: 1.35rem;
  margin-top: 10px;
}
.quick p {
  color: #c9ddeb;
  font-size: 0.9rem;
}
.quick .btn {
  background: white;
  border: 0;
  width: 100%;
  color: var(--navy);
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.toolbar > * {
  flex: 1;
  min-width: 140px;
}
.toolbar .btn {
  flex: 0 0 auto;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
label {
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 550;
}
input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #ccd9e4;
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  color: #19334d;
  font-weight: 400;
}
textarea {
  min-height: 96px;
  resize: vertical;
}
.span2 {
  grid-column: 1/-1;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.check input {
  width: 21px;
  min-height: 21px;
  height: 21px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.actions.end {
  justify-content: flex-end;
}
.actions.sticky {
  position: sticky;
  bottom: -24px;
  background: white;
  padding: 16px 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
details {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 18px 0;
  padding: 0 16px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 51px;
  padding: 16px 0;
}
details .fields {
  padding: 0 0 18px;
}
dialog {
  width: min(720px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 100px #19334d30;
  padding: 24px;
  max-height: 92dvh;
  color: inherit;
}
dialog::backdrop {
  background: #122c496b;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 23px;
}
.modal-head h2 {
  font-size: 1.3rem;
  margin: 0;
}
.error {
  background: #fff0f0;
  color: #a62e2e;
  padding: 12px;
  border-radius: 8px;
  margin: 14px 0;
  line-height: 1.5;
}
.info {
  background: #edf6fc;
  color: #235678;
  padding: 15px;
  border-radius: 9px;
  line-height: 1.5;
  font-size: 0.9rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}
.detail-grid dt {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 5px;
}
.detail-grid dd {
  margin: 0;
  font-size: 0.95rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tier {
  display: grid;
  grid-template-columns: 1fr 1fr 100px 46px;
  gap: 9px;
  align-items: end;
  margin-bottom: 12px;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}
td,
th {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  min-width: 130px;
}
th {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
tbody th {
  min-width: 150px;
  background: #f7f9fc;
}
td {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 13px;
}
.photo {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.photo img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.photo .caption {
  padding: 9px;
  font-size: 0.8rem;
}
.photo button {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
}
.note {
  border-left: 3px solid var(--sky);
  padding: 10px 15px;
  margin: 16px 0;
  background: #f7fafc;
}
.note p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0;
}
.bottom-nav {
  display: none;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #173b58;
  color: white;
  padding: 14px 21px;
  border-radius: 10px;
  box-shadow: 0 8px 30px #123b6530;
  max-width: 90%;
  z-index: 10;
  display: none;
}
#toast.show {
  display: block;
}
.boot {
  padding: 40px;
}
.lock-screen {
  max-width: 430px;
  margin: 9vh auto;
  padding: 32px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.lock-screen h1 {
  font-size: 1.5rem;
  margin-top: 30px;
}
.lock-screen .btn {
  width: 100%;
  margin-top: 18px;
}
.list-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.star {
  color: #8a6510;
  background: #fff9e8;
}
.spacer {
  margin-top: 26px;
}
.preview-image {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  margin: auto;
}
.nowrap {
  white-space: nowrap;
}
.inline-select {
  max-width: 220px;
}
.hidden {
  display: none !important;
}
.selection {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.selection input {
  width: 20px;
  height: 20px;
  min-height: 20px;
}
.date-badge {
  background: #eef5fb;
  color: #246796;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  min-width: 62px;
}
.count {
  color: var(--muted);
  font-weight: 400;
}
.quote-total {
  color: var(--blue);
  font-size: 1.1rem;
  font-weight: 650;
}
.mobile-only {
  display: none;
}
@media (max-width: 1000px) {
  .sidebar {
    width: 195px;
    padding: 28px 18px;
  }
  .workspace {
    margin-left: 195px;
  }
  .content {
    padding: 26px 24px 70px;
  }
  .topbar {
    padding: 0 24px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 15px;
  }
  .stat .symbol {
    display: none;
  }
}
@media (max-width: 700px) {
  .sidebar {
    display: none;
  }
  .workspace {
    margin: 0;
  }
  .topbar {
    height: 69px;
    padding: 0 19px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
  }
  .topbar .mobile-brand {
    display: block;
    font-size: 1.05rem;
  }
  .topbar .desktop-title,
  .topbar .lock-label {
    display: none;
  }
  .content {
    padding: 25px 17px calc(100px + env(safe-area-inset-bottom));
  }
  .page-head {
    align-items: start;
    gap: 10px;
  }
  .page-head h1 {
    font-size: 1.6rem;
  }
  .page-head p {
    font-size: 0.875rem;
  }
  .page-head > .btn {
    padding: 10px;
    font-size: 0.8rem;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0 24px;
  }
  .stat {
    padding: 17px;
  }
  .stat .symbol {
    display: block;
  }
  .stat strong {
    font-size: 1.7rem;
    margin-top: 8px;
  }
  .panel {
    padding: 19px;
    margin-bottom: 18px;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .dashboard-grid {
    gap: 0;
  }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
    background: white;
    border-top: 1px solid var(--line);
    justify-content: space-around;
  }
  .bottom-nav .navlink {
    flex-direction: column;
    gap: 4px;
    font-size: 0.73rem;
    padding: 8px 5px;
    min-width: 57px;
    border-radius: 7px;
  }
  .bottom-nav .navlink svg {
    width: 20px;
    height: 20px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .span2 {
    grid-column: auto;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tier {
    grid-template-columns: 1fr 1fr 78px 36px;
    gap: 6px;
  }
  .tier input,
  .tier select {
    padding: 9px 6px;
    min-width: 0;
  }
  .tier label {
    font-size: 0.75rem;
  }
  .tier .btn {
    min-width: 36px;
    padding: 8px;
  }
  .toolbar > * {
    min-width: 125px;
  }
  dialog {
    padding: 20px 17px;
  }
  .actions.sticky {
    bottom: -20px;
  }
  .lock-screen {
    margin: 6vh 17px;
    padding: 27px;
  }
  .top-actions {
    gap: 8px;
  }
  .status {
    font-size: 0.75rem;
  }
  #toast {
    bottom: 93px;
  }
  .mobile-only {
    display: block;
  }
  .quick {
    padding: 21px;
  }
  .card {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .btn,
  .card {
    transition:
      background 0.15s,
      border-color 0.15s;
  }
  .content {
    animation: appear 0.15s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0.5;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (max-width: 700px) {
  .topbar [data-action="lock"] {
    font-size: 0;
    min-width: 42px;
    min-height: 42px;
    gap: 0;
  }
  .topbar [data-action="lock"] svg {
    width: 18px;
    height: 18px;
  }
  .topbar .status {
    max-width: 160px;
  }
}
