:root {
  --bg-1: #fff2f0;
  --bg-2: #ffe6df;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(127, 29, 29, 0.16);
  --text: #2f1010;
  --muted: #8b5b5b;
  --accent: #b91c1c;
  --accent-2: #f97316;
  --sidebar: linear-gradient(180deg, #ffffff, #fffdfd);
  --danger: #dc2626;
  --warn: #f59e0b;
  --ok: #22c55e;
  --radius: 18px;
  --shadow: 0 16px 40px rgba(127, 29, 29, 0.13);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body.booting #authView,
body.booting #appView {
  visibility: hidden;
}

body {
  font-family: Montserrat, sans-serif;
  color: var(--text);
  background: linear-gradient(130deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

.test-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 180;
  min-height: 34px;
  padding: 7px 0;
  background: linear-gradient(90deg, #7f1d1d, #b91c1c 55%, #dc2626);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  overflow: hidden;
}

.test-banner-marquee {
  white-space: nowrap;
}

.test-banner-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  width: max-content;
  animation: testTicker 15s linear infinite;
}

.test-banner-icon {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
}

.test-banner-icon svg {
  width: 15px;
  height: 15px;
  fill: #fff;
}

@keyframes testTicker {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}

body.ui-lock {
  overflow: hidden;
  touch-action: none;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 16% 14%, rgba(248, 113, 113, 0.2), transparent 36%),
    radial-gradient(circle at 84% 12%, rgba(249, 115, 22, 0.22), transparent 35%),
    radial-gradient(circle at 54% 92%, rgba(239, 68, 68, 0.16), transparent 38%);
  pointer-events: none;
}

.hidden { display: none !important; }
.small { font-size: 0.84rem; }
.muted { color: var(--muted); }

.glass-card {
  background: var(--card);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.fade-in { animation: fadeInUp 380ms ease; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h1, h2, h3 { margin: 0; font-family: inherit; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 54px 22px 22px;
}

.auth-card {
  width: min(500px, 100%);
  padding: 28px;
}

.auth-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.8rem;
  background: linear-gradient(120deg, #fff5f5, #ffe9df);
  color: #991b1b;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: 999px;
  margin-bottom: 12px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(130deg, #b91c1c, #f97316);
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(185, 28, 28, 0.22);
}

.brand-mark img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(100);
}

.brand-text {
  white-space: nowrap;
}

.field { display: grid; gap: 7px; }
.field span { font-size: 0.86rem; color: #7f1d1d; }
input, select, textarea, button {
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.95rem;
}
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(220, 38, 38, 0.62);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.17);
}

.password-wrap {
  position: relative;
}

.password-input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  cursor: pointer;
}

.password-toggle::before {
  content: "";
  width: 17px;
  height: 17px;
  display: block;
  margin: 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23991b1b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.password-toggle.is-visible::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23991b1b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.58 10.58A2 2 0 0 0 12 14a2 2 0 0 0 1.42-.58'/%3E%3Cpath d='M9.88 5.09A10.94 10.94 0 0 1 12 5c6.5 0 10 7 10 7a17.62 17.62 0 0 1-3.1 4.19'/%3E%3Cpath d='M6.61 6.61A17.63 17.63 0 0 0 2 12s3.5 7 10 7a10.94 10.94 0 0 0 4.09-.88'/%3E%3C/svg%3E");
}

.stack-12 { display: grid; gap: 12px; }
.stack-8 { display: grid; gap: 8px; }

.manager-only-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: #7f1d1d;
}
.remember-row input { width: 18px; height: 18px; }

.btn {
  cursor: pointer;
  padding: 11px 14px;
  border-radius: 12px;
  min-height: 46px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  border: 0;
  color: white;
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.24);
}

.btn-light {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: #7f1d1d;
}

.btn-icon { font-size: 1rem; line-height: 1; }

.btn-icon svg,
.menu-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.helper { min-height: 18px; font-size: 0.86rem; color: var(--danger); }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
  padding-top: 34px;
}

.sidebar {
  padding: 20px;
  background: var(--sidebar);
  color: #2f1010;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  gap: 14px;
  border-right: 1px solid rgba(127, 29, 29, 0.14);
  overflow-y: auto;
}

.sidebar-top {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: start;
}

.sidebar-top > div {
  display: grid;
  align-content: start;
  gap: 4px;
}

#profileName,
#profileRole,
#profileStore {
  margin: 0;
  line-height: 1.2;
}

.logo-wrap {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.sidebar-muted { color: #8b5b5b; }

.date-chip {
  border: 1px solid rgba(127, 29, 29, 0.2);
  background: #fff;
  color: #5f2a2a;
  padding: 10px 11px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  min-height: 46px;
  font-size: 0.96rem;
  line-height: 1.25;
}

.menu { display: grid; gap: 10px; align-content: start; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(127, 29, 29, 0.16);
  background: #fff;
  color: #6e3030;
  text-align: left;
  padding: 12px 13px;
  border-radius: 14px;
  cursor: pointer;
  min-height: 50px;
  transform: scale(1);
  transition: transform 200ms ease, background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.menu-item:hover {
  background: #fff;
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.46);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(185, 28, 28, 0.12);
}
.menu-item.active {
  background: #fff;
  color: #991b1b;
  border-color: rgba(185, 28, 28, 0.56);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(185, 28, 28, 0.12);
}
.menu-icon { width: 22px; display: inline-grid; place-items: center; }
.menu-item:hover .menu-icon svg,
.menu-item.active .menu-icon svg {
  transform: scale(1.08);
}

.sidebar-actions { display: grid; gap: 8px; }

.sidebar-actions .btn {
  min-height: 50px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(127, 29, 29, 0.16);
  color: #6e3030;
  box-shadow: none;
}

.sidebar-actions .btn:hover,
.sidebar-actions .btn:focus-visible {
  border-color: rgba(185, 28, 28, 0.5);
  color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.12);
}

.sidebar-actions .btn:active {
  transform: translateY(0);
}

.sidebar-actions .btn .btn-icon svg {
  transition: transform 180ms ease;
}

.sidebar-actions .btn:hover .btn-icon svg,
.sidebar-actions .btn:focus-visible .btn-icon svg {
  transform: scale(1.1);
}

.sidebar-backdrop {
  display: none;
}

.mobile-dock,
.mobile-more-sheet {
  display: none;
}

.mobile-dock {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 130;
  border: 1px solid rgba(127, 29, 29, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(43, 12, 12, 0.2);
  padding: 6px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 6px;
}

.mobile-dock-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  min-height: 56px;
  font-size: 0.64rem;
  font-weight: 700;
  color: #5f2e2e;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  line-height: 1.05;
  padding: 5px 2px;
  min-width: 0;
}

.mobile-dock-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.mobile-dock-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.mobile-dock-label {
  display: block;
  text-align: center;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  width: 100%;
  line-height: 1.1;
  max-height: 2.2em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: normal;
  word-break: normal;
}

.mobile-dock-btn[data-mobile-page] {
  grid-template-rows: 18px 2.2em;
  align-content: start;
  gap: 4px;
  padding-top: 6px;
}

.mobile-dock-btn[data-mobile-page] .mobile-dock-icon,
.mobile-dock-btn[data-mobile-page] .mobile-dock-label {
  align-self: start;
}

.mobile-dock-btn.active {
  border-color: transparent;
  color: #b91c1c;
  background: transparent;
  box-shadow: none;
}

.mobile-dock-more {
  min-width: 44px;
}

.mobile-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 135;
}

.mobile-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.mobile-more-card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  border-radius: 16px;
  padding: 10px;
}

.mobile-more-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mobile-more-list {
  display: grid;
  gap: 6px;
}

.mobile-more-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  min-height: 42px;
  text-align: left;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mobile-more-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: #6e3030;
}

.mobile-more-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.mobile-more-label {
  min-width: 0;
}

.mobile-more-logout {
  margin-top: 8px;
  min-height: 56px;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.scroll-top-btn {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 136;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(127, 29, 29, 0.35);
  background: #111;
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.scroll-top-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.main {
  padding: 22px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  position: relative;
  z-index: 60;
  overflow: visible;
}

.title-wrap p { margin: 4px 0 0; }
.toolbar { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.lang-wrap, .lang-float {
  position: relative;
  z-index: 80;
}

.notif-wrap {
  position: relative;
  z-index: 85;
}

.notif-btn {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(127, 29, 29, 0.2);
  cursor: pointer;
  position: relative;
  color: #7f1d1d;
}

.notif-btn svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.notif-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
}

.notif-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 86vw);
  background: #fff;
  border: 1px solid rgba(127, 29, 29, 0.15);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(127, 29, 29, 0.18);
  overflow: hidden;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid rgba(127, 29, 29, 0.12);
}

.notif-read-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #7f1d1d;
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 0.78rem;
  cursor: pointer;
}

.notif-list {
  max-height: 340px;
  overflow: auto;
  display: grid;
}

.notif-item {
  padding: 10px;
  border-bottom: 1px solid rgba(127, 29, 29, 0.1);
  display: grid;
  gap: 4px;
}

.notif-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.notif-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notif-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(127, 29, 29, 0.28);
  background: #fff;
  color: #7f1d1d;
  display: inline-grid;
  place-items: center;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.notif-mark svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.notif-mark.delete {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
}

.notif-mark.delete:hover {
  background: rgba(185, 28, 28, 0.1);
}

.notif-mark.done {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.45);
  cursor: default;
}

.notif-item:last-child {
  border-bottom: 0;
}

.notif-item.unread {
  background: #fff7f7;
}

.notif-time {
  font-size: 0.78rem;
  color: var(--muted);
}

.notif-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.notif-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(127, 29, 29, 0.12);
}

.notif-pager-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #7f1d1d;
  border-radius: 8px;
  min-width: 28px;
  height: 28px;
  cursor: pointer;
}

.notif-pager-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.notif-page-info {
  font-size: 0.82rem;
  color: var(--muted);
}

.lang-btn {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(127, 29, 29, 0.2);
  cursor: pointer;
}
.lang-btn img {
  width: 30px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: #fff;
  border: 1px solid rgba(127, 29, 29, 0.15);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 40px rgba(127, 29, 29, 0.18);
  z-index: 120;
}

.lang-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}
.lang-item:hover,
.lang-item.active { background: #fef2f2; }
.lang-item img {
  width: 28px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
}
.lang-meta { display: grid; line-height: 1.1; }
.lang-code { font-size: 0.88rem; color: #991b1b; font-weight: 800; }

.toolbar-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7f1d1d;
  min-height: 48px;
}
.toolbar-btn-import { min-height: 48px; }

.filters-head {
  padding: 0;
  border-radius: 0;
  background: transparent;
  margin-bottom: 14px;
}

.filters {
  padding: 12px;
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr) auto;
  gap: 8px;
}

.filters input,
.filters select {
  background: rgba(255, 255, 255, 0.98);
}

.table-card { position: relative; overflow: hidden; }
.table-wrap { overflow: auto; max-width: 100%; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}
thead tr { background: rgba(127, 29, 29, 0.07); }
th, td {
  padding: 10px 9px;
  border-bottom: 1px solid rgba(127, 29, 29, 0.12);
  text-align: center;
  font-size: 0.86rem;
  line-height: 1.35;
  vertical-align: middle;
}
tbody tr { transition: background-color 180ms ease; }
tbody tr:hover { background: rgba(255, 251, 251, 0.9); }

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.77rem;
  font-weight: 700;
}
.green { background: rgba(34, 197, 94, 0.15); color: #166534; }
.yellow { background: rgba(245, 158, 11, 0.18); color: #92400e; }
.red { background: rgba(239, 68, 68, 0.16); color: #991b1b; }

.action-btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 5px 7px;
  border-radius: 10px;
  cursor: pointer;
  margin-right: 0;
  color: #991b1b;
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
}

.action-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.action-pack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cell-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
  line-height: 1.35;
}

.cell-comment {
  max-width: 280px;
}

.cell-store,
.cell-manager {
  max-width: 150px;
}

.table-footer {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#pagination { display: flex; gap: 6px; }
.page-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
}
.page-btn.active {
  background: #b91c1c;
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.loading.show { opacity: 1; }

.settings-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.settings-subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  grid-column: 1 / -1;
}

.settings-subtabs .btn {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hr-layout {
  display: grid;
  gap: 12px;
}

.hr-hero h3,
.hr-hero p {
  margin: 0;
}

.hr-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hr-kpi-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.hr-kpi-card small {
  color: var(--muted);
  font-size: 0.8rem;
}

.hr-kpi-card strong {
  color: #6d1717;
  font-size: 1.3rem;
}

.hr-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hr-attendance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 12px;
}

.hr-chart-card,
.hr-donut-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.hr-chart-card h4,
.hr-donut-card h4 {
  margin: 0 0 10px;
}

.hr-chart-area {
  min-height: 170px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.hr-bar-col {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.hr-bar-col small {
  font-size: 0.72rem;
  color: var(--muted);
}

.hr-bar-stack {
  width: 100%;
  min-height: 132px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-items: end;
}

.hr-bar-stack span {
  display: block;
  width: 100%;
  border-radius: 8px 8px 3px 3px;
}

.hr-bar-on {
  background: linear-gradient(180deg, #10b981, #059669);
}

.hr-bar-late {
  background: linear-gradient(180deg, #f97316, #dc2626);
}

.hr-donut-wrap {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.hr-ring {
  --on: 50;
  --late: 50;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(#059669 0 calc(var(--on) * 1%), #dc2626 calc(var(--on) * 1%) 100%);
  position: relative;
}

.hr-ring::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(127, 29, 29, 0.1);
}

.hr-ring-legend {
  display: grid;
  gap: 6px;
}

.hr-ring-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.hr-ring-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.hr-ring-legend i.on { background: #059669; }
.hr-ring-legend i.late { background: #dc2626; }

.hr-two-col h4,
.hr-head-row h4 {
  margin: 0 0 8px;
}

.hr-list {
  display: grid;
  gap: 8px;
}

.hr-metric-row {
  display: grid;
  gap: 4px;
}

.hr-metric-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
}

.hr-metric-title em {
  font-style: normal;
  color: #7f1d1d;
  white-space: nowrap;
}

.hr-metric-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.12);
  overflow: hidden;
}

.hr-metric-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dc2626, #f97316);
}

.hr-metric-track-late span {
  background: linear-gradient(90deg, #fb7185, #dc2626);
}

.hr-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.settings-subtabs .btn.active {
  background: linear-gradient(90deg, #c81e1e, #f97316);
  color: #fff;
  border-color: transparent;
}

.settings-subpage {
  display: contents;
}

.warehouse-layout {
  display: grid;
  grid-template-columns: 1fr;
}

.warehouse-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.warehouse-tab {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 24px 18px;
  min-height: 190px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
  color: #6e3030;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease, color 200ms ease;
}

.warehouse-tab strong {
  display: block;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.warehouse-tab small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
  font-size: 1rem;
  max-width: 42ch;
}

.warehouse-tab .menu-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(185, 28, 28, 0.08);
}

.warehouse-tab .menu-icon svg {
  width: 36px;
  height: 36px;
}

.warehouse-tab.active {
  border-color: rgba(185, 28, 28, 0.4);
  color: #b91c1c;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(185, 28, 28, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .warehouse-tab:hover {
    border-color: rgba(185, 28, 28, 0.4);
    color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(185, 28, 28, 0.12);
  }
}

.warehouse-back-wrap {
  display: flex;
  justify-content: flex-start;
  padding: 4px 2px 0;
}

.warehouse-section {
  display: grid;
  gap: 10px;
}

.section-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 0 6px;
}

.section-head-row h3 {
  margin: 0;
}

.section-head-row .btn {
  margin-left: auto;
}

.warehouse-head-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.stock-head-actions {
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.stock-head-actions .warehouse-search {
  flex: 1 1 320px;
  min-width: 280px;
  max-width: none;
}

.stock-head-actions .warehouse-filter-select {
  flex: 0 0 210px;
}

.stock-head-actions .toolbar-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.warehouse-filter-select {
  min-height: 48px;
  min-width: 180px;
}

.warehouse-stock-head-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0;
}

.stock-title-wrap {
  min-width: 0;
}

.stock-title-wrap h3 {
  margin: 0;
}

.stock-title-wrap .stock-toolbar-hint {
  margin: 6px 0 0;
}

.warehouse-stock-head-row .btn {
  width: auto;
  max-width: 240px;
  min-height: 42px;
  padding: 8px 14px;
  margin: 0;
  justify-content: center;
}

.stock-create-row {
  justify-content: flex-end;
  margin-top: 10px;
}

.sales-table-head-row {
  justify-content: flex-end;
  padding: 12px 18px 14px 0;
}

.sales-cell-center {
  text-align: center;
  vertical-align: middle;
}

.sales-check-no {
  font-weight: 700;
}

.sales-upload-btn {
  margin: 0;
}

.sales-upload-cell {
  text-align: center;
  vertical-align: middle;
}

.sales-upload-cell .sales-upload-btn {
  margin: 0 auto;
}

#salesPage thead th:nth-child(1),
#salesPage thead th:nth-child(2),
#salesPage thead th:nth-child(3),
#salesPage thead th:nth-child(7) {
  text-align: center;
}

#salesPage thead th:nth-child(6) {
  text-align: center;
}

#salesPage .filters {
  grid-template-columns: 1.5fr 1fr 1fr auto auto;
}

#salesPage #salesExportBtn,
#salesPage #salesClearFilters {
  min-width: 170px;
}

#salesPage .table-card {
  padding-top: 4px;
  border: 1px solid rgba(127, 29, 29, 0.18);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.sales-create-wrap {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 10px;
}

.clients-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px;
  flex-wrap: wrap;
}

.clients-actions-head {
  padding: 0;
  border-radius: 0;
  background: transparent;
  margin-bottom: 12px;
}

.clients-top-actions.glass-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.clients-top-actions .date-chip {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

#salesPage .table-wrap {
  border-top: 0;
}

#salesPage table {
  min-width: 100%;
}

#salesPage th,
#salesPage td {
  border-bottom: 1px solid rgba(127, 29, 29, 0.14);
}

#salesPage thead tr {
  background: rgba(127, 29, 29, 0.07);
}

#salesPage thead th {
  color: inherit;
  font-weight: 700;
}

#salesPage .table-card {
  padding-top: 0;
}

#salesPage.sales-manager-mode thead th:nth-child(7),
#salesPage.sales-manager-mode tbody td:nth-child(7) {
  display: none;
}

#salesCheckModal .modal-content {
  width: min(1040px, 94vw);
  max-height: 88vh;
  overflow: auto;
}

#salesCheckModal h3 {
  margin-bottom: 10px;
}

.sales-items-field,
.sales-questions-field {
  gap: 10px;
}

.sales-items-rows {
  display: grid;
  gap: 10px;
}

.sales-item-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr 0.7fr 1.1fr 1.1fr auto;
  gap: 8px;
  align-items: center;
}

.sales-item-price {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 6px;
}

.sales-item-price select,
.sales-item-price input {
  min-width: 0;
}

.sales-add-row-btn {
  align-self: flex-start;
}

.stock-toolbar-hint {
  margin: 0;
}

.warehouse-search {
  min-width: 260px;
  max-width: 340px;
}

.warehouse-top-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.stock-form-grid {
  margin-top: 0;
}

.location-checks {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.check-chip input {
  width: 16px;
  height: 16px;
}

.stock-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.stock-status-chip + .stock-status-chip {
  margin-left: 6px;
}

.stock-status-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}

.stock-status-wrap .stock-status-chip + .stock-status-chip {
  margin-left: 0;
}

.stock-status-available {
  background: rgba(16, 185, 129, 0.18);
  color: #057857;
}

.stock-status-sold {
  background: rgba(245, 158, 11, 0.2);
  color: #9a5b00;
}

.stock-status-unavailable {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.stock-status-reserved {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}

.stock-qty-actions {
  margin-top: 6px;
}

.stock-qty-actions .action-btn {
  min-width: 28px;
  height: 28px;
  padding: 0;
  font-weight: 700;
}

.stock-qty-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stock-qty-value {
  font-size: 1.1rem;
  line-height: 1;
}

.incoming-preview {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.75);
}

.incoming-preview-row {
  display: block;
  overflow: hidden;
  padding-bottom: 2px;
}

.incoming-preview-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.incoming-orders-list {
  display: grid;
  gap: 14px;
}

.incoming-order-card {
  margin: 0;
}

.incoming-preview-actions {
  margin-top: 2px;
}

.incoming-preview .incoming-track {
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.warehouse-add-plus {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 400;
}

.incoming-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
}

.image-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
}

.image-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(90vw, 980px);
  max-height: 88vh;
}

.image-lightbox-dialog img {
  width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  background: #fff;
}

.warehouse-table-wrap table {
  min-width: 760px;
}

.incoming-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 8px;
  min-width: 0;
}

.incoming-step {
  display: grid;
  gap: 6px;
  align-content: start;
}

.incoming-step i {
  height: 3px;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.18);
  display: block;
}

.incoming-step.done i {
  background: linear-gradient(90deg, #b91c1c, #f97316);
}

.incoming-step em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.15;
}

.incoming-step.done em {
  color: #8b1d1d;
  font-weight: 600;
}

.incoming-date {
  display: block;
  margin-top: 0;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.05;
  color: #5f1d1d;
}

.incoming-list-filters {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: stretch;
}

.incoming-list-filters .warehouse-search {
  min-width: 0;
  max-width: none;
}

.incoming-list-create {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 12px;
}

.incoming-list-create .btn {
  width: auto;
  max-width: 240px;
  min-height: 42px;
  padding: 8px 14px;
  justify-content: center;
}

.framed {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.6);
}

.admin-settings-title {
  margin-bottom: 10px;
}

.admin-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-quick-column {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 10px;
}

.admin-action-btn {
  justify-content: center;
  width: 100%;
  height: auto;
  min-height: 56px;
  max-height: none;
  padding: 10px 12px;
  border-color: rgba(185, 28, 28, 0.2);
  color: #7f1d1d;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
  transition: transform 170ms ease, border-color 170ms ease, color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.admin-action-btn .btn-icon {
  color: inherit;
}

.admin-action-btn:hover,
.admin-action-btn:focus-visible,
.admin-action-btn-active {
  transform: translateX(4px);
  border-color: rgba(220, 38, 38, 0.55);
  color: #b91c1c;
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.14);
}

.admin-action-btn-active {
  background: rgba(254, 242, 242, 0.92);
}

.chip-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.chip-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  background: #fff;
}

.user-list .user-row-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  font-size: 0.92rem;
  line-height: 1.3;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-list .store-row-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  font-size: 0.92rem;
  line-height: 1.3;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.confirm-modal-card {
  border: 1px solid rgba(185, 28, 28, 0.24);
  box-shadow: 0 16px 40px rgba(63, 13, 13, 0.22);
}

.confirm-modal-text {
  margin: 12px 0 4px;
  color: #5f1d1d;
  line-height: 1.45;
}

.chip-actions {
  display: inline-flex;
  gap: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(55, 10, 10, 0.45);
  display: grid;
  place-items: center;
  z-index: 140;
  padding: 16px;
}

.modal-content {
  width: min(760px, 100%);
  padding: 18px;
  animation: pop 220ms ease;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

.short-modal {
  width: min(520px, 100%);
}

.form-mt {
  margin-top: 10px;
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.98) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.grid-2 {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.price-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
}

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.date-modal { width: min(920px, 100%); }
.date-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
}

.preset-list {
  border-right: 1px solid var(--line);
  padding-right: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.preset-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  text-align: left;
  padding: 10px;
  cursor: pointer;
}
.preset-btn:hover,
.preset-btn.active {
  background: #fee2e2;
  border-color: rgba(185, 28, 28, 0.35);
}

.date-form-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.75);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #3f0d0d;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 120;
}

@media (max-width: 1150px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .admin-quick-grid { grid-template-columns: 1fr; }
  .hr-kpis,
  .hr-two-col,
  .hr-attendance-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .icon-btn { display: inline-grid; place-items: center; }
  #menuToggle { display: none; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    transform: translateX(-100%);
    transition: transform 220ms ease;
    z-index: 110;
    box-shadow: 0 16px 40px rgba(20, 5, 5, 0.35);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 6, 6, 0.35);
    z-index: 105;
  }
  .main { padding: 14px 14px 94px; }
  .toolbar { flex-wrap: wrap; justify-content: flex-end; }
  .grid-2 { grid-template-columns: 1fr; }
  .date-layout { grid-template-columns: 1fr; }
  .preset-list { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
  .warehouse-tabs { grid-template-columns: 1fr; }
  .section-head-row {
    flex-direction: column;
    align-items: stretch;
  }
  .section-head-row .btn {
    margin-left: 0;
    align-self: flex-end;
  }
  .warehouse-stock-head-row {
    margin-top: 2px;
    padding: 0;
  }
  .warehouse-stock-head-row .btn {
    width: 100%;
    align-self: stretch;
  }
  .clients-top-actions {
    justify-content: flex-start;
  }
  .warehouse-filter-select {
    min-width: 150px;
    flex: 1 1 160px;
  }
  .stock-head-actions,
  .incoming-list-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stock-head-actions > *,
  .incoming-list-filters > * { min-width: 0; }
  .stock-head-actions #stockSearchInput,
  .incoming-list-filters .warehouse-search { grid-column: 1 / -1; max-width: none; }
  .incoming-list-create {
    margin: 10px 0 14px;
  }
  .sales-item-row {
    grid-template-columns: 1fr;
  }
  .incoming-track { grid-template-columns: repeat(4, minmax(82px, 1fr)); }

  .modal {
    padding: 12px;
    place-items: center;
    overflow: auto;
  }

  .modal-content {
    width: 100%;
    max-width: 720px;
    max-height: calc(100dvh - 20px);
    padding: 14px;
    border-radius: 16px;
  }

  .date-modal {
    width: 100%;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), #fff 35%);
  }
}

@media (max-width: 900px) {
  .mobile-dock {
    display: grid;
  }

  .mobile-more-sheet {
    display: block;
  }
}

@media (max-width: 640px) {
  html, body {
    overflow-x: hidden;
  }

  .test-banner {
    font-size: 0.76rem;
    min-height: 32px;
    padding: 7px 0;
    line-height: 1.2;
  }

  .test-banner-item {
    gap: 7px;
    padding: 0 14px;
    animation-duration: 13s;
  }

  .auth-wrap {
    padding-top: 50px;
  }

  .app {
    padding-top: 32px;
  }

  .main { padding: 10px 10px 92px; }
  .page,
  .filters-head,
  .glass-card,
  .table-card,
  .clients-top-actions {
    min-width: 0;
    max-width: 100%;
  }
  .topbar { padding: 10px; }
  .toolbar { gap: 6px; }
  .toolbar-btn { min-height: 42px; padding: 8px 10px; }
  .lang-btn, .notif-btn { width: 44px; height: 44px; border-radius: 12px; }
  .lang-btn img { width: 24px; height: 16px; }
  .notif-btn svg { width: 18px; height: 18px; }
  .notif-menu { width: min(330px, 92vw); right: -6px; }

  .date-chip { font-size: 0.9rem; min-height: 42px; padding: 9px 10px; }
  .menu-item, .sidebar-actions .btn { min-height: 46px; }

  .settings-subtabs {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .settings-subtabs .btn {
    min-height: 50px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 0.9rem;
  }

  .admin-action-btn {
    min-height: 50px;
    font-size: 0.9rem;
    padding-left: 10px;
    padding-right: 10px;
  }

  .admin-action-btn:hover,
  .admin-action-btn:focus-visible,
  .admin-action-btn-active {
    transform: none;
  }

  .user-list .user-row-text,
  .store-list .store-row-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: clip;
  }

  .grid-2 { gap: 8px; margin-top: 10px; }
  .field { gap: 6px; }
  .field span { font-size: 0.82rem; }
  input, select, textarea { padding: 10px 11px; font-size: 0.92rem; }
  .price-row { grid-template-columns: 1fr 96px; }

  .modal-content h3 { font-size: 1.15rem; }
  .date-form-panel { padding: 10px; }
  .warehouse-tab {
    min-height: 142px;
    padding: 18px 12px;
  }
  .warehouse-tab .menu-icon {
    width: 56px;
    height: 56px;
  }
  .warehouse-tab .menu-icon svg {
    width: 28px;
    height: 28px;
  }
  .warehouse-tab strong { font-size: 1.35rem; }
  .warehouse-tab small { font-size: 0.9rem; }
  .incoming-track { grid-template-columns: repeat(4, minmax(66px, 1fr)); }
  .incoming-step em { font-size: 0.66rem; }
  .incoming-date { font-size: 0.7rem; }

  .incoming-preview-actions-row {
    margin-top: 6px;
  }

  .incoming-preview-actions-row .chip-actions {
    width: 100%;
    justify-content: flex-end;
  }

  #salesPage .filters { grid-template-columns: 1fr; gap: 8px; }
  #salesPage .filters #salesSearchInput {
    grid-column: 1 / -1;
  }
  #salesPage .filters #salesClearFilters {
    grid-column: 1 / -1;
  }

  .sales-create-wrap {
    margin-top: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: stretch;
  }
  .sales-create-wrap .btn {
    width: 100%;
    justify-content: center;
  }

  .clients-top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .clients-top-actions #addClientBtn {
    grid-column: 1 / -1;
  }

  .clients-top-actions .btn,
  .clients-top-actions .toolbar-btn,
  .clients-top-actions .date-chip {
    width: 100%;
    justify-content: center;
  }

  table { min-width: 100%; }
  .warehouse-table-wrap table { min-width: 100%; }
  .table-wrap { overflow-x: hidden; }
  thead { display: none; }
  tbody tr {
    display: block;
    margin: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
  }
  td {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 8px;
    border-bottom: 1px dashed rgba(127, 29, 29, 0.2);
    text-align: left;
    align-items: start;
  }

  td > * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .stock-qty-cell {
    align-items: flex-start;
    width: 100%;
  }
  .stock-status-wrap {
    justify-content: flex-start;
  }
  td::before {
    content: attr(data-label);
    color: #7f1d1d;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    align-self: stretch;
    text-align: left;
    padding-right: 10px;
    border-right: 1px dashed rgba(127, 29, 29, 0.2);
    line-height: 1.2;
  }
  td:last-child { border-bottom: 0; }

  #salesPage td,
  #salesPage td.sales-cell-center,
  #salesPage td.sales-upload-cell {
    text-align: left !important;
    justify-items: start;
  }

  #clientsPage td {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  #clientsPage td::before {
    border-right: 0;
    padding-right: 0;
  }

  #clientsPage td .cell-text {
    max-width: 100%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  #clientsPage .table-wrap,
  #clientsPage .table-card {
    overflow-x: hidden;
  }

  #salesPage td::before {
    border-right: 0;
    padding-right: 0;
  }

  #salesPage td > * {
    margin: 0;
    justify-self: start;
  }

  #salesPage .sales-upload-cell .sales-upload-btn {
    margin: 0;
  }

  #salesPage td .chip-actions {
    justify-content: flex-start;
  }

  #salesPage td.sales-actions-cell .chip-actions {
    flex-wrap: nowrap;
  }

  td .chip-actions,
  td .action-pack {
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 100%;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .filters > * {
    min-width: 0;
    width: 100%;
  }

}
