:root {
  --bg: #f4f8ff;
  --bg-soft: #eef6ff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #dde8f7;
  --line-strong: #c7d8ee;
  --accent: #bfe3ff;
  --accent-strong: #2f80ed;
  --accent-deep: #155eef;
  --ozon: #005bff;
  --green: #e7f7ee;
  --green-ink: #16794c;
  --red: #fdebea;
  --red-ink: #b42318;
  --yellow: #fff7d6;
  --blue-soft: #edf6ff;
  --header: #f6fbff;
  --shadow: 0 18px 48px rgba(27, 79, 132, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% -8%, rgba(191, 227, 255, 0.62), transparent 34%),
    linear-gradient(180deg, #f7fbff 0%, #eef6ff 54%, #f8fbff 100%);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(162, 211, 255, 0.55), transparent 34%),
    linear-gradient(135deg, #eef8ff 0%, #f8fbff 48%, #e7f4ff 100%);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(37, 92, 141, 0.16);
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 15px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
}

.login-error {
  margin: 0;
  color: var(--red-ink);
  font-weight: 850;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  border-color: #a8c8f0;
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(15, 61, 110, 0.09);
  transform: translateY(-1px);
}

button:active {
  box-shadow: none;
  transform: translateY(0);
}

input,
select {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: #8fc5ff;
  box-shadow: 0 0 0 3px rgba(143, 197, 255, 0.22);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.78);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 91, 255, 0.14);
  animation: iconFloat 4.2s ease-in-out infinite;
}

.brand strong {
  display: block;
  font-size: 14px;
  line-height: 1.15;
}

.account-card p,
.panel-head span,
.muted {
  color: var(--muted);
}

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

.nav-btn {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  border-color: transparent;
  border-radius: 12px;
  background: transparent;
  color: #475467;
  font-weight: 700;
}

.nav-btn.active,
.nav-btn:hover {
  background: #eaf5ff;
  border-color: #cce5ff;
  color: #0f3d6e;
  box-shadow: 0 10px 24px rgba(15, 61, 110, 0.08);
}

.tech-menu {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.tech-menu summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
  list-style: none;
  margin-bottom: 8px;
}

.tech-menu summary::-webkit-details-marker {
  display: none;
}

.tech-menu summary::after {
  content: "⌄";
  float: right;
  color: var(--muted-2);
}

.tech-menu[open] summary::after {
  content: "⌃";
}

.tech-btn {
  min-height: 30px;
  font-weight: 650;
  color: #667085;
}

.account-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.account-card label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.account-card select {
  width: 100%;
}

.account-card p {
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.logout-btn {
  width: 100%;
  margin-top: 12px;
  min-height: 34px;
  border-radius: 12px;
  color: #475467;
  font-weight: 800;
}

.main {
  min-width: 0;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.main.hide-period-controls .topbar {
  justify-content: flex-start;
}

.main.hide-period-controls .actions {
  display: none;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.actions,
.table-toolbar,
.settings-actions,
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.date-control {
  min-width: 132px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  font-weight: 800;
}

.date-control::after {
  content: "";
  width: 15px;
  height: 15px;
  display: inline-block;
  margin-left: 10px;
  border: 2px solid #0f172a;
  border-top-width: 4px;
  border-radius: 4px;
  opacity: 0.85;
}

.date-popover {
  position: absolute;
  z-index: 20;
  width: 318px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 60px rgba(15, 61, 110, 0.18);
  backdrop-filter: blur(16px);
}

.calendar-head,
.calendar-weekdays,
.calendar-days {
  display: grid;
}

.calendar-head {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.calendar-head strong {
  text-transform: capitalize;
  font-size: 15px;
}

.calendar-nav {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 11px;
  font-weight: 900;
}

.calendar-weekdays,
.calendar-days {
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-weekdays {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.calendar-days button {
  min-height: 34px;
  padding: 0;
  border-radius: 12px;
  border-color: transparent;
  background: transparent;
  font-weight: 750;
}

.calendar-days button:hover {
  background: #eef7ff;
  border-color: #cce5ff;
  box-shadow: 0 8px 18px rgba(15, 61, 110, 0.08);
}

.calendar-days .muted-day {
  color: var(--muted-2);
}

.calendar-days .today-day {
  border-color: #a8d6ff;
}

.calendar-days .selected-day {
  background: #d8eeff;
  border-color: #8ecbff;
  color: #0f3d6e;
  box-shadow: inset 0 0 0 1px #8ecbff;
}

.primary-btn {
  background: #d8eeff;
  color: #0f3d6e;
  border-color: #a8d6ff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(47, 128, 237, 0.12);
}

.primary-btn:hover {
  background: #c9e7ff;
  border-color: #8ecbff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.metric,
.panel,
.insight,
.report-summary,
.tech-note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: widgetIn 0.32s ease both;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.metric:hover,
.panel:hover,
.insight:hover,
.report-summary:hover,
.tech-note:hover {
  border-color: #c8e2ff;
  box-shadow: 0 16px 38px rgba(20, 73, 122, 0.08);
  transform: translateY(-1px);
}

.metric {
  min-height: 92px;
  padding: 12px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 650;
}

.metric strong {
  display: block;
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: 0;
}

.metric small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.25;
}

.indicator-metric {
  transition: background 0.16s ease, border-color 0.16s ease;
}

.metric-good {
  background: var(--green);
  border-color: #bfe9d1;
}

.metric-good strong {
  color: var(--green-ink);
}

.metric-bad {
  background: var(--red);
  border-color: #fac7c2;
}

.metric-bad strong {
  color: var(--red-ink);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.insight {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
}

.insight strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.insight p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  animation: iconPulse 2.8s ease-in-out infinite;
}

.green-dot {
  background: #75c992;
}

.red-dot {
  background: #f08178;
}

.yellow-dot {
  background: #ffd66b;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 12px;
}

.dashboard-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.panel {
  padding: 13px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.panel h2 {
  margin: 0;
  font-size: 17px;
}

.trend-bars {
  position: relative;
  min-height: 272px;
}

.trend-svg {
  width: 100%;
  height: 230px;
  display: block;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border: 1px solid #edf3fb;
}

.trend-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.trend-stats article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}

.trend-stats span,
.trend-stats strong {
  display: block;
}

.trend-stats span {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}

.trend-stats strong {
  font-size: 24px;
  line-height: 1.1;
}

.trend-legend {
  position: relative;
  z-index: 6;
  display: flex;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 50%;
}

.legend-blue {
  background: var(--accent-strong);
}

.legend-teal {
  background: #14b8a6;
}

#trendHoverArea {
  cursor: crosshair;
}

.trend-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(15, 61, 110, 0.14);
  pointer-events: none;
  transition: transform 0.08s ease, opacity 0.08s ease;
}

.trend-tooltip[hidden] {
  display: none;
}

.trend-tooltip strong,
.trend-tooltip span {
  display: block;
  white-space: nowrap;
}

.trend-tooltip span {
  color: var(--muted);
  font-size: 12px;
}

.attention-list,
.mini-list {
  display: grid;
  gap: 8px;
}

.attention-item {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #d8e9fb;
  border-left: 4px solid #8ecbff;
  border-radius: 14px;
  background: #fbfdff;
}

.attention-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-item span {
  color: var(--muted);
  font-size: 12px;
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(221, 232, 247, 0.85);
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-row strong,
.mini-row span {
  display: block;
  min-width: 0;
}

.mini-row strong {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.mini-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mini-row b {
  flex: 0 0 auto;
  white-space: nowrap;
}

.danger-text {
  color: var(--red-ink);
}

.info-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e4eef8;
  color: #64809b;
  font-weight: 900;
  animation: iconPulse 3s ease-in-out infinite;
}

.period-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin-bottom: 10px;
  padding-bottom: 2px;
}

.top-periods {
  margin-top: -2px;
  margin-bottom: 12px;
}

.period-tab,
.period-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  background: #ffffff;
  border-color: var(--line);
  font-weight: 800;
}

.period-tab span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.period-tab.active,
.period-chip:hover {
  background: #d8eeff;
  border-color: #a8d6ff;
  color: #0f3d6e;
}

.report-summary,
.tech-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 12px 14px;
}

.report-summary {
  padding: 10px;
}

.report-summary strong,
.tech-note strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}

.report-summary span,
.tech-note span {
  color: var(--muted);
}

.report-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-filter {
  min-height: 34px;
  border-radius: 999px;
  background: #f8fbff;
  color: #315b83;
  font-weight: 850;
}

.report-filter.active,
.report-filter:hover {
  background: #d8eeff;
  border-color: #8ecbff;
  color: #0f3d6e;
  box-shadow: 0 8px 18px rgba(15, 61, 110, 0.08);
}

.report-pills span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef8ff;
  color: #23669e;
  font-weight: 800;
  font-size: 12px;
}

.table-toolbar {
  justify-content: space-between;
  margin-bottom: 9px;
  flex-wrap: wrap;
}

.table-toolbar input {
  width: min(380px, 100%);
}

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  max-height: calc(100vh - 156px);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.raw-toolbar {
  align-items: center;
}

.raw-toolbar input {
  width: min(330px, 100%);
}

.raw-wrap {
  max-height: calc(100vh - 190px);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.compact-table {
  min-width: 980px;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(221, 232, 247, 0.7);
  padding: 6px 7px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
}

th:last-child,
td:last-child {
  border-right: 0;
}

.compact-table th,
.compact-table td {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 7px;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--header);
  color: #344054;
  border-bottom-color: var(--line-strong);
  font-weight: 850;
  text-align: center;
}

.report-table th,
.report-table td {
  text-align: center;
}

.report-table .product-cell,
.report-table .comment-cell,
.report-table .action-cell {
  text-align: left;
}

td {
  background: rgba(255, 255, 255, 0.84);
}

tbody tr:hover td {
  background: #f6fbff;
}

.report-table .col-article {
  width: 7%;
}

.report-table .col-name {
  width: 13.5%;
}

.report-table .col-stock {
  width: 4.5%;
}

.report-table .col-money {
  width: 6.6%;
}

.report-table .col-small {
  width: 5%;
}

.report-table .col-percent {
  width: 6%;
}

.report-table .col-action {
  width: 9%;
}

.report-table .col-comment {
  width: 12.5%;
}

.clip-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-cell {
  font-weight: 720;
}

.action-cell {
  background: #fbfdff;
  color: #475467;
}

.stock-cell {
  background: #eef6ff;
  color: #175cd3;
  font-weight: 850;
}

.stock-empty {
  background: var(--red);
  color: var(--red-ink);
}

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

.muted-cell {
  color: var(--muted);
  background: #f8fafc;
  font-weight: 750;
}

.compact-muted {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

td[contenteditable="true"] {
  outline-color: var(--accent-strong);
}

.money,
.number,
.percent {
  text-align: right;
}

.drr-high,
.conversion-low {
  background: var(--red);
  color: var(--red-ink);
  font-weight: 850;
}

.drr-ok,
.conversion-ok {
  background: var(--green);
  color: var(--green-ink);
  font-weight: 850;
}

.blue-cell {
  background: var(--blue-soft);
}

.tab-btn.active {
  background: #d8eeff;
  border-color: #a8d6ff;
  color: #0f3d6e;
  font-weight: 800;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.settings-actions {
  margin-top: 14px;
}

.logistics-page {
  display: grid;
  gap: 14px;
  min-width: 0;
}

#logisticsContent,
#logisticsContent > *,
.dashboard-detail-grid > *,
.logistics-detail-grid > *,
.logistics-metrics > *,
.logistics-summary-grid > * {
  min-width: 0;
}

.logistics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.logistics-head h2 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

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

.logistics-form-panel {
  max-width: 760px;
}

.logistics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.logistics-actions button {
  min-height: 42px;
}

.logistics-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.logistics-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.9fr);
  gap: 12px;
}

.logistics-items-panel {
  grid-row: span 2;
}

.logistics-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  table-layout: fixed;
}

.logistics-table th,
.logistics-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.logistics-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.logistics-col-row {
  width: 76px;
}

.logistics-col-article {
  width: 23%;
}

.logistics-col-name {
  width: 43%;
}

.logistics-col-cluster {
  width: 30%;
}

.logistics-col-qty {
  width: 118px;
}

.logistics-col-status {
  width: 130px;
}

.logistics-table .number {
  white-space: nowrap;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f5faff;
}

.logistics-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logistics-title-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  white-space: normal;
}

.status-ok {
  border-color: #b8ebc8;
  background: #ecfdf3;
  color: #0c7a43;
}

.status-warn {
  border-color: #ffe1a8;
  background: #fff8e6;
  color: #946200;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-line input {
  min-height: auto;
}

body.is-busy {
  cursor: wait;
}

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

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes widgetIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .dashboard-detail-grid,
  .logistics-detail-grid {
    grid-template-columns: 1fr;
  }

  .logistics-items-panel {
    grid-row: auto;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    padding-bottom: 20px;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-btn {
    justify-content: center;
    min-height: 46px;
    padding: 10px 8px;
    text-align: center;
  }

  .tech-menu {
    margin-top: 0;
  }

  .topbar,
  .actions,
  .report-summary,
  .tech-note {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .insight-grid,
  .settings-grid,
  .form-grid,
  .logistics-metrics,
  .logistics-summary-grid {
    grid-template-columns: 1fr;
  }

  .logistics-head {
    align-items: stretch;
    flex-direction: column;
  }

  .logistics-title-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .main,
  .sidebar {
    padding: 14px;
  }

  .brand {
    align-items: center;
  }

  .brand strong {
    font-size: 18px;
    line-height: 1.15;
  }

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

  .topbar h1 {
    font-size: 36px;
    line-height: 1.05;
  }

  .actions {
    gap: 8px;
  }

  .date-control,
  .primary-btn,
  .actions button,
  .logistics-actions button {
    width: 100%;
  }

  .panel,
  .metric,
  .insight {
    border-radius: 16px;
  }

  .metric strong {
    font-size: 32px;
    overflow-wrap: anywhere;
  }

  .logistics-table {
    min-width: 640px;
  }

  .logistics-col-row {
    width: 58px;
  }

  .logistics-col-qty {
    width: 92px;
  }

  .logistics-col-status {
    width: 96px;
  }
}

@media (max-width: 420px) {
  .main,
  .sidebar {
    padding: 12px;
  }

  .topbar h1 {
    font-size: 32px;
  }

  .brand-logo {
    width: 54px;
    height: 54px;
  }

  .nav-btn {
    font-size: 14px;
  }
}
