:root {
  --ink: #171717;
  --muted: #77736f;
  --soft-muted: #a39e98;
  --paper: #fcfbf9;
  --surface: #ffffff;
  --warm: #f4f1ed;
  --warm-2: #ebe6df;
  --line: #e8e3dd;
  --sidebar: #181817;
  --sidebar-soft: #272624;
  --green: #267a55;
  --green-soft: #e8f4ed;
  --amber: #a86f18;
  --amber-soft: #fff4dc;
  --red: #b64646;
  --red-soft: #fbeaea;
  --blue: #3a68a8;
  --blue-soft: #eaf1fb;
  --shadow: 0 12px 36px rgba(35, 31, 27, 0.07);
  --shadow-lg: 0 30px 80px rgba(24, 22, 20, 0.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Playfair Display", Georgia, serif;
  --sidebar-width: 264px;
}

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

html {
  font-size: 16px;
}

body {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

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

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  color: var(--soft-muted);
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Login */
.admin-login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(380px, 1.08fr) minmax(430px, 0.92fr);
  background: var(--paper);
}

.login-visual {
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

.login-visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.2), rgba(10, 10, 10, 0.68));
}

.login-visual-copy {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 6vw, 5rem);
  color: white;
}

.login-brand {
  position: absolute;
  top: clamp(2rem, 5vw, 4rem);
  left: clamp(2rem, 6vw, 5rem);
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.login-visual-copy > p {
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.login-visual-copy blockquote {
  max-width: 650px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.6vw, 4.8rem);
  line-height: 1.02;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 3rem;
}

.login-card {
  width: min(430px, 100%);
}

.login-card h1 {
  margin: 0.65rem 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.login-card > p:not(.login-disclaimer) {
  color: var(--muted);
  line-height: 1.7;
}

.login-actions {
  margin-top: 2.25rem;
}

.auth-button {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  transition: 0.2s ease;
}

.auth-button:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.owner-auth {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.owner-auth:hover {
  background: #30302f;
}

.google-letter {
  color: #4285f4;
  font-size: 1.15rem;
  font-weight: 700;
}

.login-divider {
  position: relative;
  margin: 1rem 0;
  text-align: center;
}

.login-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.login-divider span {
  position: relative;
  padding: 0 0.75rem;
  background: var(--paper);
  color: var(--soft-muted);
  font-size: 0.75rem;
}

.demo-owner {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface);
}

.owner-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--warm-2);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
}

.demo-owner div:nth-child(2),
.sidebar-user div:nth-child(2),
.topbar-profile div:nth-child(2) {
  display: flex;
  flex-direction: column;
}

.demo-owner strong,
.sidebar-user strong,
.topbar-profile strong {
  font-size: 0.86rem;
}

.demo-owner span,
.sidebar-user span,
.topbar-profile span {
  color: var(--soft-muted);
  font-size: 0.72rem;
}

.demo-owner > i {
  color: var(--green);
  font-size: 1.25rem;
}

.login-disclaimer {
  margin-top: 1.2rem;
  color: var(--soft-muted);
  font-size: 0.72rem;
  line-height: 1.6;
  text-align: center;
}

/* App shell */
.admin-app {
  min-height: 100dvh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  width: var(--sidebar-width);
  padding: 1.6rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--sidebar);
  color: white;
}

.sidebar-head {
  position: relative;
  padding: 0.25rem 0.75rem 1.7rem;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.sidebar-head > span {
  margin-top: 0.25rem;
  color: #9b9892;
  font-size: 0.62rem;
  letter-spacing: 0.35em;
}

.sidebar-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: var(--sidebar-soft);
  color: white;
  font-size: 1.1rem;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nav-caption {
  margin: 0.6rem 0.75rem 0.35rem;
  color: #74716c;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-caption-secondary {
  margin-top: 1.4rem;
}

.admin-nav-item {
  min-height: 45px;
  padding: 0 0.8rem;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  color: #a9a6a0;
  text-align: left;
  transition: 0.2s ease;
}

.admin-nav-item i {
  font-size: 1.2rem;
}

.admin-nav-item span:nth-child(2) {
  font-size: 0.84rem;
  font-weight: 500;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: var(--sidebar-soft);
  color: white;
}

.admin-nav-item.active {
  box-shadow: inset 3px 0 #d5c8b6;
}

.nav-count,
.nav-alert {
  min-width: 21px;
  height: 21px;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #343330;
  color: #bdb9b3;
  font-size: 0.64rem;
}

.nav-alert {
  background: #57382d;
  color: #ffc5aa;
}

.sidebar-help {
  margin-top: auto;
  padding: 1rem;
  border: 1px solid #33322f;
  border-radius: var(--radius);
  background: #211f1d;
}

.sidebar-help > i {
  color: #d7c7a5;
  font-size: 1.25rem;
}

.sidebar-help strong {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.75rem;
}

.sidebar-help p {
  color: #87837e;
  font-size: 0.68rem;
  line-height: 1.55;
}

.sidebar-user {
  margin-top: 0.8rem;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  border-top: 1px solid #2e2d2a;
}

.sidebar-user .owner-avatar {
  width: 34px;
  height: 34px;
  background: #d8cfc2;
}

.sidebar-backdrop {
  display: none;
}

.admin-main {
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 74px;
  padding: 0 2.2rem;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px) 1fr;
  align-items: center;
  gap: 1.5rem;
  background: rgba(252, 251, 249, 0.94);
  backdrop-filter: blur(16px);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  place-items: center;
  background: var(--warm);
  color: var(--ink);
  font-size: 1.2rem;
}

.topbar-title {
  display: flex;
  flex-direction: column;
}

.topbar-title span {
  color: var(--muted);
  font-size: 0.72rem;
}

.topbar-title strong {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.admin-search,
.table-search {
  height: 42px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  color: var(--soft-muted);
}

.admin-search input,
.table-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
}

.admin-search span {
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.62rem;
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.topbar-icon {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.15rem;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--red);
}

.topbar-profile {
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.topbar-profile:hover {
  background: var(--warm);
}

.topbar-profile .owner-avatar {
  width: 36px;
  height: 36px;
}

.topbar-profile[aria-expanded="true"] {
  background: var(--warm);
}

.topbar-profile[aria-expanded="true"] > i {
  transform: rotate(180deg);
}

.topbar-profile > i {
  transition: transform 0.2s ease;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  z-index: 80;
  width: 245px;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: 0.2s ease;
}

.profile-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-menu-head {
  padding: 0.65rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.profile-menu-head > div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.profile-menu-head strong {
  font-size: 0.78rem;
}

.profile-menu-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu > button,
.profile-menu > a {
  width: 100%;
  min-height: 39px;
  padding: 0 0.7rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-align: left;
}

.profile-menu > button:hover,
.profile-menu > a:hover {
  background: var(--warm);
  color: var(--ink);
}

.profile-menu .profile-logout {
  margin-top: 0.3rem;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  color: var(--red);
}

.admin-content {
  padding: 2.3rem;
}

.admin-view {
  display: none;
  animation: view-in 0.25s ease;
}

.admin-view.active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  margin-bottom: 1.8rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.page-heading h1 {
  margin: 0.35rem 0 0.25rem;
  font-family: var(--display);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.page-heading p,
.panel-heading p {
  color: var(--muted);
  font-size: 0.82rem;
}

.heading-actions {
  display: flex;
  gap: 0.65rem;
}

.button {
  min-height: 42px;
  padding: 0 1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  transition: 0.2s ease;
}

.button.primary {
  background: var(--ink);
  color: white;
}

.button.primary:hover {
  background: #343432;
  transform: translateY(-1px);
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: #bbb4ac;
  background: var(--warm);
}

/* Dashboard */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  min-height: 128px;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr auto;
  gap: 0.8rem;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(35, 31, 27, 0.025);
}

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.metric-icon.sales { background: var(--green-soft); color: var(--green); }
.metric-icon.orders { background: var(--blue-soft); color: var(--blue); }
.metric-icon.ticket { background: var(--warm); color: #776650; }
.metric-icon.stock { background: var(--amber-soft); color: var(--amber); }

.metric-meta {
  display: flex;
  flex-direction: column;
}

.metric-meta span {
  color: var(--muted);
  font-size: 0.73rem;
}

.metric-meta strong {
  margin-top: 0.15rem;
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
}

.metric-change,
.metric-link {
  align-self: end;
  grid-column: 2 / 4;
  justify-self: start;
  font-size: 0.67rem;
}

.metric-change.positive {
  color: var(--green);
}

.metric-link {
  background: transparent;
  color: var(--amber);
  text-decoration: underline;
}

.dashboard-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 1rem;
}

.lower-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(35, 31, 27, 0.025);
}

.sales-panel,
.stock-alert-panel,
.orders-panel,
.top-products-panel,
.analytics-main,
.conversion-card,
.analytics-list,
.settings-card {
  padding: 1.35rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading h2,
.settings-heading h2 {
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.panel-heading select,
.table-toolbar select,
.form-fields select,
.stock-modal-card select {
  height: 38px;
  padding: 0 2rem 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.72rem;
}

.text-button {
  flex: 0 0 auto;
  background: transparent;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
}

.chart-total {
  margin-top: 1.2rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.chart-total span {
  color: var(--muted);
  font-size: 0.7rem;
}

.chart-total strong {
  font-family: var(--display);
  font-size: 1.5rem;
}

.bar-chart {
  height: 190px;
  margin-top: 1rem;
  padding-top: 0.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem;
  background-image: linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
}

.chart-column {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
}

.chart-column .bar {
  width: min(28px, 65%);
  min-height: 8px;
  border-radius: 6px 6px 2px 2px;
  background: var(--ink);
  transition: height 0.45s ease;
}

.chart-column span {
  color: var(--soft-muted);
  font-size: 0.62rem;
}

.low-stock-list,
.top-products-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
}

.low-stock-item,
.top-product-item {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
}

.low-stock-item:last-child,
.top-product-item:last-child {
  border-bottom: 0;
}

.low-stock-item img,
.top-product-item img {
  width: 43px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
}

.low-stock-item div,
.top-product-item div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.low-stock-item strong,
.top-product-item strong {
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.low-stock-item span,
.top-product-item span {
  color: var(--soft-muted);
  font-size: 0.65rem;
}

.low-stock-item button {
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.64rem;
  font-weight: 600;
}

.top-product-item > strong {
  font-family: var(--display);
  font-size: 0.95rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--soft-muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: #45423e;
  font-size: 0.74rem;
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: #fdfcfa;
}

.compact-table {
  margin-top: 0.8rem;
}

.status-pill {
  width: max-content;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.63rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pendiente { background: var(--amber-soft); color: var(--amber); }
.status-preparando { background: var(--blue-soft); color: var(--blue); }
.status-enviado { background: #f0ebfb; color: #7350a3; }
.status-entregado, .status-active, .status-pagado { background: var(--green-soft); color: var(--green); }
.status-cancelado, .status-out { background: var(--red-soft); color: var(--red); }
.status-draft { background: var(--warm); color: var(--muted); }

/* Products and inventory */
.summary-strip {
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
}

.summary-strip > div {
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.summary-strip > div:last-child {
  border-right: 0;
}

.summary-strip span {
  color: var(--muted);
  font-size: 0.72rem;
}

.summary-strip strong {
  font-family: var(--display);
  font-size: 1.15rem;
}

.table-panel {
  overflow: hidden;
}

.table-toolbar {
  min-height: 68px;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.table-search {
  width: min(330px, 100%);
  height: 38px;
  border-radius: 9px;
  background: var(--paper);
}

.products-table,
.inventory-table,
.orders-table {
  min-width: 860px;
}

.product-cell {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.product-cell img {
  width: 42px;
  height: 52px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--warm);
}

.product-cell div {
  display: flex;
  flex-direction: column;
}

.product-cell strong {
  color: var(--ink);
  font-size: 0.75rem;
}

.product-cell span {
  color: var(--soft-muted);
  font-size: 0.63rem;
}

.stock-number {
  font-weight: 600;
}

.stock-number.low { color: var(--amber); }
.stock-number.out { color: var(--red); }

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.3rem;
}

.row-action {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--warm);
  color: var(--muted);
  font-size: 0.9rem;
}

.row-action:hover {
  background: var(--warm-2);
  color: var(--ink);
}

.row-action.delete:hover {
  background: var(--red-soft);
  color: var(--red);
}

.table-footer {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--soft-muted);
  font-size: 0.67rem;
}

.inventory-summary {
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.inventory-summary article {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface);
}

.inventory-summary article > i {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--warm);
  color: var(--ink);
  font-size: 1.2rem;
}

.inventory-summary article div {
  display: flex;
  flex-direction: column;
}

.inventory-summary span {
  color: var(--muted);
  font-size: 0.67rem;
}

.inventory-summary strong {
  font-family: var(--display);
  font-size: 1.4rem;
}

.stock-level {
  width: 120px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--warm-2);
}

.stock-level i {
  height: 100%;
  border-radius: inherit;
  display: block;
  background: var(--green);
}

.stock-level.low i { background: var(--amber); }
.stock-level.out i { background: var(--red); }

/* Orders and customers */
.order-tabs {
  margin-bottom: 1rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  background: var(--surface);
}

.order-tabs button {
  min-height: 36px;
  padding: 0 0.8rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.order-tabs button.active {
  background: var(--ink);
  color: white;
}

.order-tabs span {
  min-width: 19px;
  height: 19px;
  padding: 0 0.3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(127, 127, 127, 0.15);
  font-size: 0.58rem;
}

.toolbar-note {
  margin-left: auto;
  color: var(--soft-muted);
  font-size: 0.67rem;
}

.order-status-select {
  height: 34px;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.66rem;
}

.customer-insights {
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.customer-highlight {
  min-height: 125px;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.customer-highlight span,
.customer-highlight small {
  color: var(--muted);
  font-size: 0.7rem;
}

.customer-highlight strong {
  margin: 0.3rem 0 auto;
  font-family: var(--display);
  font-size: 1.8rem;
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.customer-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--warm);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Analytics and settings */
.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 1rem;
}

.analytics-list {
  grid-column: 1 / -1;
}

.category-bars {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-bar-row {
  display: grid;
  grid-template-columns: 115px 1fr 42px;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.72rem;
}

.category-progress {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--warm);
}

.category-progress i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--ink);
}

.conversion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.conversion-card > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.conversion-card > strong {
  margin-top: 0.2rem;
  font-family: var(--display);
  font-size: 1.8rem;
}

.conversion-ring {
  width: 130px;
  height: 130px;
  margin: 1.2rem 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ink) 0 38%, var(--warm) 38% 100%);
}

.conversion-ring::before {
  content: "";
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: white;
}

.conversion-ring span {
  position: absolute;
  font-family: var(--display);
  font-size: 1.25rem;
}

.conversion-card p {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.indicator-row {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 60px;
  gap: 1rem;
  font-size: 0.75rem;
}

.indicator-row:last-child { border-bottom: 0; }
.indicator-row em { color: var(--green); font-size: 0.68rem; font-style: normal; text-align: right; }
.indicator-row em.negative { color: var(--red); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.settings-heading {
  margin-bottom: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.settings-heading > i {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--warm);
  font-size: 1.2rem;
}

.settings-heading p {
  color: var(--muted);
  font-size: 0.7rem;
}

.settings-card > label:not(.toggle-row),
.stock-modal-card form > label {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.settings-card input,
.stock-modal-card input {
  height: 42px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  outline: 0;
}

.toggle-row {
  position: relative;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toggle-row span {
  display: flex;
  flex-direction: column;
}

.toggle-row strong { font-size: 0.74rem; }
.toggle-row small { margin-top: 0.2rem; color: var(--muted); font-size: 0.65rem; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row > i { width: 38px; height: 22px; padding: 3px; border-radius: 999px; background: var(--warm-2); transition: 0.2s; }
.toggle-row > i::before { content: ""; width: 16px; height: 16px; border-radius: 50%; display: block; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: 0.2s; }
.toggle-row input:checked + i { background: var(--ink); }
.toggle-row input:checked + i::before { transform: translateX(16px); }
.settings-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

/* Modals and notifications */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  padding: 1.5rem;
  display: grid;
  place-items: center;
  background: rgba(20, 19, 18, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.admin-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-card {
  width: min(790px, 100%);
  max-height: calc(100dvh - 3rem);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  overflow-y: auto;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.25s ease;
}

.admin-modal.open .admin-modal-card {
  transform: translateY(0) scale(1);
}

.stock-modal-card {
  width: min(460px, 100%);
}

.modal-heading {
  margin-bottom: 1.3rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-heading h2 {
  margin-top: 0.3rem;
  font-family: var(--display);
  font-size: 1.8rem;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--warm);
  color: var(--ink);
  font-size: 1.1rem;
}

.product-form-layout {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.2rem;
}

.image-preview {
  height: 250px;
  border: 1px dashed #cfc8c0;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--warm);
  color: var(--soft-muted);
  font-size: 0.7rem;
}

.image-preview i { font-size: 2rem; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }

.form-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.form-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.form-fields .full-field { grid-column: 1 / -1; }

.form-fields input {
  height: 42px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  outline: 0;
}

.form-fields select { height: 42px; background: var(--paper); }

.modal-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.stock-product-summary {
  padding: 0.9rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--warm);
}

.stock-product-summary img { width: 52px; height: 62px; border-radius: 8px; object-fit: cover; }
.stock-product-summary div { display: flex; flex-direction: column; }
.stock-product-summary span { color: var(--muted); font-size: 0.7rem; }

.notification-panel {
  position: fixed;
  top: 68px;
  right: 2rem;
  z-index: 220;
  width: min(380px, calc(100% - 2rem));
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: 0.2s ease;
}

.notification-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notification-head {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}

.notification-head div { display: flex; flex-direction: column; }
.notification-head strong { font-size: 0.86rem; }
.notification-head span { color: var(--muted); font-size: 0.67rem; }
.notification-head button { background: transparent; color: var(--muted); font-size: 1rem; }

.notification-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
}

.notification-item:last-child { border-bottom: 0; }
.notification-item > i { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.notification-item div { display: flex; flex-direction: column; }
.notification-item strong { font-size: 0.72rem; }
.notification-item span { color: var(--muted); font-size: 0.65rem; line-height: 1.45; }

.admin-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 400;
  max-width: calc(100% - 2rem);
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow-lg);
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 0.2s ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.empty-state {
  padding: 2.5rem 1rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .inventory-summary { grid-template-columns: repeat(2, 1fr); }
  .admin-topbar { grid-template-columns: auto 1fr auto; }
  .admin-search { display: none; }
}

@media (max-width: 980px) {
  .admin-sidebar {
    transform: translateX(-102%);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.22);
    transition: transform 0.3s ease;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 90; display: block; background: rgba(0,0,0,.42); opacity: 0; pointer-events: none; transition: .2s; }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .admin-main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .admin-topbar { padding: 0 1.2rem; grid-template-columns: auto 1fr auto; }
  .dashboard-grid, .lower-grid, .analytics-layout { grid-template-columns: 1fr; }
  .analytics-list { grid-column: auto; }
}

@media (max-width: 760px) {
  .admin-login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100dvh; padding: 2rem 1.2rem; }
  .login-panel::before { content: "INDI INTIMATES"; position: absolute; top: 2rem; font-family: var(--display); font-size: 1.15rem; }
  .admin-content { padding: 1.3rem 1rem 2rem; }
  .topbar-profile > div:nth-child(2), .topbar-profile > i, .topbar-title strong { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metric-grid, .customer-insights, .settings-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr; }
  .summary-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-strip > div:last-child { border-bottom: 0; }
  .settings-actions { grid-column: auto; }
  .settings-actions .button { width: 100%; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .table-search { width: 100%; }
  .table-toolbar select { width: 100%; }
  .toolbar-note { margin-left: 0; }
  .product-form-layout { grid-template-columns: 1fr; }
  .image-preview { height: 190px; }
  .notification-panel { top: 68px; right: 1rem; }
}

@media (max-width: 520px) {
  .admin-topbar { height: 64px; padding: 0 0.8rem; }
  .topbar-title span { font-size: 0.66rem; }
  .topbar-icon { width: 36px; height: 36px; }
  .topbar-profile { padding: 0; }
  .topbar-profile .owner-avatar { width: 36px; height: 36px; }
  .metric-grid, .inventory-summary { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .page-heading h1 { font-size: 2.1rem; }
  .heading-actions { flex-direction: column; }
  .heading-actions .button, .page-heading > .button { width: 100%; }
  .form-fields { grid-template-columns: 1fr; }
  .form-fields .full-field { grid-column: auto; }
  .admin-modal { padding: 0.6rem; }
  .admin-modal-card { max-height: calc(100dvh - 1.2rem); padding: 1rem; border-radius: var(--radius); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .table-footer { align-items: flex-start; flex-direction: column; gap: 0.3rem; }
}
