:root {
  --mg-ink: #19354c;
  --mg-muted: #657d8d;
  --mg-teal: #137c70;
  --mg-bg: #f3f7f9;
  --mg-line: #e1eaee;
}
.management-app {
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: var(--mg-ink);
  background: var(--mg-bg);
  min-height: 100vh;
  font-size: 15px;
}
.management-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  background: #fff;
  border-right: 1px solid var(--mg-line);
  display: flex;
  flex-direction: column;
  z-index: 20;
  padding: 25px 18px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--mg-ink);
  padding: 5px 7px 24px;
}
.brand img {
  width: 65px;
  max-height: 72px;
  object-fit: contain;
}
.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.brand small {
  display: block;
  font-size: 11px;
  color: var(--mg-muted);
  margin-top: 5px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 15px;
  background: #147d71;
  color: white;
  font-size: 28px;
  font-weight: 800;
}
.sidebar-search {
  margin: 5px 0 20px;
}
.management-sidebar nav {
  overflow: auto;
  flex: 1;
}
.management-sidebar nav a {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 15px 16px;
  min-height: 54px;
  margin: 4px 0;
  border-radius: 13px;
  font-weight: 600;
  color: #536c7d;
  text-decoration: none;
}
.management-sidebar nav a span {
  font-size: 22px;
  color: #7b929c;
  width: 24px;
  text-align: center;
}
.management-sidebar nav a.current {
  background: #e0f4ed;
  color: #126b60;
}
.management-sidebar nav a:hover {
  background: #edf6f3;
}
.sidebar-bottom {
  font-size: 12px;
  line-height: 1.6;
  padding: 18px 8px 0;
  border-top: 1px solid var(--mg-line);
  margin-top: 20px;
}
.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #2eaa78;
  border-radius: 50%;
  margin-right: 7px;
}
.management-main {
  margin-left: 264px;
  min-width: 0;
}
.management-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 20px 34px;
  background: #fff;
  border-bottom: 1px solid var(--mg-line);
}
.management-header small {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--mg-muted);
  margin-bottom: 5px;
}
.management-header strong {
  font-size: 14px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 20px;
}
.user-info > span {
  font-weight: 700;
}
.user-info small {
  margin-top: 3px;
  font-weight: 400;
  letter-spacing: 0;
}
.management-content {
  padding: 32px;
  max-width: 1700px;
  margin: auto;
  padding-bottom: 100px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--mg-teal);
}
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.page-title h1 {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -1px;
  margin: 6px 0;
}
.page-title p {
  color: var(--mg-muted);
  margin: 0;
  font-size: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 22px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn.primary {
  background: #147d71;
  color: #fff;
  box-shadow: 0 5px 14px #147d711a;
}
.btn.primary:hover {
  background: #10685f;
}
.btn.secondary {
  background: #f5f9fa;
  border-color: #dce7eb;
  color: #34586b;
}
.btn.danger {
  background: #be414e;
  color: #fff;
}
.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.text-button {
  padding: 12px;
  min-height: 48px;
  color: #567585;
  text-decoration: underline;
}
.touch-input {
  display: block;
  border: 1px solid #dce6eb;
  background: #fff;
  border-radius: 12px;
  min-height: 50px;
  padding: 12px 14px;
  width: 100%;
  font: inherit;
  color: #19354c;
  box-sizing: border-box;
}
.touch-input:focus {
  outline: 2px solid #9ed7cb;
  outline-offset: 2px;
}
.touch-input::placeholder {
  color: #91a1ac;
}
.filters-panel {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--mg-line);
  border-radius: 20px;
  margin-bottom: 22px;
}
.filter-search {
  min-width: 220px;
  flex: 1;
}
.filter-label,
.filter-search > span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 9px;
  color: #607b8a;
}
.choice-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.choice-card {
  border: 1px solid #dae6eb;
  background: #f7fafb;
  color: #526b7b;
  min-height: 48px;
  border-radius: 12px;
  padding: 12px 17px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
.choice-card:hover {
  background: #eaf4f1;
}
.choice-card.selected {
  background: #ddf3eb;
  color: #12695c;
  border-color: #96d6c1;
  box-shadow: none;
}
.choice-card.negative.selected {
  background: #fde9e9;
  color: #a53e47;
  border-color: #efbfc4;
}
.table-panel {
  background: #fff;
  border: 1px solid var(--mg-line);
  border-radius: 20px;
  overflow: hidden;
}
.table-caption {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.table-caption h2 {
  font-size: 16px;
  font-weight: 750;
}
.muted {
  color: var(--mg-muted);
  font-size: 13px;
}
.table-scroll {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #b1ccc7 #edf3f5;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th {
  background: #edf4f6;
  color: #68818e;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 15px 18px;
  white-space: nowrap;
}
td {
  padding: 17px 18px;
  border-bottom: 1px solid #edf2f5;
  vertical-align: middle;
}
tbody tr:hover {
  background: #fcfefe;
}
.cell-name {
  font-weight: 750;
  color: #294e60;
}
.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 700;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.badge.green {
  background: #e0f5ea;
  color: #23805d;
}
.badge.red {
  background: #fde9e9;
  color: #b54450;
}
.badge.blue {
  background: #e7f0ff;
  color: #4d73b3;
}
.badge.amber {
  background: #fff1ce;
  color: #8f701f;
}
.badge.neutral {
  background: #eef2f5;
  color: #768b97;
}
.row-actions {
  display: flex;
  gap: 7px;
}
.action-button {
  padding: 10px 13px;
  min-height: 44px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  color: #526e80;
  background: #edf4f6;
  white-space: nowrap;
}
.action-button.blue {
  background: #e8f0ff;
  color: #4d73b3;
}
.action-button.red {
  background: #ffeded;
  color: #b54b56;
}
.empty-state {
  text-align: center;
  padding: 55px;
  color: #7f939e;
}
.empty-state strong {
  font-size: 17px;
  color: #3f6376;
}
.empty-state p {
  margin-top: 10px;
}
.pagination {
  display: flex;
  justify-content: end;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 18px;
}
.page-button {
  padding: 11px 15px;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  background: #f4f8fa;
  border-radius: 10px;
  font-size: 12px;
  text-decoration: none;
  color: #526c7c;
}
.page-button.selected {
  background: #137d71;
  color: white;
}
.page-button.disabled {
  opacity: 0.4;
}
.touch-modal {
  padding: 0;
  border: 1px solid #e1ebef;
  border-radius: 22px;
  width: min(520px, calc(100vw - 32px));
  max-height: 88dvh;
  overflow: auto;
  color: #19354c;
  background: white;
  box-shadow: 0 30px 100px #102e3c33;
}
.touch-modal.wide {
  width: min(1080px, calc(100vw - 48px));
}
.touch-modal::backdrop {
  background: #102c3f70;
  backdrop-filter: blur(4px);
}
.touch-modal > header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid #e7eff1;
  background: #f7fbfb;
}
.touch-modal > header small {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #72918e;
}
.touch-modal h2 {
  font-size: 22px;
  font-weight: 750;
  margin: 5px 0 0;
}
.icon-button {
  border: 1px solid #dae6ea;
  border-radius: 11px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  font-size: 25px;
  color: #67818e;
  background: white;
}
.modal-content {
  padding: 26px 28px;
}
.touch-modal > footer {
  border-top: 1px solid #e7eff1;
  padding: 18px 28px;
  display: flex;
  justify-content: end;
  gap: 12px;
  background: #fbfdfd;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  border: 0;
  min-width: 0;
  padding: 0;
  margin: 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}
.field > span:first-child {
  color: #4c6b7c;
}
.field.full {
  grid-column: 1/-1;
}
.field .choice-cards {
  font-weight: 500;
}
.required {
  color: #be4c5b;
}
.field-error {
  font-size: 12px;
  color: #b33c4e;
  font-weight: 600;
}
.hint {
  color: #78919e;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.7;
}
.money-input {
  position: relative;
  min-width: 130px;
}
.money-input > span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6a9289;
}
.money-input input {
  padding-left: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.search-select {
  position: relative;
}
.select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  font-size: 13px;
}
.select-trigger span {
  font-size: 24px;
  color: #789e96;
}
.search-popover {
  position: relative;
  z-index: 35;
  margin-top: 7px;
  background: white;
  box-shadow: 0 10px 30px #19354c20;
  padding: 10px;
  border: 1px solid #dce9e7;
  border-radius: 14px;
}
.search-results {
  max-height: 240px;
  overflow: auto;
  margin-top: 6px;
}
.search-result {
  width: 100%;
  display: block;
  text-align: left;
  padding: 14px;
  min-height: 48px;
  border-radius: 8px;
  font-size: 13px;
}
.search-result:hover,
.search-result[aria-pressed="true"] {
  background: #e7f5ef;
  color: #147768;
}
.file-upload {
  display: flex;
  gap: 12px;
  align-items: start;
  flex-direction: column;
  padding: 18px;
  border: 1px dashed #b5d4cc;
  border-radius: 14px;
  background: #f4fbf8;
  font-size: 11px;
  color: #79928b;
}
.file-upload img {
  max-width: 180px;
  height: 80px;
  object-fit: contain;
}
.permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.permission-group {
  padding: 15px;
  border-radius: 13px;
  background: #f3f7fa;
}
.permission-group > strong {
  display: block;
  text-transform: capitalize;
  margin-bottom: 9px;
}
.permission-group .choice-card {
  padding: 9px;
  min-height: 44px;
  font-size: 11px;
}
.price-items {
  margin-top: 28px;
  border-top: 1px solid #e2ecef;
  padding-top: 20px;
}
.price-items td {
  padding: 12px 8px;
}
.material-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  max-height: 190px;
  overflow: auto;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin: 28px 0 18px;
}
.section-heading h2,
.section-heading h3 {
  font-weight: 750;
  font-size: 19px;
}
.record-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 11px;
  color: #8195a0;
}
.success-banner,
.error-banner {
  border-radius: 13px;
  padding: 16px 20px;
  margin-bottom: 22px;
  font-size: 13px;
}
.success-banner {
  background: #e3f6e9;
  color: #267551;
  border: 1px solid #c5e7d0;
}
.error-banner {
  background: #fff0f1;
  color: #ae4050;
}
.confirm-message {
  font-size: 15px;
  line-height: 1.8;
}
.welcome-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 38px;
  border-radius: 24px;
  background: linear-gradient(115deg, #d9f1e6, #e9f7f1 65%, #edf5fb);
  border: 1px solid #cfe6dd;
}
.welcome-banner h1 {
  font-size: 34px;
  max-width: 470px;
  line-height: 1.2;
  letter-spacing: -1px;
  font-weight: 750;
  margin: 14px 0;
}
.welcome-banner p {
  max-width: 510px;
  line-height: 1.7;
  color: #618579;
  font-size: 14px;
}
.welcome-symbol {
  font-size: 110px;
  color: #83c5b5;
  padding: 0 30px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.dashboard-card {
  display: block;
  text-decoration: none;
  padding: 25px;
  border-radius: 20px;
  border: 1px solid #e0eaeb;
  position: relative;
  transition: transform 0.2s;
}
.dashboard-card:hover {
  transform: translateY(-3px);
}
.dashboard-card strong {
  display: block;
  font-size: 37px;
  font-weight: 750;
  margin: 8px 0 2px;
}
.dashboard-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 18px;
}
.dashboard-card small {
  font-size: 12px;
  opacity: 0.65;
}
.card-icon {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 28px;
  opacity: 0.55;
}
.tone-0 {
  background: #e6f5ed;
  color: #337d62;
}
.tone-1 {
  background: #eaf0fd;
  color: #5175a2;
}
.tone-2 {
  background: #fcf0df;
  color: #9d7944;
}
.tone-3 {
  background: #efeafb;
  color: #7a62a7;
}
.tone-4 {
  background: #e3f4f6;
  color: #497f89;
}
.tone-5 {
  background: #faeaf0;
  color: #ad6d82;
}
.delivery-note {
  margin-top: 28px;
  padding: 25px;
  border: 1px dashed #cfdee4;
  border-radius: 18px;
  background: #fff;
}
.delivery-note h3 {
  font-weight: 750;
  margin: 13px 0 7px;
}
.delivery-note p {
  font-size: 13px;
  line-height: 1.8;
  color: #718996;
}
.keyboard-toggle {
  position: fixed;
  bottom: 20px;
  right: 22px;
  background: #173f51;
  color: white;
  box-shadow: 0 7px 25px #0c304f30;
  z-index: 80;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13px;
}
.touch-keyboard {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: min(740px, calc(100vw - 28px));
  padding: 16px;
  border-radius: 20px;
  border: 1px solid #bfd3d8;
  background: #eaf1f4;
  box-shadow: 0 12px 70px #14374c40;
  z-index: 100;
  color: #234c5d;
}
.touch-keyboard > header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}
.touch-keyboard header span {
  font-size: 10px;
  color: #6e8794;
}
.touch-keyboard header button {
  min-height: 44px;
  padding: 8px;
}
.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 6px 0;
}
.keyboard-row button {
  flex: 1;
  max-width: 68px;
  min-width: 0;
  height: 47px;
  border-radius: 9px;
  border: 1px solid #d5e1e5;
  background: white;
  font-weight: 700;
  box-shadow: 0 2px 0 #cad9de;
}
.keyboard-row button:active {
  background: #bde5d7;
}
.keyboard-row button.space-key {
  max-width: 360px;
  flex: 5;
}
.audit-value {
  max-width: 400px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
fieldset:disabled {
  opacity: 0.88;
}
fieldset:disabled button {
  cursor: default;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #73b9ad;
  outline-offset: 3px;
}
@media (min-width: 1500px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1050px) {
  .management-sidebar {
    width: 220px;
    padding: 20px 12px;
  }
  .management-main {
    margin-left: 220px;
  }
  .management-content {
    padding: 24px 18px 100px;
  }
  .management-header {
    padding: 16px 20px;
  }
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .welcome-symbol {
    display: none;
  }
  .welcome-banner {
    padding: 28px;
  }
  .welcome-banner h1 {
    font-size: 29px;
  }
}
@media (max-width: 740px) {
  .management-sidebar {
    position: static;
    width: 100%;
    padding: 16px;
    border-right: 0;
  }
  .brand {
    padding-bottom: 8px;
  }
  .sidebar-search,
  .sidebar-bottom {
    display: none;
  }
  .management-sidebar nav {
    display: flex;
    overflow: auto;
    gap: 5px;
  }
  .management-sidebar nav a {
    white-space: nowrap;
    padding: 10px;
    font-size: 12px;
    min-height: 44px;
  }
  .management-sidebar nav a span {
    font-size: 16px;
    width: 16px;
  }
  .management-main {
    margin-left: 0;
  }
  .management-header {
    padding: 13px;
  }
  .management-header small {
    font-size: 8px;
  }
  .user-info {
    gap: 8px;
  }
  .user-info > span {
    font-size: 11px;
  }
  .page-title {
    align-items: start;
    flex-direction: column;
    gap: 15px;
  }
  .page-title h1 {
    font-size: 28px;
  }
  .filters-panel {
    padding: 16px;
  }
  .form-grid,
  .permission-grid {
    grid-template-columns: 1fr;
  }
  .touch-modal.wide {
    width: calc(100vw - 20px);
  }
  .modal-content {
    padding: 20px;
  }
  .touch-modal > header,
  .touch-modal > footer {
    padding: 18px 20px;
  }
  .dashboard-grid {
    gap: 12px;
  }
  .dashboard-card {
    padding: 20px;
  }
  .dashboard-card h3 {
    font-size: 14px;
  }
  .keyboard-row {
    gap: 3px;
  }
  .keyboard-row button {
    height: 44px;
    font-size: 13px;
  }
  .touch-keyboard {
    padding: 8px;
  }
  .touch-keyboard header span {
    display: none;
  }
  .management-header strong {
    font-size: 11px;
  }
  .welcome-banner h1 {
    font-size: 26px;
  }
  .section-heading {
    flex-wrap: wrap;
  }
}

.weight-input {
  position: relative;
}
.weight-input input {
  padding-right: 44px;
  font-variant-numeric: tabular-nums;
}
.weight-input > span {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #6a9289;
  font-size: 12px;
}
.access-link {
  display: block;
  color: #147d71;
  font-size: 11px;
  margin-top: 6px;
  white-space: nowrap;
}
