/* Netecza görünümü. Yazı tavanı 12px. Aralıklar kök 16px üzerinden kalır. */

:root {
  --erp-blue: #1a4a86;
  --erp-blue-deep: #123864;
  --erp-orange: #e06a00;
  --erp-ink: #16324f;
  --erp-line: #e3eaf2;
  --erp-bg: #eef2f6;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.erp-phone,
html.erp-phone body,
html.erp-phone #root {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  touch-action: manipulation;
}

html.erp-phone body input,
html.erp-phone body select,
html.erp-phone body textarea {
  font-size: 16px !important;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  color: var(--erp-ink) !important;
  background: var(--erp-bg) !important;
}

body :where(
  h1, h2, h3, h4, h5, h6,
  p, span, a, button, label, legend,
  input, select, textarea,
  th, td, li, dt, dd, small, strong, em, div
) {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

h1, h2, h3, h4 {
  font-weight: 650 !important;
  letter-spacing: -0.01em;
  color: var(--erp-ink);
}

button,
a,
[role="button"] {
  touch-action: manipulation;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: 40px;
  max-width: 100%;
}

/* Giriş kartları */
main:has(form[aria-labelledby="giris-baslik"]),
main.admin-panel:has(form[aria-labelledby="admin-giris"]) {
  align-items: safe center !important;
  background:
    radial-gradient(68% 46% at 50% -8%, rgba(26, 74, 134, 0.16), transparent 70%),
    linear-gradient(180deg, #f7fafc 0%, #e6eef6 100%) !important;
  padding: 28px 16px !important;
}

form[aria-labelledby="giris-baslik"],
form[aria-labelledby="admin-giris"] {
  position: relative;
  width: min(100%, 380px) !important;
  margin-inline: auto;
  border: 1px solid var(--erp-line) !important;
  border-top: 3px solid var(--erp-orange) !important;
  border-radius: 16px !important;
  background-color: #fff !important;
  background-image: url("/brand/logonetecza.png");
  background-repeat: no-repeat;
  background-position: center 18px;
  background-size: 196px auto;
  box-shadow: 0 16px 40px rgba(22, 50, 79, 0.08);
  padding: 152px 18px 18px !important;
}

form[aria-labelledby="giris-baslik"]::before,
form[aria-labelledby="admin-giris"]::before {
  content: "Netecza";
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

form[aria-labelledby="giris-baslik"] button[type="submit"],
form[aria-labelledby="admin-giris"] button[type="submit"] {
  background: var(--erp-blue) !important;
  color: #fff !important;
  border-radius: 10px !important;
  min-height: 44px;
  width: 100%;
}

form[aria-labelledby="giris-baslik"] button[type="submit"]:hover,
form[aria-labelledby="admin-giris"] button[type="submit"]:hover {
  background: var(--erp-blue-deep) !important;
}

form[aria-labelledby="giris-baslik"] input:focus,
form[aria-labelledby="admin-giris"] input:focus {
  border-color: var(--erp-blue) !important;
  box-shadow: 0 0 0 3px rgba(26, 74, 134, 0.16);
}

@media (max-width: 380px) {
  main:has(form[aria-labelledby="giris-baslik"]),
  main.admin-panel:has(form[aria-labelledby="admin-giris"]) {
    padding: 16px 12px !important;
  }

  form[aria-labelledby="giris-baslik"],
  form[aria-labelledby="admin-giris"] {
    background-size: 164px auto;
    padding: 128px 14px 14px !important;
  }
}

/* Uygulama başlığı */
header.sticky {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 0 !important;
  box-shadow: inset 0 -2px 0 var(--erp-blue), inset 0 -4px 0 var(--erp-orange);
}

header.sticky > div.mx-auto::before {
  content: "";
  flex: 0 0 auto;
  width: 58px;
  height: 34px;
  margin-right: 2px;
  background: url("/brand/logonetecza.png") center / contain no-repeat;
}

.admin-panel header.flex.h-16::before {
  content: "";
  flex: 0 0 auto;
  width: 78px;
  height: 32px;
  background: url("/brand/logonetecza.png") left center / contain no-repeat;
}

.admin-panel aside > div:first-child::before {
  content: "";
  flex: 0 0 auto;
  width: 86px;
  height: 32px;
  background: url("/brand/logonetecza.png") left center / contain no-repeat;
}

.admin-panel aside > div:first-child > svg {
  display: none;
}

.admin-panel header.flex.h-16,
.admin-panel aside > div:first-child {
  border-bottom-color: var(--erp-line) !important;
}

@media (min-width: 640px) {
  header.sticky > div.mx-auto::before {
    width: 86px;
    height: 40px;
  }
}

@media (min-width: 1024px) {
  header.sticky > div.mx-auto::before {
    width: 116px;
    height: 44px;
  }
}

/* Alt menü kapalı: Özet, Ürünler, Sepet, Siparişler, Faturalar şeridi yok */
nav[aria-label="Alt menü"] {
  display: none !important;
}

a.fixed.inset-x-3.bottom-24,
a.fixed.inset-x-3.bottom-14 {
  bottom: calc(0.75rem + env(safe-area-inset-bottom)) !important;
}

@media (max-width: 639px) {
  .min-h-dvh > div.mx-auto > main {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom)) !important;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .min-h-dvh > div.mx-auto > main {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)) !important;
  }
}

/* Dar ekranda taşmayı kes, tablolar kaydırılsın */
body,
#root {
  overflow-x: clip;
}

.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

img,
video {
  max-width: 100%;
  height: auto;
}

@media (max-width: 639px) {
  header.sticky > div.mx-auto {
    gap: 4px !important;
    padding-inline: 6px !important;
  }
}

@media (max-width: 359px) {
  header.sticky > div.mx-auto::before {
    width: 46px;
    height: 28px;
  }
}

.erp-pager {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
}

.erp-pager-label {
  flex: 0 0 auto;
  margin: 0;
  min-width: 4.75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #475569;
  white-space: nowrap;
}

.erp-pager > button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.5rem;
  padding-inline: 0.35rem;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .erp-pager {
    gap: 0.25rem;
  }

  .erp-pager-label,
  .erp-pager > button {
    font-size: 11px !important;
  }
}

.erp-scan-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  background: #0b2a4a;
}

.erp-scan-icon {
  width: 1.85rem;
  height: 1.15rem;
  background: repeating-linear-gradient(
    90deg,
    #fff 0 2px,
    transparent 2px 4px,
    #fff 4px 5px,
    transparent 5px 9px,
    #fff 9px 13px,
    transparent 13px 15px,
    #fff 15px 17px,
    transparent 17px 21px,
    #fff 21px 26px,
    transparent 26px 28px,
    #fff 28px 30px
  );
}

.erp-scan-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: #020617;
  color: #fff;
}

.erp-scan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
}

.erp-scan-lamp {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.erp-scan-lamp svg {
  width: 1.55rem;
  height: 1.55rem;
}

.erp-scan-lamp.is-on {
  background: #f5c451;
  color: #0b2a4a;
}

.erp-scan-close {
  height: 2.5rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 0.7rem;
  background: #fff;
  color: #0b2a4a;
  font-weight: 650;
}

.erp-scan-video {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  background: #000;
}

.erp-scan-frame {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 34%;
  height: 28%;
  border: 3px solid #fff;
  border-radius: 0.75rem;
  box-shadow: 0 0 0 999px rgba(2, 6, 23, 0.35);
  pointer-events: none;
}

.erp-scan-note {
  margin: 0;
  min-height: 0;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  text-align: center;
}

.erp-scan-note:empty {
  display: none;
}

@media (min-width: 640px) {
  .erp-pager {
    gap: 0.5rem;
  }

  .erp-pager-label {
    min-width: 7.5rem;
  }

  .erp-pager > button {
    flex: 0 1 auto;
    min-width: 6.75rem;
    padding-inline: 0.75rem;
  }
}

.erp-sayim-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.erp-sayim-heading {
  min-width: 0;
}

.erp-sayim-product {
  margin-left: auto;
  max-width: 58%;
  text-align: right;
}

.erp-sayim-stock {
  margin-top: 0.2rem;
  color: #0b2a4a;
  font-weight: 700;
}

.erp-sayim-row,
.erp-sayim-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.erp-sayim-barcode {
  min-width: 0;
  flex: 1 1 auto;
  height: 2.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0 0.75rem;
}

.erp-sayim-name {
  font-weight: 650;
  color: #0b2a4a;
}

.erp-sayim-meta,
.erp-sayim-write {
  color: #64748b;
}

.erp-sayim-qty {
  width: 5.5rem;
  flex: 0 0 5.5rem;
  height: 2.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0 0.75rem;
}

.erp-sayim-unit {
  min-width: 0;
  flex: 1 1 auto;
  height: 2.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0 0.5rem;
}

.erp-sayim-save,
.erp-sayim-actions button {
  height: 2.75rem;
  flex: 0 0 auto;
  border-radius: 0.75rem;
  padding: 0 0.9rem;
}

.erp-sayim-save {
  background: #0b2a4a;
  color: #fff;
  font-weight: 600;
}

.erp-sayim-save:disabled {
  opacity: 0.45;
}

.erp-sayim-lines {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0 0.75rem;
}

.erp-sayim-line {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.erp-sayim-line:last-child {
  border-bottom: 0;
}

.erp-sayim-actions {
  flex-wrap: wrap;
}

.erp-sayim-actions input {
  width: 6rem;
  flex: 0 0 6rem;
  height: 2.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0 0.75rem;
}

.erp-sayim-actions button {
  border: 1px solid #cbd5e1;
  background: #fff;
}
