:root {
  --sok-green: #0f5132;
  --sok-green-600: #14653f;
  --sok-green-100: #e7f3ec;
  --sok-ink: #16202b;
  --sok-muted: #64707d;
  --sok-line: #e3e7ec;
  --sok-surface: #ffffff;
  --sok-canvas: #f4f6f8;
  --sok-radius: 12px;
  --sok-shadow: 0 1px 2px rgba(16, 32, 43, .04), 0 8px 24px rgba(16, 32, 43, .06);
}

html {
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sok-canvas);
  color: var(--sok-ink);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--sok-green-600);
}

/* ---------- Header ---------- */

.app-header {
  background: var(--sok-surface);
  border-bottom: 1px solid var(--sok-line);
}

.app-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: 62px;
  padding-top: .5rem;
  padding-bottom: .5rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.05rem;
  color: var(--sok-ink);
  text-decoration: none;
  white-space: nowrap;
}

.app-brand:hover {
  color: var(--sok-green);
}

.app-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--sok-green);
  color: #fff;
  flex: 0 0 auto;
}

.app-brand__text strong {
  font-weight: 700;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-inline-end: auto;
  flex-wrap: wrap;
}

.app-nav__link {
  padding: .45rem .75rem;
  border-radius: 8px;
  color: var(--sok-muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.app-nav__link:hover {
  background: var(--sok-green-100);
  color: var(--sok-green);
}

.app-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-inline-start: auto;
}

.app-user__badge {
  padding: .3rem .7rem;
  border-radius: 999px;
  background: var(--sok-green-100);
  color: var(--sok-green);
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Layout ---------- */

.app-main {
  flex: 1 0 auto;
  padding: 1.5rem 0 2.5rem;
}

.app-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--sok-line);
  background: var(--sok-surface);
  color: var(--sok-muted);
  font-size: .85rem;
  padding: 1rem 0;
}

/* ---------- Giris ekrani ---------- */

.auth-shell {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: clamp(1rem, 6vh, 4rem);
}

.auth-card {
  width: 100%;
  max-width: 390px;
  background: var(--sok-surface);
  border: 1px solid var(--sok-line);
  border-radius: var(--sok-radius);
  box-shadow: var(--sok-shadow);
  padding: 1.75rem;
}

.auth-card h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.auth-card__hint {
  color: var(--sok-muted);
  font-size: .9rem;
  margin-bottom: 1.25rem;
}

/* ---------- Panellər ---------- */

.soft-panel,
.product-panel {
  background: var(--sok-surface);
  border: 1px solid var(--sok-line);
  border-radius: var(--sok-radius);
  box-shadow: var(--sok-shadow);
  padding: 1.15rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-head h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.page-head .text-muted {
  font-size: .9rem;
}

/* ---------- Cədvəl ---------- */

.table-card {
  background: var(--sok-surface);
  border: 1px solid var(--sok-line);
  border-radius: var(--sok-radius);
  box-shadow: var(--sok-shadow);
  overflow: hidden;
}

.table-card .table {
  margin: 0;
}

.table-card .table > thead th {
  background: #fafbfc;
  border-bottom: 1px solid var(--sok-line);
  color: var(--sok-muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table-card .table > tbody td {
  vertical-align: middle;
  border-color: #eef1f4;
}

/* ---------- Sayım ekranı ---------- */

.mobile-count-shell {
  max-width: 560px;
  margin: 0 auto;
}

.scanner-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--sok-radius);
  background: #0d1420;
  aspect-ratio: 4 / 3;
  border: 1px solid #c9d0d9;
}

.scanner-panel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanner-line {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 2px;
  background: #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, .8);
}

/* Barkodu bu cercivenin icine tutmaq oxuma suretini artirir */
.scanner-frame {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 28%;
  bottom: 28%;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .28);
  pointer-events: none;
}

.scanner-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: .55rem .75rem;
  background: rgba(13, 20, 32, .82);
  color: #fff;
  font-size: .85rem;
  text-align: center;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  color: var(--sok-muted);
  font-size: .92rem;
}

.product-meta strong {
  color: var(--sok-ink);
}

.recent-list {
  display: grid;
  gap: .5rem;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem .9rem;
  border: 1px solid var(--sok-line);
  border-radius: 10px;
  background: var(--sok-surface);
}

/* ---------- Ümumi ---------- */

.btn {
  border-radius: 9px;
  font-weight: 500;
}

.btn-primary {
  --bs-btn-bg: var(--sok-green);
  --bs-btn-border-color: var(--sok-green);
  --bs-btn-hover-bg: var(--sok-green-600);
  --bs-btn-hover-border-color: var(--sok-green-600);
  --bs-btn-active-bg: var(--sok-green-600);
  --bs-btn-active-border-color: var(--sok-green-600);
  --bs-btn-disabled-bg: var(--sok-green);
  --bs-btn-disabled-border-color: var(--sok-green);
}

.btn-outline-primary {
  --bs-btn-color: var(--sok-green);
  --bs-btn-border-color: var(--sok-green);
  --bs-btn-hover-bg: var(--sok-green);
  --bs-btn-hover-border-color: var(--sok-green);
  --bs-btn-active-bg: var(--sok-green);
  --bs-btn-active-border-color: var(--sok-green);
}

.form-control:focus,
.form-select:focus {
  border-color: #8fc0a6;
  box-shadow: 0 0 0 .2rem rgba(15, 81, 50, .14);
}

.badge {
  font-weight: 600;
  letter-spacing: .01em;
}

.alert {
  border-radius: var(--sok-radius);
  border-width: 1px;
}

/* ---------- Telefon ---------- */

@media (max-width: 575.98px) {
  .app-header__inner {
    gap: .5rem;
  }

  .app-nav {
    order: 3;
    width: 100%;
    margin-inline-end: 0;
  }

  .app-nav__link {
    padding: .4rem .6rem;
  }

  .app-main {
    padding: 1rem 0 1.75rem;
  }

  .mobile-count-shell .btn-lg,
  .mobile-count-shell .form-control-lg,
  .mobile-count-shell .form-select-lg,
  .mobile-count-shell .input-group-lg > .btn,
  .mobile-count-shell .input-group-lg > .form-control,
  .mobile-count-shell .input-group-lg > .input-group-text {
    min-height: 3.25rem;
  }
}

/* ---------- Sayım göstəriciləri: anbar / sayılan / fərq ---------- */

.count-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.count-stat {
  border: 1px solid var(--sok-line);
  border-radius: 10px;
  background: #fafbfc;
  padding: .6rem .5rem;
  text-align: center;
}

.count-stat__label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--sok-muted);
  white-space: nowrap;
}

.count-stat__value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: .15rem;
}

/* Fərq sıfır deyilsə diqqət çəksin */
.count-stat--off {
  border-color: #f1b0b7;
  background: #fdf0f1;
}

.count-stat--off .count-stat__value {
  color: #b02a37;
}

.count-stat--ok {
  border-color: #a7d7bb;
  background: #eef8f2;
}

.count-stat--ok .count-stat__value {
  color: var(--sok-green);
}

/* Uzaqdakı barkod üçün zum slayderi */
.zoom-wrap {
  margin-top: .6rem;
}

.zoom-wrap .form-label {
  font-size: .8rem;
  color: var(--sok-muted);
}

/* ---------- SweetAlert2 (tətbiqin görünüşünə uyğunlaşdırılıb) ---------- */

.sok-swal {
  border-radius: var(--sok-radius) !important;
  font-family: inherit;
}

.sok-swal .swal2-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sok-ink);
}

.sok-swal .swal2-html-container {
  font-size: .95rem;
  color: var(--sok-muted);
}

.sok-swal .swal2-actions {
  gap: .5rem;
}

.sok-swal .swal2-actions .btn {
  min-width: 7rem;
}
