:root {
  --ink: #211f2a;
  --muted: #716c78;
  --line: #e5dcc2;
  --surface: #fffdf8;
  --canvas: #f6f1e5;
  --green: #d9a91c;
  --green-dark: #b68408;
  --green-soft: #fff2bf;
  --success: #2f7d4a;
  --success-soft: #e4f3e8;
  --yellow: #e6b800;
  --yellow-dark: #755b00;
  --yellow-soft: #fff3a8;
  --yellow-border: #dfbd28;
  --red-soft: #fcebea;
  --red: #b64237;
  --shadow: 0 18px 50px rgba(48, 38, 14, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(224, 176, 36, 0.14), transparent 28rem),
    var(--canvas);
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(217, 169, 28, 0.3);
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 42px 64px;
}

.topbar {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 12px max(18px, calc((100vw - 1440px) / 2 + 42px));
  background: linear-gradient(180deg, rgba(177, 136, 69, 0.88), rgba(131, 95, 33, 0.9));
  border-bottom: 0;
  color: #fff;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 34px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: 162px;
  height: 78px;
  object-fit: contain;
  border-radius: 10px;
}

.topbar-actions,
.panel-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-button {
  height: 38px;
  padding: 0 13px;
  color: #fff;
  background: rgba(33, 31, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  font-weight: 700;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav-button:hover {
  color: #fff;
  background: #211f2a;
  box-shadow: none;
}

.nav-button.active {
  color: #fff;
  background: #211f2a;
  box-shadow: none;
}

.app-back-button {
  font-size: 0.82rem;
  height: 34px;
  padding: 0 11px;
  white-space: nowrap;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 5px 5px 8px;
  background: linear-gradient(180deg, rgba(177, 136, 69, 0.96), rgba(131, 95, 33, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(33, 31, 42, 0.18);
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: rgba(33, 31, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.user-avatar.small {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.user-copy {
  min-width: 82px;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-copy strong {
  color: #fff;
  font-size: 12px;
}

.user-copy small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
}

.logout-button {
  height: 34px;
  padding: 0 10px;
  color: #fff;
  background: rgba(33, 31, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.logout-button:hover {
  color: #fff;
  background: #211f2a;
}

.live-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding-right: 10px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(217, 169, 28, 0.15);
}

.offline-sync-status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  color: #211f2a;
  background: #fff3bd;
  border: 1px solid #d9a91c;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(33, 31, 42, 0.16);
  font-size: 12px;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.whatsapp-button,
.ghost-button {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.primary-button {
  color: var(--ink);
  background: var(--green);
  box-shadow: 0 8px 20px rgba(120, 87, 5, 0.18);
}

.primary-button:hover {
  background: var(--green-dark);
  color: white;
  transform: translateY(-1px);
}

.primary-button:disabled,
.action-button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.primary-button svg,
.secondary-button svg,
.whatsapp-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.secondary-button {
  color: #755700;
  background: var(--green-soft);
}

.secondary-button:hover {
  background: #f5dfa0;
}

.back-apps-button {
  text-decoration: none;
  white-space: nowrap;
}

.whatsapp-button {
  color: white;
  background: #218c4f;
  box-shadow: 0 8px 20px rgba(33, 140, 79, 0.18);
}

.whatsapp-button:hover {
  background: #176d3c;
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: #f2f4f1;
}

.hero {
  padding: 54px 0 36px;
}

.hero-heading {
  margin-bottom: 27px;
}

.access-banner {
  margin-top: 24px;
  padding: 13px 16px;
  color: #684e00;
  background: #fff6d7;
  border: 1px solid #ead17a;
  border-radius: 12px;
  font-size: 13px;
}

.access-banner strong {
  margin-right: 8px;
}

.section-heading {
  padding: 54px 0 36px;
}

.users-heading {
  padding-bottom: 28px;
}

.secondary-heading h1 {
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 9px;
  color: #9a7200;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Manrope", sans-serif;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(38px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.summary-card {
  color: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  min-height: 108px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(24, 33, 27, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(30, 45, 36, 0.035);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.summary-card:hover,
.summary-card.active {
  transform: translateY(-2px);
  border-color: rgba(182, 132, 8, 0.38);
  box-shadow: 0 12px 32px rgba(126, 92, 8, 0.11);
}

.summary-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
}

.summary-icon svg {
  width: 21px;
  height: 21px;
}

.total-icon {
  color: #316796;
  background: #e8f1f8;
}

.urgent-icon {
  color: var(--yellow-dark);
  background: var(--yellow-soft);
}

.overdue-icon {
  color: var(--red);
  background: var(--red-soft);
}

.today-icon {
  color: var(--success);
  background: var(--success-soft);
}

.summary-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.summary-card strong {
  font-family: "Manrope", sans-serif;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.orders-panel {
  background: #ffffff;
  border: 1px solid rgba(87, 68, 20, 0.12);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 24px 26px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.panel-header h2 {
  margin-bottom: 4px;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.search-box {
  width: min(250px, 24vw);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  background: #f8f9f7;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.search-box:focus-within {
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(217, 169, 28, 0.14);
}

.search-box svg {
  width: 17px;
  height: 17px;
  color: #7d857f;
}

.search-box input {
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 14px;
}

.search-box input::placeholder {
  color: #9aa09c;
}

select {
  height: 42px;
  color: var(--ink);
  background: #f8f9f7;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 34px 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.archive-tabs {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  background: #f8f9f7;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.archive-tab {
  height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.archive-tab:hover {
  color: var(--ink);
  background: var(--green-soft);
}

.archive-tab.active {
  color: var(--ink);
  background: var(--green);
  box-shadow: 0 6px 16px rgba(120, 87, 5, 0.16);
}

.urgent-key {
  min-height: 38px;
  padding: 0 27px;
  display: flex;
  align-items: center;
  gap: 22px;
  color: #8f4f00;
  background: #fff4e3;
  border-top: 1px solid #f6d7ab;
  border-bottom: 1px solid #eeb97b;
  font-size: 12px;
  font-weight: 600;
}

.alert-key-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.alert-key-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.urgent-dot {
  background: #f08a24;
}

.overdue-dot {
  background: var(--red);
}

.completed-dot {
  background: #2f7a3d;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed;
}

th {
  padding: 12px 14px;
  color: #3f3a45;
  background: #fafbf9;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 16px 14px;
  border-bottom: 1px solid #edf0ed;
  font-size: 14px;
  vertical-align: middle;
}

tbody tr {
  position: relative;
  transition: background 160ms ease;
}

tbody tr:not(.urgent-order):hover {
  background: #fafcf9;
}

tbody tr.urgent-order {
  background: #fff0dd;
  box-shadow: inset 4px 0 0 #f08a24;
}

tbody tr.urgent-order:hover {
  background: #ffe2bf;
}

tbody tr.overdue-order {
  background: #f7c9c5;
  box-shadow: inset 5px 0 0 #c73529;
}

tbody tr.overdue-order:hover {
  background: #f2b8b2;
}

tbody tr.completed-dashboard-order {
  background: #eaf6eb;
  box-shadow: inset 4px 0 0 #4f9d57;
}

tbody tr.completed-dashboard-order:hover {
  background: #dff0e1;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.date-cell {
  min-width: 90px;
}

.date-primary,
.customer-name {
  display: block;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
}

.date-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.customer-cell {
  min-width: 148px;
}

.customer-name {
  display: inline;
  vertical-align: middle;
}

.details-cell {
  width: auto;
  min-width: 154px;
  max-width: 100%;
  color: #424b45;
  line-height: 1.45;
}

.quantity-cell {
  min-width: 88px;
  color: var(--ink);
  font-weight: 800;
}

.note-cell {
  min-width: 120px;
  overflow-wrap: anywhere;
  color: #59625c;
  line-height: 1.45;
}

.product-cell-line {
  display: block;
  min-height: 1.45em;
}

.delivery-cell {
  min-width: 136px;
}

.time-to-delivery-cell {
  min-width: 136px;
}

.delivery-meta {
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.delivery-meta svg {
  width: 14px;
  height: 14px;
}

.urgent-order .delivery-meta {
  color: #c66a12;
  font-weight: 800;
}

.overdue-order .delivery-meta {
  color: #a9271d;
  font-weight: 800;
}

.completed-dashboard-order .delivery-meta {
  color: #2f7a3d;
  font-weight: 800;
}

.status-badge {
  margin-left: 7px;
  padding: 3px 7px;
  color: #8f4f00;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(240, 138, 36, 0.28);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.urgent-order .status-badge {
  color: #c66a12;
  background: #fff2e2;
  border-color: rgba(240, 138, 36, 0.34);
  font-weight: 900;
}

.overdue-order .status-badge {
  color: #9e2118;
  background: #fff2f0;
  border-color: rgba(158, 33, 24, 0.35);
}

.completed-current-badge {
  color: #2f7a3d;
  background: #f0fbf1;
  border-color: rgba(79, 157, 87, 0.28);
}

.done-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  color: #765700;
  background: var(--green-soft);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.actions-cell {
  min-width: 118px;
}

.icon-button {
  border: 0;
  display: inline-grid;
  place-items: center;
  color: #59625c;
  background: transparent;
  border-radius: 9px;
  transition: background 140ms ease, color 140ms ease;
}

.action-select {
  width: 118px;
  max-width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 0 24px 0 10px;
  color: #374139;
  background: white;
  border: 1px solid rgba(24, 33, 27, 0.16);
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(24, 33, 27, 0.05);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.action-select:hover,
.action-select:focus {
  color: #765700;
  background: var(--green-soft);
  border-color: rgba(182, 132, 8, 0.32);
}

.action-select:disabled {
  cursor: wait;
  opacity: 0.5;
}

.status-cell {
  min-width: 116px;
}

#orders-table th:nth-child(1),
#orders-table td:nth-child(1) {
  width: 120px;
}

#orders-table th:nth-child(2),
#orders-table td:nth-child(2) {
  width: 70px;
}

#orders-table th:nth-child(2) {
  font-size: 11px;
  letter-spacing: 0.04em;
}

#orders-table th:nth-child(3),
#orders-table td:nth-child(3) {
  width: 148px;
}

#orders-table th:nth-child(4),
#orders-table td:nth-child(4) {
  width: 154px;
}

#orders-table th:nth-child(5),
#orders-table td:nth-child(5) {
  width: 88px;
}

#orders-table th:nth-child(6),
#orders-table td:nth-child(6) {
  width: 120px;
}

#orders-table th:nth-child(7),
#orders-table td:nth-child(7) {
  width: 136px;
}

#orders-table th:nth-child(8),
#orders-table td:nth-child(8) {
  width: 136px;
}

#orders-table th:nth-child(9),
#orders-table td:nth-child(9) {
  width: 116px;
}

#orders-table th:nth-child(10),
#orders-table td:nth-child(10) {
  width: 146px;
}

#orders-table td:nth-child(2) .date-primary {
  font-size: 13px;
}

.trace-line {
  display: block;
  margin-top: 6px;
  color: #7b837d;
  font-size: 11px;
  font-weight: 500;
}

.history-cell {
  min-width: 170px;
}

.history-cell span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.archive-status,
.activity-action {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.completed-badge,
.action-completed,
.action-created {
  color: #765700;
  background: var(--green-soft);
}

.completed-late-badge,
.action-completed_late {
  color: var(--red);
  background: var(--red-soft);
}

.not-delivered-badge,
.action-not_delivered {
  color: var(--red);
  background: var(--red-soft);
}

.cancelled-badge,
.action-cancelled {
  color: var(--red);
  background: var(--red-soft);
}

.action-updated {
  color: #316796;
  background: #e8f1f8;
}

.activity-user {
  min-width: 150px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-admin {
  color: #6c3f91;
  background: #f0e7f7;
}

.role-operator {
  color: #765700;
  background: var(--green-soft);
}

.role-viewer {
  color: #476176;
  background: #e8f1f8;
}

.alert-team-badge {
  display: inline-flex;
  min-height: 27px;
  padding: 0 9px;
  align-items: center;
  color: #176d3c;
  background: var(--success-soft);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.user-actions button {
  min-height: 34px;
  padding: 0 11px;
  color: #765700;
  background: var(--green-soft);
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.user-actions button:hover {
  color: white;
  background: var(--green);
}

.user-actions .remove-user-button {
  color: var(--red);
  background: var(--red-soft);
}

.user-actions .remove-user-button:hover {
  color: white;
  background: var(--red);
}

.user-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.role-explainer {
  margin: -5px 0 20px;
  padding: 11px 13px;
  color: var(--muted);
  background: #f5f7f4;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.5;
}

.empty-state {
  min-height: 330px;
  padding: 55px 20px;
  text-align: center;
}

.empty-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 17px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 21px;
}

.empty-icon svg {
  width: 30px;
  height: 30px;
}

.empty-state h3 {
  margin-bottom: 7px;
  font-size: 20px;
}

.empty-state p {
  margin-bottom: 19px;
  color: var(--muted);
  font-size: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 19, 0.58);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 27px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(5, 18, 10, 0.25);
  transform: translateY(14px) scale(0.985);
  transition: transform 180ms ease;
}

#order-modal .modal {
  width: min(760px, 100%);
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

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

.modal-header h2 {
  margin-bottom: 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.icon-button {
  width: 38px;
  height: 38px;
}

.close-button:hover {
  color: var(--red);
  background: var(--red-soft);
}

.form-field {
  display: block;
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  gap: 14px;
}

.form-row.two-columns {
  grid-template-columns: 1fr 0.55fr;
}

.product-lines {
  display: grid;
  gap: 10px;
}

.product-line {
  display: grid;
  grid-template-columns: 1fr 0.35fr 0.85fr 38px;
  gap: 10px;
  align-items: end;
}

.product-line .form-field {
  margin-bottom: 0;
}

.remove-product-button {
  color: var(--red);
  background: var(--red-soft);
}

.remove-product-button:disabled {
  visibility: hidden;
}

.add-product-button {
  width: auto;
  min-height: 38px;
  margin-top: 10px;
  padding: 0 14px;
}

.form-field > span {
  display: block;
  margin-bottom: 7px;
  color: #333d36;
  font-size: 13px;
  font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  color: var(--ink);
  background: #fbfcfa;
  border: 1px solid #dfe3df;
  border-radius: 11px;
  outline: none;
  transition: border 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.form-field input,
.form-field select {
  height: 48px;
  padding: 0 13px;
}

.form-field select[multiple] {
  height: auto;
  min-height: 124px;
  padding: 6px;
}

.form-field select[multiple] option {
  padding: 9px 8px;
  border-radius: 7px;
}

.form-field textarea {
  padding: 12px 13px;
  line-height: 1.5;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  background: white;
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(217, 169, 28, 0.14);
}

.checkbox-field {
  margin: -2px 0 20px;
  padding: 12px 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  background: #f5f7f4;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.checkbox-field input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--green-dark);
}

.checkbox-field strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
}

.form-field small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.form-actions {
  padding-top: 5px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.submit-button {
  min-width: 128px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  min-width: 230px;
  min-height: 54px;
  padding: 10px 16px 10px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  background: #183c2a;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(13, 37, 24, 0.3);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #7b2f27;
}

.toast.error .toast-icon {
  color: #7b2f27;
  background: #ffd7d2;
}

.toast-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #5f4700;
  background: #f5df96;
  border-radius: 50%;
}

.toast-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}

.login-page {
  background:
    radial-gradient(circle at 75% 15%, rgba(217, 169, 28, 0.16), transparent 24rem),
    #f2ecdd;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
}

.login-intro {
  min-height: 100vh;
  padding: 52px clamp(38px, 6vw, 92px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background:
    linear-gradient(145deg, rgba(26, 24, 34, 0.99), rgba(34, 31, 43, 0.97)),
    var(--ink);
}

.login-brand {
  color: white;
}

.login-logo {
  width: 220px;
  height: 120px;
  border-radius: 14px;
}

.login-intro h1 {
  margin-bottom: 20px;
  font-size: clamp(44px, 5vw, 72px);
  color: white;
}

.login-intro > div > p:last-child {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 17px;
  line-height: 1.7;
}

.login-intro .eyebrow {
  color: #efc84f;
}

.login-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-feature-list span {
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.login-card-wrap {
  min-height: 100vh;
  padding: 30px;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(430px, 100%);
  padding: 38px;
  background: white;
  border: 1px solid rgba(24, 33, 27, 0.08);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.login-card-heading {
  margin-bottom: 28px;
}

.login-card-heading h2 {
  margin-bottom: 8px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.login-card-heading > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.login-error {
  margin-bottom: 18px;
  padding: 12px 14px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.login-button {
  width: 100%;
  margin-top: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .topbar {
    padding-top: 14px;
    padding-bottom: 14px;
    align-items: flex-start;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .brand-area {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .summary-grid {
    max-width: 700px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 18px 38px;
  }

  .topbar {
    min-height: 76px;
  }

  .live-clock {
    display: none;
  }

  .user-copy {
    display: none;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: 360px;
    padding: 35px 28px;
  }

  .login-feature-list {
    display: none;
  }

  .form-row.two-columns {
    grid-template-columns: 1fr;
  }

  .product-line {
    grid-template-columns: 1fr;
  }

  .remove-product-button:disabled {
    display: none;
  }

  .login-card-wrap {
    min-height: auto;
    padding: 28px 18px 50px;
  }

  .hero {
    padding: 40px 0 27px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 80px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-tools {
    width: 100%;
  }

  .search-box {
    width: auto;
    flex: 1;
  }

  th,
  td {
    padding-left: 17px;
    padding-right: 17px;
  }
}

@media (max-width: 480px) {
  .brand span:last-child {
    display: none;
  }

  .topbar .primary-button {
    padding: 0 13px;
  }

  .main-nav {
    width: calc(100vw - 36px);
  }

  .nav-button {
    flex: 1;
  }

  .user-menu {
    display: none;
  }

  .login-card {
    padding: 28px 22px;
  }

  .panel-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box,
  .archive-tabs,
  select {
    width: 100%;
  }

  .archive-tab {
    flex: 1;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }
}

@media (max-width: 640px) {
  .app-shell { padding: 0 12px 32px; }
  .topbar { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px; }
  .brand-area, .topbar-actions { width: 100%; }
  .brand-area { align-items: center; justify-content: space-between; gap: 10px; }
  .brand-logo { width: 122px; height: 58px; }
  .main-nav { flex: 1; justify-content: flex-end; }
  .nav-button { height: 34px; padding: 0 9px; font-size: 12px; }
  .topbar-actions { flex-wrap: wrap; justify-content: space-between; }
  .live-clock { width: 100%; justify-content: center; padding: 0; font-size: 12px; }
  .user-menu { flex: 1 1 100%; justify-content: space-between; }
  .user-copy { display: flex; flex: 1; }
  .task-alert-button, #new-order-button { flex: 1 1 calc(50% - 6px); min-width: 0; padding: 0 10px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .summary-card { min-height: 74px; padding: 12px; }
  .orders-panel { margin-left: -12px; margin-right: -12px; border-radius: 0; }
  .panel-header, .panel-tools { align-items: stretch; flex-direction: column; }
  .panel-tools > *, .search-box, .panel-tools select { width: 100%; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #orders-table { min-width: 860px; }
  .modal { width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow-y: auto; }
  #order-modal .modal { width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
