/* ===================================================================
   TV LED BAR STOK — styles.css
   Tasarım ilkeleri: beyaz/açık gri zemin, ince border, küçük radius,
   gradyansız, ağır animasyonsuz, yönetim paneli hissi.
=================================================================== */

:root {
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --border: #E3E6EB;
  --border-strong: #CBD2DC;

  --text: #14181F;
  --text-muted: #667085;
  --text-faint: #98A2B3;

  --accent: #0E6B63;
  --accent-hover: #0A544E;
  --accent-soft: #E4F3F1;

  --danger: #DC2626;
  --danger-soft: #FDECEC;
  --warn: #C2740A;
  --warn-soft: #FDF1E0;
  --ok: #17803D;
  --ok-soft: #E7F6EC;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --shadow-modal: 0 12px 32px rgba(20, 24, 31, 0.16);

  --content-max: 1180px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: inherit;
}

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

/* ---------------- Topbar ---------------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-email {
  color: var(--text-muted);
  font-size: 13px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 28px rgba(20, 24, 31, 0.08);
}

.login-card h1 {
  font-size: 23px;
  font-weight: 750;
  margin-bottom: 4px;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 18px;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.local-import,
.loading-state,
.error-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  color: var(--text-muted);
}

.local-import {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.error-state,
.form-error {
  color: var(--danger);
}

.muted-text {
  color: var(--text-faint);
}

.topbar-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------------- Layout ---------------- */

.main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 18px 20px 60px;
}

/* ---------------- Stat cards ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-ok .stat-value { color: var(--ok); }
.stat-warn .stat-value { color: var(--warn); }
.stat-danger .stat-value { color: var(--danger); }

/* ---------------- Search ---------------- */

.search-section { margin-bottom: 12px; }

.search-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  padding: 0 12px;
  transition: border-color .12s ease;
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-icon {
  color: var(--text-faint);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 13px 10px;
  font-size: 15px;
}

.search-clear {
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
}
.search-clear:hover { color: var(--text); }

/* ---------------- Brand filters ---------------- */

.brand-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.brand-filters::-webkit-scrollbar { height: 5px; }
.brand-filters::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.brand-pill {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.brand-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.brand-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------------- Product grid ---------------- */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card-top {
  display: flex;
  gap: 10px;
}

.product-thumb {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.product-info {
  min-width: 0;
  flex: 1;
}

.product-name {
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-escode {
  font-size: 12.5px;
  color: var(--text-muted);
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.product-specs b { color: var(--text); font-weight: 600; }

.product-compat {
  font-size: 12px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}

.stock-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.stock-out { background: var(--danger-soft); color: var(--danger); }
.stock-low { background: var(--warn-soft); color: var(--warn); }
.stock-ok  { background: var(--ok-soft); color: var(--ok); }

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: auto;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ---------------- Buttons ---------------- */

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost {
  background: transparent;
}

.btn-danger-outline {
  color: var(--danger);
  border-color: #F3C6C6;
  background: var(--danger-soft);
}
.btn-danger-outline:hover { border-color: var(--danger); }

.btn-sm {
  padding: 7px 8px;
  font-size: 12.5px;
}

.btn-block { width: 100%; }

/* ---------------- Modal ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 20, 27, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-modal);
  margin: auto;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px 6px;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-subtitle {
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-stock-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---------------- Forms ---------------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field.span-2 { grid-column: span 2; }

.form-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-field .hint {
  font-weight: 400;
  color: var(--text-faint);
}

.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  outline: none;
  background: var(--surface);
  width: 100%;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
}

.form-field textarea { resize: vertical; font-family: inherit; }

.form-error {
  color: var(--danger);
  font-size: 12.5px;
  margin: 6px 0 0;
}

.image-preview {
  width: 112px;
  height: 96px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
}

.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.image-preview-item { position: relative; line-height: 0; }

.image-preview-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 32, 36, .82);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* ---------------- Detay modalı ---------------- */

.detail-top {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}

.detail-image {
  width: 150px;
  height: 150px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, 72px);
  gap: 8px;
  flex: 0 0 152px;
  align-content: start;
}

.detail-image-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.detail-gallery .detail-image { width: 72px; height: 72px; }

.detail-heading h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.detail-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin: 20px 0 8px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.spec-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.spec-table tr:last-child td { border-bottom: none; }
.spec-table td:first-child { color: var(--text-muted); width: 40%; }
.spec-table td:last-child { font-weight: 600; }

.compat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compat-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.movements-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.movements-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 520px;
}

.movements-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.movements-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.movements-table tr:last-child td { border-bottom: none; }

.mv-in { color: var(--ok); font-weight: 600; }
.mv-out { color: var(--danger); font-weight: 600; }

.no-movements {
  padding: 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* ---- Image Viewer ---- */

.image-viewer-container {
  position: relative;
  width: 90vw;
  max-width: 900px;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  user-select: none;
}

.image-viewer-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background .15s ease;
}

.image-viewer-close:hover {
  background: rgba(255,255,255,0.25);
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-field.span-2 { grid-column: span 1; }

  .modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  .modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }

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

  .detail-image {
    width: 100%;
    height: 180px;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .topbar-title { font-size: 16px; }

  .btn { padding: 10px 12px; }
}

/* ---------------- 2026 visual refresh ---------------- */

:root {
  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --border: #dfe5e8;
  --border-strong: #c7d1d6;
  --text: #142024;
  --text-muted: #637176;
  --text-faint: #8d9a9f;
  --accent: #087f72;
  --accent-hover: #05685f;
  --accent-soft: #e3f4f1;
  --indigo: #4056a1;
  --danger: #c73b44;
  --danger-soft: #fbecee;
  --warn: #a96816;
  --warn-soft: #fff3df;
  --ok: #17734a;
  --ok-soft: #e8f6ee;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --shadow-modal: 0 24px 64px rgba(14, 29, 34, 0.18);
  --content-max: 1240px;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  font-size: 14px;
}

body {
  background-image:
    linear-gradient(rgba(255,255,255,.52) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.52) 1px, transparent 1px);
  background-size: 36px 36px;
}

.auth-screen {
  min-height: 100vh;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(8,127,114,.06), transparent 44%),
    #f3f6f7;
}

.auth-shell {
  width: min(880px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(290px, .9fr) minmax(360px, 1.1fr);
  overflow: hidden;
  border: 1px solid rgba(33, 54, 61, .1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(27, 49, 56, .14);
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 38px;
  overflow: hidden;
  color: #fff;
  background: #123b3a;
}

.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-brand::before {
  width: 230px;
  height: 230px;
  right: -96px;
  top: 66px;
  border: 38px solid rgba(117, 211, 194, .12);
  border-radius: 50%;
}

.auth-brand::after {
  inset: auto -30px 65px 58px;
  height: 1px;
  background: rgba(255,255,255,.14);
  box-shadow: 0 15px 0 rgba(255,255,255,.08), 0 30px 0 rgba(255,255,255,.04);
  transform: rotate(-7deg);
}

.brand-lockup,
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 8px 7px;
  border-radius: 8px;
  background: #58c7b4;
}

.brand-mark i {
  display: block;
  width: 4px;
  border-radius: 3px 3px 1px 1px;
  background: #103b39;
}

.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 11px; }

.auth-brand-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
}

.auth-kicker {
  display: block;
  margin-bottom: 14px;
  color: #83d7c8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.auth-brand h1 {
  margin: 0 0 18px;
  font-size: 38px;
  line-height: 1.12;
  font-weight: 750;
  letter-spacing: 0;
}

.auth-brand-copy p {
  max-width: 280px;
  color: rgba(255,255,255,.7);
  font-size: 15px;
  line-height: 1.65;
}

.auth-brand-foot {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,.48);
  font-size: 12px;
}

.login-card {
  width: 100%;
  max-width: none;
  align-self: center;
  padding: 58px 54px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 34px;
}

.login-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 20px;
  font-weight: 700;
}

.login-card h2 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 23px;
  font-weight: 750;
}

.login-card .login-heading p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.login-card .form-field {
  gap: 7px;
  margin-bottom: 18px;
}

.login-card .form-field label {
  color: #35454a;
  font-size: 13px;
  font-weight: 650;
}

.login-card .form-field input {
  min-height: 46px;
  padding: 11px 13px;
  background: #fbfcfc;
}

.login-card .form-field input::placeholder { color: #a2adb1; }

.password-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-toggle {
  min-width: 72px;
  background: var(--surface-subtle);
}

.login-submit {
  min-height: 47px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
}

.login-submit span {
  font-size: 18px;
  transition: transform .15s ease;
}

.login-submit:hover span { transform: translateX(3px); }

.login-support {
  margin: 16px 0 0 !important;
  color: var(--text-faint) !important;
  font-size: 12px;
  text-align: center;
}

.topbar {
  border-bottom: 1px solid rgba(25, 46, 52, .1);
  box-shadow: 0 4px 18px rgba(30, 50, 56, .035);
}

.topbar-inner { min-height: 72px; padding: 12px 24px; }

.brand-mark-sm {
  width: 34px;
  height: 34px;
}

.topbar-title {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar-subtitle {
  display: block;
  margin-top: 1px;
  color: var(--text-faint);
  font-size: 11px;
}

.user-email {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--surface-subtle);
}

.main { padding: 26px 24px 70px; }

.stats { gap: 12px; margin-bottom: 18px; }

.stat-card {
  position: relative;
  min-height: 96px;
  justify-content: center;
  gap: 5px;
  padding: 18px 19px;
  overflow: hidden;
  border-color: rgba(39, 61, 68, .09);
  box-shadow: 0 8px 24px rgba(35, 55, 61, .05);
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(8,127,114,.28);
  box-shadow: 0 12px 28px rgba(35,55,61,.09);
}

.stat-card:focus-visible {
  outline: 3px solid rgba(8,127,114,.2);
  outline-offset: 2px;
}

.stat-card.active {
  border-color: var(--accent);
  background: rgba(8,127,114,.045);
  box-shadow: 0 0 0 2px rgba(8,127,114,.1), 0 12px 28px rgba(35,55,61,.08);
}

.stat-card.stat-ok.active { border-color: var(--ok); background: var(--ok-soft); }
.stat-card.stat-warn.active { border-color: var(--warn); background: var(--warn-soft); }
.stat-card.stat-danger.active { border-color: var(--danger); background: var(--danger-soft); }

.stat-card::after {
  content: "";
  position: absolute;
  top: 17px;
  right: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ba8ac;
  box-shadow: 0 0 0 5px rgba(155,168,172,.13);
}

.stat-ok::after { background: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); }
.stat-warn::after { background: var(--warn); box-shadow: 0 0 0 5px var(--warn-soft); }
.stat-danger::after { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-soft); }

.stat-value { font-size: 27px; }
.stat-label { font-size: 12.5px; }

.search-box {
  min-height: 52px;
  padding: 0 16px;
  border-color: rgba(39, 61, 68, .11);
  box-shadow: 0 7px 22px rgba(35, 55, 61, .045);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8,127,114,.1);
}

.search-icon { font-size: 20px; }

.brand-filters { gap: 7px; margin: 14px 0 20px; }

.brand-pill {
  border-radius: 7px;
  padding: 8px 14px;
  box-shadow: 0 3px 10px rgba(35,55,61,.025);
}

.products-grid {
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
}

.product-card {
  min-height: 238px;
  gap: 13px;
  padding: 16px;
  border-color: rgba(39, 61, 68, .1);
  box-shadow: 0 8px 25px rgba(35, 55, 61, .045);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(8,127,114,.25);
  box-shadow: 0 15px 36px rgba(35, 55, 61, .09);
}

.product-card-top { gap: 13px; }

.product-thumb {
  width: 76px;
  height: 76px;
  border-radius: 7px;
  background: var(--surface-subtle);
}

.product-name { font-size: 15px; font-weight: 700; line-height: 1.4; }
.product-escode { margin-top: 5px; }

.product-specs {
  min-height: 29px;
  align-items: center;
  gap: 5px;
}

.product-specs span {
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--surface-subtle);
}

.stock-badge { border-radius: 6px; padding: 6px 10px; }
.product-actions { gap: 7px; }

.btn {
  min-height: 38px;
  border-radius: 6px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}

.btn-primary { box-shadow: 0 6px 16px rgba(8,127,114,.18); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }

.modal-overlay {
  align-items: center;
  background: rgba(14, 27, 31, .56);
  backdrop-filter: blur(4px);
}

.modal {
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 8px;
}

.modal-header { padding: 18px 22px; }
.modal-body { padding: 22px; }

.modal-close,
.image-viewer-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 6px;
}

.modal-close:hover { background: var(--surface-subtle); }

.form-field input,
.form-field select,
.form-field textarea {
  min-height: 42px;
  border-radius: 6px;
  background: #fbfcfc;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(8,127,114,.1);
}

.spec-table,
.movements-table-wrap { border-radius: 8px; }
.compat-tag { border-radius: 6px; }
.toast { border-radius: 7px; }

@media (max-width: 760px) {
  .auth-screen { padding: 18px; align-items: center; }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-brand {
    min-height: 205px;
    padding: 25px 26px;
  }

  .auth-brand-copy { margin: 28px 0 10px; }
  .auth-kicker { margin-bottom: 8px; }
  .auth-brand h1 { margin-bottom: 10px; font-size: 29px; }
  .auth-brand h1 br { display: block; }
  .auth-brand-copy p { font-size: 13.5px; }
  .auth-brand-foot { display: none; }

  .login-card { padding: 34px 28px 30px; }
  .login-heading { margin-bottom: 26px; }

  .topbar-inner {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .topbar-actions { max-width: 58%; }
  .user-email { display: none; }
  .main { padding: 18px 16px 55px; }

  .modal {
    height: auto;
    max-height: 100vh;
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  .auth-screen { padding: 0; }
  .auth-shell { min-height: 100vh; border: 0; border-radius: 0; }
  .auth-brand { min-height: 190px; border-radius: 0; }
  .login-card { padding: 30px 22px; }

  .topbar-inner { flex-direction: column; }
  .topbar-actions { width: 100%; max-width: none; justify-content: stretch; }
  .topbar-actions .btn { flex: 1; }

  .stats { gap: 8px; }
  .stat-card { min-height: 84px; padding: 14px; }
  .stat-value { font-size: 24px; }
  .products-grid { grid-template-columns: minmax(0, 1fr); }
  .product-actions { grid-template-columns: 1fr 1fr; }
  .product-actions .btn:last-child { grid-column: span 2; }
}
