:root {
  --primary: #1e4aff;
  --primary-dark: #1638bf;
  --surface: #ffffff;
  --surface-alt: #f4f7ff;
  --border: #dce3f7;
  --text: #121826;
  --muted: #6a7592;
  --success-bg: #e7fff4;
  --success-text: #0f7d49;
  --error-bg: #ffe9e9;
  --error-text: #ba3030;
  --danger: #ce3f3f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: #f2f5ff;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.flash-wrap,
.panel-flash-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  width: min(92%, 560px);
  display: grid;
  gap: 8px;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.btn {
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(30, 74, 255, 0.25);
}

.btn-secondary {
  background: #ebefff;
  color: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-danger {
  background: #ffebeb;
  color: var(--danger);
}

.btn-sm {
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.error-text {
  color: var(--danger);
  margin: 0;
}

/* Homepage */
.homepage {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  text-align: center;
  background: #08111f;
}

.homepage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(3, 8, 22, 0.78), rgba(12, 24, 50, 0.56)),
    url("../images/back.webp") center/cover no-repeat;
  transform: scale(1.02);
  pointer-events: none;
}

.home-inner {
  position: relative;
  z-index: 2;
  width: min(1080px, 100%);
  display: grid;
  justify-items: center;
  gap: 22px;
}

.home-shell {
  width: min(1020px, 100%);
  display: grid;
  gap: 22px;
  padding: clamp(18px, 3vw, 32px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(8px);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.2);
}

.home-copy {
  width: min(100%, 860px);
  margin: 0 auto;
}

.home-copy h1 {
  max-width: 14ch;
  color: #fff;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  text-wrap: balance;
  margin-inline: auto;
}

.home-copy p {
  max-width: 720px;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.6;
  text-wrap: pretty;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.home-stats {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-stats article {
  text-align: left;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}

.home-stats strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  color: #fff;
}

.home-stats span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.home-actions {
  width: min(980px, 100%);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.btn-home {
  flex: 0 0 auto;
  min-width: 180px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 16px 22px;
  border-radius: 18px;
  font-size: 17px;
  background: linear-gradient(90deg, #1e4aff 0%, #1562f5 52%, #13a17c 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Auth */
.auth-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 34px 18px;
  background:
    linear-gradient(140deg, rgba(8, 16, 34, 0.78), rgba(10, 26, 52, 0.62)),
    url("../images/back.webp") center/cover no-repeat;
}

.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(220px 120px at 16% 18%, rgba(255, 255, 255, 0.52), transparent 70%),
    radial-gradient(220px 120px at 85% 78%, rgba(255, 255, 255, 0.45), transparent 72%);
}

.auth-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 28px;
  padding: 30px;
  border: 1px solid rgba(220, 227, 247, 0.95);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 26px 42px rgba(15, 36, 93, 0.1),
    0 5px 12px rgba(15, 36, 93, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 30px 50px rgba(15, 36, 93, 0.14),
    0 8px 16px rgba(15, 36, 93, 0.08);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #1e4aff 0%, #2d6cf5 45%, #13a17c 100%);
}

.auth-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -70px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(30, 74, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.auth-wide {
  width: min(560px, 100%);
}

.auth-brand-text {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.auth-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eef3ff;
  color: #2146cf;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-brand-text strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
  color: #0f2f94;
}

.auth-brand-text span {
  display: block;
  font-size: 12px;
  color: #6a7592;
}

.auth-head h1 {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.08;
  position: relative;
  z-index: 1;
  text-wrap: balance;
}

.auth-head p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  position: relative;
  z-index: 1;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 24px 0 18px;
  background: #ecf1ff;
  padding: 6px;
  border-radius: 16px;
}

.switch-btn {
  border: 0;
  background: transparent;
  padding: 11px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  color: #627090;
  font-size: 14px;
}

.switch-btn.active {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
  color: var(--primary-dark);
  box-shadow: 0 8px 14px rgba(16, 41, 121, 0.08);
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

.auth-back {
  display: inline-block;
  margin-top: 18px;
  color: #1e3ecb;
  font-weight: 700;
  font-size: 14px;
}

.form-grid {
  display: grid;
  gap: 15px;
}

.form-grid.compact + .form-grid.compact {
  margin-top: 12px;
}

.auth-page label {
  display: grid;
  gap: 8px;
}

.auth-page label span {
  color: #33425f;
  font-size: 14px;
  font-weight: 700;
}

.auth-page input,
.auth-page select {
  width: 100%;
  border: 1px solid #d8e1f8;
  border-radius: 13px;
  padding: 13px 14px;
  background: #ffffff;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-page input:focus,
.auth-page select:focus {
  outline: 2px solid rgba(30, 74, 255, 0.22);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 74, 255, 0.08);
}

.auth-page .btn {
  border-radius: 14px;
  padding: 13px 16px;
}

.auth-page .btn-primary {
  background: linear-gradient(90deg, #1e4aff 0%, #2f57f0 100%);
}

.auth-page .btn-secondary {
  background: #eaf0ff;
  color: #1b44da;
}

.otp-status {
  border: 1px solid #cde7da;
  background: #f2fbf6;
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 14px;
}

.otp-status strong {
  color: #16704a;
  font-size: 14px;
}

.otp-status p {
  margin: 6px 0 0;
  color: #29563f;
  font-size: 14px;
}

.otp-resend-form {
  margin-top: 10px;
}

.auth-back-link {
  border: 0;
  background: transparent;
  color: #1e43dd;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.panel-content label {
  display: grid;
  gap: 8px;
}

.panel-content label span {
  color: #33425f;
  font-size: 14px;
  font-weight: 700;
}

.panel-content input,
.panel-content select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  font: inherit;
}

.panel-content input:focus,
.panel-content select:focus {
  outline: 2px solid rgba(30, 74, 255, 0.22);
  border-color: var(--primary);
}

/* Panel */
.panel-body {
  background:
    radial-gradient(900px 380px at 12% -10%, rgba(30, 74, 255, 0.1), transparent 70%),
    linear-gradient(180deg, #eef3ff 0%, #e8eefc 100%);
  min-height: 100vh;
}

.panel-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(7, 13, 30, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1050;
}

.sidebar {
  background:
    radial-gradient(380px 220px at 8% 0%, rgba(116, 144, 255, 0.3), transparent 72%),
    linear-gradient(172deg, #0a1a45, #101c39);
  color: #fff;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.08),
    18px 0 30px rgba(4, 10, 30, 0.12);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  flex: 0 0 auto;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #3f6cff, #2a49be);
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 18px rgba(25, 49, 148, 0.35);
}

.brand-text {
  display: grid;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.brand-text strong {
  color: #fff;
  font-size: 16px;
}

.side-menu {
  display: grid;
  gap: 8px;
}

.side-menu a {
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.side-menu a span:last-child {
  white-space: nowrap;
}

.side-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(1px);
}

.menu-item-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.78);
}

.menu-item-icon svg {
  width: 18px;
  height: 18px;
}

.side-menu a.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  box-shadow: 0 8px 16px rgba(5, 10, 27, 0.28);
}

.side-menu a.active .menu-item-icon {
  color: #fff;
}

.logout-form {
  margin-top: auto;
}

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

.panel-header {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(220, 227, 247, 0.95);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 26px rgba(16, 41, 121, 0.07);
}

.panel-header-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(210, 221, 247, 0.95);
  background: #fff;
  box-shadow: 0 8px 18px rgba(16, 41, 121, 0.12);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex: 0 0 auto;
}

.sidebar-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #152748;
}

.panel-header h1 {
  font-size: clamp(24px, 2.7vw, 34px);
  margin: 0;
}

.user-chip {
  display: grid;
  justify-items: end;
  text-align: right;
}

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

.panel-content {
  display: grid;
  gap: 16px;
}

.panel-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(220, 227, 247, 0.95);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(16, 41, 121, 0.06);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.split-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 370px) minmax(0, 1fr);
}

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

.metric-card {
  background: linear-gradient(165deg, #ffffff 0%, #f4f8ff 100%);
  border: 1px solid rgba(210, 221, 247, 0.95);
  border-radius: 16px;
  padding: 16px;
}

.metric-card h3 {
  font-size: 14px;
  color: var(--muted);
}

.metric-card p {
  margin: 8px 0 0;
  font-size: clamp(30px, 2.6vw, 34px);
  color: var(--primary-dark);
  font-family: "Space Grotesk", sans-serif;
}

.metric-card.wide {
  grid-column: span 2;
}

.dashboard-actions-card {
  padding: 12px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.dashboard-actions .btn {
  white-space: nowrap;
  border-radius: 12px;
  padding: 11px 14px;
}

.dashboard-grid {
  align-items: start;
}

.chart-card,
.alert-card {
  min-height: 100%;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.chart-item {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.chart-item strong {
  font-size: 13px;
  color: #33425f;
}

.chart-item span {
  font-size: 12px;
  color: var(--muted);
}

.chart-bar-shell {
  width: 100%;
  height: 180px;
  border-radius: 18px;
  background: linear-gradient(180deg, #edf2ff 0%, #f8faff 100%);
  border: 1px solid #e2e8fb;
  display: flex;
  align-items: end;
  padding: 10px;
}

.chart-bar {
  width: 100%;
  min-height: 8px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, #1e4aff 0%, #13a17c 100%);
  box-shadow: 0 12px 20px rgba(30, 74, 255, 0.18);
}

.notification-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.notification-summary article {
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(165deg, #fff, #f7f9ff);
  border: 1px solid var(--border);
}

.notification-summary strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  color: var(--primary-dark);
}

.notification-summary span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-list.compact-list {
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-radius: 16px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  background: #fff;
}

.notification-item strong {
  display: block;
  font-size: 15px;
}

.notification-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.notification-item small {
  display: block;
  margin-top: 6px;
  color: #7b86a5;
  font-size: 12px;
}

.notification-item span {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf2ff;
  color: #2146cf;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.notification-item.warning {
  border-color: rgba(255, 176, 58, 0.28);
  background: linear-gradient(180deg, #fffaf1 0%, #fff 100%);
}

.notification-item.warning span {
  background: #fff1d6;
  color: #9a5b00;
}

.notification-item.info {
  border-color: rgba(30, 74, 255, 0.18);
}

.notification-item.info span {
  background: #e8efff;
  color: #2146cf;
}

.notification-item.success {
  border-color: rgba(19, 161, 124, 0.22);
}

.notification-item.success span {
  background: #e5fbf3;
  color: #147a59;
}

.notification-item.clean {
  align-items: center;
}

.notification-item.clean span {
  display: none;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #edf1fd;
  font-size: 14px;
  vertical-align: middle;
}

th {
  color: #425273;
  font-weight: 700;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #1d3d97;
  background: #eaf0ff;
  border: 1px solid #d3defe;
}

.stock-pill.strong {
  color: #0d5a3d;
  background: #e8fff3;
  border-color: #bdeccf;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-active {
  color: #0f6b49;
  background: #e8fff3;
  border-color: #bdeccf;
}

.status-inactive {
  color: #a02222;
  background: #ffecec;
  border-color: #f6c7c7;
}

.card-head-wrap {
  flex-wrap: wrap;
  gap: 10px;
}

.products-table-wrap {
  margin-bottom: 14px;
}

.product-mobile-list {
  display: none;
  gap: 10px;
}

.product-mobile-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.product-mobile-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.product-mobile-head strong {
  display: block;
  font-size: 15px;
}

.product-mobile-head .muted {
  margin-top: 2px;
}

.product-mobile-meta {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: #405071;
}

.product-form-card {
  width: min(920px, 100%);
  margin-inline: auto;
}

.product-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-form-grid > .action-row,
.product-form-grid > .product-image-preview {
  grid-column: 1 / -1;
}

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

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

.category-image {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #edf3ff 0%, #e6edff 100%);
  display: grid;
  place-items: center;
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-image span {
  font-family: "Space Grotesk", sans-serif;
  font-size: 34px;
  color: #2b49ac;
}

.category-body h3 {
  margin: 0;
  font-size: 17px;
}

.category-body p {
  margin: 4px 0 0;
  font-size: 14px;
}

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

.branch-summary-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.branch-summary-card.active {
  border-color: #9fb4fb;
  box-shadow: 0 10px 22px rgba(30, 74, 255, 0.1);
}

.branch-summary-card h3 {
  margin: 0;
  font-size: 16px;
}

.branch-summary-card p {
  margin: 4px 0 0;
  font-size: 13px;
}

.branch-report-btn {
  color: #1a3fd2;
  border-color: #bfd0ff;
  background: #f2f6ff;
}

.stock-action-grid {
  display: grid;
  gap: 8px;
  min-width: 230px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin: 0;
}

.inline-form input {
  min-width: 0;
  padding: 7px 8px;
}

.barcode-input-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
  background: #f8faff;
}

.product-thumb.lg {
  width: 72px;
  height: 72px;
}

.product-thumb.placeholder {
  padding: 4px;
}

.staff-avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  color: #1f3f9a;
  background: #eef3ff;
}

.staff-avatar.lg {
  width: 84px;
  height: 84px;
  font-size: 30px;
}

.staff-avatar.placeholder {
  line-height: 1;
}

.user-action-stack {
  min-width: 84px;
}

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

.staff-profile-meta {
  display: grid;
  gap: 6px;
}

.staff-profile-meta h3 {
  margin: 0;
  font-size: 22px;
}

.staff-profile-meta p {
  margin: 0;
  font-size: 14px;
  color: #33425f;
}

.product-image-preview {
  display: grid;
  gap: 10px;
}

.inline-check {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

.inline-check input {
  width: auto;
}

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

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Billing */
.billing-shell {
  padding: 14px;
}

.billing-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.billing-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 230px) minmax(0, 1fr) auto;
}

.scan-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.billing-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
}

.catalog-panel,
.cart-panel {
  padding: 12px;
}

.catalog-panel .card-head,
.cart-panel .card-head {
  margin-bottom: 10px;
}

.product-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  max-height: 62vh;
  overflow: auto;
  padding-right: 2px;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.product-card-click {
  cursor: pointer;
}

.product-card-click:focus-within,
.product-card-click:hover {
  border-color: #c6d6ff;
  box-shadow: 0 8px 18px rgba(30, 74, 255, 0.08);
}

.product-card-media {
  height: 104px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #eef3ff 0%, #e5ecff 100%);
  display: grid;
  place-items: center;
}

.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-fallback {
  font-size: 26px;
  font-family: "Space Grotesk", sans-serif;
  color: #1f3f9a;
}

.product-card-body {
  display: grid;
  gap: 3px;
}

.product-card-body strong {
  font-size: 14px;
  line-height: 1.25;
  min-height: 34px;
}

.product-card-body small {
  color: var(--muted);
  font-size: 12px;
}

.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cart-table-wrap {
  max-height: 62vh;
  overflow: auto;
}

.qty-control {
  display: grid;
  grid-template-columns: auto minmax(52px, 64px) auto;
  gap: 6px;
  align-items: center;
}

.qty-control input {
  text-align: center;
  padding: 8px 6px;
}

.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(2, 6, 14, 0.78);
  display: grid;
  place-items: center;
  padding: 14px;
}

.scan-modal[hidden] {
  display: none;
}

.scan-modal-card {
  width: min(96vw, 560px);
  background: #0f1628;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.36);
  padding: 12px;
}

.scan-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.scan-modal-head h3 {
  color: #fff;
  font-size: 18px;
}

#cameraScannerVideo {
  width: 100%;
  border-radius: 12px;
  background: #000;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.product-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: #fcfdff;
}

.product-item > div {
  display: grid;
  gap: 4px;
}

.product-item small {
  color: var(--muted);
}

.checkout-bar {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.barcode-tool {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto auto;
  margin-top: 14px;
}

.barcode-generator-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
}

.barcode-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.barcode-size-hint {
  margin-bottom: 8px;
}

.barcode-sheet {
  --label-width: 50mm;
  --label-height: 25mm;
  min-height: 150px;
  border: 1px dashed #cad7fa;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8faff 0%, #f2f6ff 100%);
  padding: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(var(--label-width), var(--label-width)));
  align-content: start;
  justify-content: start;
}

.barcode-empty {
  margin: auto 0;
  color: var(--muted);
  text-align: center;
}

.barcode-label {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  width: var(--label-width);
  min-height: var(--label-height);
  padding: 6px;
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
  align-content: center;
}

.barcode-label strong {
  font-size: 11px;
  line-height: 1.15;
}

.barcode-label small {
  color: #43506f;
  font-size: 10px;
}

.barcode-price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #1f315f;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  color: #1b2f60;
  background: #f2f6ff;
}

.barcode-serial {
  color: var(--muted);
  font-size: 9px;
}

.barcode-svg {
  width: 100%;
  height: calc(var(--label-height) * 0.44);
  min-height: 32px;
}

.error-state {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
}

@media (max-width: 1080px) {
  .home-stats {
    grid-template-columns: 1fr;
    width: min(620px, 100%);
  }

  .chart-grid,
  .notification-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-grid {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .barcode-input-group {
    grid-template-columns: 1fr;
  }

  .barcode-generator-grid {
    grid-template-columns: 1fr;
  }

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

  .product-grid,
  .cart-table-wrap {
    max-height: none;
  }

  .product-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .home-copy h1 {
    max-width: none;
  }

  .home-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .home-copy p {
    margin-top: 12px;
  }

  .home-copy h1 {
    font-size: clamp(34px, 7.2vw, 52px);
    line-height: 1.02;
  }

  .home-stats article {
    padding: 15px;
  }

  .home-shell {
    border-radius: 22px;
    padding: 16px;
  }

  .chart-bar-shell {
    height: 160px;
  }

  .panel-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 290px);
    z-index: 1100;
    transform: translateX(-108%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    padding: 16px 14px;
    gap: 14px;
  }

  .side-menu {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
    padding-bottom: 0;
  }

  .logout-form {
    margin-top: auto;
  }

  .panel-main {
    padding: 14px;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar-overlay {
    display: block;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .billing-controls {
    grid-template-columns: 1fr;
  }

  .scan-controls {
    grid-template-columns: 1fr 1fr;
  }

  .scan-controls input {
    grid-column: 1 / -1;
  }

  .products-table-wrap {
    margin-bottom: 0;
  }

  .stock-action-grid {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .homepage,
  .auth-page {
    padding: 18px 14px;
  }

  .auth-card {
    padding: 22px;
    border-radius: 24px;
  }

  .auth-wide {
    width: min(100%, 560px);
  }

  .home-copy h1 {
    font-size: clamp(30px, 9.6vw, 40px);
    line-height: 1.06;
    letter-spacing: -0.03em;
  }

  .home-copy p {
    font-size: 15px;
    line-height: 1.55;
  }

  .home-eyebrow {
    font-size: 12px;
    padding: 7px 12px;
  }

  .home-stats strong {
    font-size: 16px;
  }

  .home-stats span {
    font-size: 13px;
  }

  .dashboard-actions-card {
    padding: 10px;
  }

  .chart-grid,
  .notification-summary {
    grid-template-columns: 1fr;
  }

  .btn-home {
    min-width: 150px;
    font-size: 15px;
    padding: 12px 16px;
  }

  .auth-head h1 {
    font-size: clamp(28px, 8vw, 36px);
  }

  .auth-head p {
    font-size: 14px;
  }

  .auth-page .btn {
    padding: 12px 14px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-chip {
    justify-items: start;
    text-align: left;
  }

  .metric-grid,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .metric-card.wide {
    grid-column: auto;
  }

  .checkout-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .barcode-tool {
    grid-template-columns: 1fr;
  }

  .billing-controls {
    grid-template-columns: 1fr;
  }

  .scan-controls {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-card {
    padding: 8px;
  }

  .product-card-media {
    height: 88px;
  }

  .products-table-wrap {
    display: none;
  }

  .product-mobile-list {
    display: grid;
  }

  .category-grid,
  .branch-summary-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .staff-profile-head {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}
