:root {
  --navy: #0f3d5e;
  --blue: #1769aa;
  --blue-dark: #0b4f84;
  --green: #1d7a46;
  --red: #b42318;
  --bg: #f4f7fa;
  --card: #ffffff;
  --border: #d7e0e8;
  --text: #16212b;
  --muted: #61707d;
  --shadow: 0 12px 30px rgba(15, 61, 94, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100% - 32px, 960px);
  margin: 0 auto;
  padding: 24px 0 48px;
}

.app-header {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: start;
  gap: 20px;
  width: 100%;
  margin-bottom: 44px;
}

.brand-title {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  padding-top: 18px;
}

.brand {
  display: contents;
}

.company-logo {
  grid-column: 1;
  justify-self: start;
  width: 120px;
  height: 90px;
  object-fit: contain;
  object-position: left center;
}

.brand-title {
  min-width: 0;
}

.brand-title h1 {
  margin: 0;
  color: var(--navy);
  font-size: 1.6rem;
  white-space: nowrap;
}

.company-logo {
  width: 260px;
  height: 115px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.user-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

#userName {
  max-width: 180px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 440px);
  margin: 48px auto;
}

.auth-card p {
  color: var(--muted);
}

form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(23, 105, 170, 0.14);
}

.button {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 800;
}

.button-primary {
  background: var(--blue);
  color: #fff;
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  background: #e7eef5;
  color: var(--navy);
}

.button-danger {
  background: var(--red);
  color: #fff;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.action-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.action-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.action-card span:not(.action-icon) {
  font-size: 1.1rem;
  font-weight: 800;
}

.action-card small {
  color: var(--muted);
  line-height: 1.35;
}

.action-icon {
  font-size: 2rem;
}

#operationView {
  margin-top: 24px;
}

.section-heading,
.search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.search-row {
  margin: 24px 0 16px;
}

.search-row input {
  flex: 1;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.search-result:hover {
  border-color: var(--blue);
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result small {
  margin-top: 4px;
  color: var(--muted);
}

.product-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 12px;
  background: #edf6fd;
  border: 1px solid #bed8ed;
}

.product-card h3 {
  margin: 0 0 16px;
}

.product-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
}

.product-card dl div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.product-card dt {
  color: var(--muted);
  font-size: 0.75rem;
}

.product-card dd {
  margin: 5px 0 0;
  font-weight: 800;
}

.operation-form {
  grid-template-columns: repeat(2, 1fr);
}

.operation-form label:nth-last-of-type(1),
.operation-form button {
  grid-column: 1 / -1;
}

.message {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 10px;
  font-weight: 700;
}

.message.success {
  color: #075d2b;
  background: #dff6e7;
  border: 1px solid #a8e2bb;
}

.message.error {
  color: #8f1b13;
  background: #fde7e4;
  border: 1px solid #f4bbb4;
}

.transaction-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.transaction-item p {
  margin: 0;
}

.transaction-item small {
  color: var(--muted);
}

.transaction-qty {
  font-weight: 800;
}

.transaction-qty.positive {
  color: var(--green);
}

.transaction-qty.negative {
  color: var(--red);
}

#scannerContainer {
  margin: 16px 0;
}

#reader {
  overflow: hidden;
  border-radius: 16px;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 960px);
    padding-top: 14px;
  }

  .app-header,
  .section-heading,
  .search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .user-actions {
    justify-content: space-between;
  }

  .user-actions .button {
  min-width: 96px;
}



  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-row .button {
    width: 100%;
  }

  .product-card dl,
  .operation-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .action-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 18px;
  }
}

.small-text {
  margin-top: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.small-text a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.small-text a:hover {
  text-decoration: underline;
}

.app-title {
  margin: 0;
  color: var(--blue);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .app-title {
    font-size: 1.15rem;
    white-space: normal;
  }

  .user-actions {
  width: auto;
  align-items: flex-end;
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .app-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 24px;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .company-logo {
    width: 100px;
    height: 70px;
  }

  .brand-title {
    padding-top: 0;
    text-align: left;
  }

  .user-actions {
    align-self: flex-end;
    text-align: right;
  }
}


}