:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #17283b;
  background: #f3f6f8;
  font-size: 16px;
  line-height: 1.42;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 1.6rem;
  letter-spacing: -0.035em;
  margin-bottom: 0.25rem;
}
h2 {
  font-size: 1.04rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}
p {
  color: #617488;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 72px;
  padding: 0 clamp(18px, 3vw, 48px);
  background: #14283e;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 36px;
  box-shadow: 0 4px 20px #0d233127;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1rem;
  font-weight: 740;
  line-height: 1.15;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #31a5ac;
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.025em;
}
.topnav {
  display: flex;
  align-self: stretch;
  gap: 4px;
}
.nav-button {
  border: 0;
  background: transparent;
  color: #a9bac9;
  padding: 0 16px;
  border-bottom: 3px solid transparent;
  font-weight: 650;
}
.nav-button:hover {
  color: #fff;
}
.nav-button.active {
  color: #fff;
  border-bottom-color: #42b9bf;
}
.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  white-space: nowrap;
}
.role-pill {
  border: 1px solid #517083;
  border-radius: 30px;
  padding: 3px 9px;
  color: #c8dae5;
}
.text-button {
  border: 0;
  background: transparent;
  color: #a9c8d6;
  padding: 5px;
}
.text-button:hover {
  color: white;
}
.page {
  max-width: 1800px;
  margin: auto;
  padding: 28px clamp(18px, 3vw, 48px) 55px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}
.page-heading p {
  margin: 0;
  font-size: 0.9rem;
}
.button {
  border: 1px solid #cfdae3;
  border-radius: 9px;
  padding: 10px 15px;
  background: #fff;
  color: #19364b;
  font-size: 0.88rem;
  font-weight: 680;
  box-shadow: 0 1px 1px #1734470d;
  white-space: nowrap;
}
.button:hover {
  background: #edf5f6;
  border-color: #90c4c9;
}
.button.primary {
  background: #147b83;
  border-color: #147b83;
  color: #fff;
}
.button.primary:hover {
  background: #0d6870;
}
.button.danger {
  color: #ae3434;
  border-color: #f1c3c3;
}
.button.danger:hover {
  background: #fff4f4;
}
.button.quiet {
  background: #f8fafb;
}
.button.small {
  font-size: 0.78rem;
  padding: 6px 9px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.metric {
  background: #fff;
  border: 1px solid #dee7ed;
  border-radius: 12px;
  padding: 15px 18px;
  min-height: 83px;
}
.metric span {
  display: block;
  color: #60788a;
  font-size: 0.8rem;
  font-weight: 650;
  margin-bottom: 5px;
}
.metric strong {
  font-size: 1.46rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}
.metric small {
  margin-left: 5px;
  color: #687f91;
  font-size: 0.77rem;
}
.metric.warn strong {
  color: #ad6230;
}
.metric.risk strong {
  color: #b83a3a;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 17px;
}
.period-controls,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
}
.period-controls strong {
  min-width: 176px;
  text-align: center;
  font-size: 0.9rem;
}
.icon-button {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  border: 1px solid #d5e0e8;
  background: #fff;
  font-size: 1.55rem;
  line-height: 1;
  color: #31556b;
}
.icon-button:hover {
  background: #eaf4f5;
}
.select-label {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #567183;
  font-size: 0.85rem;
  font-weight: 650;
}
input,
select,
textarea {
  border: 1px solid #cbd9e3;
  background: white;
  border-radius: 8px;
  color: #1c3547;
  padding: 9px 10px;
  min-width: 0;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #16868e;
  box-shadow: 0 0 0 3px #12868e22;
}
label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 650;
  color: #3d586c;
}
label input,
label select,
label textarea {
  width: 100%;
}
.select-label select {
  width: auto;
  min-width: 170px;
}
.alert-box {
  border: 1px solid #f0d1ab;
  background: #fff7e9;
  color: #714917;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 15px;
  font-size: 0.85rem;
}
.alert-box strong {
  color: #9a511e;
}
.board-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.backlog-panel,
.board-main {
  background: #fff;
  border: 1px solid #dee7ed;
  border-radius: 13px;
  overflow: hidden;
}
.backlog-panel {
  min-height: 390px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 17px;
  border-bottom: 1px solid #e6edf2;
}
.section-title p {
  margin: 0;
  font-size: 0.74rem;
}
.section-title h2 {
  margin: 0 0 2px;
}
.counter {
  background: #e9f1f3;
  color: #24596b;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.backlog-list {
  min-height: 325px;
  padding: 9px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.backlog-list.empty:after {
  content: 'Заявок без даты нет';
  color: #8397a6;
  font-size: 0.83rem;
  padding: 24px 10px;
  text-align: center;
}
.board-main {
  min-width: 0;
}
.production-heading {
  background: #f8fbfc;
}
.shipment-heading {
  background: #f8fbfc;
  border-top: 1px solid #e6edf2;
}
.production-board,
.shipment-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(155px, 1fr));
  min-width: 1090px;
}
.day-column {
  border-right: 1px solid #e8eff2;
  min-width: 0;
}
.day-column:last-child {
  border-right: 0;
}
.day-head {
  padding: 10px 10px 8px;
  background: #f9fbfc;
  border-bottom: 1px solid #e8eff2;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 3px;
}
.day-head strong {
  font-size: 0.85rem;
}
.day-head small {
  color: #7b91a1;
  font-size: 0.72rem;
  text-transform: capitalize;
}
.day-column.today .day-head {
  background: #e8f6f6;
  color: #076f78;
}
.day-column.weekend .day-head {
  background: #f7f8fa;
}
.production-day {
  padding: 9px;
  min-height: 153px;
}
.line-slot {
  margin-bottom: 8px;
  cursor: pointer;
  border-radius: 7px;
  padding: 6px 7px;
  background: #f7f9fb;
  border: 1px solid #e7edf2;
}
.line-slot:hover {
  border-color: #94c7cb;
  background: #f0f8f8;
}
.line-slot strong {
  display: block;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.line-slot small {
  display: block;
  color: #678091;
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.line-slot .fill {
  height: 4px;
  border-radius: 5px;
  background: #dce8ec;
  margin-top: 6px;
  overflow: hidden;
}
.line-slot .fill i {
  display: block;
  height: 100%;
  background: #2da0a6;
}
.line-slot.over .fill i {
  background: #d18a37;
}
.line-slot .fact {
  color: #0d8188;
  font-weight: 700;
}
.line-slot progress.fill {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
}
.line-slot progress.fill::-webkit-progress-bar {
  background: #dce8ec;
}
.line-slot progress.fill::-webkit-progress-value {
  background: #2da0a6;
}
.line-slot progress.fill::-moz-progress-bar {
  background: #2da0a6;
}
.line-slot.over progress.fill::-webkit-progress-value {
  background: #d18a37;
}
.line-slot.over progress.fill::-moz-progress-bar {
  background: #d18a37;
}
.alert-box .button {
  margin-left: 12px;
}
.board-main {
  overflow: auto;
}
.shipment-day {
  padding: 9px;
  min-height: 278px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.shipment-day.drag-over,
.backlog-list.drag-over {
  background: #e8f6f6;
  outline: 2px dashed #30a0a6;
  outline-offset: -4px;
}
.capacity {
  font-size: 0.69rem;
  color: #6f8898;
  font-variant-numeric: tabular-nums;
  margin-bottom: 1px;
}
.capacity b {
  color: #2b5a6e;
}
.capacity.full b {
  color: #ae4e38;
}
.load-card {
  border: 1px solid #d4e3e8;
  border-left: 4px solid #278e98;
  background: #fbfdfd;
  border-radius: 8px;
  padding: 8px 9px;
  text-align: left;
  width: 100%;
  box-shadow: 0 1px 3px #15384a0a;
  cursor: grab;
  min-height: 64px;
}
.load-card:hover {
  border-color: #6eb4ba;
  background: #f2fafa;
  transform: translateY(-1px);
}
.load-card:active {
  cursor: grabbing;
}
.load-card.dragging {
  opacity: 0.45;
}
.load-card.risk {
  border-left-color: #c0504c;
  background: #fff7f6;
}
.load-card.late {
  border-left-color: #c4802a;
}
.load-card.confirmed {
  border-left-color: #244f85;
}
.load-card.shipped {
  border-left-color: #58a582;
  opacity: 0.76;
}
.load-card .card-top {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  color: #527085;
  font-size: 0.67rem;
  margin-bottom: 4px;
}
.load-card strong {
  display: block;
  font-size: 0.79rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.load-card .card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 3px;
  font-size: 0.68rem;
  color: #577084;
}
.load-card .qty {
  font-weight: 800;
  color: #1c455a;
}
.load-card .risk-label {
  color: #b93f3b;
  font-weight: 750;
}
.panel {
  background: #fff;
  border: 1px solid #dee7ed;
  border-radius: 12px;
  padding: 19px;
  margin-bottom: 16px;
}
.panel h2 {
  margin-bottom: 12px;
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.84rem;
}
th {
  text-align: left;
  background: #f7fafb;
  color: #637b8c;
  font-weight: 700;
  font-size: 0.74rem;
  white-space: nowrap;
}
th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid #e8eff3;
  vertical-align: middle;
}
tbody tr:hover {
  background: #f9fbfc;
}
td .subtle {
  font-size: 0.72rem;
  margin: 3px 0 0;
}
.table-action {
  border: 0;
  background: none;
  color: #147b83;
  font-weight: 750;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mono {
  font-variant-numeric: tabular-nums;
}
.negative {
  color: #b44142;
  font-weight: 750;
}
.positive {
  color: #167b6b;
  font-weight: 750;
}
.subtle {
  color: #758b99;
  font-size: 0.8rem;
}
.tag {
  display: inline-block;
  border-radius: 6px;
  background: #e9f4f4;
  color: #17747b;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 720;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.settings-grid .panel {
  margin: 0;
}
.users-panel {
  grid-column: 1/-1;
}
.stack {
  display: grid;
  gap: 14px;
}
.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form > * {
  flex: 1;
}
.inline-form button {
  flex: 0;
}
.setting-row,
.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #ebf0f2;
  font-size: 0.82rem;
}
.setting-row span,
.user-row span:first-child {
  flex: 1;
}
.setting-row input {
  max-width: 130px;
}
.setting-row .button {
  min-width: 90px;
}
.user-row .subtle {
  flex: 0 1 225px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-row select {
  max-width: 150px;
}
.user-row button {
  border: 0;
  background: none;
  color: #187a82;
  font-size: 0.78rem;
  font-weight: 700;
}
.modal {
  width: min(600px, calc(100vw - 30px));
  max-height: min(92vh, 950px);
  border: 0;
  border-radius: 15px;
  box-shadow: 0 24px 70px #10283a55;
  padding: 0;
  color: #173146;
  background: #fff;
  overflow: auto;
}
.modal::backdrop {
  background: #10263b88;
}
.modal-head {
  padding: 19px 23px 15px;
  border-bottom: 1px solid #e4edf1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.modal-head h2 {
  font-size: 1.18rem;
  margin: 0;
}
.close-button {
  border: 0;
  background: #f1f5f7;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  color: #456276;
  font-size: 1.25rem;
  line-height: 1;
}
.modal-body {
  padding: 19px 23px 23px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.modal .notice {
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef7f7;
  color: #24576b;
  font-size: 0.84rem;
}
.modal .notice.warn {
  background: #fff3e4;
  color: #9a581e;
}
.modal .notice.error {
  background: #fff0ef;
  color: #a53635;
}
.modal .actions-left {
  margin-right: auto;
}
.form-error {
  color: #b73535;
  font-size: 0.82rem;
  margin: 0;
  min-height: 0;
}
.detail-list {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  margin: 0 0 17px;
  font-size: 0.85rem;
}
.detail-list dt {
  color: #71899b;
}
.detail-list dd {
  margin: 0;
  font-weight: 650;
}
.suggestions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 11px;
}
.suggestions button {
  border: 1px solid #a7cbd0;
  background: #eaf6f6;
  color: #116f77;
  border-radius: 7px;
  font-size: 0.75rem;
  padding: 5px 8px;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 20px;
  max-width: 410px;
  background: #193e50;
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 12px 35px #10283a44;
  font-size: 0.86rem;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.18s;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.error {
  background: #9b343b;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 78% 15%, #20627a 0, transparent 35%), #14283e;
}
.login-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 34px;
  box-shadow: 0 28px 60px #07162240;
}
.login-card .brand {
  color: #20465a;
  margin-bottom: 34px;
}
.brand-large .brand-mark {
  width: 46px;
  height: 46px;
}
.login-card h1 {
  font-size: 1.3rem;
  margin-bottom: 18px;
}
.login-card .button {
  width: 100%;
  margin-top: 4px;
}
.login-note {
  font-size: 0.73rem;
  color: #8295a4;
  margin: 20px 0 0;
}
@media (max-width: 1100px) {
  .topbar {
    gap: 16px;
  }
  .account {
    font-size: 0.76rem;
  }
  .brand span:last-child {
    max-width: 105px;
    white-space: normal;
  }
  .board-layout {
    grid-template-columns: 215px minmax(0, 1fr);
  }
  .board-main {
    overflow: auto;
  }
  .production-board,
  .shipment-board {
    width: max-content;
  }
  .day-column {
    width: 170px;
  }
}
@media (max-width: 720px) {
  .topbar {
    height: auto;
    min-height: 62px;
    flex-wrap: wrap;
    padding: 10px 15px;
    gap: 7px;
  }
  .brand {
    font-size: 0.86rem;
  }
  .brand-mark {
    width: 31px;
    height: 31px;
  }
  .topnav {
    order: 3;
    width: 100%;
    height: 42px;
    overflow: auto;
    gap: 0;
  }
  .nav-button {
    flex: 1;
    padding: 0 9px;
    font-size: 0.78rem;
  }
  .account {
    gap: 5px;
  }
  .account #accountName {
    display: none;
  }
  .role-pill {
    font-size: 0.65rem;
  }
  .page {
    padding: 19px 12px 40px;
  }
  .page-heading {
    margin-bottom: 16px;
  }
  .page-heading p {
    font-size: 0.78rem;
  }
  .page-heading .button {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .metric {
    min-height: 72px;
    padding: 11px;
  }
  .metric strong {
    font-size: 1.2rem;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .board-layout {
    display: flex;
    flex-direction: column;
  }
  .backlog-panel,
  .board-main {
    width: 100%;
  }
  .backlog-panel {
    min-height: 0;
  }
  .backlog-list {
    min-height: 75px;
    display: flex;
    overflow: auto;
  }
  .backlog-list .load-card {
    min-width: 170px;
    max-width: 210px;
  }
  .production-board,
  .shipment-board {
    min-width: 0;
    display: flex;
    width: max-content;
  }
  .day-column {
    width: min(82vw, 260px);
  }
  .production-day {
    min-height: 100px;
  }
  .shipment-day {
    min-height: 220px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .users-panel {
    grid-column: auto;
  }
  .user-row {
    flex-wrap: wrap;
  }
  .user-row span:first-child {
    min-width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  .modal-actions .button {
    flex: 1;
  }
  .inline-form {
    display: grid;
  }
  .inline-form button {
    width: 100%;
  }
}

/* Second iteration: stronger hierarchy, capacity cues and dedicated work views. */
:root {
  background: #f0f5f6;
  color: #153044;
}
.topbar {
  background: linear-gradient(110deg, #112d42, #174f60 68%, #176f70);
  box-shadow: 0 7px 24px #123b4f2b;
}
.brand-mark {
  background: linear-gradient(135deg, #2bc2b2, #0c858e);
  box-shadow: 0 3px 11px #0b8d994a;
}
.nav-button {
  white-space: nowrap;
}
.nav-button.active {
  border-bottom-color: #ffc56b;
  color: #fff;
}
.page {
  background: linear-gradient(180deg, #eaf4f3 0, #f4f7f8 200px);
  min-height: calc(100vh - 72px);
}
.page-heading h1 {
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  color: #12394d;
}
.button.primary {
  background: #12858d;
  border-color: #12858d;
  box-shadow: 0 3px 10px #12858d28;
}
.button.primary:hover {
  background: #087780;
}
.button.success {
  background: #e6f8ee;
  border-color: #a9dac1;
  color: #167144;
}
.panel,
.backlog-panel,
.board-main,
.metric {
  box-shadow: 0 5px 20px #1947560a;
  border-color: #d8e5e9;
}
.metric {
  border-top: 3px solid #2ba6a4;
}
.metric.accent-1 {
  border-top-color: #f0a844;
}
.metric.accent-2 {
  border-top-color: #5e81c5;
}
.metric.accent-3 {
  border-top-color: #55ab77;
}
.metric.accent strong {
  font-size: clamp(1.1rem, 2vw, 1.7rem);
}
.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #c9dce0;
  background: #e9f2f3;
  border-radius: 10px;
}
.segmented button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5b7483;
  padding: 7px 10px;
  font-weight: 730;
  font-size: 0.78rem;
  white-space: nowrap;
}
.segmented button.active {
  background: #fff;
  color: #0b6873;
  box-shadow: 0 1px 5px #143f4f20;
}
.heading-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.status-legend {
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
  font-size: 0.7rem;
  font-weight: 700;
  color: #78919d;
}
.status-legend span:nth-child(1) {
  color: #278e98;
}
.status-legend span:nth-child(2) {
  color: #385fba;
}
.status-legend span:nth-child(3) {
  color: #168048;
}
.free-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin: 3px 0 7px;
}
.free-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 0.62rem;
  white-space: nowrap;
  overflow: hidden;
}
.free-chip b {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 650;
}
.free-chip.available {
  background: #e7f7ed;
  color: #0d704a;
}
.free-chip.empty {
  background: #f4f2ef;
  color: #9b8c7e;
}
.shipment-day {
  min-height: 315px;
}
.capacity {
  padding: 4px 0;
  border-bottom: 1px solid #e3eef0;
  color: #496b78;
}
.load-card.shipped {
  opacity: 1;
  border: 1px solid #9bd4b2;
  border-left: 5px solid #22945c;
  background: #eaf8ef;
}
.load-card.shipped .card-top {
  color: #19774d;
}
.load-card.confirmed {
  background: #f0f5fd;
  border-left-color: #4d73bd;
}
.load-card.risk {
  background: #fff1ec;
}
.load-card .qty {
  font-size: 0.77rem;
}
.month-calendar {
  background: #fff;
  border: 1px solid #d6e4e8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 5px 22px #19475613;
}
.month-weekdays,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.month-weekdays {
  background: #214858;
  color: #deeff0;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 750;
  padding: 10px 0;
}
.month-day,
.month-blank {
  min-height: 180px;
  border-right: 1px solid #e4ecef;
  border-bottom: 1px solid #e4ecef;
  padding: 9px;
  background: #fff;
  min-width: 0;
}
.month-day.today {
  background: #ecf9f6;
  box-shadow: inset 0 0 0 2px #3aada4;
}
.month-day.past {
  background: #f9faf9;
}
.month-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}
.month-day-top strong {
  font-size: 1.15rem;
  color: #20485b;
}
.month-day-top span {
  font-size: 0.63rem;
  color: #637e88;
  white-space: nowrap;
}
.month-free-title {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: #778f98;
  margin: 8px 0 3px;
}
.month-day .free-products {
  grid-template-columns: 1fr;
}
.month-day .free-chip {
  font-size: 0.67rem;
}
.month-day-open {
  border: 0;
  background: transparent;
  color: #127b81;
  font-size: 0.68rem;
  font-weight: 760;
  padding: 5px 0;
  margin-top: 4px;
  text-align: left;
}
.month-day-open:hover {
  text-decoration: underline;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}
.rank {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #edf6f6;
  color: #23808a;
  font-size: 0.7rem;
  font-weight: 800;
  margin-right: 5px;
}
.product-analytics {
  padding: 10px 0;
  border-bottom: 1px solid #e5eef0;
}
.product-analytics > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.83rem;
}
.product-analytics span,
.product-analytics small {
  color: #6e8791;
}
.product-analytics small {
  font-size: 0.73rem;
}
.bar {
  height: 7px;
  background: #e8f0f2;
  border-radius: 10px;
  margin: 7px 0 4px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #21a9a3, #f5ad58);
}
.warehouse-group {
  background: #fff;
  border: 1px solid #d9e8e9;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 15px;
}
.warehouse-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #5c7784;
}
.warehouse-group-head h2 {
  color: #174b5c;
}
.warehouse-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}
.warehouse-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid #d8e6e9;
  border-left: 5px solid #27a3a9;
  border-radius: 10px;
  padding: 14px;
  background: #fafdfe;
}
.warehouse-card.confirmed {
  border-left-color: #5c7cbe;
  background: #f6f8fd;
}
.warehouse-card.shipped {
  border-color: #9fd8b8;
  border-left-color: #18804f;
  background: #ecf9f0;
}
.warehouse-card-main {
  display: flex;
  gap: 10px;
  min-width: 0;
}
.warehouse-icon {
  display: grid;
  place-items: center;
  background: #e3f4f4;
  color: #177981;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  font-size: 1.3rem;
}
.warehouse-card.shipped .warehouse-icon {
  background: #d3f1de;
  color: #18804f;
}
.warehouse-card h3 {
  font-size: 0.96rem;
  margin: 2px 0;
}
.warehouse-card p {
  margin: 0;
  font-size: 0.72rem;
}
.warehouse-card small {
  color: #78929d;
}
.warehouse-card-side {
  display: grid;
  gap: 5px;
  text-align: right;
  justify-items: end;
}
.warehouse-card-side strong {
  font-size: 1.2rem;
  color: #184f62;
  white-space: nowrap;
}
.status-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 7px;
  padding: 3px 7px;
  color: #147c83;
  background: #e3f5f4;
}
.status-badge.confirmed {
  color: #3d63a7;
  background: #eaf0fc;
}
.status-badge.shipped {
  color: #087543;
  background: #d9f4e4;
}
.empty-state {
  text-align: center;
  color: #72909a;
  padding: 45px;
}
.packing-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.packing-controls label {
  flex: 1;
  min-width: 170px;
}
.packing-controls label:nth-child(2) {
  flex: 2;
}
.packing-hint {
  padding: 13px 16px;
  background: #e9f7f2;
  border: 1px solid #bee4d6;
  border-radius: 10px;
  margin-bottom: 15px;
  color: #326a5b;
  font-size: 0.84rem;
}
.packing-hint strong {
  color: #0e704f;
}
.capacity-error {
  background: #fff0ea !important;
  color: #a74a2c;
}
.pack-tonnes,
.pack-load {
  white-space: nowrap;
}
.pack-load small {
  display: block;
  color: #79929a;
}
.pack-plan,
.pack-fact {
  width: 128px;
}
.load-availability {
  border: 1px solid #d9e9e9;
  border-radius: 10px;
  padding: 12px;
  background: #f7fbfb;
}
.calendar-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.81rem;
}
.calendar-title span {
  color: #78929c;
  font-size: 0.72rem;
}
.calendar-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
}
.calendar-nav strong {
  text-transform: capitalize;
}
.picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.picker-weekday {
  text-align: center;
  color: #78929a;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 5px;
}
.picker-day {
  border: 1px solid #e0e8e9;
  background: #fff;
  border-radius: 7px;
  min-height: 50px;
  padding: 4px 2px;
  display: grid;
  place-items: center;
  color: #45636d;
}
.picker-day strong {
  font-size: 0.82rem;
}
.picker-day small {
  font-size: 0.61rem;
  white-space: nowrap;
}
.picker-day.enough {
  background: #e5f7eb;
  border-color: #a5d7b5;
  color: #087147;
}
.picker-day.short {
  background: #fff1ed;
  border-color: #edcbc1;
  color: #b35338;
}
.picker-day.late {
  outline: 1px solid #eda84a;
}
.picker-day.selected {
  box-shadow: 0 0 0 2px #137e8b;
}
.picker-day.blocked {
  opacity: 0.38;
  background: #f3f4f4;
}
.picker-day:hover:not(:disabled) {
  filter: brightness(0.96);
}
.month-plan-days {
  max-height: 40vh;
  overflow: auto;
  border: 1px solid #e1e9ed;
  border-radius: 8px;
}
.month-plan-head {
  background: #e7f3f4;
  color: #326978;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 750;
}
.month-plan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-top: 1px solid #e9eff1;
  font-size: 0.78rem;
}
.month-plan-row > span {
  min-width: 62px;
}
.month-plan-row input {
  width: 100px;
  padding: 5px 7px;
}
.month-plan-row small {
  color: #8aa0aa;
  font-size: 0.68rem;
}
.fill-actions {
  display: flex;
  gap: 6px;
  align-items: end;
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .topbar {
    gap: 15px;
  }
  .topnav {
    overflow: auto;
  }
  .nav-button {
    padding: 0 10px;
  }
  .month-day .free-chip {
    font-size: 0.6rem;
  }
  .month-day {
    padding: 6px;
  }
}
@media (max-width: 720px) {
  .topbar {
    padding-bottom: 0;
  }
  .topnav {
    flex: 0 0 100%;
    overflow-x: auto;
  }
  .nav-button {
    flex: 0 0 auto;
  }
  .page {
    padding: 17px 12px 40px;
  }
  .toolbar-right {
    flex-wrap: wrap;
  }
  .select-label {
    flex: 1;
  }
  .select-label select {
    min-width: 140px;
  }
  .status-legend {
    display: none;
  }
  .heading-actions {
    justify-content: flex-end;
  }
  .month-weekdays {
    display: none;
  }
  .month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .month-blank {
    display: none;
  }
  .month-day {
    min-height: 165px;
    padding: 9px;
  }
  .month-day .free-chip {
    font-size: 0.65rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .warehouse-card {
    align-items: flex-start;
  }
  .warehouse-cards {
    grid-template-columns: 1fr;
  }
  .warehouse-card-side strong {
    font-size: 1rem;
  }
  .packing-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .packing-controls label:nth-child(2) {
    grid-column: 1/-1;
  }
  .packing-controls button {
    white-space: normal;
  }
  .pack-plan,
  .pack-fact {
    width: 95px;
  }
  .modal {
    width: calc(100vw - 16px);
  }
  .modal-body {
    padding: 13px;
  }
  .picker-grid {
    gap: 2px;
  }
  .picker-day {
    min-height: 45px;
  }
  .picker-day small {
    font-size: 0.56rem;
  }
}

/* Separate grain packing, warehouse calendar, and monthly comparison. */
.grain-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 10px;
  margin: 15px 0;
}
.grain-product {
  min-height: 105px;
  display: grid;
  align-content: space-between;
  gap: 5px;
  text-align: left;
  padding: 12px;
  border: 1px solid #d2e3e5;
  background: #fff;
  border-radius: 11px;
  cursor: pointer;
  color: #21465b;
}
.grain-product:hover {
  border-color: #4faeb3;
  background: #f2fbf9;
}
.grain-product.selected {
  border: 2px solid #13898d;
  background: #e7f7f3;
  box-shadow: 0 4px 12px #157c8323;
}
.grain-product small {
  color: #78929a;
}
.grain-product strong {
  font-size: 0.91rem;
}
.grain-product span {
  font-size: 0.7rem;
  color: #3a8267;
}
.grain-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.grain-selected-head h2 {
  margin: 8px 0 4px;
  font-size: 1.34rem;
}
.grain-selected-head p {
  font-size: 0.82rem;
  color: #587481;
  margin: 0;
}
.grain-calendar,
.warehouse-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  padding: 14px 0;
}
.grain-day,
.warehouse-day {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 122px;
  min-width: 0;
  text-align: left;
  background: #f7fbfa;
  border: 1px solid #d7e8e6;
  color: #265364;
  border-radius: 9px;
  padding: 10px;
  cursor: pointer;
}
.grain-day:hover,
.warehouse-day:hover {
  background: #eaf8f5;
  border-color: #72bbb1;
}
.grain-day.today,
.warehouse-day.selected {
  box-shadow: inset 0 0 0 2px #23a19a;
  background: #e7f7f2;
}
.grain-day span,
.warehouse-day span {
  font-size: 0.72rem;
}
.grain-day b {
  color: #168060;
  font-size: 0.78rem;
  margin-top: auto;
}
.grain-day.no-free b {
  color: #a7583b;
}
.warehouse-day {
  min-height: 95px;
}
.warehouse-day small {
  font-size: 0.68rem;
  color: #708995;
  margin-top: auto;
}
.warehouse-day strong {
  font-size: 1.05rem;
}
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.comparison-grid > div {
  padding: 12px;
  border-radius: 9px;
  background: #f3f9f8;
  font-size: 0.8rem;
}
.comparison-grid strong {
  font-size: 0.95rem;
}
.attention-item {
  display: block;
  width: 100%;
  padding: 8px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #e7eef0;
  background: white;
  color: #9a5035;
  cursor: pointer;
}
.attention-item:hover {
  background: #fff3ea;
}
.reason-required {
  color: #ad5132;
}
.reason-required input {
  border-color: #e1a18d;
}
@media (max-width: 900px) {
  .grain-calendar,
  .warehouse-calendar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .grain-calendar,
  .warehouse-calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .grain-day {
    min-height: 110px;
    padding: 7px;
  }
  .warehouse-day {
    min-height: 88px;
    padding: 8px;
  }
  .grain-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grain-product {
    min-height: 100px;
    padding: 8px;
  }
  .grain-selected-head .heading-actions {
    width: 100%;
  }
}

/* v0.5: requests, scheduling and clear day headers */
.schedule-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid #cbd9e3;
  margin: 4px 0 16px;
}
.schedule-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  padding: 13px 25px;
  color: #5a7083;
  font-weight: 750;
}
.schedule-tabs button.active {
  border-bottom-color: #147b83;
  color: #0d6570;
  background: #e7f4f4;
  border-radius: 9px 9px 0 0;
}
.board-layout.production-only {
  grid-template-columns: minmax(0, 1fr);
}
.day-head {
  background: #e3eaf1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 12px 10px;
  border-bottom: 2px solid #c2d0df;
  min-height: 67px;
}
.day-weekday {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #233e5b;
  color: white;
  border-radius: 6px;
  padding: 3px 7px;
  width: max-content;
}
.day-head strong {
  font-size: 0.9rem;
}
.today-label {
  grid-column: 1/-1;
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 800;
  color: #08626b;
}
.day-column.today .day-head {
  background: #d6f0ee;
  border-bottom-color: #17858c;
}
.day-column.today .day-weekday {
  background: #147b83;
}
.day-column.weekend .day-head {
  background: #fff0df;
  border-bottom-color: #e0bc95;
}
.day-column.weekend .day-weekday,
.month-day.weekend .day-weekday {
  background: #a46226;
}
.month-weekdays {
  background: #233e5b;
  color: white;
  border-radius: 10px 10px 0 0;
  font-weight: 800;
}
.month-day .day-weekday {
  font-size: 0.61rem;
  margin-left: 4px;
  padding: 2px 4px;
}
.month-day.weekend {
  background: #fffaf3;
}
.production-board.production-month {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
}
.production-board.production-month .day-column {
  border-bottom: 1px solid #d2dee7;
}
.load-card {
  cursor: default;
  padding: 0;
  overflow: hidden;
}
.load-open {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px;
  cursor: grab;
  color: inherit;
}
.card-quick {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid #d4e3e8;
  background: #eaf2fa;
  color: #234f81;
  font-size: 0.67rem;
  font-weight: 750;
  padding: 6px;
  cursor: pointer;
}
.card-quick.shipped {
  background: #dff2e8;
  color: #236045;
}
.card-quick:hover {
  filter: brightness(0.96);
}
.order-filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1.2fr;
  gap: 14px;
  align-items: end;
  padding: 17px;
}
.order-filters label {
  font-size: 0.78rem;
}
.orders-results {
  color: #587084;
  font-size: 0.86rem;
  margin: 0 0 12px;
  font-weight: 650;
}
.client-name {
  color: #1d3950;
  margin: 3px 0 0;
  font-weight: 650;
  min-width: 150px;
}
.order-product {
  padding: 4px 0;
  min-width: 140px;
}
.order-product small {
  display: block;
  color: #718497;
}
.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.quick-request-status {
  margin-top: 8px;
  font-size: 0.71rem;
  display: block;
  width: 170px;
  padding: 7px;
}
.status-badge.unscheduled {
  background: #edf1f6;
  color: #586879;
}
.status-badge.partial {
  background: #fff1da;
  color: #92601c;
}
.status-badge.cancelled {
  background: #fbe9e9;
  color: #aa4545;
}
.empty-orders {
  padding: 35px;
  text-align: center;
  color: #637b8e;
}
.modal.wide-modal {
  width: min(1220px, calc(100vw - 32px));
  max-height: 94vh;
}
.request-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(350px, 1fr);
  gap: 24px;
}
.request-fields {
  display: flex;
  flex-direction: column;
  gap: 17px;
  min-width: 0;
}
.request-slots {
  background: #f4f8fb;
  border: 1px solid #dde7ef;
  border-radius: 13px;
  padding: 16px;
  min-width: 0;
}
.request-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.request-section-head h3 {
  font-size: 0.97rem;
  margin: 0;
}
.request-section-head span {
  font-size: 0.7rem;
  color: #70899b;
}
.request-item {
  display: grid;
  grid-template-columns:
    minmax(130px, 2fr) minmax(66px, 0.9fr) minmax(66px, 0.9fr) minmax(70px, 0.8fr)
    25px;
  gap: 8px;
  padding: 13px 10px;
  background: #f8fafc;
  border: 1px solid #dee6ee;
  border-radius: 9px;
  margin-bottom: 9px;
  align-items: end;
}
.request-item label {
  font-size: 0.72rem;
  gap: 5px;
}
.request-item input,
.request-item select {
  padding: 9px 6px;
  font-size: 0.84rem;
  width: 100%;
}
.remove-item {
  border: 0;
  background: #f5eaea;
  color: #a64646;
  border-radius: 7px;
  padding: 7px 0;
  height: 38px;
  font-size: 1.2rem;
}
.add-product {
  align-self: flex-start;
  color: #10737c;
  background: #e8f5f4;
  border-color: #a9d1d3;
}
.request-totals {
  background: #eef6f6;
  border-radius: 8px;
  padding: 12px;
  font-weight: 750;
  color: #155a64;
  font-size: 0.88rem;
}
.split-hint {
  align-self: end;
  font-size: 0.76rem;
  color: #607889;
  padding: 9px 0;
}
.draft-loads {
  display: grid;
  gap: 7px;
  max-height: 168px;
  overflow: auto;
  margin: 10px 0;
}
.draft-load {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: white;
  border: 1px solid #d3dfe9;
  border-radius: 7px;
  padding: 9px;
  text-align: left;
  color: #28445c;
}
.draft-load strong {
  font-size: 0.74rem;
}
.draft-load span {
  font-size: 0.68rem;
  color: #678397;
}
.draft-load.active {
  border-color: #15838a;
  box-shadow: inset 3px 0 #15838a;
  background: #e8f6f5;
}
.draft-load.assigned span {
  color: #087467;
  font-weight: 700;
}
.slots-empty {
  padding: 30px 16px;
  border: 1px dashed #c5d9e4;
  background: white;
  border-radius: 9px;
  text-align: center;
  margin: 14px 0;
  color: #6a8297;
  font-size: 0.82rem;
}
.draft-slot-title {
  font-weight: 750;
  font-size: 0.81rem;
  margin: 10px 0;
}
.draft-calendar-grid,
.move-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin: 12px 0;
}
.draft-day {
  border: 1px solid #dce5ec;
  border-radius: 7px;
  padding: 7px 3px;
  background: #edf1f5;
  text-align: center;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  color: #677c8e;
}
.draft-day span {
  text-transform: uppercase;
  font-size: 0.61rem;
  font-weight: 800;
}
.draft-day strong {
  font-size: 0.69rem;
}
.draft-day small {
  font-size: 0.57rem;
  line-height: 1.3;
}
.draft-day.enough {
  background: #e7f6ee;
  border-color: #a6d6bf;
  color: #25614c;
}
.draft-day.short {
  opacity: 0.65;
}
.draft-day.weekend span {
  color: #92582b;
}
.draft-day.selected {
  background: #147b83;
  color: white !important;
  border-color: #147b83;
  box-shadow: 0 0 0 2px #89cccb;
}
.draft-day.selected span {
  color: white;
}
.draft-day.late {
  border-color: #dda64c;
}
.draft-day.enough:hover {
  border-color: #147b83;
}
.slots-legend {
  font-size: 0.69rem;
  margin: 7px 0;
  color: #607b8c;
}
.request-slots .checkbox-line {
  font-size: 0.74rem;
  margin: 17px 0 8px;
}
.request-slots > .subtle {
  font-size: 0.76rem;
}
.sticky-actions {
  border-top: 1px solid #dce5ed;
  padding: 15px 0 0;
  margin-top: 3px;
}
.request-product-detail {
  border: 1px solid #dce6ed;
  padding: 12px;
  border-radius: 9px;
  margin-bottom: 12px;
}
.request-product-detail h3 {
  font-size: 0.86rem;
  display: grid;
  gap: 4px;
  margin-bottom: 13px;
}
.request-product-detail h3 span {
  font-size: 0.76rem;
  color: #648193;
  font-weight: 600;
}
.request-machine {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  padding: 8px 0;
  border-top: 1px solid #e6edf2;
}
.request-machine strong {
  display: block;
  font-size: 0.8rem;
}
.request-machine span {
  font-size: 0.74rem;
  color: #6c8193;
}
.request-edit-item {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 14px;
  align-items: end;
  border: 1px solid #dce6ee;
  background: #f6f9fb;
  padding: 13px;
  border-radius: 9px;
}
.request-edit-item strong {
  align-self: center;
}
.move-calendar-grid .draft-day {
  min-height: 85px;
}
.move-calendar-grid .draft-day strong {
  font-size: 0.87rem;
}
.move-calendar-grid .draft-day small {
  font-size: 0.7rem;
}
@media (max-width: 1450px) {
  .topbar {
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
  }
  .topnav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    min-height: 45px;
  }
  .account {
    margin-left: auto;
  }
  .production-board.production-month {
    grid-template-columns: repeat(7, minmax(145px, 1fr));
    min-width: 1050px;
  }
}
@media (max-width: 950px) {
  .request-layout {
    grid-template-columns: 1fr;
  }
  .request-slots {
    width: 100%;
  }
  .order-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .request-item {
    grid-template-columns: minmax(160px, 2fr) 1fr 1fr 1fr 30px;
  }
  .draft-day strong {
    font-size: 0.8rem;
  }
  .draft-day small {
    font-size: 0.69rem;
  }
  .board-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .request-item {
    grid-template-columns: 1fr 1fr 30px;
    gap: 10px;
  }
  .request-item label:first-child {
    grid-column: 1/3;
  }
  .request-item .remove-item {
    grid-column: 3;
    grid-row: 1;
  }
  .request-item label:last-of-type {
    grid-column: 1/3;
  }
  .request-item label:nth-child(2),
  .request-item label:nth-child(3) {
    grid-row: 2;
  }
  .request-section-head .button {
    font-size: 0.67rem;
    padding: 6px;
  }
  .request-layout {
    gap: 16px;
  }
  .request-slots {
    padding: 10px;
  }
  .draft-day {
    min-height: 71px;
  }
  .draft-day strong {
    font-size: 0.64rem;
  }
  .draft-day small {
    font-size: 0.55rem;
  }
  .draft-calendar-grid {
    gap: 3px;
  }
  .modal.wide-modal {
    width: calc(100vw - 12px);
  }
  .request-edit-item {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .request-edit-item > strong {
    grid-column: 1/-1;
  }
  .move-calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .request-machine {
    flex-wrap: wrap;
  }
  .board-layout {
    grid-template-columns: 1fr;
  }
  .day-head {
    min-height: 67px;
  }
  .order-filters {
    gap: 10px;
    padding: 13px;
  }
  .schedule-tabs button {
    flex: 1;
    padding: 12px 15px;
  }
  .draft-load {
    flex-wrap: wrap;
  }
  .draft-loads {
    max-height: 155px;
  }
  .table-actions .button {
    font-size: 0.7rem;
  }
}
.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.checkbox-line input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 2px 0;
  accent-color: #147b83;
}
.line-slot:disabled {
  opacity: 1;
  cursor: default;
}
.load-card[draggable='false'] .load-open {
  cursor: pointer;
}
.request-layout.no-slots {
  grid-template-columns: 1fr;
}
.access-modal .modal-head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fff;
}
.access-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #fff;
  border-top: 1px solid #d9e5ed;
  box-shadow: 0 -8px 18px #173b4f0a;
  padding: 12px 0;
  margin-top: 8px;
}
.access-footer .button {
  min-width: 125px;
}
.access-description {
  font-size: 0.75rem;
  max-width: 310px;
  margin: 7px 0 0;
}
.access-role-hint {
  align-self: end;
  font-size: 0.85rem;
  margin: 0;
  padding: 10px;
  background: #eef6f6;
  border-radius: 8px;
}
.self-tag,
.custom-tag {
  margin-left: 8px;
}
.custom-tag {
  color: #286a70;
  background: #e5f2f3;
}
#accessSummary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.access-users td {
  vertical-align: top;
}
.access-users .table-actions {
  min-width: 245px;
}
.access-users p.subtle {
  margin: 6px 0 0;
}
.roles-table td {
  max-width: 280px;
}
details summary {
  cursor: pointer;
  font-weight: 700;
  color: #244e65;
  padding: 5px 0;
}
details[open] > summary {
  margin-bottom: 14px;
}
.permission-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.75fr) minmax(0, 2fr);
  gap: 18px;
  margin-top: 8px;
}
.permission-layout fieldset {
  border: 1px solid #d5e2ea;
  border-radius: 10px;
  padding: 13px;
  margin: 0;
  min-width: 0;
  background: #f8fbfc;
}
.permission-layout legend {
  font-weight: 750;
  font-size: 0.9rem;
  color: #28576c;
  padding: 0 5px;
}
.permission-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.permission-sections {
  align-self: start;
}
.permission-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 11px;
  font-size: 0.81rem;
  line-height: 1.4;
}
.permission-check:last-child {
  margin-bottom: 0;
}
.permission-check input,
.checkbox-label input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 2px 0;
  accent-color: #147b83;
}
.permission-check small {
  display: block;
  color: #738695;
  font-size: 0.7rem;
  line-height: 1.4;
  margin-top: 4px;
}
.permission-check input:disabled {
  opacity: 0.6;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
}
.permission-heading {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.request-item.without-price {
  grid-template-columns: minmax(130px, 2fr) minmax(66px, 1fr) 25px;
}
@media (max-width: 720px) {
  .permission-layout {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .permission-actions {
    grid-template-columns: 1fr;
  }
  .permission-check {
    font-size: 0.82rem;
  }
  .permission-heading .button {
    width: 100%;
  }
  #accessSummary {
    gap: 6px;
  }
  #accessSummary .metric strong {
    font-size: 1.3rem;
  }
  .account .text-button {
    font-size: 0.72rem;
  }
  .request-item.without-price {
    grid-template-columns: minmax(0, 2fr) minmax(55px, 1fr) 25px;
  }
  .request-item.without-price label:first-child {
    grid-column: 1;
  }
  .request-item.without-price label:nth-child(2) {
    grid-row: 1;
  }
  .request-item.without-price .remove-item {
    grid-column: 3;
    grid-row: 1;
  }
}
@media (min-width: 721px) and (max-width: 1920px) {
  .topbar {
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
  }
  .topnav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    min-height: 45px;
  }
  .account {
    margin-left: auto;
  }
}

.card-status {
  border-top: 1px solid #d4e3e8;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 750;
  background: #eaf6f5;
  color: #14666d;
}
.card-status.searching {
  background: #fff3dc;
  color: #84560e;
}
.card-status.confirmed {
  background: #eaf0fb;
  color: #315da2;
}
.card-status.shipped {
  background: #dff2e8;
  color: #236045;
}
.card-status-select {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 6px 24px 6px 9px;
  color: inherit;
  background-color: transparent;
  font: inherit;
  cursor: pointer;
  white-space: normal;
}
.load-card.searching {
  border-left-color: #c79231;
  background: #fffdf8;
}
.free-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  white-space: normal;
  padding: 7px;
  min-width: 0;
}
.free-chip b {
  white-space: nowrap;
}
.free-chip .stock-forecast {
  font-size: 0.68rem;
  color: #264c62;
}
.free-chip .stock-forecast.negative {
  color: #ae3636;
}
.free-chip small {
  font-size: 0.61rem;
}
.free-products {
  align-items: start;
}
.free-chip.empty .stock-forecast {
  color: #264c62;
}
.stock-forecast strong {
  display: inline;
  font-size: inherit;
  white-space: nowrap;
}
.free-chip small strong {
  white-space: nowrap;
}
.status-legend span.searching {
  color: #a97519;
}
.status-legend span.confirmed {
  color: #385fba;
}
.status-legend span.shipped {
  color: #168048;
}
.capacity.full {
  color: #a63530;
  background: #fff1eb;
}
.month-ramp {
  white-space: normal;
}

#grainCapacityForm .month-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
}
#grainCapacityForm .month-plan-row input {
  max-width: 140px;
}

