:root {
  --sidebar-bg: #ffffff;
  --sidebar-active: #fff5f7;
  --sidebar-text: #64748b;
  --sidebar-text-strong: #4c1420;
  --page-bg: #f6f0f2;
  --workspace-bg: #ffffff;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #ece4e7;
  --rose: #c73e54;
  --rose-soft: #fff0f3;
  --navy: #4c1420;
  --brown: #8b5e34;
  --brown-dark: #6b4423;
  --green: #16a34a;
  --orange: #ea580c;
  --blue: #2563eb;
  --red: #dc2626;
  --shadow: 0 10px 30px rgba(76, 20, 32, 0.06);
  --shadow-lg: 0 18px 50px rgba(76, 20, 32, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body.admin-app {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

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

.admin-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  width: 250px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 24px rgba(76, 20, 32, 0.03);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5e34, #6b4423);
  display: grid;
  place-items: center;
  color: #fff;
}

.brand-icon .icon svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  overflow: auto;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0 12px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.nav-link .icon:last-child svg {
  display: none;
}

.nav-link:hover {
  background: #faf7f8;
  color: var(--sidebar-text-strong);
}

.nav-link.active {
  background: var(--sidebar-active);
  color: var(--rose);
  font-weight: 700;
  box-shadow: inset -3px 0 0 var(--rose);
}

.nav-link .icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-link-label {
  flex: 1;
  min-width: 0;
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 6px;
  flex-shrink: 0;
}

.nav-badge[hidden] {
  display: none;
}

.nav-link span:nth-child(2) {
  flex: 1;
}

.nav-link.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  color: var(--navy);
  font-weight: 600;
  background: #faf7f8;
  border: 1px solid var(--border);
}

.sidebar-logout .icon svg {
  width: 18px;
  height: 18px;
}

.admin-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--workspace-bg);
  border-top-left-radius: 28px;
  border-bottom-left-radius: 28px;
  box-shadow: var(--shadow-lg);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px 12px;
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
}

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

.topbar-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border-radius: 14px;
  padding: 0 16px;
  height: 46px;
  box-shadow: var(--shadow);
}

.topbar-search .icon svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.topbar-search input {
  border: 0;
  outline: none;
  flex: 1;
  font: inherit;
  font-size: 14px;
  background: transparent;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.bell-btn {
  position: relative;
}

.bell-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.bell-badge[hidden] {
  display: none;
}

.notification-menu {
  position: relative;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(61, 43, 31, 0.14);
  z-index: 60;
  overflow: hidden;
}

.notification-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.notification-dropdown-head strong {
  font-size: 14px;
  color: var(--navy);
}

.notification-mark-all {
  border: 0;
  background: transparent;
  color: var(--rose);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.notification-mark-all[hidden] {
  display: none;
}

.notification-list {
  max-height: 360px;
  overflow: auto;
}

.notification-empty {
  padding: 28px 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(236, 228, 231, 0.7);
  transition: background 0.15s ease;
  position: relative;
}

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

.notification-item:hover {
  background: #fff8f9;
}

.notification-item.is-unread {
  background: linear-gradient(90deg, rgba(199, 62, 84, 0.06), transparent);
}

.notification-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.notification-icon-buyer {
  background: #eef6ff;
  color: #2563eb;
}

.notification-icon-partner {
  background: #f6eee6;
  color: #8b5e34;
}

.notification-icon-order {
  background: #fff0f2;
  color: #c73e54;
}

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

.notification-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-right: 12px;
}

.notification-body strong {
  font-size: 13px;
  color: var(--navy);
  line-height: 1.35;
}

.notification-body span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

.notification-body em {
  font-style: normal;
  font-size: 11px;
  color: #a89298;
}

.notification-dot {
  position: absolute;
  top: 18px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
}

.notification-dropdown-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #faf7f8;
}

.notification-dropdown-foot a {
  font-size: 12px;
  font-weight: 700;
  color: var(--rose);
  text-decoration: none;
}

.notification-menu.open .notification-dropdown {
  display: block;
}

.profile-menu {
  position: relative;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: 14px;
  padding: 8px 10px 8px 14px;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-menu.open .profile-chip,
.profile-chip:hover {
  border-color: rgba(139, 94, 52, 0.18);
  box-shadow: 0 10px 28px rgba(61, 43, 31, 0.08);
}

.profile-name {
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.profile-role {
  font-size: 12px;
  color: var(--text-muted);
  text-align: left;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c73e54, #8b5e34);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-chevron {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.profile-chevron .icon svg {
  width: 16px;
  height: 16px;
}

.profile-menu.open .profile-chevron {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(61, 43, 31, 0.14);
  padding: 10px;
  z-index: 50;
}

.profile-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
}

.profile-dropdown-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c73e54, #8b5e34);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-dropdown-head strong {
  display: block;
  font-size: 14px;
}

.profile-dropdown-head span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s ease;
}

.profile-dropdown-item .icon svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.profile-dropdown-item:hover {
  background: #faf8f6;
}

.profile-dropdown-item.danger {
  color: var(--red);
}

.profile-dropdown-item.danger .icon svg {
  color: var(--red);
}

.page-content {
  padding: 0 28px 28px;
  flex: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.page-content-flush {
  padding-top: 4px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
}

.page-subtitle {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
  width: 100%;
}

.stats-grid > * {
  min-width: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(76, 20, 32, 0.48);
  z-index: 35;
}

.admin-shell.sidebar-open .sidebar-backdrop {
  display: block;
}

body.sidebar-lock {
  overflow: hidden;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-icon .icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.brown { background: #f6eee6; color: var(--brown); }
.stat-icon.green { background: #eaf7ee; color: var(--green); }
.stat-icon.orange { background: #fff1e8; color: var(--orange); }
.stat-icon.blue { background: #eef4ff; color: var(--blue); }
.stat-icon.gold { background: #fff8e8; color: #d97706; }

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 6px;
  word-break: break-word;
}

.stat-card > div:last-child {
  min-width: 0;
  flex: 1;
}

.stat-meta {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

.stat-meta.neutral {
  color: var(--text-muted);
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
  width: 100%;
  max-width: 100%;
}

.dashboard-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 100%;
}

.panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
  overflow: hidden;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.panel-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brown);
}

.chart-wrap {
  height: 280px;
  position: relative;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-item {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.order-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #f3f4f6;
}

.order-meta small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 2px;
}

.order-meta strong {
  display: block;
  font-size: 14px;
}

.order-buyer {
  font-size: 13px;
  color: var(--text-muted);
}

.order-price {
  font-weight: 700;
  font-size: 14px;
  margin-right: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-pending { background: #fff7ed; color: #c2410c; }
.badge-preparing { background: #fff7ed; color: #ea580c; }
.badge-ready { background: #ecfdf3; color: #15803d; }
.badge-delivered { background: #eff6ff; color: #1d4ed8; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }

.rank-list,
.simple-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rank-item,
.simple-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f6eee6;
  color: var(--brown);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.list-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #f3f4f6;
}

.list-main {
  flex: 1;
  min-width: 0;
}

.list-main strong {
  display: block;
  font-size: 14px;
}

.list-main span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.list-side {
  text-align: right;
  font-size: 12px;
}

.list-side .rating {
  color: #d97706;
  font-weight: 700;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.donut-chart {
  width: 150px;
  height: 150px;
  position: relative;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 22px;
}

.donut-center span {
  font-size: 12px;
  color: var(--text-muted);
}

.insight-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.insight-stat {
  background: #faf8f6;
  border-radius: 12px;
  padding: 12px;
}

.insight-stat span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.insight-stat strong {
  font-size: 22px;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.admin-footer {
  padding: 18px 28px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.heart {
  color: var(--red);
}

.data-table-wrap {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: #faf8f6;
}

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

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* Login — split card layout */
body.login-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(199, 62, 84, 0.12), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(61, 43, 31, 0.1), transparent 32%),
    linear-gradient(135deg, #f7f2ef 0%, #ece4df 100%);
}

.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.login-card-split {
  width: min(980px, 100%);
  min-height: 580px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(76, 20, 32, 0.16);
  background: #fff;
}

.login-brand-panel {
  position: relative;
  padding: 34px 38px 28px;
  background:
    radial-gradient(circle at top right, rgba(199, 62, 84, 0.28), transparent 42%),
    linear-gradient(160deg, #4c1420 0%, #3d2b1f 55%, #5a3f2d 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.login-brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #8b5e34, #6b4423);
  display: grid;
  place-items: center;
  color: #fff;
}

.login-logo-mark .icon svg {
  width: 20px;
  height: 20px;
}

.login-logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-illustration {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 12px 0 8px;
}

.login-illustration svg {
  width: min(280px, 100%);
  height: auto;
}

.login-brand-copy h1 {
  margin: 0 0 10px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
}

.login-brand-copy p {
  margin: 0;
  max-width: 360px;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.login-dots {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.login-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: transparent;
}

.login-dots span.active {
  background: #fff;
  border-color: #fff;
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: 42px 34px;
  background: #fff;
}

.login-form-inner {
  width: min(340px, 100%);
}

.login-form-inner h2 {
  margin: 0 0 10px;
  font-size: 34px;
  font-weight: 800;
  color: #c73e54;
  letter-spacing: -0.02em;
}

.login-form-lead {
  margin: 0 0 28px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.field-line {
  position: relative;
  margin-bottom: 26px;
}

.field-line input {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid #d8d2cc;
  background: transparent;
  padding: 10px 34px 12px 0;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  border-radius: 0;
}

.field-line input::placeholder {
  color: #9ca3af;
}

.field-line input:focus {
  outline: none;
  border-bottom-color: #c73e54;
}

.field-icon,
.field-icon-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #b8b0a8;
  display: grid;
  place-items: center;
}

.field-icon .icon svg,
.field-icon-btn .icon svg {
  width: 18px;
  height: 18px;
}

.field-icon-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.field-icon-btn .toggle-eye-off {
  display: none;
}

.field-icon-btn.revealed .toggle-eye {
  display: none;
}

.field-icon-btn.revealed .toggle-eye-off {
  display: grid;
}

.login-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
}

.login-btn {
  min-width: 118px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #c73e54;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 22px;
  box-shadow: 0 10px 24px rgba(199, 62, 84, 0.24);
  transition: background 0.15s ease, transform 0.15s ease;
}

.login-btn:hover {
  background: #b5364a;
}

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

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.remember-check input {
  width: 15px;
  height: 15px;
  accent-color: #c73e54;
}

.login-forgot {
  display: block;
  margin-top: 34px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #c73e54;
}

.login-forgot:hover {
  color: #4c1420;
}

.login-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 18px;
}

.login-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 18px;
}

.login-resend-form {
  margin-top: 12px;
}

.login-forgot-btn {
  display: block;
  width: 100%;
  margin-top: 0;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

/* Professional dashboard layout */
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.dashboard-main {
  min-width: 0;
}

.hero-banner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: center;
  padding: 28px 30px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(135deg, #c73e54 0%, #8b5e34 52%, #4c1420 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 22px;
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.86;
}

.hero-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  font-weight: 800;
}

.hero-copy p {
  margin: 0 0 18px;
  max-width: 520px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: #fff;
  color: var(--rose);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(76, 20, 32, 0.16);
}

.hero-art {
  display: grid;
  place-items: center;
}

.hero-art svg {
  width: min(240px, 100%);
  height: auto;
}

.widget-section {
  margin-bottom: 22px;
}

.section-head,
.rail-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h3,
.rail-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}

.section-link,
.panel-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--rose);
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.widget-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.widget-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.widget-icon .icon svg {
  width: 22px;
  height: 22px;
}

.widget-card.tone-rose .widget-icon { background: #fff0f3; color: #c73e54; }
.widget-card.tone-amber .widget-icon { background: #fff7ed; color: #ea580c; }
.widget-card.tone-wine .widget-icon { background: #fdf2f4; color: #7a4550; }
.widget-card.tone-brown .widget-icon { background: #f6eee6; color: #8b5e34; }
.widget-card.tone-gold .widget-icon { background: #fff8e8; color: #d97706; }

.widget-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.widget-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  word-break: break-word;
}

.widget-meta {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #16a34a;
}

.panel-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.panel-table {
  margin-bottom: 22px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.pro-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.pro-table th,
.pro-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.pro-table th {
  background: #faf7f8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

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

.pro-table tr.is-highlight {
  background: linear-gradient(90deg, rgba(199, 62, 84, 0.08), rgba(199, 62, 84, 0.02));
}

.pro-table tr.is-highlight td {
  color: var(--navy);
}

.cell-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.cell-menu {
  text-align: right;
  color: var(--text-muted);
  font-size: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-orange { background: #ea580c; }
.dot-blue { background: #2563eb; }
.dot-green { background: #16a34a; }
.dot-teal { background: #0d9488; }
.dot-gray { background: #94a3b8; }
.dot-red { background: #dc2626; }

.chart-wrap-pro {
  height: 260px;
}

.dashboard-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.rail-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.rail-profile strong {
  display: block;
  font-size: 15px;
  color: var(--navy);
}

.rail-profile span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.rail-profile a {
  color: var(--rose);
  font-weight: 600;
}

.rail-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.week-day {
  text-align: center;
  padding: 10px 6px;
  border-radius: 14px;
  background: #faf7f8;
  border: 1px solid transparent;
}

.week-day span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.week-day strong {
  font-size: 16px;
  color: var(--navy);
}

.week-day.is-today {
  background: var(--rose);
  border-color: var(--rose);
}

.week-day.is-today span,
.week-day.is-today strong {
  color: #fff;
}

.rail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rail-item.compact {
  justify-content: space-between;
}

.rail-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c73e54, #8b5e34);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.rail-avatar.buyer {
  background: linear-gradient(135deg, #8b5e34, #4c1420);
}

.rail-item-main {
  flex: 1;
  min-width: 0;
}

.rail-item-main strong {
  display: block;
  font-size: 14px;
  color: var(--navy);
}

.rail-item-main span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 11px;
  font-weight: 700;
}

.rail-empty {
  padding: 18px 0;
  font-size: 13px;
}

@media (max-width: 1200px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

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

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

  .dashboard-grid-2,
  .dashboard-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .login-card-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-brand-panel {
    min-height: 320px;
  }

  .login-illustration svg {
    width: min(220px, 80%);
  }

  .login-form-panel {
    padding: 34px 24px 30px;
  }

  .admin-shell {
    display: block;
    width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 88vw);
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 40;
    flex-shrink: 0;
  }

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

  .admin-main {
    border-radius: 0;
    box-shadow: none;
  }

  .hero-banner {
    grid-template-columns: 1fr;
    padding: 22px 18px;
  }

  .hero-art {
    display: none;
  }

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

  .widget-card {
    padding: 14px 12px;
  }

  .widget-value {
    font-size: 18px;
  }

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

  .topbar {
    padding: 12px 14px;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .topbar-search {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
    flex-shrink: 0;
  }

  .profile-text {
    display: none;
  }

  .profile-chip {
    padding: 6px 8px;
    gap: 8px;
  }

  .profile-chevron {
    display: none;
  }

  .profile-dropdown {
    width: min(260px, calc(100vw - 24px));
    right: 0;
  }

  .page-content,
  .admin-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .page-subtitle {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .chart-wrap {
    height: 220px;
  }

  .admin-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 18px;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 12px 10px;
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .stat-icon .icon svg {
    width: 16px;
    height: 16px;
  }

  .stat-label {
    font-size: 11px;
    line-height: 1.3;
  }

  .stat-value {
    font-size: 17px;
  }

  .stat-meta {
    font-size: 10px;
    line-height: 1.3;
  }

  .panel {
    padding: 16px 14px;
  }

  .panel-head h2 {
    font-size: 16px;
  }

  .donut-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .donut-chart {
    width: 130px;
    height: 130px;
  }

  .order-item {
    grid-template-columns: 44px 1fr;
    gap: 10px;
  }

  .order-buyer,
  .order-price {
    display: none;
  }

  .login-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .remember-check {
    justify-content: center;
  }
}

/* ── Manage list pages (restaurants, buyers) ── */

.page-restaurants .widget-grid-4,
.page-buyers .widget-grid-4,
.page-menu-items .widget-grid-4,
.page-categories .widget-grid-4,
.page-locations .widget-grid-4,
.page-orders .widget-grid-4,
.page-banners .widget-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.banner-preview-panel {
  margin-bottom: 22px;
}

.location-row-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.location-pin-badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(199, 62, 84, 0.1);
  color: var(--rose);
  flex-shrink: 0;
}

.location-pin-badge .icon svg {
  width: 18px;
  height: 18px;
}

.location-avatar .icon svg {
  width: 28px;
  height: 28px;
}

.location-detail-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff7f8;
  border: 1px solid rgba(199, 62, 84, 0.12);
}

.location-detail-name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
}

.location-detail-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.tag-chip-soft {
  background: rgba(199, 62, 84, 0.08);
  color: var(--rose);
}

.banner-phone-preview {
  max-width: 420px;
}

.banner-full-image {
  width: 100%;
  aspect-ratio: 2.4 / 1;
  border-radius: 20px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--border);
}

.banner-full-image-compact {
  max-width: 100%;
}

.banner-full-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-preview-caption {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.banner-thumb {
  width: 120px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}

.banner-modal-preview {
  margin-bottom: 16px;
}

.banner-row-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.banner-thumb-only-mobile {
  display: none;
}

.banner-slide-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.banner-slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(199, 62, 84, 0.25);
}

.banner-slide-dot.is-active {
  background: var(--rose);
  width: 10px;
  height: 10px;
}

.admin-modal-wide {
  width: min(520px, calc(100vw - 32px));
}

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

.admin-field-check {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #faf7f8;
  font-size: 14px;
  color: var(--navy);
}

.admin-checkbox input {
  width: 16px;
  height: 16px;
}

.widget-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.widget-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(76, 20, 32, 0.12);
}

.filter-add-btn {
  margin-left: auto;
}

.category-avatar .icon svg {
  width: 28px;
  height: 28px;
}

.detail-actions .btn.detail-action-form {
  display: inline-flex;
  width: auto;
  flex: 1 1 calc(50% - 5px);
  min-width: 140px;
  text-decoration: none;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(320px, 100%);
  padding: 0 14px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}

.toolbar-search .icon svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.toolbar-search input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: var(--navy);
}

.search-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-clear-btn:hover {
  background: #faf7f8;
  color: var(--rose);
}

.search-clear-btn .icon svg {
  width: 16px;
  height: 16px;
}

.admin-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
}

.admin-alert-success {
  background: #ecfdf3;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.admin-alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-tab.is-active {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

.filter-search-note {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

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

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

.buyer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff0f3, #fdf2f4);
  color: var(--rose);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.buyer-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  font-size: 22px;
}

.detail-hero {
  position: relative;
  margin: 16px 20px 0;
  border-radius: 18px;
  overflow: hidden;
  background: #f3f4f6;
}

.detail-hero-buyer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #fff0f3, #faf7f8);
  border: 1px solid var(--border);
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.detail-order-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.cell-actions {
  text-align: right;
  white-space: nowrap;
}

.cell-actions .inline-form {
  display: inline-block;
  margin-left: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.btn .icon svg {
  width: 16px;
  height: 16px;
}

.btn-ghost {
  background: #faf7f8;
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-success {
  background: #16a34a;
  color: #fff;
}

.btn-outline {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-warn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(76, 20, 32, 0.42);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.detail-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--card-bg);
  z-index: 130;
  box-shadow: -12px 0 40px rgba(76, 20, 32, 0.18);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-drawer.is-open {
  transform: translateX(0);
}

.detail-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.detail-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rose);
}

.detail-drawer-head h2 {
  margin: 0;
  font-size: 22px;
  color: var(--navy);
}

.detail-close .icon svg {
  width: 20px;
  height: 20px;
}

.detail-cover {
  position: relative;
  margin: 16px 20px 0;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
}

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

.detail-cover-meta {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-open-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
}

.detail-open-pill.is-closed {
  color: #6b7280;
}

.detail-body {
  flex: 1;
  overflow: auto;
  padding: 18px 20px 24px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.detail-stat {
  padding: 14px;
  border-radius: 14px;
  background: #faf7f8;
  border: 1px solid var(--border);
}

.detail-stat strong {
  display: block;
  font-size: 18px;
  color: var(--navy);
}

.detail-stat span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.detail-tag {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brown);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.detail-field span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-field strong {
  display: block;
  font-size: 14px;
  color: var(--navy);
  line-height: 1.45;
  word-break: break-word;
}

.detail-field-wide {
  grid-column: 1 / -1;
}

.detail-section {
  margin-bottom: 18px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--navy);
}

.detail-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.detail-muted {
  font-size: 13px !important;
}

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

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff0f3;
  color: var(--rose);
  font-size: 12px;
  font-weight: 700;
}

.tag-chip-sm {
  font-size: 11px;
  padding: 4px 10px;
}

.menu-item-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.toolbar-search-inline {
  min-width: min(280px, 100%);
  margin-bottom: 16px;
}

.panel-head .toolbar-search-inline {
  margin-bottom: 0;
}

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

.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #faf7f8;
}

.category-card-body {
  min-width: 0;
}

.category-card-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.category-edit-btn .icon svg {
  width: 14px;
  height: 14px;
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(76, 20, 32, 0.42);
  z-index: 140;
}

.admin-modal-backdrop.is-open {
  display: block;
}

.admin-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(76, 20, 32, 0.22);
  z-index: 150;
  overflow: hidden;
}

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

.admin-modal-head h3 {
  margin: 0;
  font-size: 18px;
  color: var(--navy);
}

.admin-modal-form {
  padding: 20px;
}

.admin-field {
  display: block;
  margin-bottom: 16px;
}

.admin-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.admin-field small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.admin-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.admin-field select,
.admin-field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--navy);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-field textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}

.admin-field select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A4550' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}

.admin-field input[type="file"] {
  width: 100%;
  min-height: 46px;
  border: 1px dashed #dccfd3;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--navy);
  background: #faf7f8;
  cursor: pointer;
}

.admin-field input::placeholder,
.admin-field textarea::placeholder {
  color: #a89298;
}

.admin-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.admin-field select:focus,
.admin-field textarea:focus {
  outline: none;
  border-color: rgba(199, 62, 84, 0.55);
  box-shadow: 0 0 0 3px rgba(199, 62, 84, 0.12);
}

.admin-field input[type="file"]:focus {
  outline: none;
  border-color: rgba(199, 62, 84, 0.55);
  box-shadow: 0 0 0 3px rgba(199, 62, 84, 0.12);
}

.admin-field-note {
  margin: -4px 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.admin-modal-delete-bar {
  padding: 0 24px 20px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 16px;
}

.admin-modal-delete-bar .btn-block {
  width: 100%;
  justify-content: center;
}

body.modal-lock {
  overflow: hidden;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: #fff;
}

.detail-action-form {
  flex: 1 1 calc(50% - 5px);
  min-width: 140px;
}

.detail-action-form .btn {
  width: 100%;
}

body.drawer-lock {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .page-restaurants .widget-grid-4,
  .page-buyers .widget-grid-4,
  .page-menu-items .widget-grid-4,
  .page-categories .widget-grid-4,
  .page-locations .widget-grid-4,
  .page-orders .widget-grid-4,
  .page-banners .widget-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-restaurants .section-head,
  .page-buyers .section-head,
  .page-menu-items .section-head,
  .page-categories .section-head,
  .page-orders .section-head,
  .page-banners .section-head,
  .page-locations .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-field-row {
    grid-template-columns: 1fr;
  }

  .filter-add-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .panel-head .toolbar-search-inline {
    width: 100%;
  }

  .toolbar-search {
    width: 100%;
    min-width: 0;
  }

  .cell-actions {
    white-space: normal;
  }

  .cell-actions .btn,
  .cell-actions .inline-form {
    display: block;
    margin: 6px 0 0;
  }

  .detail-drawer {
    width: 100vw;
  }

  .detail-action-form {
    flex: 1 1 100%;
  }
}

@media (max-width: 640px) {
  .page-restaurants .widget-grid-4,
  .page-buyers .widget-grid-4,
  .page-menu-items .widget-grid-4,
  .page-categories .widget-grid-4,
  .page-locations .widget-grid-4,
  .page-orders .widget-grid-4,
  .page-banners .widget-grid-4 {
    grid-template-columns: 1fr 1fr;
  }

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

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

.sidebar-brand-logo-only {
  padding: 4px 10px 20px;
}

.brand-logo-img {
  width: auto;
  height: 56px;
  max-width: 100%;
  object-fit: contain;
  flex-shrink: 0;
  /* Dark brown brand mark on light sidebar */
  filter: brightness(0) saturate(100%) invert(28%) sepia(30%) saturate(900%) hue-rotate(358deg) brightness(94%) contrast(91%);
}

.login-brand-top-logo-only {
  justify-content: flex-start;
}

.login-logo-image {
  width: auto;
  height: 72px;
  max-width: 220px;
  object-fit: contain;
  /* White logo on the login brand panel */
  filter: brightness(0) invert(1);
}

.settings-tabs {
  margin-bottom: 18px;
}

.settings-panel {
  margin-bottom: 18px;
}

.settings-panel .panel-head {
  padding: 20px 22px 0;
}

.settings-form {
  padding: 18px 22px 22px;
}

.settings-section + .settings-section {
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.settings-section-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
}

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

.settings-form-grid .admin-field {
  margin-bottom: 0;
}

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

.settings-preview-card {
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #fff8f9 100%);
}

.settings-preview-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--navy);
}

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

.settings-preview-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.settings-preview-grid strong,
.settings-preview-grid span {
  display: block;
  color: var(--navy);
}

.settings-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.settings-form-actions .btn {
  min-height: 44px;
  padding: 0 18px;
}

.brand-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.brand-upload-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.brand-upload-card .admin-field {
  margin-bottom: 0;
}

.brand-upload-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--navy);
}

.brand-upload-head p {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.brand-upload-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px dashed #e7d8dc;
  background: #fff8f9;
  color: var(--text-muted);
  overflow: hidden;
}

.brand-upload-preview img {
  max-width: 100%;
  max-height: 88px;
  object-fit: contain;
}

.brand-upload-preview-mobile {
  min-height: 120px;
}

.brand-upload-preview-favicon {
  min-height: 72px;
}

.brand-upload-preview.is-empty span {
  font-size: 13px;
}

.settings-test-mail .settings-form {
  padding-top: 0;
}

.settings-test-card {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #bbf7d0;
  background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%);
}

.settings-test-copy {
  margin-bottom: 16px;
}

.settings-test-copy strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  color: var(--navy);
}

.settings-test-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.settings-test-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.settings-test-row .admin-field {
  flex: 1;
  margin: 0;
}

.settings-test-row .btn {
  min-height: 46px;
  white-space: nowrap;
  flex-shrink: 0;
}

.page-settings .admin-field-note,
.page-settings .settings-field-note {
  margin: 4px 0 0;
}

@media (max-width: 900px) {
  .settings-form-grid,
  .settings-preview-grid,
  .brand-upload-grid {
    grid-template-columns: 1fr;
  }

  .settings-field-full {
    grid-column: auto;
  }

  .settings-test-row {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-test-row .btn {
    width: 100%;
  }
}

.page-profile .profile-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.page-profile .profile-dashboard-main {
  min-width: 0;
}

.page-profile .profile-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-profile .hero-btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

.page-profile .hero-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.page-profile .profile-hero-card {
  width: min(260px, 100%);
  padding: 22px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  backdrop-filter: blur(8px);
}

.page-profile .profile-hero-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--rose);
  background: #fff;
}

.page-profile .profile-hero-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.page-profile .profile-hero-card span {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
  word-break: break-word;
}

.page-profile .profile-hero-card em {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.page-profile .widget-value-sm {
  font-size: clamp(16px, 2vw, 20px);
}

.page-profile .profile-tabs .filter-tab {
  gap: 8px;
}

.page-profile .profile-tabs .filter-tab .icon svg {
  width: 16px;
  height: 16px;
}

.page-profile .profile-tabs .filter-tab.is-active .icon svg {
  stroke: #fff;
}

.page-profile .profile-security-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.page-profile .profile-security-list a {
  color: var(--rose);
  font-weight: 600;
}

.page-profile .profile-rail-card {
  align-items: flex-start;
}

.page-profile .profile-rail-stats {
  display: grid;
  gap: 12px;
}

.page-profile .profile-rail-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #faf7f8;
  border: 1px solid var(--border);
}

.page-profile .profile-rail-stat span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.page-profile .profile-rail-stat strong {
  font-size: 13px;
  color: var(--navy);
  text-align: right;
}

.page-profile .profile-status-active {
  color: #16a34a !important;
}

.page-profile .profile-link-list {
  display: grid;
  gap: 8px;
}

.page-profile .profile-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.page-profile .profile-link-item:hover {
  background: #fff8f9;
  border-color: #f0d9de;
}

.page-profile .profile-link-item .icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--rose);
}

.page-profile .profile-link-danger {
  color: #b42318;
}

.page-profile .profile-link-danger .icon svg {
  stroke: #b42318;
}

.page-profile .profile-tip-card p {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.page-profile .profile-tip-btn {
  width: 100%;
}

@media (max-width: 1100px) {
  .page-profile .profile-dashboard {
    grid-template-columns: 1fr;
  }

  .page-profile .profile-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .page-profile .profile-rail-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .page-profile .profile-rail {
    grid-template-columns: 1fr;
  }

  .page-profile .profile-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-profile .hero-btn,
  .page-profile .hero-btn-ghost {
    width: 100%;
  }
}

.page-mail-users .mail-users-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.page-mail-users .mail-compose-panel {
  position: sticky;
  top: 12px;
}

.page-mail-users .mail-compose-panel .settings-form {
  padding-top: 0;
}

.page-mail-users .mail-compose-panel textarea {
  width: 100%;
  min-height: 160px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 14px;
  color: var(--navy);
  background: #fff;
  resize: vertical;
}

.page-mail-users .mail-compose-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.page-mail-users .mail-compose-meta strong {
  color: var(--rose);
}

.page-mail-users .filter-tabs .filter-tab {
  gap: 8px;
}

.page-mail-users .filter-tabs .filter-tab .icon svg {
  width: 16px;
  height: 16px;
}

.page-mail-users .filter-tabs .filter-tab.is-active .icon svg {
  stroke: #fff;
}

.page-mail-users .mail-check-col {
  width: 42px;
}

.page-mail-users .mail-check-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--rose);
}

.page-mail-users .mail-link,
.page-mail-users .contact-link {
  color: var(--rose);
  font-weight: 600;
  font-size: 13px;
  word-break: break-word;
}

.page-mail-users .contact-link-wa {
  color: #128c7e;
}

.page-mail-users .mail-missing {
  color: var(--text-muted);
  font-size: 12px;
}

.page-mail-users .mail-users-table-panel .panel-head {
  padding-bottom: 0;
}

@media (max-width: 1100px) {
  .page-mail-users .mail-users-layout {
    grid-template-columns: 1fr;
  }

  .page-mail-users .mail-compose-panel {
    position: static;
  }
}
