@import url("https://fonts.googleapis.com/css2?family=Sriracha&display=swap");

:root {
  --bg: #eef4f9;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.12);
  --line: #dde6ef;
  --line-soft: rgba(255, 255, 255, 0.18);
  --text: #0f2140;
  --muted: #6b7d95;
  --muted-strong: #50627c;
  --blue-700: #234bb7;
  --blue-600: #2b63d4;
  --cyan-500: #18b7d7;
  --green-500: #2ccf8e;
  --amber-500: #ffb31f;
  --red-500: #f35a57;
  --shadow-hero: 0 24px 48px rgba(29, 62, 133, 0.18);
  --shadow-panel: 0 18px 40px rgba(20, 38, 72, 0.1);
  --shadow-button: 0 14px 28px rgba(36, 82, 191, 0.22);
  --hero-gradient: linear-gradient(135deg, #2948b1 0%, #2458bb 45%, #12bbd8 100%);
  --radius-hero: 30px;
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(24, 183, 215, 0.12), transparent 26%),
    radial-gradient(circle at top left, rgba(43, 99, 212, 0.12), transparent 24%),
    linear-gradient(180deg, #f7fafc 0%, var(--bg) 100%);
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

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

.app-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 28px 44px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.74fr);
  align-items: start;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-hero);
  background: var(--hero-gradient);
  color: #fff;
  box-shadow: var(--shadow-hero);
}

.hero-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.icon-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.icon-frame svg,
.icon-frame img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
  stroke: currentColor;
}

.brand-icon,
.device-icon,
.heading-icon,
.metric-icon,
.support-icon {
  flex: 0 0 auto;
}

.brand-icon {
  width: clamp(58px, 7vw, 78px);
  height: clamp(58px, 7vw, 78px);
  background: transparent;
  border: none;
  box-shadow: none;
}

.brand-icon .brand-logo {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 28px rgba(12, 36, 88, 0.32));
}

.brand-copy {
  min-width: 0;
  max-width: 100%;
}

.hero-title-line {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-wrap: nowrap;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex: 0 0 auto;
}

.hero-brand-title {
  font-family: "Sriracha", "Segoe UI Variable", "Trebuchet MS", cursive;
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.hero-subtitle {
  margin-top: 8px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
}

.hero-copy {
  max-width: 700px;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.hero-side {
  display: flex;
  align-items: flex-start;
}

.device-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "top top"
    "status actions"
    "threshold threshold";
  gap: 10px 12px;
  padding: 14px 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(10, 28, 66, 0.34), rgba(9, 23, 54, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 28px rgba(9, 22, 54, 0.18);
  backdrop-filter: blur(12px);
}

.device-card-top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.device-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1ac978 0%, #1fdaae 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.device-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.device-meta strong {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(7, 17, 40, 0.22);
}

.device-meta span {
  color: rgba(242, 248, 255, 0.92);
  font-size: 13px;
}

.device-status-row {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: #fff;
  font-weight: 600;
}

.account-actions {
  grid-area: actions;
  display: flex;
  gap: 10px;
  margin: 0;
  justify-self: end;
}

.account-action-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.account-action-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.account-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.account-action-button-secondary {
  background: rgba(15, 33, 64, 0.26);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.status-indicator-on {
  background: #2ce17d;
  box-shadow: 0 0 0 5px rgba(44, 225, 125, 0.16);
}

.status-indicator-off {
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.08);
}

.threshold-group {
  grid-area: threshold;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.threshold-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(245, 249, 255, 0.96);
}

.threshold-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 15px;
  background: rgba(10, 22, 48, 0.22);
}

.threshold-button {
  min-height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(241, 247, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.threshold-button:hover {
  color: #fff;
}

.threshold-button.active {
  background: #fff;
  color: var(--blue-700);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.08);
}

.pairing-card,
.scan-card,
.metric-card,
.sales-card,
.support-card {
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.pairing-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.45fr);
  gap: 22px;
  align-items: center;
  margin-top: 24px;
  padding: 24px 26px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(20, 55, 121, 0.08);
}

.section-kicker {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-600);
}

.pairing-copy h2 {
  font-size: 32px;
  letter-spacing: -0.03em;
}

.pairing-copy p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.58;
}

.pairing-stack {
  display: grid;
  gap: 16px;
}

.pairing-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.pairing-full-row {
  grid-column: 1 / -1;
}

.pairing-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.pairing-form input,
.scan-input-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  background: #fbfdff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pairing-form input {
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
}

.pairing-form input:focus,
.scan-input-wrap input:focus {
  border-color: #76c7ef;
  box-shadow: 0 0 0 5px rgba(86, 191, 234, 0.15);
}

.pairing-form button,
.scan-input-wrap button,
.undo-button {
  border: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.pairing-form button:hover,
.scan-input-wrap button:hover,
.undo-button:hover {
  transform: translateY(-1px);
}

.pairing-form button {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 16px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #234db8 0%, #16b6d4 100%);
  box-shadow: var(--shadow-button);
}

.advanced-pairing {
  border: 1px solid rgba(20, 55, 121, 0.08);
  border-radius: 18px;
  background: #f8fbff;
  padding: 16px 18px 18px;
}

.advanced-pairing summary {
  font-size: 15px;
  font-weight: 800;
  color: var(--blue-700);
  cursor: pointer;
  list-style: none;
}

.advanced-pairing summary::-webkit-details-marker {
  display: none;
}

.advanced-pairing[open] summary {
  margin-bottom: 14px;
}

.pairing-form-code {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.main-grid {
  display: grid;
  gap: 26px;
  margin-top: 24px;
}

.scan-card {
  padding: 30px 32px 32px;
  border-radius: var(--radius-xl);
}

.scan-card {
  border: 1px solid rgba(28, 92, 179, 0.08);
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.heading-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #2551be 0%, #16b4d4 100%);
  box-shadow: 0 10px 20px rgba(42, 96, 202, 0.2);
}

.card-heading h2 {
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.03em;
}

.card-heading p {
  margin-top: 4px;
  color: var(--muted);
}

.scan-priority-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.scan-priority-step {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #dbe8f3;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f9ff 100%);
}

.scan-priority-step strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.scan-priority-step span {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.scan-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 14px;
}

.scan-input-wrap input {
  min-height: 64px;
  padding: 0 22px;
  border-radius: 18px;
  font-size: 16px;
}

.scan-input-wrap button {
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  background: linear-gradient(135deg, #234db8 0%, #16b6d4 100%);
  box-shadow: var(--shadow-button);
}

.flash-alert {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid transparent;
}

.flash-alert.hidden {
  display: none;
}

.flash-alert.info {
  background: #eef8ff;
  border-color: #b8def8;
  color: #24527e;
}

.flash-alert.success {
  background: #eefcf4;
  border-color: #b9eccd;
  color: #1f6a44;
}

.flash-alert.warning {
  background: #fff8eb;
  border-color: #ffd78d;
  color: #835900;
}

.flash-alert.danger {
  background: #fff1f1;
  border-color: #ffbbb9;
  color: #a53430;
}

.flash-alert-title {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 800;
}

.last-check-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid transparent;
}

.last-check-card.success {
  background: linear-gradient(180deg, #f3fff7 0%, #ebfaf1 100%);
  border-color: #bae9cb;
}

.last-check-card.warning {
  background: linear-gradient(180deg, #fffaf0 0%, #fff5e6 100%);
  border-color: #ffd58f;
}

.last-check-card.danger {
  background: linear-gradient(180deg, #fff5f5 0%, #fff0f0 100%);
  border-color: #ffb8b6;
}

.last-check-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.last-check-head h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.last-check-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(29, 62, 133, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.last-check-title {
  margin-top: 12px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.last-check-message {
  margin-top: 8px;
  line-height: 1.6;
  color: var(--muted-strong);
}

.last-check-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.last-check-detail {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(29, 62, 133, 0.08);
}

.last-check-detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.last-check-detail-value {
  display: block;
  font-size: 16px;
  line-height: 1.4;
}

.scan-secondary-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef5fc 100%);
  border: 1px solid #d9e7f2;
  color: var(--muted-strong);
  line-height: 1.55;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.metric-card {
  padding: 26px 22px 20px;
  border-radius: 22px;
  border: 1px solid rgba(16, 34, 64, 0.06);
}

.metric-card-clickable {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.metric-card-clickable:hover,
.metric-card-clickable:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(36, 82, 191, 0.18);
  box-shadow: 0 22px 40px rgba(20, 38, 72, 0.14);
  outline: none;
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
}

.metric-icon-blue {
  background: linear-gradient(135deg, #315ad0 0%, #4b7ef0 100%);
}

.metric-icon-cyan {
  background: linear-gradient(135deg, #209bd5 0%, #19c4df 100%);
}

.metric-icon-gold {
  background: linear-gradient(135deg, #f6a313 0%, #ffc63a 100%);
}

.metric-icon-green {
  background: linear-gradient(135deg, #20bd72 0%, #2fda92 100%);
}

.metric-card strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(36px, 3vw, 50px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted-strong);
  font-size: 18px;
}

.metric-rule {
  margin-top: 18px;
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(42, 99, 212, 0.12), rgba(24, 183, 215, 0.08));
}

.sales-card {
  overflow: hidden;
  border-radius: 26px;
}

.stock-card {
  overflow: hidden;
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.sales-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 26px;
  color: #fff;
  background: linear-gradient(135deg, #2451b9 0%, #16b7d4 100%);
}

.sales-head h2 {
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.04em;
}

.sales-head p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.9);
}

.sales-head-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.stock-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 26px;
  color: #fff;
  background: linear-gradient(135deg, #1d5bc0 0%, #1fb9d7 100%);
}

.stock-head h2 {
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.stock-head p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.9);
}

.stock-head-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stock-head-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.stock-scope-button {
  appearance: none;
  min-width: 138px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  color: #fff;
  letter-spacing: 0.01em;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 16px 28px rgba(10, 36, 82, 0.16);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.stock-scope-button:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.1);
}

.stock-scope-button.active {
  background: #fff;
  color: var(--blue-700);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 22px rgba(6, 28, 70, 0.16);
}

.stock-collapse-button {
  appearance: none;
  min-height: 44px;
  min-width: 172px;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(8, 29, 69, 0.22), rgba(5, 24, 58, 0.1)),
    rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 16px 28px rgba(10, 36, 82, 0.18);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.stock-collapse-button:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.1)),
    rgba(255, 255, 255, 0.08);
}

.stock-collapse-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.stock-section-chevron {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.16s ease;
}

.stock-collapse-button[aria-expanded="true"] .stock-section-chevron {
  transform: rotate(180deg);
}

.sales-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.sales-body {
  background: #fff;
}

.stock-body-collapsed {
  display: none;
}

.stock-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 260px)) minmax(200px, 1fr);
  gap: 14px 16px;
  align-items: end;
  padding: 22px 24px 0;
  margin: 0 20px;
  background: linear-gradient(180deg, #fcfdff 0%, #f4f9ff 100%);
  border: 1px solid #e1ebf4;
  border-radius: 20px;
  box-shadow: 0 16px 28px rgba(21, 42, 76, 0.06);
}

.stock-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted-strong);
}

.stock-toolbar-field select {
  appearance: none;
  min-height: 48px;
  padding: 0 44px 0 14px;
  border: 1px solid #d7e4ef;
  border-radius: 14px;
  outline: none;
  background:
    linear-gradient(180deg, #ffffff 0%, #f5faff 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m7 10 5 5 5-5' stroke='%23234bb7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: left top, right 14px center;
  background-size: auto, 16px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-weight: 700;
}

.stock-toolbar-field select:focus {
  border-color: #76c7ef;
  box-shadow: 0 0 0 5px rgba(86, 191, 234, 0.15);
}

.stock-filter-summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.5;
  text-align: right;
  font-weight: 700;
}

.manual-entry-card {
  padding: 24px 26px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(20, 55, 121, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
  box-shadow: var(--shadow-panel);
}

.manual-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.manual-entry-head h2 {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.manual-entry-details {
  margin-top: 18px;
  border: 1px solid #dbe8f3;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}

.manual-entry-details summary {
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 800;
  color: var(--blue-700);
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f9ff 100%);
}

.manual-entry-details summary::-webkit-details-marker {
  display: none;
}

.manual-entry-details[open] summary {
  border-bottom: 1px solid #e4edf5;
}

.manual-import-panel {
  padding: 20px;
  border-bottom: 1px solid #e4edf5;
  background: linear-gradient(180deg, #fbfdff 0%, #f6fbff 100%);
}

.manual-import-head h3 {
  font-size: 24px;
  letter-spacing: -0.02em;
}

.manual-import-head p:last-child {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.manual-import-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.manual-import-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.manual-import-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.manual-file-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.manual-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.manual-file-picker-button,
.manual-primary-button,
.manual-secondary-button {
  appearance: none;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  text-decoration: none;
}

.manual-file-picker-button,
.manual-primary-button {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #214ab5 0%, #1aa9d2 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 16px 28px rgba(31, 79, 188, 0.22);
}

.manual-file-picker-button:hover,
.manual-primary-button:hover,
.manual-secondary-button:hover {
  transform: translateY(-1px);
}

.manual-file-picker-button:hover,
.manual-primary-button:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 18px 32px rgba(31, 79, 188, 0.28);
}

.manual-secondary-button {
  border: 1px solid #d5e2ee;
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
  color: var(--blue-700);
  box-shadow: 0 12px 24px rgba(21, 42, 76, 0.08);
}

.manual-file-picker-button:focus-visible,
.manual-primary-button:focus-visible,
.manual-secondary-button:focus-visible {
  outline: 2px solid rgba(35, 99, 212, 0.35);
  outline-offset: 3px;
}

.stock-scope-button:disabled,
.stock-collapse-button:disabled,
.manual-primary-button:disabled,
.manual-secondary-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.manual-file-name {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid #dbe7f2;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--muted-strong);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.manual-import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manual-import-actions button,
.manual-secondary-button {
  flex: 0 0 auto;
}

.manual-import-hint {
  max-width: 620px;
  padding: 12px 14px;
  border: 1px solid #dce8f2;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.delivery-note-preview {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #dbe8f3;
  border-radius: 20px;
  background: #fff;
}

.delivery-note-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.delivery-note-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.delivery-note-preview-head h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.delivery-note-preview-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.delivery-note-preview-warnings {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.delivery-note-preview-warning {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #ffd48a;
  background: #fff8eb;
  color: #835900;
  line-height: 1.5;
}

.delivery-note-preview-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.delivery-note-preview-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(29, 62, 133, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

.delivery-note-preview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.delivery-note-preview-card h4 {
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.delivery-note-preview-remove {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #ffd0c8;
  border-radius: 999px;
  background: #fff4f2;
  color: #b14638;
  font-weight: 700;
  cursor: pointer;
}

.delivery-note-preview-card p {
  margin-top: 6px;
  color: var(--muted);
  white-space: pre-line;
}

.delivery-note-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin-top: 14px;
}

.delivery-note-preview-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.delivery-note-preview-field span {
  color: var(--muted);
}

.delivery-note-preview-field input {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  outline: none;
  background: #fbfdff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.delivery-note-preview-field input:focus {
  border-color: #76c7ef;
  box-shadow: 0 0 0 4px rgba(86, 191, 234, 0.12);
}

.delivery-note-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 14px;
}

.manual-lot-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 20px;
}

.manual-lot-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.manual-lot-form input {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  outline: none;
  background: #fbfdff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.manual-lot-form input:focus {
  border-color: #76c7ef;
  box-shadow: 0 0 0 5px rgba(86, 191, 234, 0.15);
}

.manual-full-row,
.manual-actions {
  grid-column: 1 / -1;
}

.manual-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.manual-actions button {
  min-height: 52px;
  padding: 0 22px;
  border: none;
  border-radius: 16px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #234db8 0%, #16b6d4 100%);
  box-shadow: var(--shadow-button);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.manual-actions button:hover {
  transform: translateY(-1px);
}

.empty-state {
  margin: 24px;
  padding: 28px 24px;
  border-radius: 22px;
  border: 1px dashed #ccdae7;
  background: linear-gradient(180deg, #fcfdff 0%, #f5f9fc 100%);
}

.empty-state p {
  font-size: 22px;
  font-weight: 800;
}

.empty-state span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.sale-row {
  padding: 24px 26px 20px;
  border-radius: 22px;
  border: 1px solid #e7eef5;
}

.sale-row-normal {
  background: #fff;
}

.sale-row-info {
  background: linear-gradient(180deg, #f8fcff 0%, #eef8ff 100%);
}

.sale-row-warning {
  background: linear-gradient(180deg, #fffdf7 0%, #fff8eb 100%);
}

.sale-row-danger {
  background: linear-gradient(180deg, #fff9f9 0%, #fff1f1 100%);
}

.sale-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.sale-content {
  min-width: 0;
}

.sale-title {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.undo-button {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 12px;
  color: #8697ad;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(130, 148, 171, 0.18);
}

.undo-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.sale-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px 16px;
  margin-top: 14px;
}

.sale-detail {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
  min-width: 0;
}

.sale-detail-label {
  font-size: 13px;
  color: var(--muted);
}

.sale-detail-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}

.sale-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
}

.sale-alert svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.sale-alert strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}

.sale-alert.info {
  color: #24507d;
  background: #eef8ff;
  border: 1px solid #b7def8;
}

.sale-alert.warning {
  color: #8a5a00;
  background: #fff7e8;
  border: 1px solid #ffd47a;
}

.sale-alert.danger {
  color: #a6322f;
  background: #fff0f0;
  border: 1px solid #ffb3b2;
}

.sale-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted-strong);
}

.sale-footer svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.stock-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 16px;
}

.stock-product-card {
  overflow: hidden;
}

.stock-product-toggle {
  width: 100%;
  padding: 22px 24px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.stock-product-summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.stock-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  color: var(--muted-strong);
  font-size: 14px;
}

.stock-product-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stock-group-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.8);
}

.stock-group-badge.success {
  color: #1f6a44;
}

.stock-group-badge.warning {
  color: #8a5a00;
}

.stock-group-badge.danger {
  color: #a6322f;
}

.stock-chevron {
  width: 24px;
  height: 24px;
  transition: transform 0.16s ease;
}

.stock-chevron.expanded {
  transform: rotate(180deg);
}

.stock-product-body {
  display: none;
  padding: 0 24px 22px;
}

.stock-product-body.expanded {
  display: grid;
  gap: 12px;
}

.stock-lot-card {
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(29, 62, 133, 0.08);
}

.stock-status-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.stock-status-field {
  display: grid;
  gap: 8px;
  min-width: min(100%, 260px);
  flex: 1 1 240px;
}

.stock-status-field span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.stock-status-field select,
.stock-status-field input {
  min-height: 48px;
  border: 1px solid #d6e6f4;
  border-radius: 16px;
  background: #f8fbff;
  padding: 0 16px;
  color: var(--text);
  font: inherit;
}

.stock-status-quantity-field {
  flex: 0 0 150px;
  min-width: 150px;
}

.stock-status-button {
  min-width: 132px;
  min-height: 48px;
  border: none;
  border-radius: 16px;
  padding: 0 18px;
  background: linear-gradient(135deg, #315ad0 0%, #16b7d4 100%);
  box-shadow: var(--shadow-button);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.stock-status-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.stock-status-help {
  flex: 1 1 100%;
  margin: -2px 2px 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.stock-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #d9e6f2;
  background: #f6fbff;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.stock-status-pill.success {
  border-color: rgba(47, 184, 120, 0.26);
  background: rgba(47, 184, 120, 0.12);
  color: #1f6a44;
}

.stock-status-pill.info {
  border-color: rgba(49, 90, 208, 0.2);
  background: rgba(49, 90, 208, 0.1);
  color: #2446a5;
}

.stock-status-pill.warning {
  border-color: rgba(240, 168, 41, 0.26);
  background: rgba(240, 168, 41, 0.14);
  color: #8a5a00;
}

.stock-status-pill.danger {
  border-color: rgba(214, 92, 92, 0.24);
  background: rgba(214, 92, 92, 0.12);
  color: #a6322f;
}

.stock-note {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.55;
}

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

.support-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
  border-radius: 22px;
}

.support-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
}

.support-icon-green {
  background: linear-gradient(135deg, #22b977 0%, #2fd8a1 100%);
}

.support-icon-blue {
  background: linear-gradient(135deg, #315ad0 0%, #16b7d4 100%);
}

.support-card h3 {
  margin-bottom: 8px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.support-card p {
  color: var(--muted);
  line-height: 1.6;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 24, 48, 0.56);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 26px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(11, 24, 48, 0.28);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.modal-header h2 {
  font-size: 32px;
  letter-spacing: -0.03em;
}

.modal-close-button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid #d9e6f2;
  border-radius: 14px;
  background: #f8fbff;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.profile-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid #deebf6;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
}

.profile-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-item strong {
  font-size: 18px;
  line-height: 1.4;
}

.profile-item-full {
  grid-column: 1 / -1;
}

.profile-password-card {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid #deebf6;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.profile-password-head h3 {
  font-size: 24px;
  letter-spacing: -0.02em;
}

.profile-password-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.profile-password-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-top: 18px;
}

.profile-password-form label,
.password-code-panel label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.profile-password-form input,
.password-code-panel input {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: #fbfdff;
}

.profile-password-form input:focus,
.password-code-panel input:focus {
  border-color: #76c7ef;
  box-shadow: 0 0 0 5px rgba(86, 191, 234, 0.15);
}

.profile-password-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.profile-password-actions button {
  min-height: 50px;
  padding: 0 18px;
  border: none;
  border-radius: 16px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #234db8 0%, #16b6d4 100%);
  box-shadow: var(--shadow-button);
}

.password-code-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e3edf6;
}

.password-debug-code {
  padding: 14px 16px;
  border: 1px solid #ffd47a;
  border-radius: 16px;
  background: #fff7e8;
  color: #8a5a00;
  line-height: 1.5;
}

@media (max-width: 1260px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

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

  .scan-priority-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 16px;
  }

  .device-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "status"
      "actions"
      "threshold";
  }

  .account-actions {
    justify-self: stretch;
  }

  .threshold-group {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .pairing-card {
    grid-template-columns: 1fr;
  }

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

  .scan-input-wrap {
    grid-template-columns: 1fr;
  }

  .manual-entry-head {
    flex-direction: column;
  }

  .manual-import-actions,
  .delivery-note-preview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .delivery-note-preview-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .manual-lot-form {
    grid-template-columns: 1fr;
  }

  .sales-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .stock-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .stock-head-side {
    width: 100%;
    justify-content: flex-start;
  }

  .stock-toolbar {
    grid-template-columns: 1fr;
  }

  .stock-filter-summary {
    justify-content: flex-start;
    text-align: left;
  }

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

  .profile-grid,
  .profile-password-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .brand-row {
    align-items: flex-start;
    gap: 14px;
  }

  .hero-title-line {
    flex-wrap: wrap;
  }

  .metrics-strip {
    grid-template-columns: 1fr;
  }

  .scan-card,
  .pairing-card,
  .metric-card,
  .support-card {
    padding-left: 20px;
    padding-right: 20px;
  }

  .sale-row {
    padding-left: 18px;
    padding-right: 18px;
  }

  .sale-top {
    flex-direction: column;
  }

  .undo-button {
    align-self: flex-end;
  }

  .stock-product-summary {
    flex-direction: column;
  }

  .stock-product-actions {
    width: 100%;
    justify-content: space-between;
  }
}
