/* public/styles.css */

/* --- base button styles --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 0.5rem; /* ~rounded-lg */
  padding: 0.5rem 1rem;  /* ~px-4 py-2 */

  font-weight: 600;
  line-height: 1.2;

  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  user-select: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- variants --- */
.btn-primary {
  background: #1f2937; /* gray-800 */
  color: #fff;
}
.btn-primary:hover { background: #111827; } /* gray-900 */

.btn-danger {
  background: #ef4444; /* red-500 */
  color: #fff;
}
.btn-danger:hover { background: #dc2626; } /* red-600 */

.btn-success {
  background: #16a34a; /* green-600 */
  color: #fff;
}
.btn-success:hover { background: #15803d; } /* green-700 */

.btn-outline {
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb; /* gray-200 */
}
.btn-outline:hover { background: #f9fafb; } /* gray-50 */

/* --- sizes --- */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
}

.btn-xl {
  padding: 1.25rem 2rem;  /* similar to your big buttons */
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: 1rem; /* rounded-2xl */
  box-shadow: 0 10px 18px rgba(0,0,0,0.12);
}

/* --- shared admin surfaces --- */
:root {
  --admin-ink: #111827;
  --admin-muted: #6b7280;
  --admin-line: #e5e7eb;
  --admin-panel: #ffffff;
  --admin-soft: #f9fafb;
  --admin-accent: #0f766e;
  --admin-warn: #b45309;
  --admin-danger: #b91c1c;
}

.admin-shell {
  width: min(1480px, calc(100vw - 48px));
  margin: 0 auto;
}

.panel {
  background: var(--admin-panel);
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .05);
}

.panel-pad { padding: 18px; }

.admin-sticky-head {
  position: sticky;
  top: 0;
  z-index: 9000;
  background: #f3f4f6;
  padding-bottom: 8px;
}

body.inventory-location-modal-open .admin-sticky-head {
  visibility: hidden;
  pointer-events: none;
}

.admin-top-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.admin-brand-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--admin-ink);
}

.admin-brand-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--admin-muted);
}

.admin-actions {
  margin-left: auto;
  align-items: center;
}

.app-version {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.admin-app-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

.admin-sidebar {
  position: sticky;
  top: var(--workflow-sticky-top, 88px);
  max-height: calc(100vh - var(--workflow-sticky-top, 88px) - 16px);
  overflow: auto;
}

.sidebar-section,
.sidebar-group {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--admin-line);
}

.sidebar-section:last-child,
.sidebar-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.sidebar-section-title,
.sidebar-group > summary {
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sidebar-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 2px 2px 6px;
}

.sidebar-group > summary::-webkit-details-marker {
  display: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--admin-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}

.sidebar-link:hover {
  background: var(--admin-soft);
  text-decoration: none;
}

.sidebar-link.active {
  background: var(--admin-ink);
  color: #fff;
}

.sidebar-overview-link,
.sidebar-overview-link.active {
  background: rgb(29 78 216 / .13);
  color: #0f172a;
  box-shadow: inset 4px 0 0 rgb(37 99 235 / .5), 0 0 0 1px rgb(96 165 250 / .35);
}

.sidebar-overview-link:hover {
  background: rgb(29 78 216 / .18);
  color: #0f172a;
}

.sidebar-sub-link {
  min-height: 32px;
  padding-left: 22px;
  font-size: 13px;
  font-weight: 700;
}

.sidebar-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
}

.sidebar-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #60a5fa;
  flex: 0 0 auto;
}

.sidebar-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 900;
}

.workflow-sticky-row {
  position: sticky;
  top: var(--workflow-sticky-top, 88px);
  z-index: 8990;
}

#detailModal,
#unsavedOverlay,
#statusOverlay,
.modal {
  z-index: 10050 !important;
}

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

.nav-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link,
.seg-btn,
.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--admin-line);
  background: #fff;
  color: var(--admin-ink);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
}

.nav-link:hover,
.seg-btn:hover,
.small-btn:hover {
  text-decoration: none;
  background: var(--admin-soft);
}

.nav-link.active,
.seg-btn.active {
  background: var(--admin-ink);
  color: #fff;
  border-color: var(--admin-ink);
}

.small-btn {
  padding: 7px 10px;
  font-size: 12px;
}

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

.small-btn.dark {
  background: var(--admin-ink);
  border-color: var(--admin-ink);
  color: #fff;
}

.small-btn.warn {
  color: var(--admin-warn);
  border-color: #fed7aa;
  background: #fff7ed;
}

.small-btn.danger {
  color: var(--admin-danger);
  border-color: #fecaca;
  background: #fef2f2;
}

.small-btn.icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
}

.same-row-control {
  height: 38px;
}

.placement-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.placement-summary-row .small-btn {
  min-width: 140px;
}

.raktarozas-modal {
  z-index: 10000;
  align-items: flex-start;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.raktarozas-modal-dialog {
  display: flex;
  flex-direction: column;
  width: min(100%, 1024px);
  max-height: calc(100dvh - 32px);
  margin: auto 0;
  border-radius: 16px;
  overflow: hidden;
}

.raktarozas-modal-dialog-narrow {
  width: min(100%, 896px);
}

.raktarozas-modal-header,
.raktarozas-modal-footer {
  flex: 0 0 auto;
  background: #fff;
}

.raktarozas-modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 700px) {
  .raktarozas-modal {
    padding: 0;
  }

  .raktarozas-modal-dialog,
  .raktarozas-modal-dialog-narrow {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .raktarozas-modal-header,
  .raktarozas-modal-body,
  .raktarozas-modal-footer {
    padding: 14px;
  }
}

.small-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* --- reusable admin form, table, modal, and summary primitives --- */
.field-label {
  display: block;
  margin-bottom: 4px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
}

.field-tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.field-tag.required {
  background: #fef3c7;
  color: #92400e;
}

.field-tag.optional {
  background: #f3f4f6;
  color: #6b7280;
}

.field-tag.auto {
  background: #e0f2fe;
  color: #075985;
}

.form-control {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  outline: none;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.form-control:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 2px rgb(15 118 110 / .22);
}

.form-control.large {
  border-radius: 12px;
  padding: 12px 16px;
}

.form-control.soft {
  background: var(--admin-soft);
}

.form-control.soft:focus {
  background: #fff;
}

.form-control.readonly,
.form-control:read-only:not(select) {
  background: #f3f4f6;
  color: #374151;
}

.form-control.compact {
  padding: 8px 12px;
}

.form-control.search-wide {
  min-width: 280px;
}

.password-dialog {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgb(15 23 42 / .58);
  backdrop-filter: blur(2px);
}

.password-dialog.hidden { display: none; }

.password-dialog-panel {
  width: min(100%, 420px);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 24px 65px rgb(15 23 42 / .3);
}

.password-dialog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #0f172a;
}

.password-dialog-error {
  margin-top: 10px;
  border-radius: 8px;
  background: #fef2f2;
  padding: 9px 11px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
}

.password-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* Worker profile notebook */
.worker-notebook {
  overflow: hidden;
}

.worker-notebook-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.worker-notebook-actions,
.worker-notebook-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.worker-notebook-toolbar {
  padding: 14px 22px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.worker-notebook-status {
  min-width: 72px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.worker-notebook-status[data-tone="saved"] { color: #047857; }
.worker-notebook-status[data-tone="pending"] { color: #a16207; }
.worker-notebook-status[data-tone="error"] { color: #b91c1c; }

.worker-notebook-list {
  display: grid;
  gap: 0;
  padding: 0 22px 22px;
}

.worker-notebook-empty {
  margin: 22px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 24px;
  color: #64748b;
  text-align: center;
}

.worker-notebook-empty.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.worker-note-block {
  padding: 18px 0;
  border-bottom: 1px solid #e2e8f0;
}

.worker-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.worker-note-type {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.worker-note-delete,
.worker-checklist-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 21px;
  line-height: 1;
}

.worker-note-delete:hover,
.worker-checklist-delete:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.worker-note-text {
  width: 100%;
  min-height: 112px;
  resize: none;
  border: 0;
  border-radius: 0;
  outline: none;
  padding: 8px 10px;
  color: #1e293b;
  font: inherit;
  line-height: 28px;
  background-color: #fff;
  background-image: linear-gradient(to bottom, transparent 27px, #e2e8f0 28px);
  background-size: 100% 28px;
}

.worker-note-text:focus {
  background-color: #f8fafc;
}

.worker-checklist-title {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
}

.worker-checklist-items {
  display: grid;
  gap: 4px;
}

.worker-checklist-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  border-bottom: 1px solid #f1f5f9;
}

.worker-checklist-row > input[type="checkbox"] {
  width: 21px;
  height: 21px;
  accent-color: #0f766e;
}

.worker-checklist-row > input[type="text"] {
  width: 100%;
  border: 0;
  outline: none;
  padding: 10px 2px;
  background: transparent;
  color: #1e293b;
  font-size: 16px;
}

.worker-checklist-row.completed > input[type="text"] {
  color: #94a3b8;
  text-decoration: line-through;
}

.worker-checklist-add {
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: #0f766e;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 640px) {
  .worker-page { padding: 12px; }
  .worker-notebook-header { display: grid; padding: 17px 16px 14px; }
  .worker-notebook-actions { justify-content: space-between; }
  .worker-notebook-status { text-align: left; }
  .worker-notebook-toolbar { padding: 12px 16px; }
  .worker-notebook-toolbar .small-btn { min-height: 44px; flex: 1; }
  .worker-notebook-list { padding: 0 16px 16px; }
  .worker-notebook-empty { margin: 16px; }
  .worker-note-delete, .worker-checklist-delete { width: 42px; height: 42px; }
}

.stat-card {
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: var(--admin-soft);
  padding: 16px;
}

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

.stat-value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
}

.data-table {
  width: 100%;
  font-size: 14px;
}

.data-table thead {
  background: var(--admin-soft);
  color: #4b5563;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  font-weight: 700;
}

.data-table td {
  padding: 12px 16px;
}

.table-cell-nowrap {
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / .5);
  padding: 16px;
  z-index: 10050;
}

.modal-backdrop.flex {
  display: flex;
}

.modal-panel {
  width: 100%;
  max-width: 768px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
}

.modal-panel.wide {
  max-width: 1280px;
}

.tetel-create-modal-panel {
  width: min(90vw, 1152px);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}

.tetel-create-modal-panel > form {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.tetel-create-modal-panel .modal-scroll-body {
  max-height: none;
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--admin-line);
  padding: 20px;
}

.modal-body {
  padding: 20px;
}

.modal-scroll-body {
  max-height: 85vh;
  overflow: auto;
}

.inventory-location-modal {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
}

.inventory-location-modal > .modal-header {
  flex: 0 0 auto;
}

.inventory-location-modal-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.warehouse-add-modal { max-width: 520px; }

.warehouse-add-action,
.warehouse-add-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.inventory-delete-btn,
.inventory-delete-confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 800;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.inventory-delete-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.inventory-delete-confirm { padding: 9px 14px; }
.inventory-delete-btn:hover,
.inventory-delete-confirm:hover { background: #fee2e2; border-color: #fca5a5; }
.inventory-delete-btn:active,
.inventory-delete-confirm:active { transform: scale(.97); }
.inventory-delete-btn:disabled,
.inventory-delete-confirm:disabled { cursor: not-allowed; opacity: .5; }
.inventory-delete-btn.hidden { display: none; }

.status-card {
  width: 100%;
  max-width: 384px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-radius: 16px;
  background: #fff;
  padding: 32px 40px;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
}

.status-icon-wrap {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f3f4f6;
}

.language-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 76px;
  min-width: 76px;
  height: 34px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  padding: 3px 8px;
  box-shadow: inset 0 0 0 1px rgb(17 24 39 / .03);
}

.language-toggle .flag {
  position: relative;
  font-size: 17px;
  line-height: 1;
  opacity: .55;
  z-index: 2;
}

.language-toggle .lang-knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 34px;
  height: 28px;
  border-radius: 999px;
  background: var(--admin-ink);
  transition: transform 160ms ease;
  z-index: 1;
  box-shadow: 0 1px 4px rgb(0 0 0 / .22);
}

.language-toggle[data-lang="en"] .lang-knob {
  transform: translateX(36px);
}

.language-toggle[data-lang="hu"] .flag-hu,
.language-toggle[data-lang="en"] .flag-en {
  opacity: 1;
  filter: saturate(1.2);
}

.muted { color: var(--admin-muted); }

.surface-title {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.raktarozas-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--admin-line);
  padding-top: 16px;
}

.inventory-embedded {
  min-width: 0;
}

.inventory-embedded-toolbar,
.inventory-embedded-filters {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.inventory-search-label {
  width: min(100%, 360px);
}

.inventory-embedded-filters {
  align-items: center;
  margin-top: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--admin-line);
  border-bottom: 1px solid var(--admin-line);
}

.inventory-area-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.inventory-area-section {
  width: 100%;
  padding: 18px;
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgb(15 23 42 / .05);
}

.inventory-location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.inventory-area-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inventory-location-card {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.inventory-location-card:hover,
.inventory-location-card:focus-visible {
  border-color: #0f766e;
  box-shadow: 0 8px 20px rgb(15 118 110 / .12);
  transform: translateY(-1px);
}

.inventory-location-card.reserved { background: #fffbeb; border-color: #f5c542; }
.inventory-location-card.reserved-full { background: #ffedd5; border-color: #f97316; }

.inventory-admin-location {
  overflow: hidden;
}

.inventory-admin-location-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.inventory-admin-location-summary::-webkit-details-marker { display: none; }

.inventory-admin-location-summary:hover,
.inventory-admin-location-summary:focus-visible {
  background: rgb(15 118 110 / .05);
  outline: none;
}

.inventory-admin-location-chevron {
  color: #64748b;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  transition: transform 160ms ease;
}

.inventory-admin-location[open] .inventory-admin-location-chevron {
  transform: rotate(180deg);
}

.inventory-admin-location-body {
  border-top: 1px solid rgb(148 163 184 / .3);
  padding: 0 14px 14px;
}

.inventory-embedded-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgb(15 23 42 / .52);
}

.inventory-embedded-dialog {
  width: min(100%, 900px);
  max-height: min(92vh, 860px);
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgb(15 23 42 / .28);
}

.inventory-embedded-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--admin-line);
}

.inventory-embedded-dialog-body { padding: 18px; }

.inventory-detail-row {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: #fff;
}

.inventory-detail-row.reserved { background: #fffbeb; border-color: #f5c542; }
.inventory-qty-input { text-align: right; }

.inventory-row-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.inventory-row-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.inventory-qty-display {
  min-width: 108px;
  padding: 8px 10px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #f8fafc;
  text-align: right;
  font-weight: 800;
}

.inventory-edit-form {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--admin-line);
}

.inventory-edit-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 1px;
}

.inventory-edit-error {
  grid-column: 1 / -1;
  color: var(--admin-danger);
  font-size: 13px;
}

.inventory-add-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}

@media (max-width: 700px) {
  .admin-sticky-head {
    /* Phones already provide a persistent back gesture/button; let the banner scroll naturally. */
    position: static;
    top: auto;
    z-index: auto;
    margin-top: -12px;
    padding-top: 12px;
    padding-bottom: 0;
  }
  .admin-top-panel {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }
  .admin-brand {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }
  .admin-brand .nav-link {
    width: max-content;
    max-width: 100%;
    white-space: normal;
    justify-content: flex-start;
  }
  .admin-brand-title { font-size: 17px; }
  .admin-brand-subtitle { line-height: 1.35; }
  .admin-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    align-items: center;
  }
  .admin-actions .small-btn,
  .admin-actions .nav-link,
  .admin-actions .seg-btn { width: auto; }
  .admin-shell { width: calc(100vw - 24px); }
  .admin-app-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; max-height: none; }
  .panel-pad { padding: 14px; }
  .nav-link, .seg-btn, .small-btn { width: 100%; }
  body:has(.inventory-embedded) { padding: 12px; }
  .raktarozas-tabs .small-btn { width: auto; flex: 1 1 180px; }
  .inventory-embedded-toolbar { align-items: stretch; }
  .inventory-search-label { width: 100%; }
  .inventory-area-section { padding: 12px; }
  .inventory-location-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .inventory-location-card { min-height: 78px; padding: 11px; }
  .inventory-row-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .inventory-row-meta { min-width: 96px; }
  .inventory-qty-display { min-width: 96px; }
  .inventory-edit-form { grid-template-columns: 1fr; }
  .inventory-edit-actions { justify-content: flex-end; }
  .inventory-edit-actions .small-btn { width: auto; }
  .warehouse-add-action,
  .warehouse-add-save { width: auto; }
  .inventory-embedded-dialog { max-height: 96vh; border-radius: 12px; }
  .inventory-embedded-dialog-head, .inventory-embedded-dialog-body { padding: 14px; }
}
