:root {
  --ink: #1c2130;
  --text: #1c2130;
  --muted: #6e716e;
  --gold: #d5ac50;
  --gold-dark: #88621f;
  --gold-soft: #f6efdd;
  --paper: #fff;
  --canvas: #f5f3ee;
  --bg: #f5f3ee;
  --line: #e7e3da;
  --border: #e7e3da;
  --nav: #080b16;
  --dark: #080b16;
  --green: #277158;
  --red: #ad4b43;
  --blue: #486783;
  --shadow: 0 3px 14px #18203204;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.65 var(--font);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
.app-shell {
  min-height: 100vh;
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav);
  color: #d7d8df;
  box-shadow: 0 3px 14px #080b1610;
}
.header-inner,
.top-nav,
.header-context {
  width: min(1440px, 100%);
  margin-inline: auto;
  padding-inline: 40px;
}
.header-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 13px;
  color: #fff;
}
.brand img {
  width: 63px;
  height: 63px;
  object-fit: contain;
  border-radius: 12px;
}
.brand b {
  display: block;
  font-size: 23px;
  line-height: 1.3;
  color: #e7c775;
}
.brand-latin {
  display: inline-block;
  margin-inline-start: 9px;
  color: #fff;
  font:
    500 11px/1 Arial,
    sans-serif;
  letter-spacing: 3px;
  vertical-align: middle;
}
.brand small {
  display: block;
  font-size: 11px;
  color: #adb0bf;
  margin-top: 4px;
}
.header-divider {
  width: 1px;
  height: 30px;
  background: #ffffff1c;
}
.workspace {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  white-space: nowrap;
  color: #c9ccd7;
}
.online-dot,
.env-note i {
  width: 7px;
  height: 7px;
  border-radius: 100%;
  background: #51bd8b;
  display: inline-block;
}
.workspace-tag {
  color: #9ed2b5;
  background: #8bd5ad14;
  border: 1px solid #8bd5ad24;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10px;
}
.navigation-bar {
  background: #101420;
  border-top: 1px solid #ffffff09;
  border-bottom: 1px solid #ffffff09;
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 57px;
}
.nav-group {
  position: relative;
  flex: 0 1 auto;
}
.nav-trigger,
.nav-home {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #bfc2cf;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  list-style: none;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav-trigger::-webkit-details-marker {
  display: none;
}
.nav-trigger:hover,
.nav-home:hover,
.nav-group[open] > .nav-trigger {
  background: #ffffff09;
  color: #fff;
}
.nav-group.is-active > .nav-trigger,
.nav-home.active {
  color: #efd38e;
  background: #d5ac5014;
  border-color: #d5ac502e;
}
.nav-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.7;
  transition: transform 0.18s;
}
.nav-group[open] > .nav-trigger .nav-chevron {
  transform: rotate(180deg);
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-start: 0;
  width: 275px;
  max-height: min(450px, 65vh);
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 16px 40px #080b1626;
  color: var(--ink);
}
.nav-dropdown-label {
  padding: 7px 12px 9px;
  margin-bottom: 3px;
  border-bottom: 1px solid var(--line);
  color: #81734e;
  font-size: 11px;
  font-weight: 700;
}
.nav-group:last-child .nav-dropdown {
  inset-inline-start: auto;
  inset-inline-end: 0;
}
.nav-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 2px 0;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav-dropdown .nav-link {
  color: #4f5361;
}
.nav-dropdown .nav-link:hover {
  background: #f7f5f0;
  color: var(--ink);
}
.nav-dropdown .nav-link.active {
  background: var(--gold-soft);
  color: #75531b;
  font-weight: 700;
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
}
.nav-icon svg {
  width: 18px;
  height: 18px;
}
.nav-count {
  margin-inline-start: auto;
  background: #f3ead4;
  color: #7b581f;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}
.header-context {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--canvas);
  color: var(--muted);
}
.app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  height: 1px;
  background: var(--line);
}
.app-header:has(.header-context) {
  background: linear-gradient(var(--nav) 0 86px, #101420 86px 144px, var(--canvas) 144px);
}
.env-note {
  font-size: 11px;
  color: #72736c;
  display: flex;
  align-items: center;
  gap: 8px;
}
.env-note i {
  background: #aa8130;
}
.profile {
  border: 0;
  border-inline-start: 1px solid #ffffff1c;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  text-align: start;
  padding: 0;
  padding-inline-start: 19px;
  gap: 10px;
}
.profile b {
  font-size: 12px;
  display: block;
}
.profile small {
  font-size: 10px;
  color: #a8adbc;
  display: block;
}
.profile-chevron {
  width: 14px;
  height: 14px;
  margin-inline-start: 6px;
  color: #a8adbc;
}
.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7ce91;
  color: #4f3915;
  width: 36px;
  height: 36px;
  font-weight: 700;
}
.main-area {
  min-height: calc(100vh - 187px);
  display: flex;
  flex-direction: column;
}
.crumb {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #73766f;
}
.crumb b {
  font-weight: 400;
  color: #d0cec6;
}
.crumb strong {
  font-weight: 600;
  color: #393c45;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 19px;
  margin-inline-start: auto;
}
.today {
  font-size: 12px;
  color: #b7bbc9;
}
.icon-button {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid #e8e6df;
  background: #fff;
  border-radius: 9px;
  color: #565760;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.icon-button:hover {
  border-color: #c5a75f;
  color: var(--gold-dark);
}
.header-inner .icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid #ffffff21;
  background: #ffffff06;
  color: #d3d7e2;
}
.header-inner .icon-button:hover {
  color: #efd38e;
  border-color: #d5ac5066;
}
.icon-button svg {
  width: 19px;
  height: 19px;
}
.notify-dot {
  width: 6px;
  height: 6px;
  position: absolute;
  top: 6px;
  right: 7px;
  border-radius: 50%;
  background: #d0685c;
}
.mobile-menu {
  display: none;
}
.page-view {
  width: min(1440px, 100%);
  padding: 30px 40px 40px;
  margin: 0 auto;
  flex: 1;
}
.footer {
  display: flex;
  justify-content: space-between;
  color: #777970;
  font-size: 11px;
  padding: 18px max(40px, calc((100% - 1360px) / 2));
  border-top: 1px solid var(--line);
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.page-head h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.4px;
  font-weight: 700;
}
.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.eyebrow {
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid #dedbd3;
  background: #fff;
  padding: 9px 15px;
  border-radius: 8px;
  color: #4f5360;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
}
.btn:hover {
  border-color: #cbb77f;
}
.btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #221c10;
  font-weight: 700;
  box-shadow: 0 2px 4px #9d741616;
}
.btn.primary:hover {
  background: #e1bd68;
}
.btn.soft {
  background: var(--gold-soft);
  color: #785a23;
  border-color: #e8d9b6;
}
.btn.danger {
  color: #b65d58;
  background: #fff9f8;
  border-color: #f0d9d7;
}
.btn.small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #efede6;
}
.card-head h2,
.card-head h3 {
  font-size: 15px;
  margin: 0;
  font-weight: 700;
}
.card-head p {
  font-size: 11px;
  color: var(--muted);
  margin: 3px 0 0;
}
.card-body {
  padding: 18px 20px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #686d77;
  font-size: 12px;
}
.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: #977129;
  font-size: 18px;
}
.stat-value {
  font-size: 29px;
  font-weight: 700;
  margin-top: 12px;
  line-height: 1.2;
}
.stat-meta {
  font-size: 11px;
  color: #767b83;
  margin-top: 9px;
}
.stat-card:first-child {
  background: #121725;
  border-color: #121725;
  color: #fff;
}
.stat-card:first-child .stat-top,
.stat-card:first-child .stat-meta {
  color: #b9bfce;
}
.stat-card:first-child .stat-value {
  color: #efd38e;
}
.stat-card:first-child .stat-icon {
  background: #d5ac5019;
  color: #e7c775;
}
.trend {
  color: var(--green);
  font-size: 9px;
  margin-right: 5px;
}
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 20px;
  margin-bottom: 20px;
}
.chart-wrap {
  height: 198px;
  padding: 18px 22px 7px;
}
.chart-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart-grid {
  stroke: #f1efe9;
  stroke-width: 1;
}
.chart-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-fill {
  fill: url(#chart-fill);
}
.chart-point {
  fill: #fff;
  stroke: var(--gold);
  stroke-width: 2;
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  color: #727873;
  font-size: 11px;
  padding: 0 22px 18px;
}
.legend {
  font-size: 11px;
  color: var(--muted);
}
.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 6px;
}
.mini-list {
  display: grid;
  gap: 0;
}
.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f1ed;
}
.mini-row:last-child {
  border: 0;
}
.mini-date {
  background: #f5f1e7;
  border-radius: 8px;
  width: 43px;
  height: 43px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 10px;
  color: #847349;
  line-height: 1.3;
}
.mini-date b {
  font-size: 17px;
  color: #785a23;
}
.mini-row-main {
  flex: 1;
  min-width: 0;
}
.mini-row-main b {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-row-main small {
  color: var(--muted);
  font-size: 11px;
}
.mini-row .arrow {
  color: #b8b8bc;
}
.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(230px, 0.85fr);
  gap: 20px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 12px;
}
th {
  text-align: right;
  color: #6c706c;
  font-weight: 600;
  background: #faf9f5;
  padding: 13px 16px;
  border-bottom: 1px solid #f0eee8;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f1ed;
  color: #525866;
}
tr:last-child td {
  border: 0;
}
.table-link {
  font-weight: 700;
  color: #444650;
}
.muted {
  color: var(--muted);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 11px;
  background: #f5f4f0;
  color: #777;
}
.status:before {
  content: '';
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}
.status.green {
  background: #edf7f2;
  color: #348365;
}
.status.gold {
  background: #f8efdb;
  color: #815d1d;
}
.status.red {
  background: #fcf0ef;
  color: #b65e59;
}
.status.blue {
  background: #eef4fa;
  color: #587da4;
}
.status.gray {
  background: #f2f2f2;
  color: #85868c;
}
.task {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f3f1ed;
}
.task:last-child {
  border: 0;
}
.task input {
  accent-color: var(--gold);
  margin-top: 4px;
}
.task b {
  font-size: 12px;
  display: block;
}
.task small {
  font-size: 11px;
  color: var(--muted);
}
.timeline {
  position: relative;
  padding-right: 17px;
}
.timeline:before {
  content: '';
  position: absolute;
  right: 4px;
  top: 5px;
  bottom: 5px;
  width: 1px;
  background: #eee9dc;
}
.timeline-item {
  position: relative;
  padding: 0 0 17px 0;
}
.timeline-item:before {
  content: '';
  position: absolute;
  right: -17px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px #f7f3e9;
}
.timeline-item b {
  font-size: 10px;
  display: block;
}
.timeline-item small {
  color: #999aa1;
  font-size: 9px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0eee8;
}
.field,
.select,
.search {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  color: #51525b;
  font-size: 12px;
  outline: none;
}
.field:focus,
.select:focus,
.search:focus,
textarea:focus {
  border-color: #c6a65a;
  box-shadow: 0 0 0 3px #bc963f18;
}
.search {
  min-width: 200px;
}
.filters .spacer {
  flex: 1;
}
.table-actions {
  display: flex;
  gap: 5px;
}
.table-actions .btn {
  min-height: 30px;
  padding: 3px 7px;
  font-size: 11px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  font-size: 9px;
  color: #999;
}
.tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  background: #f4f3ef;
  border-radius: 9px;
  width: max-content;
  margin-bottom: 15px;
}
.tab {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 7px;
  color: #85858d;
  font-size: 12px;
}
.tab.active {
  background: #fff;
  box-shadow: 0 2px 5px #0000000b;
  color: #393a43;
  font-weight: 600;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-field {
  display: grid;
  gap: 5px;
}
.form-field.full {
  grid-column: 1/-1;
}
.form-field label {
  font-size: 12px;
  color: #626975;
}
.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid #e9e7e0;
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  font-size: 13px;
  color: #44454e;
  min-width: 0;
  outline: none;
}
.form-field textarea {
  min-height: 80px;
  resize: vertical;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 15px;
}
.detail-hero {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
}
.detail-monogram {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f4eddb;
  color: #886d30;
  font-weight: 700;
  font-size: 20px;
}
.detail-hero h2 {
  margin: 0;
  font-size: 16px;
}
.detail-hero p {
  margin: 3px 0;
  color: #95969d;
  font-size: 10px;
}
.detail-hero .status {
  margin-right: auto;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.detail-cell {
  padding: 12px;
  background: #fcfbf9;
  border-radius: 8px;
}
.detail-cell small {
  display: block;
  font-size: 9px;
  color: #999;
}
.detail-cell b {
  font-size: 11px;
  display: block;
  margin-top: 3px;
}
.segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.check-option {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fcfbf8;
  border: 1px solid #efede6;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 10px;
}
.check-option input {
  accent-color: var(--gold);
}
.notice {
  padding: 11px 13px;
  background: #fbf7eb;
  border: 1px solid #f0e8d3;
  border-radius: 9px;
  color: #88703c;
  font-size: 12px;
  margin: 12px 0;
}
.notice.info {
  background: #f2f6fa;
  border-color: #e2eaf2;
  color: #627c96;
}
.notice.danger {
  background: #fcf3f1;
  border-color: #f0dfdc;
  color: #a75c56;
}
.empty {
  padding: 42px 15px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty b {
  display: block;
  color: #555;
  margin-bottom: 5px;
}
.metric-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.metric-chip {
  background: #faf9f6;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 10px;
  color: #777;
}
.metric-chip b {
  color: #34353e;
  margin-right: 6px;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  padding: 14px;
}
.calendar-head,
.calendar-day {
  padding: 8px 4px;
  text-align: center;
  font-size: 9px;
}
.calendar-head {
  color: #9a9aa0;
}
.calendar-day {
  background: #fcfbf9;
  border-radius: 8px;
  min-height: 47px;
  color: #595a63;
  text-align: right;
  padding: 6px;
}
.calendar-day.today {
  background: #f7f0df;
  border: 1px solid #e8d9b5;
}
.calendar-day.has-event:after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 5px;
}
.calendar-day.dim {
  color: #c5c5c8;
}
.chart-bars {
  height: 150px;
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 10px 12px;
}
.bar-group {
  height: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: end;
  flex-direction: column;
  gap: 6px;
}
.bar {
  width: min(26px, 70%);
  border-radius: 5px 5px 0 0;
  background: #d4bd83;
  min-height: 4px;
}
.bar.alt {
  background: #e9e4d7;
}
.bar-group small {
  font-size: 8px;
  color: #999;
}
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1efe9;
}
.switch-row b {
  font-size: 10px;
}
.switch-row small {
  display: block;
  color: #999;
  font-size: 9px;
}
.switch {
  appearance: none;
  width: 33px;
  height: 18px;
  border-radius: 10px;
  background: #d9d9d9;
  position: relative;
  cursor: pointer;
}
.switch:checked {
  background: var(--gold);
}
.switch:before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  top: 2px;
  right: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
}
.switch:checked:before {
  right: 17px;
}
.toast-root {
  position: fixed;
  z-index: 99;
  bottom: 20px;
  left: 20px;
  display: grid;
  gap: 7px;
}
.toast {
  background: #20212a;
  color: #fff;
  border-radius: 9px;
  padding: 10px 14px;
  box-shadow: 0 8px 25px #0002;
  font-size: 11px;
  animation: toast-in 0.2s ease;
}
.toast.error {
  background: #a94c49;
}
.toast.success {
  background: #287458;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal {
  border: 1px solid #e8e5dc;
  border-radius: 14px;
  padding: 0;
  width: min(560px, calc(100vw - 28px));
  box-shadow: 0 20px 70px #0003;
}
.modal::backdrop {
  background: #17192266;
  backdrop-filter: blur(2px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid #efede6;
}
.modal-head h2 {
  font-size: 14px;
  margin: 0;
}
.modal #modal-body {
  padding: 18px;
}
.modal:has(.catalog-editor) {
  width: min(880px, calc(100vw - 28px));
}
.modal:has(.catalog-editor) .modal-head {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: var(--paper);
}
.catalog-editor-section {
  min-inline-size: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.catalog-editor > .full,
.catalog-editor-section .form-grid > .full,
[data-form='stock-save'] > .full {
  grid-column: 1 / -1;
}
.catalog-editor-section legend {
  padding-inline: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.catalog-editor-section p,
.catalog-copy-note,
.catalog-error {
  margin: 0;
}
.catalog-editor-section .catalog-lines + button {
  margin-block-start: 8px;
}
.catalog-editor .form-actions {
  flex-wrap: wrap;
  margin-block-start: 0;
}
.catalog-editor .form-field,
.catalog-editor .form-field input,
.catalog-editor .form-field select,
.catalog-editor .form-field textarea {
  font-size: 12px;
}
.catalog-editor .form-field input:focus,
.catalog-editor .form-field select:focus,
.catalog-editor .form-field textarea:focus,
.catalog-library .search:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.catalog-editor .form-field small,
.catalog-cell-photo small,
.catalog-library-item small,
.catalog-component-name small {
  display: block;
  color: var(--muted);
}
.catalog-lines {
  display: grid;
  gap: 8px;
}
.catalog-lines:not(:empty) {
  margin-block-start: 10px;
}
.catalog-line {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.5fr) minmax(76px, 0.55fr) auto;
  align-items: end;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.album-line {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) auto;
}
.catalog-line .form-field {
  min-width: 0;
}
.catalog-line .catalog-photo-previews {
  grid-column: 1 / -1;
}
.catalog-line .catalog-photo-previews:empty {
  display: none;
}
.catalog-library-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.5fr);
  gap: 8px;
  margin-block: 10px;
}
.catalog-library-filters input,
.catalog-library-filters select {
  min-width: 0;
  width: 100%;
}
.catalog-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
  max-height: 240px;
  overflow-y: auto;
}
.catalog-library-item,
.catalog-component-name,
.catalog-cell-photo {
  display: flex;
  align-items: center;
  gap: 9px;
}
.catalog-library-item {
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: start;
}
.catalog-library-item:hover,
.catalog-library-item:focus-visible {
  border-color: var(--gold);
}
.catalog-library-item[hidden] {
  display: none;
}
.form-field[hidden],
.switch-row[hidden] {
  display: none;
}
.directory-assigned {
  display: block;
}
.catalog-add-mark {
  margin-inline-start: auto;
  color: var(--gold-dark);
}
.catalog-library-item img,
.catalog-component-name img,
.catalog-cell-photo img,
.catalog-photo-placeholder {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
}
.catalog-cell-photo img,
.catalog-cell-photo .catalog-photo-placeholder {
  width: 63px;
}
.catalog-photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--gold-dark);
  background: #f7f2e4;
}
.catalog-photo-placeholder svg {
  width: 18px;
  height: 18px;
}
.catalog-photo-previews {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.catalog-photo-tile {
  position: relative;
  width: 94px;
  height: 62px;
}
.catalog-photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.catalog-photo-tile button {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-end: 3px;
  padding: 0;
  width: 24px;
  height: 24px;
  min-height: 0;
  line-height: 1;
}
.catalog-status,
.catalog-copy-note,
.catalog-error {
  border-radius: 8px;
  padding: 4px 8px;
  background: #f4f0e4;
  color: #705b2c;
}
.catalog-status.published {
  background: #eaf5ee;
  color: #23694f;
}
.catalog-error {
  background: #fbeceb;
  color: #882d27;
}
@media (max-width: 600px) {
  .catalog-line {
    grid-template-columns: minmax(0, 1fr) minmax(66px, 0.6fr);
  }
  .catalog-line > :first-child {
    grid-column: 1/-1;
  }
  .catalog-line > button {
    justify-self: start;
  }
}
.role-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}
.denied-card {
  max-width: 600px;
  margin: 45px auto;
  text-align: center;
  padding: 35px;
}
.denied-icon {
  font-size: 35px;
  color: #bf6a61;
}
.denied-card h2 {
  margin: 8px 0;
}
.denied-card p {
  font-size: 11px;
  color: #94949a;
}
@media (max-width: 1280px) {
  .header-inner,
  .top-nav,
  .header-context {
    padding-inline: 24px;
  }
  .nav-trigger,
  .nav-home {
    gap: 6px;
    padding-inline: 10px;
    font-size: 12px;
  }
  .page-view {
    padding: 24px;
  }
  .today {
    display: none;
  }
}
@media (max-width: 1120px) {
  .app-header:has(.header-context) {
    background: var(--nav);
  }
  .header-inner {
    min-height: 77px;
    gap: 18px;
  }
  .mobile-menu {
    display: grid;
  }
  .top-nav {
    display: none;
  }
  .app-header.menu-open .top-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-block: 10px 16px;
    max-height: min(68vh, 580px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .navigation-bar {
    border: 0;
  }
  .app-header.menu-open .navigation-bar {
    border-top: 1px solid #ffffff15;
  }
  .nav-trigger,
  .nav-home {
    min-height: 44px;
    font-size: 14px;
    padding-inline: 13px;
  }
  .nav-chevron {
    margin-inline-start: auto;
  }
  .nav-dropdown,
  .nav-group:last-child .nav-dropdown {
    position: static;
    max-height: none;
    width: 100%;
    margin-block: 6px;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
  }
  .nav-dropdown .nav-link {
    min-height: 44px;
  }
  .nav-dropdown-label {
    display: none;
  }
  .header-context {
    padding-block: 5px;
  }
  .main-area {
    min-height: calc(100vh - 120px);
  }
}
@media (max-width: 1000px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-grid,
  .lower-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .header-divider,
  .workspace {
    display: none;
  }
}
@media (max-width: 760px) {
  .header-inner,
  .top-nav,
  .header-context {
    padding-inline: 16px;
  }
  .header-inner {
    min-height: 75px;
    gap: 8px;
  }
  .brand {
    gap: 8px;
  }
  .brand img {
    width: 49px;
    height: 49px;
  }
  .brand b {
    font-size: 21px;
  }
  .brand small {
    font-size: 10px;
    margin-top: 2px;
  }
  .brand-latin,
  .profile-copy,
  .profile-chevron {
    display: none;
  }
  .profile {
    border: 0;
    padding: 0;
    min-height: 40px;
    min-width: 36px;
    justify-content: center;
  }
  .top-actions {
    gap: 8px;
  }
  .header-context {
    min-height: 39px;
  }
  .env-note {
    font-size: 10px;
  }
  .crumb {
    font-size: 11px;
    min-width: 0;
  }
  .crumb strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .page-view {
    padding: 24px 16px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
    gap: 16px;
  }
  .page-head h1 {
    font-size: 25px;
  }
  .head-actions {
    width: 100%;
  }
  .dash-grid,
  .lower-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-value {
    font-size: 24px;
  }
  .footer {
    padding: 14px 16px;
    gap: 6px;
    flex-direction: column;
  }
  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .search {
    min-width: 150px;
    flex: 1;
  }
  .table-wrap {
    margin-inline: -1px;
  }
  .chart-wrap {
    height: 175px;
  }
  .card-head {
    padding: 16px;
    flex-wrap: wrap;
  }
  .card-body {
    padding: 16px;
  }
  .dash-grid,
  .lower-grid {
    gap: 16px;
    margin-bottom: 16px;
  }
}
@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-card {
    padding: 13px;
  }
  .stat-top {
    font-size: 11px;
    gap: 5px;
  }
  .stat-icon {
    width: 29px;
    height: 29px;
    flex-shrink: 0;
  }
  .stat-value {
    font-size: 23px;
  }
  .stat-meta {
    font-size: 10px;
  }
  .header-inner .icon-button {
    width: 34px;
    height: 38px;
  }
  .top-actions {
    gap: 6px;
  }
  .env-note {
    white-space: nowrap;
    gap: 5px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-field.full {
    grid-column: auto;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .head-actions .btn {
    flex: 1;
  }
}
/* Keep small screens within the viewport; tab strips and data tables scroll internally. */
html,
body,
.app-shell,
.main-area,
.page-view {
  max-width: 100%;
  min-width: 0;
}
html,
body {
  overflow-x: clip;
}
.tabs {
  max-width: 100%;
  overflow-x: auto;
}
.card,
.card-head,
.content-grid,
.dash-grid,
.lower-grid {
  min-width: 0;
  max-width: 100%;
}
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.search {
  min-width: min(200px, 100%);
}
@media (max-width: 760px) {
  .crumb {
    overflow: hidden;
  }
  .page-head {
    min-width: 0;
  }
  .page-head > div:first-child {
    min-width: 0;
  }
  .head-actions {
    max-width: 100%;
  }
  .card-head {
    gap: 8px;
  }
  .content-grid,
  .dash-grid,
  .lower-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer {
    min-width: 0;
  }
  .footer span {
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
