* {
  box-sizing: border-box;
}

:root {
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-raised: rgba(255, 255, 255, 0.92);
  --border: #dbe3ef;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --muted: #64748b;
  --primary: #0e7490;
  --primary-strong: #155e75;
  --success: #047857;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background:
    linear-gradient(180deg, #f8fbff 0%, #f3f6fb 38%, #eef4f8 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(14, 116, 144, 0.22);
  outline-offset: 2px;
}

::selection {
  background: rgba(14, 116, 144, 0.18);
}

.menu-link {
  display: block;
  padding: 0.75rem 1rem;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 600;
}

.menu-heading {
  display: block;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.45rem 1rem;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.menu-link + .menu-link {
  border-top: 1px solid #f1f5f9;
}

.menu-link:hover,
.menu-link-active {
  background: #eff6ff;
  color: var(--ink);
}

@keyframes menuEnter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-logout-form {
  margin: 0;
  border-top: 1px solid #f1f5f9;
}

.menu-logout-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-panel {
  width: min(100%, 26rem);
  display: grid;
  gap: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.9) !important;
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) minmax(22rem, 34rem) minmax(13rem, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0 1rem;
}

.org-switcher {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 0.875rem;
  color: #0f172a;
}

.topbar-search {
  grid-column: 2;
  position: relative;
  width: 100%;
  justify-self: center;
}

.topbar-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface-soft);
  padding: 0.6rem 4.2rem 0.6rem 0.9rem;
  color: var(--ink);
  font-size: 0.875rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.topbar-search input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12);
  outline: 0;
}

.topbar-search span {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  padding: 0.15rem 0.4rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 0.5rem;
  background: #155e75;
  color: #fff;
  font-weight: 700;
}

.side-logo {
  display: block;
  width: 5.25rem;
  height: 5.25rem;
  object-fit: contain;
}

.topbar-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
}

.topbar-add {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 0.25rem;
  background: #3b82f6;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.profile-menu {
  position: relative;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 0.5rem;
  padding: 0.2rem 0.35rem;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.profile-button:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.profile-avatar,
.profile-page-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: linear-gradient(180deg, #fff 0%, #dbeafe 100%);
  color: #334155;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-avatar img,
.profile-page-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar {
  width: 2.25rem;
  height: 2.25rem;
}

.profile-page-avatar {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.5rem;
}

.profile-name {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 700;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 40;
  min-width: 12rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: start center;
  background: rgba(15, 23, 42, 0.42);
  padding: 10vh 1rem 1rem;
  backdrop-filter: blur(8px);
}

.command-palette[hidden] {
  display: none;
}

.command-open {
  overflow: hidden;
}

.command-panel {
  width: min(100%, 40rem);
  overflow: hidden;
  border: 1px solid rgba(219, 227, 239, 0.9);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: commandEnter 0.16s ease-out;
}

.command-search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
}

.command-kicker,
.command-shortcut {
  border-radius: 0.375rem;
  background: #f1f5f9;
  padding: 0.25rem 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.command-search-row input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  outline: 0;
}

.command-list {
  display: grid;
  gap: 0.25rem;
  max-height: 26rem;
  overflow-y: auto;
  padding: 0.45rem;
}

.command-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.5rem;
  padding: 0.7rem;
  color: var(--ink);
}

.command-item:hover,
.command-item:focus-visible {
  background: #eff6ff;
  outline: 0;
}

.command-item-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 0.5rem;
  background: #e0f2fe;
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.command-item strong,
.command-item small {
  display: block;
}

.command-item strong {
  font-size: 0.9rem;
}

.command-item small {
  color: var(--muted);
  font-size: 0.76rem;
}

.command-empty .command-list::after {
  content: "No matching page";
  padding: 1.25rem;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

@keyframes commandEnter {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 249, 255, 0.96) 52%, rgba(236, 253, 245, 0.9) 100%);
  min-height: 8.5rem;
  padding: 1.6rem;
  box-shadow: var(--shadow-md);
}

.dashboard-hero-title {
  flex: 1 1 auto;
  min-width: min(100%, 18rem);
}

.dashboard-hero-title h2 {
  font-size: 3.5rem;
  line-height: 1;
  letter-spacing: 0;
}

.dashboard-metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-metrics-admin {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-action {
  border: 1px solid var(--primary);
  border-radius: 0.375rem;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(14, 116, 144, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.quick-action:hover {
  background: var(--primary-strong);
  box-shadow: 0 12px 24px rgba(14, 116, 144, 0.22);
  transform: translateY(-1px);
}

.metric-card,
.dashboard-panel,
.rounded-lg.border.bg-white {
  background: var(--surface-raised) !important;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.metric-card:hover,
.dashboard-panel:hover,
.rounded-lg.border.bg-white:hover {
  border-color: #bae6fd;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sales-bars {
  display: grid;
  gap: 0.75rem;
}

.sales-bar-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 7rem;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.sales-bar-label,
.sales-bar-value {
  color: #64748b;
  font-weight: 600;
}

.sales-bar-value {
  text-align: right;
}

.sales-bar-track {
  height: 0.65rem;
  overflow: hidden;
  border-radius: 9999px;
  background: #e2e8f0;
}

.sales-bar-fill {
  display: block;
  height: 100%;
  min-width: 0.25rem;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  transition: width 0.35s ease;
}

.sales-workspace {
  overflow: hidden;
}

.sales-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sales-tab-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.75rem;
}

.sales-tab-bar label {
  cursor: pointer;
  border-radius: 0.375rem;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.55rem 0.85rem;
}

.sales-tab-bar span {
  margin-left: auto;
  border-radius: 9999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
}

#sales-tab-record:checked ~ .sales-tab-bar label[for="sales-tab-record"],
#sales-tab-history:checked ~ .sales-tab-bar label[for="sales-tab-history"] {
  background: #0891b2;
  color: #ffffff;
}

.sales-tab-panel {
  display: none;
  padding: 1rem;
}

#sales-tab-record:checked ~ .sales-tab-record-panel,
#sales-tab-history:checked ~ .sales-tab-history-panel {
  display: block;
}

.quick-sale-form {
  display: grid;
  grid-template-columns: minmax(16rem, 2fr) minmax(4.5rem, 0.45fr) minmax(9rem, 0.8fr) minmax(8rem, 0.8fr) minmax(9rem, 0.9fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.quick-sale-form label,
.quick-sale-more label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
}

.quick-sale-form input,
.quick-sale-form select,
.quick-sale-more input,
.sale-edit-panel input {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
}

.quick-sale-small {
  min-width: 4.5rem;
}

.quick-price-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.quick-price-field input {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}

.quick-price-field strong {
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-left: 0;
  border-radius: 0 0.375rem 0.375rem 0;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.78rem;
  padding: 0 0.65rem;
}

.quick-sale-submit {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: #0891b2;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  padding: 0.65rem 1rem;
  white-space: nowrap;
}

.quick-sale-submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.quick-sale-more {
  grid-column: 1 / -1;
  border-top: 1px solid #e2e8f0;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

.quick-sale-more summary {
  cursor: pointer;
  color: #0e7490;
  font-size: 0.875rem;
  font-weight: 800;
}

.quick-sale-more label {
  margin-top: 0.75rem;
  max-width: 42rem;
}

.sales-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.sales-table {
  min-width: 62rem;
}

.sales-table th,
.sales-table td {
  padding: 0.65rem 0.75rem;
  vertical-align: top;
}

.sale-actions-menu {
  position: relative;
  width: max-content;
  margin-left: auto;
}

.sale-actions-menu > summary {
  display: grid;
  width: 2rem;
  height: 2rem;
  list-style: none;
  place-items: center;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  color: #334155;
  background: #ffffff;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.sale-actions-menu > summary:hover,
.sale-actions-menu[open] > summary {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.sale-actions-menu > summary svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: currentColor;
}

.sale-actions-menu > summary::-webkit-details-marker,
.sale-edit-panel > summary::-webkit-details-marker {
  display: none;
}

.sale-actions-panel {
  display: grid;
  gap: 0.45rem;
  min-width: 10rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  border: 1px solid #dbe3ef;
  border-radius: 0.5rem;
  background: #ffffff;
  padding: 0.55rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.sale-actions-panel a,
.sale-actions-panel button,
.sale-edit-panel > summary,
.sale-actions-panel span {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #0e7490;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.45rem 0.5rem;
  text-align: left;
}

.sale-actions-panel a:hover,
.sale-actions-panel button:hover,
.sale-edit-panel > summary:hover {
  background: #ecfeff;
}

.sale-edit-panel form {
  display: grid;
  gap: 0.4rem;
  padding: 0.4rem 0.2rem 0.2rem;
}

.sale-edit-panel button {
  background: #0891b2;
  color: #ffffff;
  text-align: center;
}

.sale-actions-panel .sale-danger-action {
  color: #b91c1c;
}

.category-actions-menu {
  flex: 0 0 auto;
}

.category-actions-panel {
  min-width: 15rem;
}

.category-rename-form {
  display: grid;
  gap: 0.45rem;
}

.category-rename-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
}

.pending-row,
.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pending-row {
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  color: #334155;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.pending-row:hover {
  border-color: #67e8f9;
  background: #ecfeff;
  transform: translateX(2px);
}

.price-stack {
  display: grid;
  gap: 0.35rem;
  min-width: 11rem;
}

.price-stack span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #f8fafc;
  padding: 0.35rem 0.5rem;
}

.price-stack small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.price-stack strong {
  color: var(--ink);
  font-size: 0.8rem;
  white-space: nowrap;
}

.product-list {
  display: grid;
  gap: 0.75rem;
}

.product-directory {
  display: grid;
  gap: 0.75rem;
}

.product-card {
  display: grid;
  grid-template-columns: minmax(16rem, 1.4fr) minmax(10rem, 0.8fr) minmax(8rem, 0.7fr) minmax(12rem, 1fr) minmax(7rem, 0.55fr) minmax(8rem, 0.55fr);
  gap: 1rem;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface-raised);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.product-card:hover {
  border-color: #bae6fd;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.product-card-alert {
  border-color: #fecaca;
  background: #fff7f7;
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.product-main h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.product-main p,
.product-field small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.product-field a {
  color: var(--primary);
  font-weight: 800;
}

.product-field strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.product-actions .field-label {
  flex-basis: 100%;
  text-align: right;
}

.product-directory-card {
  grid-template-columns: minmax(16rem, 1.35fr) minmax(10rem, 0.85fr) minmax(8rem, 0.7fr) minmax(12rem, 1fr) minmax(7rem, 0.55fr) minmax(7rem, 0.5fr);
}

.product-directory-card:not(:has(.price-stack)) {
  grid-template-columns: minmax(16rem, 1.5fr) minmax(10rem, 1fr) minmax(8rem, 0.8fr) minmax(7rem, 0.6fr);
}

[hidden] {
  display: none !important;
}

.compact-row {
  padding: 0.75rem 0;
}

.bg-slate-50 { background-color: #f8fafc; }
.bg-white { background-color: #fff; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-700 { background-color: #047857; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-cyan-700 { background-color: #0e7490; }

.hover\:bg-slate-100:hover { background-color: #f1f5f9; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:bg-red-100:hover { background-color: #fee2e2; }
.hover\:bg-cyan-800:hover { background-color: #155e75; }
.hover\:bg-emerald-800:hover { background-color: #065f46; }

.text-slate-900 { color: #0f172a; }
.text-slate-950 { color: #020617; }
.text-slate-700 { color: #334155; }
.text-slate-600 { color: #475569; }
.text-slate-500 { color: #64748b; }
.text-red-900 { color: #7f1d1d; }
.text-red-800 { color: #991b1b; }
.text-red-700 { color: #b91c1c; }
.text-red-950 { color: #450a0a; }
.text-emerald-800 { color: #065f46; }
.text-emerald-700 { color: #047857; }
.text-amber-900 { color: #78350f; }
.text-cyan-700 { color: #0e7490; }
.text-cyan-800 { color: #155e75; }
.text-white { color: #fff; }

.hover\:text-cyan-900:hover { color: #164e63; }
.hover\:text-red-900:hover { color: #7f1d1d; }

.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }
.border-red-200 { border-color: #fecaca; }
.border-emerald-200 { border-color: #a7f3d0; }

.divide-y > :not([hidden]) ~ :not([hidden]) {
  border-top: 1px solid #e2e8f0;
}
.divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-top-color: #f1f5f9; }
.divide-slate-200 > :not([hidden]) ~ :not([hidden]) { border-top-color: #e2e8f0; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-10 { margin-top: 2.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-3 { margin-left: 0.75rem; }

.block { display: block; }
.inline { display: inline; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }

.max-w-7xl { max-width: 80rem; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.w-full { width: 100%; }
.max-w-xl { max-width: 36rem; }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.align-top { vertical-align: top; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.25rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }

.app-layout {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  max-width: none;
  margin: 0;
  overflow-x: hidden;
}

.content-shell {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  padding-bottom: 4rem;
  animation: pageEnter 0.18s ease-out;
}

.side-nav {
  min-height: calc(100vh - 3.25rem);
  background: #1e2538;
  padding: 0;
  position: relative;
  z-index: 25;
  width: 4.25rem;
  transition: width 0.18s ease;
  overflow: visible;
}

.side-nav:hover,
.side-nav:focus-within {
  width: 13.25rem;
}

.side-nav-panel {
  position: sticky;
  top: 3.25rem;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-height: calc(100vh - 3.25rem);
  border: 0;
  border-radius: 0;
  background: #1e2538;
  padding: 0.5rem 0.45rem 1rem;
  box-shadow: none;
  width: 4.25rem;
  overflow: hidden;
  transition: width 0.24s ease, box-shadow 0.24s ease;
}

.side-nav:hover .side-nav-panel,
.side-nav:focus-within .side-nav-panel {
  width: 13.25rem;
  box-shadow: 18px 0 40px rgba(15, 23, 42, 0.12);
}

.side-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: -0.5rem -0.45rem 0.75rem;
  padding: 0.85rem 0.75rem;
  background: #171c2d;
  color: #fff;
  font-size: 1.125rem;
}

.side-heading {
  padding: 0.75rem 0.75rem 0.25rem;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 0.375rem;
  padding: 0.55rem 0.75rem;
  color: #f8fafc;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.side-nav:not(:hover):not(:focus-within) .side-link,
.side-nav:not(:hover):not(:focus-within) .side-group summary {
  width: 3.35rem;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
  font-size: 0;
}

.side-nav:not(:hover):not(:focus-within) .side-icon {
  font-size: 0.72rem;
}

.side-nav:not(:hover):not(:focus-within) .side-brand {
  width: 4.25rem;
}

.side-nav:not(:hover):not(:focus-within) .side-logo {
  width: 2.7rem;
  height: 2.7rem;
}

.side-nav:not(:hover):not(:focus-within) .side-sub-link,
.side-nav:not(:hover):not(:focus-within) .configure-link,
.side-nav:not(:hover):not(:focus-within) .side-group summary::after {
  display: none;
}

.side-sub-link {
  display: block;
  margin-left: 1.9rem;
  border-radius: 0.375rem;
  padding: 0.45rem 0.6rem;
  color: #cbd5e1;
  font-size: 0.8125rem;
  font-weight: 600;
}

.side-group summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 0.375rem;
  padding: 0.55rem 0.75rem;
  color: #f8fafc;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  list-style: none;
}

.side-group summary::-webkit-details-marker {
  display: none;
}

.side-group summary::after {
  content: "›";
  margin-left: auto;
  color: #94a3b8;
  transition: transform 0.15s ease;
}

.side-group[open] summary::after {
  transform: rotate(90deg);
}

.side-icon {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  color: #dbeafe;
  font-size: 0.72rem;
  font-weight: 800;
}

.side-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  stroke: currentColor;
  fill: none;
}

.side-link:hover,
.side-sub-link:hover,
.side-group summary:hover,
.side-link-active {
  background: #3b82f6;
  color: #fff;
}

.side-link:hover,
.side-group summary:hover {
  transform: translateX(2px);
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.configure-link {
  margin: 3rem 0.45rem 0;
  border-radius: 0.375rem;
  background: #343b58;
  color: #fff;
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
}

form.rounded-lg,
form.rounded-md,
.rounded-lg.border.bg-white,
.dashboard-panel,
.metric-card {
  border-color: #dbe3ef;
}

input,
select,
textarea {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #94a3b8;
}

tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: #f8fafc;
}

thead {
  position: static;
}

.saving {
  pointer-events: none;
}

.updates-chat {
  display: grid;
  grid-template-rows: minmax(24rem, 1fr) auto;
  min-height: min(70vh, 42rem);
  overflow: hidden;
  background: #f8fafc;
}

.updates-feed {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1.25rem;
  background: linear-gradient(180deg, #f8fafc 0%, #eef6ff 100%);
}

.chat-message {
  display: flex;
  justify-content: flex-start;
}

.chat-message-own {
  justify-content: flex-end;
}

.chat-bubble {
  width: fit-content;
  max-width: min(72%, 42rem);
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: #ffffff;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.chat-message-own .chat-bubble {
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 0.25rem;
  background: #0891b2;
  color: #ffffff;
}

.chat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
}

.chat-message-own .chat-meta {
  color: rgba(255, 255, 255, 0.76);
}

.chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  line-height: 1.45;
}

.chat-delete {
  margin-top: 0.45rem;
}

.chat-delete button {
  border: 0;
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
}

.chat-message-own .chat-delete button {
  color: rgba(255, 255, 255, 0.88);
}

.updates-empty {
  margin: auto;
  color: #64748b;
  font-size: 0.875rem;
}

.updates-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  border-top: 1px solid #dbe3ef;
  background: #ffffff;
  padding: 0.75rem;
}

.updates-composer textarea {
  min-height: 3rem;
  max-height: 9rem;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
}

.updates-compose-actions {
  display: grid;
  gap: 0.5rem;
  justify-items: end;
}

.updates-compose-actions label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
}

.updates-compose-actions button {
  min-width: 5rem;
  border: 0;
  border-radius: 0.5rem;
  background: #0891b2;
  color: #ffffff;
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.shadow-sm { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }

.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-tight { letter-spacing: 0; }

.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:border-cyan-600:focus { border-color: #0891b2; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--ring-color, rgba(8, 145, 178, 0.16)); }
.focus\:ring-cyan-100:focus { --ring-color: #cffafe; }

input,
select,
textarea {
  background-color: var(--surface);
  color: var(--ink);
}

input,
select,
textarea,
button {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

textarea {
  resize: vertical;
}

table {
  border-collapse: collapse;
}

th,
td {
  border: 0;
}

button:hover:not(:disabled),
a.rounded-md:hover,
a.rounded-lg:hover {
  transform: translateY(-1px);
}

tbody tr {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

tbody tr:hover {
  background: #f8fafc;
}

.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:items-end { align-items: flex-end; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:grid-cols-\[minmax\(0\,1fr\)_150px\] {
    grid-template-columns: minmax(0, 1fr) 150px;
  }
  .sm\:grid-cols-\[minmax\(0\,1fr\)_120px\] {
    grid-template-columns: minmax(0, 1fr) 120px;
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:grid-cols-\[minmax\(0\,420px\)_1fr\] {
    grid-template-columns: minmax(0, 420px) 1fr;
  }
  .lg\:grid-cols-\[minmax\(0\,360px\)_1fr\] {
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  }
  .lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,420px\)\] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  }
}

@media (max-width: 1023px) {
  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .topbar-actions {
    grid-column: 2;
  }
  .org-switcher {
    grid-column: 1;
    display: flex;
    gap: 0.6rem;
    min-width: 0;
    overflow: hidden;
  }
  .topbar-search {
    display: none;
  }
  .profile-name {
    display: none;
  }
  .updates-chat {
    min-height: 34rem;
  }
  .updates-composer {
    grid-template-columns: 1fr;
  }
  .updates-compose-actions {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: stretch;
  }
  .updates-compose-actions button {
    justify-self: end;
  }
  .chat-bubble {
    max-width: 88%;
  }
  .quick-sale-form {
    grid-template-columns: 1fr;
  }
  .quick-sale-submit {
    width: 100%;
  }
  .sales-tab-bar span {
    flex-basis: 100%;
    margin-left: 0;
    width: max-content;
  }
  .product-card {
    grid-template-columns: 1fr 1fr;
  }
  .product-directory-card,
  .product-directory-card:not(:has(.price-stack)) {
    grid-template-columns: 1fr 1fr;
  }
  .product-main,
  .product-field:nth-of-type(4),
  .product-actions {
    grid-column: 1 / -1;
  }
  .product-actions,
  .product-actions .field-label {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 767px) {
  .md\:grid-cols-2,
  .md\:grid-cols-3,
  .md\:grid-cols-4,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  table { min-width: 42rem; }
  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-hero-title h2 {
    font-size: 2rem;
  }
  .dashboard-metrics,
  .dashboard-metrics-admin {
    grid-template-columns: 1fr;
  }
  .quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .quick-action {
    text-align: center;
  }
  .product-card,
  .product-directory-card,
  .product-directory-card:not(:has(.price-stack)) {
    grid-template-columns: 1fr;
  }
  .sales-bar-row {
    grid-template-columns: 2rem minmax(0, 1fr);
  }
  .sales-bar-value {
    grid-column: 2;
    text-align: left;
  }
  .content-shell {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Claude redesign port: compact operations dashboard */
:root {
  --surface: #ffffff;
  --surface-soft: #f6f7f8;
  --surface-raised: #ffffff;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --ink: #1c1917;
  --muted: #78716c;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --success: #047857;
  --warning: #a16207;
  --danger: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow-md: 0 12px 28px rgba(28, 25, 23, 0.08);
  --shadow-lg: 0 22px 54px rgba(28, 25, 23, 0.14);
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fafaf9;
  color: var(--ink);
}

.topbar {
  background: rgba(250, 250, 249, 0.88) !important;
  border-color: var(--border) !important;
}

.topbar-inner {
  min-height: 3.5rem;
  padding-inline: 1.25rem;
}

.org-switcher {
  font-weight: 700;
  color: var(--ink);
}

.topbar-search input,
.command-search-row input {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: none;
}

.topbar-search input:focus,
.command-search-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.profile-button,
.topbar-search span,
.command-shortcut {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--muted);
}

.app-layout {
  align-items: start;
}

.side-nav {
  width: 4rem;
  min-height: calc(100vh - 3.5rem);
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.side-nav:hover,
.side-nav:focus-within {
  width: 14.5rem;
}

.side-nav-panel {
  top: 3.5rem;
  min-height: calc(100vh - 3.5rem);
  width: 4rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0.75rem 0.5rem 1rem;
}

.side-nav:hover .side-nav-panel,
.side-nav:focus-within .side-nav-panel {
  width: 14.5rem;
  box-shadow: 18px 0 38px rgba(28, 25, 23, 0.1);
}

.side-brand {
  margin: -0.75rem -0.5rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  min-height: 5rem;
  justify-content: flex-start;
  gap: 0.55rem;
  overflow: hidden;
}

.side-logo {
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.65rem;
}

.side-brand-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

.side-brand-org {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 760;
  line-height: 1.15;
}

.side-brand-sub {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.1;
}

.side-nav:not(:hover):not(:focus-within) .side-logo {
  width: 2.25rem;
  height: 2.25rem;
}

.side-nav:not(:hover):not(:focus-within) .side-brand {
  justify-content: center;
  gap: 0;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.side-nav:not(:hover):not(:focus-within) .side-brand-text {
  width: 0;
  opacity: 0;
  transform: translateX(-0.3rem);
}

.side-link,
.side-group summary {
  color: var(--ink);
  font-size: 0.84rem;
  border-radius: 0.42rem;
}

.side-sub-link {
  color: var(--muted);
  font-size: 0.78rem;
  border-radius: 0.38rem;
}

.side-icon {
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 0.68rem;
}

.side-link:hover,
.side-sub-link:hover,
.side-group summary:hover,
.side-link-active {
  background: #f0fdfa;
  color: var(--primary-strong);
  transform: none;
}

.side-link-active .side-icon,
.side-link:hover .side-icon,
.side-group summary:hover .side-icon {
  background: var(--primary);
  color: #fff;
}

.configure-link {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.content-shell {
  max-width: 76rem;
  padding-top: 1.4rem;
}

#dashboard,
#updates,
#sales,
#product-list,
#products,
#sale-requests,
#sales-reports,
#stock,
#batches,
#purchasing,
#suppliers,
#customers,
#activity,
#help,
#reports,
#profile,
#categories,
#currency {
  margin-top: 0;
}

.dashboard-hero {
  min-height: 0;
  padding: 1rem 1.15rem;
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dashboard-hero-title h2,
.dashboard-hero h2,
section > div > h2,
section h2.text-xl {
  font-size: 1.12rem !important;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0;
}

.quick-actions {
  gap: 0.4rem;
}

.quick-action {
  border-color: var(--border-strong);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
}

.quick-action:hover {
  border-color: var(--primary);
  background: #f0fdfa;
  color: var(--primary-strong);
}

.dashboard-metrics,
.dashboard-metrics-admin {
  gap: 0.75rem;
}

.metric-card,
.dashboard-panel,
.rounded-lg.border.bg-white,
.sales-workspace,
.updates-chat {
  border-color: var(--border) !important;
  border-radius: 0.55rem !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-sm) !important;
}

.metric-card:hover,
.dashboard-panel:hover,
.rounded-lg.border.bg-white:hover {
  border-color: var(--border-strong) !important;
  box-shadow: var(--shadow-sm) !important;
  transform: none;
}

.metric-card {
  min-height: auto !important;
  padding: 0.95rem 1rem !important;
}

.metric-card p:first-child,
.dashboard-panel h3 + p,
.sales-history-header p,
.text-slate-500,
.text-slate-600 {
  color: var(--muted) !important;
}

.metric-card .text-3xl,
.metric-card .text-2xl {
  font-size: 1.35rem !important;
  line-height: 1.2;
}

.dashboard-panel {
  padding: 1rem !important;
}

.pending-row,
.compact-row {
  border-radius: 0.45rem;
}

.sales-bar-track {
  background: #f1f5f9;
}

.sales-bar-fill {
  background: var(--primary);
}

.sales-tab-bar {
  gap: 0.35rem;
  border-bottom-color: var(--border);
  background: var(--surface-soft);
  padding: 0.55rem;
}

.sales-tab-bar label {
  border-radius: 0.38rem;
  padding: 0.42rem 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
}

#sales-tab-record:checked ~ .sales-tab-bar label[for="sales-tab-record"],
#sales-tab-history:checked ~ .sales-tab-bar label[for="sales-tab-history"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.sales-tab-panel {
  padding: 1rem;
}

.quick-sale-form {
  gap: 0.75rem;
}

.quick-sale-form label span,
.quick-sale-more summary,
.field-label {
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.quick-sale-form input,
.quick-sale-form select,
.quick-price-field,
input,
select,
textarea {
  border-color: var(--border-strong) !important;
  border-radius: 0.45rem !important;
}

.quick-sale-form input,
.quick-sale-form select {
  min-height: 2.45rem;
}

.quick-sale-submit,
.updates-compose-actions button,
button.bg-cyan-700,
.bg-cyan-700 {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: #fff !important;
}

.quick-sale-submit:hover,
.updates-compose-actions button:hover,
button.bg-cyan-700:hover,
.bg-cyan-700:hover {
  background: var(--primary-strong) !important;
}

.sales-table {
  border-collapse: collapse;
  font-size: 0.82rem;
}

.sales-table thead,
table thead {
  background: var(--surface-soft) !important;
}

.sales-table th,
.sales-table td,
table th,
table td {
  padding: 0.7rem 0.85rem;
  vertical-align: middle;
}

.sales-table th,
table th {
  color: var(--muted) !important;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sales-table tbody tr:hover,
table tbody tr:hover {
  background: var(--surface-soft);
}

.sale-actions-menu summary {
  width: 1.75rem;
  height: 1.75rem;
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--ink);
}

.sale-actions-panel {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.updates-chat {
  min-height: min(68vh, 39rem);
  grid-template-rows: minmax(20rem, 1fr) auto;
  background: #f8fafc !important;
}

.updates-feed {
  padding: 1rem;
}

.chat-bubble {
  border-color: var(--border);
  box-shadow: none;
}

.chat-message-own .chat-bubble {
  background: var(--primary);
  color: #fff;
}

.updates-composer {
  border-top-color: var(--border);
  background: var(--surface);
  padding: 0.75rem;
}

.updates-composer textarea {
  min-height: 2.75rem;
  background: var(--surface-soft);
}

.command-panel,
.profile-dropdown {
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  background: #0f766e;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.25rem 0.35rem;
}

.dashboard-ops {
  display: grid;
  gap: 1.35rem;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.page-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0;
}

.page-subtitle {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ops-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
}

.ops-btn-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 7rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  padding: 1rem;
  text-align: left;
}

.kpi:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.kpi-value {
  color: #000000;
  font-size: 1.45rem;
  font-weight: 760;
  line-height: 1.2;
}

.kpi-delta {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  margin-top: auto;
}

.tone-up {
  color: #15803d;
}

.tone-alert,
.tone-danger {
  color: #c0392b;
}

.tone-warn {
  color: #a16207;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(20rem, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.dash-today,
.dash-low {
  grid-column: 1;
}

.dash-trend,
.dash-act {
  grid-column: 2;
}

.ops-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
}

.ops-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
}

.ops-card-head h3 {
  margin: 0;
  color: #000000;
  font-size: 0.92rem;
  font-weight: 760;
}

.ops-card-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.ops-card-head a {
  color: #000000;
  font-size: 0.78rem;
  font-weight: 700;
}

.queue,
.lowlist,
.activity {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

.queue-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding: 0.8rem 1rem;
}

.queue-row:first-child {
  border-top: 0;
}

.queue-icon {
  display: grid;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 0.4rem;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
}

.queue-icon.tone-danger {
  background: #fee2e2;
  color: #dc2626;
}

.queue-icon.tone-info {
  background: #e0f2fe;
  color: #0369a1;
}

.queue-icon.tone-warn {
  background: #ffedd5;
  color: #b45309;
}

.queue-text {
  flex: 1;
  min-width: 0;
}

.queue-title {
  overflow: hidden;
  color: #000000;
  font-size: 0.86rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
}

.pill.tone-danger {
  background: #fee2e2;
  color: #dc2626;
}

.pill.tone-info {
  background: #e0f2fe;
  color: #0369a1;
}

.pill.tone-warn {
  background: #ffedd5;
  color: #b45309;
}

.trend {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 8.75rem;
  padding: 1rem 1rem 0.4rem;
}

.trend-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
  min-width: 0;
}

.trend-bar-wrap {
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
}

.trend-bar {
  display: block;
  width: 80%;
  max-width: 2rem;
  min-height: 0.2rem;
  border-radius: 0.2rem 0.2rem 0 0;
  background: #5f8f8e;
}

.trend-label {
  color: var(--muted);
  font-size: 0.7rem;
}

.trend-foot {
  display: flex;
  gap: 2rem;
  border-top: 1px solid var(--border);
  padding: 0.8rem 1rem 1rem;
}

.trend-foot div {
  display: grid;
  gap: 0.15rem;
}

.trend-foot span {
  color: var(--muted);
  font-size: 0.7rem;
}

.trend-foot strong {
  color: #000000;
  font-size: 0.85rem;
}

.lowlist {
  gap: 0.8rem;
  padding: 1rem;
}

.lowlist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.25rem;
  align-items: center;
  gap: 0.75rem;
}

.lowlist-name {
  overflow: hidden;
  color: #000000;
  font-size: 0.84rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lowlist-meta {
  color: var(--muted);
  font-size: 0.74rem;
}

.lowlist-bar {
  height: 0.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.lowlist-bar span {
  display: block;
  height: 100%;
  min-width: 0.25rem;
  max-width: 100%;
  border-radius: inherit;
  background: #b7793f;
}

.activity {
  gap: 0.8rem;
  padding: 1rem;
}

.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.activity-dot {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--border-strong);
}

.activity-line {
  color: #000000;
  font-size: 0.82rem;
}

.activity-when {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.empty-line {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 1rem;
}

.messages-page {
  display: grid;
  gap: 1.6rem;
  margin-top: 0;
}

.messages-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
}

.messages-head h2 {
  margin: 0;
  color: #000000;
  font-size: 1.55rem;
  font-weight: 760;
  line-height: 1.15;
}

.messages-head p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.team-button,
.msg-notify {
  border: 0;
  border-radius: 0.35rem;
  background: var(--surface);
  color: #000000;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.7rem;
}

.team-button:hover,
.msg-notify:hover {
  background: var(--surface-soft);
}

.msg-shell {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1rem;
  min-height: 34rem;
}

.msg-side {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.msg-side-head {
  padding: 0.45rem 0.6rem;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.msg-direct-head {
  margin-top: 1.35rem;
}

.msg-channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #000000;
  font-size: 0.9rem;
  padding: 0.65rem 0.7rem;
  text-align: left;
}

.msg-channel:hover {
  background: var(--surface-soft);
}

.msg-channel.is-on {
  background: #dff5f5;
  color: #00545a;
  font-weight: 650;
}

.msg-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background: #4f8b8f;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 760;
  padding: 0 0.35rem;
}

.msg-main {
  display: flex;
  min-width: 0;
  min-height: 34rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
}

.msg-main {
  flex-direction: column;
}

.msg-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.1rem;
}

.msg-main-head h3 {
  margin: 0;
  color: #000000;
  font-size: 0.98rem;
  font-weight: 760;
}

.msg-main-head p {
  margin: 0.25rem 0 0;
  color: var(--ink);
  font-size: 0.8rem;
}

.msg-feed {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding: 1rem 1.1rem;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.msg-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 999px;
  background: #dff5f5;
  color: #00545a;
  font-size: 0.76rem;
  font-weight: 760;
}

.msg-body {
  min-width: 0;
  flex: 1;
}

.msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.msg-meta strong {
  color: #000000;
  font-weight: 760;
}

.msg-pin {
  border-radius: 0.25rem;
  background: #dff5f5;
  color: #00656b;
  font-size: 0.68rem;
  font-weight: 760;
  padding: 0.12rem 0.35rem;
  text-transform: uppercase;
}

.msg-bubble {
  display: inline-block;
  max-width: min(100%, 44rem);
  border-radius: 0.6rem;
  background: var(--surface-soft);
  color: #000000;
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  padding: 0.62rem 0.75rem;
  white-space: pre-wrap;
}

.msg-mine .msg-bubble {
  background: #dff5f5;
  color: #00545a;
}

.msg-delete {
  margin-top: 0.35rem;
}

.msg-delete button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0;
}

.msg-empty {
  margin: auto;
  color: var(--muted);
  font-size: 0.86rem;
}

.msg-compose {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
}

.msg-compose input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 0.35rem;
  background: var(--surface);
  color: #000000;
  font-size: 0.9rem;
  padding: 0.55rem 0.65rem;
}

.msg-compose-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.msg-compose-actions label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.msg-compose-actions button {
  border: 0;
  border-radius: 0.4rem;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.82rem;
  font-weight: 760;
  padding: 0.58rem 0.85rem;
}

.ops-page {
  display: grid;
  gap: 1.5rem;
  margin-top: 0.45rem;
}

.ops-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ops-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: min(22.5rem, 100%);
  border: 1px solid var(--border-strong);
  border-radius: 0.4rem;
  background: var(--surface);
  color: var(--muted);
  padding: 0 0.65rem;
}

.ops-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.84rem;
  padding: 0.5rem 0;
}

.picker-toolbar {
  padding: 0 0.75rem 0.75rem;
}

.form-search {
  width: 100%;
}

.ops-seg {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.4rem;
  background: var(--surface);
  padding: 0.18rem;
}

.ops-seg button,
.ops-seg a {
  border: 0;
  border-radius: 0.28rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1;
  padding: 0.45rem 0.75rem;
}

.ops-seg .is-on {
  background: var(--surface-soft);
  color: #000000;
  box-shadow: var(--shadow-sm);
}

.ops-table-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.ops-table-wrap {
  overflow-x: auto;
}

.ops-table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.ops-table th {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  padding: 0.72rem 1rem;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.ops-table td {
  border-bottom: 1px solid var(--border);
  color: #000000;
  padding: 0.82rem 1rem;
  vertical-align: middle;
}

.ops-table tbody tr:last-child td {
  border-bottom: 0;
}

.ops-table tbody tr:hover {
  background: var(--surface-soft);
}

.ops-table tbody tr.sale-row-undone {
  background: #f8fafc;
  opacity: 0.62;
}

tr.sale-row-undone {
  background: #f8fafc;
  opacity: 0.62;
}

.ops-table tbody tr.sale-row-undone:hover {
  background: #f1f5f9;
}

.ops-table tbody tr.sale-row-undone td {
  color: #64748b;
}

.ops-table tbody tr.sale-row-undone .status-pill,
.ops-table tbody tr.sale-row-undone .sale-actions-menu {
  opacity: 1;
}

.ops-table .num {
  text-align: right;
}

.ops-prod {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.ops-prod-mark {
  display: grid;
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border-radius: 0.38rem;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
}

.ops-prod-name {
  color: #000000;
  font-weight: 650;
}

.ops-prod-sub {
  color: var(--muted);
  font-size: 0.74rem;
}

.muted {
  color: var(--muted) !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.28rem 0.55rem;
  white-space: nowrap;
}

.status-ok {
  background: #dcfce7;
  color: #16834a;
}

.status-warn {
  background: #ffedd5;
  color: #b7791f;
}

.status-danger {
  background: #fee2e2;
  color: #dc2626;
}

.status-neutral {
  background: var(--surface-soft);
  color: var(--muted);
}

.sale-add-line {
  background: transparent;
  border: 0;
  cursor: pointer;
}

.sale-add-line:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.remove-sale-line {
  display: inline-grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 0.38rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.remove-sale-line:hover:not(:disabled) {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.remove-sale-line:disabled,
.remove-sale-line.is-disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.row-arrow {
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 500;
}

.empty-cell {
  color: var(--muted) !important;
  font-size: 0.84rem;
  padding: 2rem 1rem !important;
  text-align: center;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #000000;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0;
}

.ops-btn-small {
  min-height: 1.9rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.76rem;
}

.action-menu {
  position: relative;
}

.action-menu > summary {
  list-style: none;
}

.action-menu > summary::-webkit-details-marker {
  display: none;
}

.action-menu-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 0.75rem;
  width: min(26rem, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
}

.action-menu-panel h3 {
  margin: 0;
  color: #000000;
  font-size: 0.95rem;
  font-weight: 760;
}

.field {
  display: grid;
  gap: 0.38rem;
  margin: 0;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.table-select,
.table-number {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 0.38rem;
  background: var(--surface);
  color: #000000;
  font-size: 0.84rem;
  padding: 0.52rem 0.65rem;
}

.field textarea {
  resize: vertical;
}

.form-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.5rem;
  gap: 0.75rem;
}

.sales-grid-new {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(20rem, 1fr);
  gap: 0.8rem;
  align-items: start;
}

.sale-entry-table {
  min-width: 42rem;
}

.table-select {
  min-width: 18rem;
}

.table-number {
  max-width: 6rem;
  text-align: right;
}

.price-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.price-ccy {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.price-input {
  background: #e6f7f7;
  border-color: #8dcfd0;
  color: #00545a;
  font-weight: 700;
}

.sale-summary-card {
  overflow: hidden;
}

.summary-fields {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding: 1rem;
}

.summary-total span {
  color: #000000;
  font-size: 0.95rem;
  font-weight: 760;
}

.summary-total strong {
  color: #000000;
  font-size: 0.95rem;
}

.recent-sales-table {
  min-width: 44rem;
}

.request-list-new {
  display: grid;
  gap: 0.55rem;
}

.request-card-new {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
}

.request-card-new:hover {
  border-color: var(--border-strong);
}

.request-main-new {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 0.4rem;
}

.request-title-row,
.request-meta-new,
.request-actions-new {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.request-title-row strong {
  color: #000000;
  font-size: 0.9rem;
}

.request-product-new {
  color: #000000;
  font-size: 0.84rem;
}

.request-meta-new {
  color: var(--muted);
  font-size: 0.74rem;
}

.request-note-new {
  color: var(--muted);
  font-size: 0.78rem;
}

.request-actions-new {
  justify-content: flex-end;
}

.request-actions-new form {
  margin: 0;
}

.request-view {
  position: relative;
}

.request-view > summary {
  list-style: none;
  color: #000000;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
}

.request-view > summary::-webkit-details-marker {
  display: none;
}

.request-view div {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 20;
  width: 16rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.75rem;
}

.stock-grid-new {
  display: grid;
  gap: 0.8rem;
  width: 100%;
}

.stock-activity-card {
  overflow: hidden;
}

@media (min-width: 768px) {
  .dashboard-metrics-admin {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stock-grid-new {
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
    align-items: start;
  }
}

@media (max-width: 1023px) {
  .side-nav,
  .side-nav-panel,
  .side-nav:not(:hover):not(:focus-within) .side-brand {
    width: 4rem;
  }

  .content-shell {
    padding-top: 1rem;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-today,
  .dash-low,
  .dash-trend,
  .dash-act {
    grid-column: 1;
  }
}

@media (max-width: 767px) {
  .dashboard-hero {
    padding: 0.9rem;
  }

  .dashboard-hero-title h2,
  .dashboard-hero h2,
  section > div > h2,
  section h2.text-xl {
    font-size: 1.05rem !important;
  }

  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    padding: 0.85rem !important;
  }

  .sales-tab-panel {
    padding: 0.8rem;
  }

  .page-header {
    align-items: stretch;
  }

  .page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .kpi-row {
    grid-template-columns: 1fr;
  }

  .trend-foot {
    gap: 1rem;
  }

  .lowlist-row {
    grid-template-columns: 1fr;
  }

  .msg-shell {
    grid-template-columns: 1fr;
  }

  .msg-side {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .msg-side-head {
    width: 100%;
  }

  .msg-direct-head {
    margin-top: 0.5rem;
  }

  .msg-channel {
    width: auto;
  }

  .msg-compose {
    align-items: stretch;
    flex-direction: column;
  }

  .msg-compose-actions {
    justify-content: flex-end;
  }

  .ops-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .ops-search,
  .ops-seg {
    width: 100%;
  }

  .ops-seg {
    overflow-x: auto;
  }

  .sales-grid-new,
  .form-two {
    grid-template-columns: 1fr;
  }

  .action-menu-panel,
  .request-view div {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
  }

  .request-card-new {
    align-items: stretch;
    flex-direction: column;
  }

  .request-actions-new {
    justify-content: flex-start;
  }
}

/* ---------- Mobile bottom tab bar (item 7) ---------- */
.mobile-tab-bar {
  display: none;
}

@media (max-width: 767px) {
  .side-nav {
    display: none !important;
  }

  .content-shell {
    padding-bottom: 5.5rem !important;
  }

  .mobile-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: #fff;
    border-top: 1px solid var(--border, #e2e8f0);
    box-shadow: 0 -1px 2px rgba(15, 23, 42, 0.04);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.45rem 0.25rem 0.55rem;
    color: var(--muted, #64748b);
    font-size: 0.66rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
  }

  .mobile-tab.is-on {
    color: var(--primary, #0e7490);
  }

  .mobile-tab-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
  }

  .mobile-tab-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    fill: none;
  }

  .mobile-tab-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.45rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
}

@media print {
  .mobile-tab-bar {
    display: none !important;
  }
}

/* ---------- Toast notifications (item 3) ---------- */
.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #0f172a;
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-out {
  opacity: 0;
  transform: translateY(-6px);
}

.toast-success { background: #065f46; }
.toast-error   { background: #991b1b; }
.toast-info    { background: #1e293b; }

.toast-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}
.toast-close:hover { opacity: 1; }

#flash-banner.is-toasted {
  display: none;
}

@media (max-width: 767px) {
  .toast-stack {
    top: auto;
    bottom: 5.5rem;
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

@media print {
  .toast-stack { display: none !important; }
}

/* ---------- Sidebar unread badge (item 6) ---------- */
.side-link {
  position: relative;
}

.side-unread-badge {
  margin-left: auto;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.side-nav:not(:hover):not(:focus-within) .side-link-label,
.side-nav:not(:hover):not(:focus-within) .side-unread-badge {
  /* keep badge visible when collapsed; hide just the label */
}

.side-nav:not(:hover):not(:focus-within) .side-link-label {
  display: none;
}

.side-nav:not(:hover):not(:focus-within) .side-unread-badge {
  position: absolute;
  top: 0.1rem;
  right: 0.25rem;
  margin-left: 0;
  min-width: 0.85rem;
  height: 0.85rem;
  padding: 0 0.25rem;
  font-size: 0.55rem;
}
