:root {
  color-scheme: dark;
  --bg: #07111f;
  --card: rgba(10, 22, 42, 0.82);
  --text: #f3f7ff;
  --muted: #9cb0d0;
  --line: rgba(146, 174, 230, 0.14);
  --primary: #c95712;
  --primary-2: #a83f0b;
  --success: #21c47b;
  --danger: #ff6b7c;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
  --radius-shell: 20px;
  --radius-section: 16px;
  --radius-row: 12px;
  --radius-control: 9px;
  --radius: var(--radius-shell);
  --item-columns: minmax(78px, 0.8fr) minmax(150px, 1.65fr) minmax(100px, 1.05fr) minmax(76px, 0.78fr) minmax(76px, 0.78fr) minmax(52px, 0.55fr) minmax(52px, 0.55fr) minmax(58px, 0.62fr) minmax(38px, 0.4fr) minmax(62px, 0.65fr) minmax(48px, 0.5fr) 108px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f9;
  --card: rgba(255, 255, 255, 0.88);
  --text: #17243a;
  --muted: #66758b;
  --line: rgba(47, 67, 99, 0.14);
  --primary: #c95712;
  --primary-2: #a83f0b;
  --success: #138a58;
  --danger: #d5445d;
  --shadow: 0 18px 46px rgba(56, 74, 103, 0.13);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.25;
  background:
    radial-gradient(circle at top left, rgba(226, 112, 39, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(245, 166, 91, 0.13), transparent 26%),
    linear-gradient(160deg, var(--bg) 0%, #050b14 100%);
  color: var(--text);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(226, 112, 39, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(245, 166, 91, 0.12), transparent 28%),
    linear-gradient(160deg, #f7f9fc 0%, var(--bg) 100%);
}

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

.app-shell {
  min-height: 100vh;
}

.shell-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: rgba(5, 12, 24, 0.7);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(201, 87, 18, 0.22);
}

.brand-copy h1,
.brand-copy p,
.page-header h2,
.page-header p {
  margin: 0;
}

.sidebar .brand-copy {
  width: 100%;
}

.sidebar-brand-logo-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0 0 10px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.sidebar-brand-logo {
  display: block;
  width: min(190px, 100%);
  height: auto;
}

.sidebar-portal-title,
.sidebar-supplier-name {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}

.sidebar-portal-title {
  font-weight: 400;
}

.sidebar-supplier-name {
  margin-top: 3px;
  color: var(--text);
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  color: var(--text);
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-row);
  cursor: pointer;
  transition: 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(201, 87, 18, 0.14);
  border-color: rgba(226, 112, 39, 0.26);
}

.icon-wrap {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.nav-item .icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.glass-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.main-content {
  padding: 12px;
  transition: filter 0.25s ease, transform 0.25s ease;
}

.blurred-view {
  filter: blur(10px);
}

html.viewport-locked,
body.viewport-locked {
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding-top: 6px;
  margin-bottom: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-btn,
.primary-btn,
.secondary-btn,
.danger-btn {
  border: 0;
  border-radius: var(--radius-control);
  padding: 8px 11px;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.ghost-btn:hover,
.primary-btn:hover,
.secondary-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.secondary-btn {
  color: #e9f0ff;
  background: linear-gradient(180deg, rgba(41, 55, 84, 0.95), rgba(24, 36, 58, 0.95));
  border: 1px solid rgba(130, 159, 216, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.danger-btn {
  color: white;
  background: linear-gradient(135deg, #d94d73, #ff7a59);
}

.content-grid,
.profile-grid,
.help-grid {
  display: grid;
  gap: 10px;
}

.section-card,
.profile-card,
.help-card,
.login-panel,
.login-showcase {
  padding: 12px;
}

.section-card > header,
.detail-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.legacy-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: stretch;
  gap: 10px;
  padding: 4px 0;
}

.filter-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
}

.filter-item.active .legacy-radio span {
  color: #ffd8bf;
}

.filter-item.active .filter-field .input {
  border-color: rgba(226, 112, 39, 0.48);
  background: rgba(201, 87, 18, 0.1);
  box-shadow: 0 0 0 2px rgba(201, 87, 18, 0.08);
}

.legacy-radio,
.orders-toolbar,
.toolbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legacy-radio {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
  color: var(--muted);
  font-weight: 600;
}

.legacy-radio:hover {
  transform: translateY(-1px);
  color: #ffd8bf;
}

.legacy-radio input {
  margin: 0 2px 0 0;
  accent-color: var(--primary);
}

.orders-toolbar {
  gap: 8px;
}

.toolbar-link {
  color: var(--text);
  text-decoration: none;
  padding: 4px 0;
}

.toolbar-link:hover {
  opacity: 0.92;
}

.filter-field {
  display: flex;
  flex: 1 1 auto;
}

.filter-actions,
.filters-submit-btn,
.filters-clear-btn,
.toolbar-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.filter-actions {
  justify-content: flex-end;
  align-self: stretch;
  height: 36px;
}

.legacy-filters .compact-input,
.filters-submit-btn,
.filters-clear-btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
}

.filters-submit-btn {
  align-self: stretch;
  white-space: nowrap;
}

.filters-clear-btn {
  white-space: nowrap;
}

.field,
.field-row {
  display: grid;
  gap: 5px;
}

.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(176, 195, 235, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  outline: none;
}

.compact-btn {
  min-height: 34px;
  padding: 7px 12px;
}

.compact-input {
  min-height: 36px;
  padding: 5px 9px;
  border-radius: var(--radius-control);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(226, 112, 39, 0.58);
  box-shadow: 0 0 0 3px rgba(201, 87, 18, 0.12);
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.orders-head,
.order-row {
  display: grid;
  grid-template-columns: 120px 110px minmax(180px, 1fr) 70px 84px;
  gap: 10px;
  align-items: center;
}

.orders-head {
  padding: 0 10px 6px;
  font-size: 0.86rem;
}

.orders-list {
  display: grid;
  gap: 6px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
}

.pagination-summary {
  font-size: 0.84rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.pagination-btn {
  min-width: 32px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(176, 195, 235, 0.14);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(226, 112, 39, 0.34);
}

.pagination-btn.active {
  border-color: rgba(226, 112, 39, 0.48);
  background: rgba(201, 87, 18, 0.16);
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.order-card {
  border-radius: var(--radius-row);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: 0.18s ease;
  padding: 7px 10px;
}

.order-card:hover,
.order-card.active {
  background: rgba(201, 87, 18, 0.12);
  border-color: rgba(226, 112, 39, 0.28);
}

.order-cell {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-id {
  font-variant-numeric: tabular-nums;
}

.order-status,
.order-direct {
  display: flex;
  align-items: center;
}

.status-mark,
.direct-delivery-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-mark {
  color: #ff6b7c;
  min-width: 30px;
  min-height: 30px;
  padding: 4px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.status-mark:hover {
  background: rgba(255, 107, 124, 0.1);
}

.status-mark.worked {
  color: #38c779;
}

.status-mark.worked:hover {
  background: rgba(56, 199, 121, 0.12);
}

.status-mark:disabled {
  cursor: wait;
  opacity: 0.55;
}

.direct-delivery-mark {
  color: #7ef0a6;
}

.direct-delivery-mark .icon-wrap {
  width: 22px;
  height: 22px;
  animation: none;
}

.direct-delivery-mark svg {
  width: 20px;
  height: 20px;
}

.detail-meta,
.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.detail-summary-card {
  padding: 8px 10px;
  border-radius: var(--radius-row);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
}

.chip.info {
  color: #ffd8bf;
  background: rgba(201, 87, 18, 0.14);
}

.detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.detail-close-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 58px;
  padding: 10px 12px;
  background: rgba(8, 18, 36, 0.98);
  border-bottom: 1px solid rgba(146, 174, 230, 0.14);
  box-shadow: 0 10px 24px rgba(3, 8, 18, 0.18);
  z-index: 2;
}

.detail-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px;
  text-decoration: none;
}

.detail-scroll-content {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.detail-scroll-content .detail-summary {
  margin-top: 0;
}

.detail-close-btn,
.inline-action-btn,
.bulk-delivery-btn {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: var(--radius-control);
}

.bulk-delivery-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: saturate(0.25);
  box-shadow: none;
}

.bulk-delivery-btn:disabled:hover {
  transform: none;
}

.detail-block {
  padding: 8px;
  border-radius: var(--radius-section);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.item-list,
.chat-list {
  display: grid;
  overflow-x: hidden;
}

.item-list {
  gap: 5px;
}

.chat-list {
  gap: 8px;
}

.chat-card {
  padding: 6px;
  border-radius: var(--radius-row);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.bulk-delivery-btn {
  min-width: 180px;
}

.item-table-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  padding: 0 0 4px;
  font-size: 0.74rem;
  align-items: center;
}

.item-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.item-card {
  display: grid;
  grid-template-columns: var(--item-columns);
  gap: 0;
  align-items: center;
  font-size: 0.78rem;
  padding: 0 0 0 6px;
  min-height: 44px;
  border-radius: var(--radius-row);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.item-card-title {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.15;
}

.item-card > * {
  min-width: 0;
  padding: 0 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 44px;
}

.item-card > *:last-child {
  border-right: 0;
}

.item-col,
.item-card-action {
  min-width: 0;
}

.item-card-main,
.item-col,
.item-card-action {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-col-num {
  text-align: right;
}

.item-toggle-head,
.item-toggle-rail {
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-toggle-head {
  min-height: 44px;
}

.item-toggle-rail {
  min-height: 44px;
}

.item-card-action {
  display: flex;
  align-items: center;
  padding-right: 0;
  margin-right: 8px;
}

.inline-action-btn {
  width: 100%;
  white-space: nowrap;
}

.item-card-head {
  background: transparent;
  border-color: transparent;
  min-height: 44px;
  padding: 0 0 0 6px;
}

.item-card-head > * {
  min-height: 44px;
}

.item-card-head .item-card-action {
  margin-right: 8px;
}

.item-row.selected .item-card {
  background: rgba(201, 87, 18, 0.1);
  border-color: rgba(226, 112, 39, 0.28);
}

.item-card .detail-block {
  padding: 0;
  border: 0;
  background: transparent;
}

.ios-switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: 0.2s ease;
  border-radius: 999px;
}

.ios-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.ios-switch input:checked + .ios-slider {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.ios-switch input:checked + .ios-slider::before {
  transform: translateX(18px);
}

.chat-form {
  gap: 8px;
}

.chat-actions {
  display: flex;
  justify-content: flex-end;
}

.chat-compose-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.chat-feedback:empty {
  display: none;
}

.chat-feedback {
  padding: 8px 10px;
  border-radius: var(--radius-control);
  font-size: 0.78rem;
}

.chat-feedback.success {
  color: #d6ffe8;
  background: rgba(33, 196, 123, 0.12);
  border: 1px solid rgba(33, 196, 123, 0.22);
}

.chat-feedback.error {
  color: #ffd3da;
  background: rgba(255, 107, 124, 0.12);
  border: 1px solid rgba(255, 107, 124, 0.26);
}

.chat-submit-btn {
  width: 100%;
  max-width: 200px;
  min-height: 34px;
  padding: 7px 12px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.login-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center start;
  padding: clamp(20px, 5vw, 64px);
  background-image:
    linear-gradient(115deg, rgba(5, 11, 20, 0.36), rgba(5, 11, 20, 0.12)),
    url("/login-background.jpg");
  background-position: right top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.login-screen::before {
  width: min(72vw, 820px);
  aspect-ratio: 1;
  top: -48%;
  right: -20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 112, 39, 0.2), transparent 66%);
}

.login-screen::after {
  width: 420px;
  height: 420px;
  left: -180px;
  bottom: -220px;
  border: 1px solid rgba(226, 112, 39, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgba(226, 112, 39, 0.035), 0 0 0 104px rgba(226, 112, 39, 0.025);
}

.login-layout {
  width: min(440px, 100%);
  display: grid;
}

.login-screen .login-panel {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border-radius: 24px;
  backdrop-filter: blur(22px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.login-screen .login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #f08a3d 60%, transparent);
}

.login-header {
  display: grid;
  justify-items: start;
  margin-bottom: 26px;
}

.login-logo {
  display: block;
  width: min(270px, 78%);
  height: auto;
  margin-bottom: 26px;
}

.login-kicker {
  margin-bottom: 7px;
  color: #ef873c;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-header h1,
.login-header p {
  margin: 0;
}

.login-header h1 {
  font-size: clamp(2rem, 6vw, 2.65rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.login-header p {
  max-width: 34rem;
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-field {
  gap: 7px;
}

.login-field > span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.login-input,
.login-submit {
  min-height: 46px;
}

.login-input {
  padding-inline: 13px;
  background: rgba(255, 255, 255, 0.065);
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 3px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 28px rgba(201, 87, 18, 0.26);
}

.login-footnote {
  margin: 20px 0 0;
  padding-top: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  text-align: center;
}

:root[data-theme="light"] .login-screen .login-panel {
  box-shadow: 0 28px 70px rgba(56, 74, 103, 0.18);
}

:root[data-theme="light"] .login-input {
  background: rgba(235, 240, 247, 0.76);
}

.login-showcase {
  display: none;
}

.login-showcase::before {
  content: none;
}

.login-showcase > * {
  display: none;
}

.theme-panel {
  padding: 16px;
}

.theme-panel-header h3,
.theme-panel-header p {
  margin: 0;
}

.theme-panel-header p {
  margin-top: 5px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.theme-option {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-section);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.theme-option:hover {
  transform: translateY(-1px);
  border-color: rgba(226, 112, 39, 0.42);
}

.theme-option.selected {
  border-color: rgba(226, 112, 39, 0.52);
  background: rgba(201, 87, 18, 0.1);
  box-shadow: 0 0 0 3px rgba(201, 87, 18, 0.08);
}

.theme-preview {
  display: grid;
  grid-template-columns: 28px 1fr;
  width: 112px;
  height: 70px;
  overflow: hidden;
  border-radius: var(--radius-row);
  border: 1px solid rgba(126, 148, 184, 0.24);
  box-shadow: 0 8px 20px rgba(4, 12, 28, 0.16);
}

.theme-preview-sidebar {
  border-right: 1px solid rgba(126, 148, 184, 0.18);
}

.light-preview {
  background: #f3f6fb;
}

.light-preview .theme-preview-sidebar {
  background: #e5ebf4;
}

.dark-preview {
  background: #0b1729;
}

.dark-preview .theme-preview-sidebar {
  background: #07111f;
}

.theme-preview-content {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 9px;
}

.theme-preview-content i {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  opacity: 0.9;
}

.theme-preview-content i:nth-child(2) {
  width: 78%;
  opacity: 0.5;
}

.theme-preview-content i:nth-child(3) {
  width: 58%;
  opacity: 0.28;
}

.theme-option-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.theme-option-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}

.theme-selected-mark {
  padding: 5px 8px;
  border-radius: var(--radius-control);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  white-space: nowrap;
}

.theme-option.selected .theme-selected-mark {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

:root[data-theme="light"] .sidebar {
  background: rgba(239, 244, 251, 0.86);
}

:root[data-theme="light"] .nav-item .icon-wrap,
:root[data-theme="light"] .ghost-btn,
:root[data-theme="light"] .theme-selected-mark {
  background: rgba(37, 60, 96, 0.06);
}

:root[data-theme="light"] .nav-item:hover,
:root[data-theme="light"] .nav-item.active {
  background: rgba(201, 87, 18, 0.11);
  border-color: rgba(201, 87, 18, 0.25);
}

:root[data-theme="light"] .brand-badge {
  box-shadow: 0 10px 28px rgba(201, 87, 18, 0.2);
}

:root[data-theme="light"] .legacy-radio input {
  accent-color: var(--primary);
}

:root[data-theme="light"] .filter-item.active .legacy-radio span {
  color: #91400e;
}

:root[data-theme="light"] .legacy-radio:hover {
  color: #91400e;
}

:root[data-theme="light"] .filter-item.active .filter-field .input,
:root[data-theme="light"] .input:focus,
:root[data-theme="light"] .select:focus,
:root[data-theme="light"] .textarea:focus {
  border-color: rgba(201, 87, 18, 0.48);
  background: rgba(226, 112, 39, 0.08);
  box-shadow: 0 0 0 3px rgba(201, 87, 18, 0.1);
}

:root[data-theme="light"] .secondary-btn {
  color: #263854;
  background: linear-gradient(180deg, #fff, #edf2f8);
  border-color: rgba(65, 88, 125, 0.16);
  box-shadow: inset 0 1px 0 #fff;
}

:root[data-theme="light"] .input,
:root[data-theme="light"] .select,
:root[data-theme="light"] .textarea,
:root[data-theme="light"] .pagination-btn,
:root[data-theme="light"] .order-card,
:root[data-theme="light"] .detail-summary-card,
:root[data-theme="light"] .detail-block,
:root[data-theme="light"] .theme-option,
:root[data-theme="light"] .calendar-selected-date {
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(55, 76, 110, 0.14);
}

:root[data-theme="light"] .order-card:hover,
:root[data-theme="light"] .order-card.active,
:root[data-theme="light"] .item-row.selected .item-card,
:root[data-theme="light"] .theme-option.selected {
  background: rgba(226, 112, 39, 0.1);
  border-color: rgba(201, 87, 18, 0.28);
}

:root[data-theme="light"] .pagination-btn:hover:not(:disabled),
:root[data-theme="light"] .calendar-day:not(.empty):hover,
:root[data-theme="light"] .calendar-day:not(.empty):focus-visible {
  border-color: rgba(201, 87, 18, 0.34);
}

:root[data-theme="light"] .pagination-btn.active {
  border-color: rgba(201, 87, 18, 0.42);
  background: rgba(226, 112, 39, 0.12);
}

:root[data-theme="light"] .theme-option:hover {
  border-color: rgba(201, 87, 18, 0.36);
}

:root[data-theme="light"] .theme-option.selected {
  box-shadow: 0 0 0 3px rgba(201, 87, 18, 0.08);
}

:root[data-theme="light"] .chat-card,
:root[data-theme="light"] .item-card {
  background: rgba(231, 237, 246, 0.72);
  border-color: rgba(55, 76, 110, 0.12);
}

:root[data-theme="light"] .item-card > * {
  border-right-color: rgba(55, 76, 110, 0.1);
}

:root[data-theme="light"] .detail-close-bar {
  background: rgba(250, 252, 255, 0.97);
  border-bottom-color: rgba(55, 76, 110, 0.14);
  box-shadow: 0 10px 24px rgba(56, 74, 103, 0.1);
}

:root[data-theme="light"] .drawer-card {
  background: rgba(243, 247, 252, 0.98);
  border-left-color: rgba(55, 76, 110, 0.14);
  box-shadow: -20px 0 60px rgba(56, 74, 103, 0.2);
}

:root[data-theme="light"] .delivery-lightbox-backdrop {
  background: rgba(60, 73, 94, 0.34);
}

:root[data-theme="light"] .delivery-calendar-card {
  border-color: rgba(55, 76, 110, 0.16);
  background:
    radial-gradient(circle at 100% 0, rgba(226, 112, 39, 0.13), transparent 38%),
    #f9fbfe;
  box-shadow: 0 24px 72px rgba(43, 58, 82, 0.28);
}

:root[data-theme="light"] .calendar-nav-btn {
  background: rgba(37, 60, 96, 0.06);
}

:root[data-theme="light"] .calendar-day.selected {
  box-shadow: 0 7px 18px rgba(201, 87, 18, 0.23);
}

:root[data-theme="light"] .ios-slider {
  background: rgba(55, 76, 110, 0.24);
  border-color: rgba(55, 76, 110, 0.14);
}

:root[data-theme="light"] .status-banner.success,
:root[data-theme="light"] .chat-feedback.success,
:root[data-theme="light"] .detail-action-banner.success {
  color: #116b46;
}

:root[data-theme="light"] .status-banner.error,
:root[data-theme="light"] .chat-feedback.error,
:root[data-theme="light"] .detail-action-banner.error,
:root[data-theme="light"] .delivery-dialog-feedback.error {
  color: #a82f46;
}

.mobile-toggle {
  display: none;
}

.menu-toggle-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 18px;
}

.menu-toggle-icon span {
  position: absolute;
  left: 2px;
  width: 14px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition: top 220ms ease, transform 220ms ease, opacity 140ms ease;
}

.menu-toggle-icon span:nth-child(1) { top: 4px; }
.menu-toggle-icon span:nth-child(2) { top: 8px; }
.menu-toggle-icon span:nth-child(3) { top: 12px; }

.mobile-toggle.menu-open .menu-toggle-icon span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}

.mobile-toggle.menu-open .menu-toggle-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-toggle.menu-open .menu-toggle-icon span:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

.sidebar-backdrop {
  display: none;
}

.status-banner {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 0.84rem;
}

.status-banner.error {
  background: rgba(255, 107, 124, 0.12);
  color: #ffd3da;
  border: 1px solid rgba(255, 107, 124, 0.26);
}

.status-banner.success {
  background: rgba(33, 196, 123, 0.12);
  color: #d6ffe8;
  border: 1px solid rgba(33, 196, 123, 0.22);
}

.detail-action-banner {
  padding: 9px 11px;
  border-radius: var(--radius-row);
  font-size: 0.82rem;
}

.detail-action-banner.success {
  background: rgba(33, 196, 123, 0.12);
  color: #d6ffe8;
  border: 1px solid rgba(33, 196, 123, 0.22);
}

.detail-action-banner.error {
  background: rgba(255, 107, 124, 0.12);
  color: #ffd3da;
  border: 1px solid rgba(255, 107, 124, 0.26);
}

.transient-message {
  animation: transient-message-fade 5s ease forwards;
}

@keyframes transient-message-fade {
  0%, 80% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 18, 0.28);
  backdrop-filter: blur(8px);
}

.drawer-card {
  position: absolute;
  top: 0;
  right: 0;
  width: min(1580px, 96vw);
  height: 100vh;
  overflow: hidden;
  padding: 0;
  border-radius: 0;
  background: rgba(8, 18, 36, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.35);
  animation: none;
}

.delivery-lightbox {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  isolation: isolate;
}

.delivery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: rgba(2, 8, 19, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: default;
}

.delivery-calendar-card {
  width: min(410px, 100%);
  padding: 16px;
  border: 1px solid rgba(146, 174, 230, 0.2);
  border-radius: var(--radius-section);
  background:
    radial-gradient(circle at 100% 0, rgba(226, 112, 39, 0.16), transparent 38%),
    #0b172a;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.5);
  animation: calendarEnter 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.delivery-calendar-titlebar,
.calendar-month-nav,
.delivery-calendar-actions {
  display: flex;
  align-items: center;
}

.delivery-calendar-titlebar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.delivery-calendar-titlebar h3,
.delivery-calendar-titlebar p {
  margin: 0;
}

.delivery-calendar-titlebar p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.calendar-close-btn,
.calendar-nav-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
}

.calendar-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-close-btn {
  width: 34px;
  height: 34px;
}

.calendar-close-btn svg,
.calendar-nav-btn svg {
  width: 17px;
  height: 17px;
}

.calendar-month-nav {
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  margin-bottom: 8px;
}

.calendar-month-nav strong {
  text-transform: capitalize;
  font-size: 0.9rem;
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.05);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

.calendar-weekdays span {
  padding: 5px 0;
}

.calendar-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.calendar-day:not(.empty):hover,
.calendar-day:not(.empty):focus-visible {
  border-color: rgba(226, 112, 39, 0.42);
  background: rgba(201, 87, 18, 0.12);
  outline: none;
}

.calendar-day.today {
  border-color: rgba(156, 176, 208, 0.5);
}

.calendar-day.selected {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 7px 18px rgba(201, 87, 18, 0.25);
}

.calendar-day.empty {
  pointer-events: none;
}

.calendar-day.unavailable {
  color: var(--muted);
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

.calendar-selected-date {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(146, 174, 230, 0.12);
  border-radius: var(--radius-row);
  background: rgba(255, 255, 255, 0.04);
}

.calendar-selected-date strong {
  text-transform: capitalize;
}

.delivery-dialog-feedback:empty {
  display: none;
}

.delivery-dialog-feedback {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-control);
}

.delivery-dialog-feedback.error {
  color: #ffd3da;
  background: rgba(255, 107, 124, 0.12);
  border: 1px solid rgba(255, 107, 124, 0.26);
}

.delivery-calendar-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.delivery-calendar-actions button {
  min-height: 36px;
  white-space: nowrap;
}

@keyframes calendarEnter {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.24);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.float {
  animation: float 4s ease-in-out infinite;
}

.wiggle:hover svg,
.wiggle:focus-visible svg {
  animation: wiggle 0.9s ease-in-out;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.92; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@media (max-width: 1279px) {
  .legacy-filters {
    grid-template-columns: repeat(2, minmax(210px, 1fr));
    align-items: center;
    gap: 8px;
  }

  .filter-item {
    width: 100%;
  }

  .legacy-radio {
    min-width: 90px;
  }

  .filter-field {
    min-width: 0;
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 1180px) {
  .orders-head,
  .order-row {
    grid-template-columns: 108px 96px minmax(150px, 1fr) 66px 78px;
  }
}

@media (max-width: 980px) {
  .shell-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .main-content,
  .content-grid,
  .section-card,
  .orders-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 300px);
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 50;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .topbar {
    min-height: 48px;
    padding: 8px 52px 2px 0;
    margin-bottom: 18px;
  }

  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 60;
  }

  .mobile-toggle.menu-open {
    background: rgba(20, 33, 56, 0.96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }

  .topbar-actions {
    margin-right: 0;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0 0 0 min(86vw, 300px);
    z-index: 45;
    border: 0;
    padding: 0;
    background: rgba(2, 7, 16, 0.46);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    cursor: pointer;
  }

  .legacy-filters {
    grid-template-columns: repeat(2, minmax(210px, 1fr));
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-inline: 0;
    padding: 4px 0 8px;
  }

  .filter-item {
    width: 100%;
  }

  .legacy-radio {
    min-width: 90px;
  }

  .filter-field {
    min-width: 0;
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .orders-head {
    display: none;
  }

  .item-table-head {
    display: none;
  }

  .order-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
  }

  .item-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
  }

  .item-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 6px 8px;
  }

  .item-card > * {
    position: relative;
    padding: 16px 8px 5px;
    border-right: 0;
    min-height: 34px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .item-card > [data-label]::before {
    content: attr(data-label);
    position: absolute;
    top: 4px;
    left: 8px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 500;
  }

  .item-card-main {
    grid-column: 1 / -1;
  }

  .item-col-num {
    text-align: left;
    align-items: flex-start;
  }

  .item-card-action {
    grid-column: 1 / -1;
    border-bottom: 0;
    min-height: 38px;
    padding: 6px 0 0;
    margin-right: 0;
  }

  .item-card-action {
    justify-content: center;
  }

  .detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bulk-actions {
    align-items: center;
    flex-direction: row;
  }

  .pagination-bar {
    align-items: center;
    flex-direction: row;
  }

  .pagination-controls {
    justify-content: flex-end;
  }

  .chat-submit-btn {
    max-width: 100%;
  }

  .drawer-card {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    inset: 0;
    height: 100dvh;
    animation: none;
  }
}

@keyframes slideUpMobile {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (max-width: 720px) {
  .main-content,
  .sidebar,
  .section-card,
  .profile-card,
  .help-card,
  .login-panel,
  .login-showcase {
    padding: 12px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
  }

  .topbar-actions {
    width: auto;
    justify-content: flex-end;
    margin-right: 0;
  }

  .mobile-toggle {
    min-width: 0;
    justify-content: center;
  }

  .bulk-actions {
    gap: 12px;
  }

  .bulk-delivery-btn,
  .chat-submit-btn {
    width: 100%;
  }

  .detail-close-btn {
    justify-content: center;
  }

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

  .theme-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-screen {
    place-items: center;
    background-position: 70% top;
  }
}

@media (max-width: 480px) {
  .login-screen {
    padding: 14px;
  }

  .login-screen .login-panel {
    padding: 26px 20px 22px;
    border-radius: var(--radius-section);
  }

  .login-logo {
    width: min(250px, 82%);
    margin-bottom: 22px;
  }

  .login-header {
    margin-bottom: 22px;
  }

  .sidebar {
    inset: 0;
    width: 100%;
    max-width: none;
    box-shadow: none;
  }

  .sidebar-backdrop {
    display: none;
  }

  .theme-option {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
  }

  .theme-preview {
    width: 92px;
    height: 62px;
  }

  .theme-selected-mark {
    grid-column: 1 / -1;
    text-align: center;
  }

  .delivery-lightbox {
    align-items: end;
    padding: 8px;
  }

  .delivery-calendar-card {
    width: 100%;
    padding: 14px;
  }

  .delivery-calendar-actions button {
    flex: 1;
  }

  .legacy-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-item {
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
    gap: 8px;
  }

  .legacy-radio {
    min-height: 36px;
  }

  .filter-actions {
    grid-column: 1;
    width: 100%;
    min-width: 0;
  }

  .filters-submit-btn,
  .filters-clear-btn {
    flex: 1;
  }

  .pagination-summary,
  .pagination-nav-label {
    display: none;
  }

  .pagination-bar {
    justify-content: flex-end;
  }

  .pagination-controls {
    width: 100%;
    justify-content: flex-end;
  }

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

  .bulk-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-delivery-btn {
    min-width: 0;
  }

  .item-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 5px;
    align-items: start;
  }

  .item-toggle-rail {
    padding-top: 10px;
  }

  .ios-switch {
    transform: scale(0.86);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .menu-toggle-icon span,
  .main-content {
    transition: none;
  }
}
