:root {
  --primary: #F97316;
  --secondary: #0F766E;
  --background: #FFFDF8;
  --text: #1F2937;
  --success: #16A34A;
  --warning: #F59E0B;
  --error: #DC2626;
  --white: #ffffff;
  --surface: #fff8f1;
  --muted: #6b7280;
  --line: #f1e4d7;
  --shadow: 0 20px 40px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--background);
  color: var(--text);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

button, input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff9f3, #fffdf8 50%, #fff7ee);
}

.login-card {
  width: min(920px, 92vw);
  min-height: 620px;
  display: grid;
  grid-template-columns: 38% 62%;
  background: var(--white);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brand-panel {
  background: linear-gradient(180deg, var(--primary), #f97316d6);
  color: var(--white);
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.brand-mark {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 2.2rem;
  font-weight: 700;
}

.brand-mark.compact {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.3rem;
}

.brand-panel h1 {
  margin: 22px 0 0;
  font-size: 2rem;
}

.brand-dots {
  display: flex;
  gap: 12px;
  margin-top: 42px;
}

.brand-dots span {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
}

.auth-panel {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fffaf5;
}

.tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  width: fit-content;
  margin-bottom: 30px;
}

.tab-button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

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

.auth-form {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.auth-form.active {
  display: flex;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.auth-form input,
.auth-form select {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
}

.powered-by {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 7px 12px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  letter-spacing: 0.04em;
}

.primary-btn,
.secondary-btn,
.icon-btn,
.nav-item,
.close-btn,
.link-btn {
  border: none;
  cursor: pointer;
}

.primary-btn {
  background: var(--primary);
  color: var(--white);
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.secondary-btn {
  background: rgba(15, 118, 110, 0.08);
  color: var(--secondary);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
}

.auth-message {
  min-height: 24px;
  margin-top: 16px;
  color: var(--error);
  font-size: 0.95rem;
}

.auth-message.success {
  color: var(--success);
}

.otp-actions {
  display: flex;
  justify-content: flex-end;
}

.otp-verify {
  margin-top: 6px;
}

.otp-input-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.otp-digit {
  width: 100%;
  height: 50px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.otp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.link-btn {
  background: transparent;
  color: var(--secondary);
  font-weight: 700;
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--background);
}

.section-block,
.kpi-card,
.dashboard-data-card,
.customer-list-card {
  min-width: 0;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 8px 10px;
}

.brand-name {
  font-weight: 700;
  color: var(--text);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.sidebar-message {
  margin: 8px 0 0;
  color: var(--error);
  font-size: 0.82rem;
}

.nav-item {
  background: rgba(249,115,22,0.08);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
}

.nav-item.active {
  background: rgba(249,115,22,0.16);
  color: var(--primary);
}

.main-panel {
  min-width: 0;
  padding: 26px 28px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  padding: 10px 14px;
}

.search-box input {
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  margin-left: 8px;
}

.topbar-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f9c46b, #ee8b3d);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.admin-menu-wrapper,
.quick-search-wrapper {
  position: relative;
}

.quick-search-wrapper {
  width: min(480px, 60%);
  min-width: 0;
}

.avatar {
  border: 0;
  cursor: pointer;
}

.admin-menu,
.quick-search-results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-menu span {
  color: var(--muted);
}

.quick-search-results {
  left: 0;
  right: auto;
  max-height: 70vh;
  overflow-y: auto;
}

.quick-search-results h3 {
  margin: 8px 0;
}

.quick-search-results p {
  margin: 0;
}

.quick-search-result {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 6px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.quick-search-result span {
  color: var(--muted);
}

.section-block {
  margin-top: 16px;
}

.section-head {
  margin: 0 0 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

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

.section-description {
  color: var(--muted);
  margin: 8px 0 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 6px solid var(--primary);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 16px 30px rgba(15, 41, 55, 0.03);
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.kpi-card.teal {
  border-top-color: var(--secondary);
}

.kpi-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.kpi-value {
  margin: 12px 0 14px;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  font-weight: 800;
}

.kpi-trend {
  font-size: 0.9rem;
  color: var(--success);
  margin-bottom: 10px;
}

.kpi-source {
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.kpi-source strong {
  display: inline-block;
  margin-right: 6px;
  color: var(--text);
}

.kpi-open {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
}

.kpi-open:hover {
  background: #ea580c;
}

.kpi-open:focus-visible {
  outline: 3px solid rgba(249, 115, 22, 0.35);
  outline-offset: 2px;
}

.dashboard-support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.dashboard-data-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 16px 30px rgba(15, 41, 55, 0.03);
}

.dashboard-data-card h3 {
  margin: 0 0 14px;
}

.dashboard-chart {
  width: 100%;
  min-height: 220px;
}

.line-chart {
  display: block;
  width: 100%;
  height: 220px;
  overflow: visible;
}

.line-chart polyline {
  fill: none;
  stroke: var(--secondary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.line-chart circle {
  fill: var(--primary);
  stroke: var(--white);
  stroke-width: 2;
}

.line-chart circle.today {
  fill: var(--secondary);
  stroke: var(--primary);
  stroke-width: 3;
}

.line-chart text {
  fill: var(--muted);
  font-size: 10px;
}

.line-chart .line-chart-value {
  fill: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.line-chart .line-chart-axis-label {
  font-size: 9px;
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.activity-item p {
  margin: 5px 0;
}

.activity-item time,
.activity-item small {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-breakdown {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.status-breakdown-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 3fr auto;
  align-items: center;
  gap: 12px;
}

.status-breakdown-track {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.status-breakdown-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.detail-chart {
  margin: 18px 0;
}

.detail-total {
  margin: 0 0 20px;
  color: var(--text);
  font-size: 2rem;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-actions .secondary-btn {
  margin: 0;
}

.customer-summary-grid {
  margin-bottom: 20px;
}

.customer-kpi-card .kpi-open {
  display: block;
  width: max-content;
}

.customer-order-count {
  margin: 0;
  padding: 0;
  font-weight: 700;
}

.customer-order-search {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}

.customer-order-search label {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.customer-order-search input,
.customer-order-search select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.customer-list-card,
.customer-detail-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 30px rgba(15, 41, 55, 0.03);
}

.customer-list-card {
  padding: 18px;
}

.customer-filters,
.customer-profile-fields {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(145px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.customer-filters label,
.customer-profile-fields label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.customer-filters input,
.customer-filters select,
.customer-profile-fields input,
.customer-profile-fields select,
.customer-profile-fields textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.customer-profile-fields textarea {
  min-height: 64px;
  resize: vertical;
}

.customer-field-value {
  display: block;
  min-width: 0;
  color: var(--text);
  font-weight: 400;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.customer-filters input:focus,
.customer-filters select:focus,
.customer-profile-fields input:focus,
.customer-profile-fields select:focus,
.customer-profile-fields textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.25);
  border-color: var(--secondary);
}

.customer-filter-button {
  min-height: 42px;
  margin-top: 0;
  padding: 10px 15px;
  white-space: nowrap;
}

#customerFilters {
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(145px, 1fr)) auto auto;
}

.customer-list-message {
  min-height: 24px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.notification-origin {
  margin: 0 0 6px;
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.notification-unavailable {
  margin: 0;
  color: var(--error);
  font-size: 0.9rem;
}

.notification-highlight {
  scroll-margin: 120px;
  animation: notification-highlight-fade 4s ease-out forwards;
}

@keyframes notification-highlight-fade {
  0%, 20% {
    background-color: rgba(249, 115, 22, 0.28);
  }
  100% {
    background-color: transparent;
  }
}

.customer-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.customer-col-name { width: 17.5%; }
.customer-col-mobile { width: 10.5%; }
.customer-col-email { width: 18%; }
.customer-col-orders { width: 6%; }
.customer-col-cancelled { width: 7.5%; }
.customer-col-loyalty { width: 7%; }
.customer-col-status { width: 6.5%; }
.customer-col-actions { width: 27%; }

.customer-table th {
  padding-right: 0;
  padding-left: 0;
  white-space: normal;
}

.customer-table th,
.customer-table td {
  min-width: 0;
  padding-right: 6px;
  padding-left: 6px;
  vertical-align: middle;
}

.customer-table th {
  padding-right: 0;
  padding-left: 0;
}

.customer-table td:not([data-label="Email"]) {
  overflow-wrap: anywhere;
}

.customer-table th:nth-child(n+4):nth-child(-n+7),
.customer-table td:nth-child(n+4):nth-child(-n+7) {
  text-align: center;
}

.customer-table td[data-label="Email"] {
  overflow-wrap: normal;
  word-break: normal;
}

.customer-table td:first-child small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.customer-table td[data-label="Customer"] strong {
  white-space: nowrap;
}

.customer-row-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  width: 100%;
  gap: 2px;
  min-width: 0;
}

.customer-table td[data-label="Actions"] {
  padding-right: 4px;
  padding-left: 4px;
}

.customer-row-actions .link-btn {
  width: 100%;
  margin: 0;
  padding: 6px 0;
  text-align: center;
  white-space: nowrap;
}

.customer-table td[data-label="Actions"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-table td[data-label="Actions"]::before {
  grid-column: 1 / -1;
}

.customer-table .customer-status {
  padding: 4px 2px;
}

.danger-btn,
.danger-link {
  color: var(--error) !important;
}

.danger-btn {
  padding: 10px 14px;
  background: rgba(220, 38, 38, 0.08);
  border-radius: 10px;
  font-weight: 700;
}

.customer-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.customer-status.is-active {
  color: var(--success);
  background: rgba(22, 163, 74, 0.1);
}

.customer-status.is-inactive {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
}

.customer-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.customer-pagination > div {
  display: flex;
  gap: 8px;
}

.customer-pagination button:disabled {
  cursor: not-allowed;
  color: #6b7280;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  opacity: 1;
}

.customer-detail-panel {
  position: fixed;
  z-index: 31;
  top: 0;
  right: 0;
  width: min(760px, 94vw);
  height: 100vh;
  margin: 0;
  padding: 28px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 20px 0 0 20px;
  box-shadow: -20px 0 45px rgba(15, 41, 55, 0.16);
  transform: translateX(105%);
  transition: transform 240ms ease;
}

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

.customer-detail-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: rgba(18, 30, 38, 0.38);
}

.customer-profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.customer-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #fff;
  background: var(--secondary);
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 800;
}

.customer-id-label {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.customer-profile-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}

.customer-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.customer-detail-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
}

.customer-detail-heading h3 {
  margin: 2px 0 0;
  font-size: 1.4rem;
}

.customer-detail-eyebrow {
  margin: 0;
  color: var(--secondary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.customer-profile-fields {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.customer-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.customer-detail-actions .primary-btn {
  margin-top: 0;
}

.customer-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.customer-metrics article,
.customer-metrics .customer-metric-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.customer-metrics .customer-metric-card {
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.customer-metrics .customer-metric-card:hover,
.customer-metrics .customer-metric-card:focus-visible {
  border-color: var(--secondary);
  outline: 2px solid rgba(15, 118, 110, 0.2);
}

.customer-metrics span {
  color: var(--muted);
  font-size: 0.84rem;
}

.customer-metrics strong {
  font-size: 1.25rem;
}

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

.customer-detail-columns h4 {
  margin: 8px 0;
}

.customer-address-list {
  margin: 0;
  padding-left: 20px;
}

.customer-address-list li {
  margin: 8px 0;
}

.customer-empty-detail {
  color: var(--muted);
}

.customer-detail-columns table {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  font-size: 0.84rem;
  table-layout: fixed;
}

.customer-detail-columns td {
  max-width: 100%;
}

.customer-order-cards {
  display: grid;
  gap: 10px;
}

.customer-order-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.customer-order-card p {
  margin: 5px 0;
}

.customer-audit-trail {
  display: grid;
  gap: 10px;
}

.customer-audit-entry {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.customer-audit-entry time,
.customer-audit-entry span {
  color: var(--muted);
}

.customer-audit-entry ul {
  margin: 0;
  padding-left: 20px;
}

.quick-search-highlight {
  outline: 3px solid rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.12);
}

.customer-pagination button:disabled {
  color: #6b7280;
  background: #e5e7eb;
  opacity: 1;
  cursor: not-allowed;
}

.notification-wrapper {
  position: relative;
}

.notification-wrapper .icon-btn {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--error);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
}

.notification-panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + 10px);
  right: 0;
  width: min(390px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.notification-panel-heading,
.notification-item-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.notification-panel-heading h3 {
  margin: 0;
}

.notification-item {
  display: block;
  width: 100%;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

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

.notification-item.is-unread {
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.notification-item-heading strong {
  white-space: normal;
}

.notification-item time,
.notification-item small,
.notification-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.notification-item p {
  margin: 8px 0 4px;
  white-space: pre-wrap;
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .customer-table colgroup,
  .customer-table thead {
    display: none;
  }

  .customer-table,
  .customer-table tbody,
  .customer-table tr,
  .customer-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .customer-table tr {
    margin: 12px 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .customer-table td {
    display: grid;
    grid-template-columns: minmax(90px, 38%) minmax(0, 1fr);
    gap: 8px;
    padding: 8px 4px;
    text-align: left;
  }

  .customer-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--secondary);
  }

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

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.44);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: min(900px, 92vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.modal-body {
  padding: 20px 24px 28px;
  min-height: 0;
  overflow: auto;
}

.table-wrap {
  width: 100%;
  overflow-x: hidden;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 18px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

th {
  background: rgba(15, 118, 110, 0.04);
  color: var(--secondary);
}

@media (max-width: 1023px) {
  .customer-table colgroup,
  .customer-table thead,
  .customer-detail-columns table thead,
  .modal-body table thead {
    display: none;
  }

  .customer-table,
  .customer-table tbody,
  .customer-table tr,
  .customer-table td,
  .customer-detail-columns table,
  .customer-detail-columns tbody,
  .customer-detail-columns tr,
  .customer-detail-columns td,
  .modal-body table,
  .modal-body tbody,
  .modal-body tr,
  .modal-body td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-wrap {
    width: 100%;
    overflow-x: hidden;
  }

  .customer-table tr,
  .customer-detail-columns tr,
  .modal-body table tr {
    margin: 12px 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .customer-table td,
  .customer-detail-columns td,
  .modal-body td {
    display: grid;
    grid-template-columns: minmax(90px, 38%) minmax(0, 1fr);
    gap: 8px;
    padding: 8px 4px;
    text-align: left;
  }

  .customer-table td::before,
  .customer-detail-columns td::before,
  .modal-body td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--secondary);
  }

  .customer-row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .customer-row-actions .link-btn {
    text-align: left;
    padding: 6px 0;
    white-space: nowrap;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    padding: 28px 18px;
    min-height: 220px;
  }

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

  .dashboard-support-grid {
    grid-template-columns: 1fr;
  }

  .customer-filters {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  #customerFilters {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .customer-search {
    grid-column: 1 / -1;
  }

  .customer-profile-fields {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

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

@media (min-width: 921px) and (max-width: 1200px) {
  .dashboard {
    grid-template-columns: 176px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 12px;
  }

  .main-panel {
    padding: 20px 16px 32px;
  }

  .customer-list-card {
    padding: 14px;
  }

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

  #customerFilters .customer-search {
    grid-column: span 2;
  }
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .brand-row {
    margin: 0;
    padding: 4px;
  }

  .sidebar-nav {
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-item {
    flex: 1 1 auto;
    width: auto;
    padding: 10px;
  }

  .logout-button {
    margin: 0;
  }

  .sidebar-message {
    flex: 1 1 auto;
  }

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

  .login-shell {
    padding: 12px;
    place-items: start center;
  }

  .login-card {
    width: 100%;
    min-height: 0;
    border-radius: 18px;
  }

  .brand-panel {
    min-height: 0;
    padding: 20px 12px;
  }

  .auth-panel {
    min-width: 0;
    padding: 24px 16px;
  }

  .main-panel {
    padding: 14px 10px 24px;
  }

  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

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

  .quick-search-wrapper {
    flex: 1 1 100%;
    width: 100%;
  }

  .topbar-icons {
    margin-left: auto;
    gap: 6px;
  }

  .dashboard-support-grid,
  .dashboard-data-card,
  .customer-list-card,
  .modal-card {
    min-width: 0;
    max-width: 100%;
  }

  .modal {
    padding: 8px;
  }

  .modal-card {
    width: 100%;
    max-height: calc(100vh - 16px);
  }

  .modal-header,
  .modal-body {
    padding: 14px;
  }

  .customer-order-search {
    align-items: stretch;
    flex-direction: column;
  }

  .otp-input-row {
    gap: 5px;
  }

  .otp-digit {
    min-width: 0;
  }

  .line-chart {
    width: 100%;
    height: auto;
  }

  .customer-detail-panel {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    padding: 14px;
    border-radius: 0;
    overflow-x: hidden;
  }

  .customer-detail-columns {
    min-width: 0;
  }

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

  .customer-pagination {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .customer-pagination > div {
    flex-wrap: wrap;
  }

  .section-head-row,
  .customer-detail-heading {
    align-items: flex-start;
  }

  .customer-detail-heading {
    justify-content: space-between;
  }

  .customer-profile-identity {
    min-width: 0;
    flex: 1 1 auto;
  }

  .customer-profile-identity > div:last-of-type {
    min-width: 0;
  }

  .customer-list-card,
  .customer-detail-panel {
    padding: 14px;
  }

  .customer-filters,
  .customer-profile-fields,
  .customer-metrics {
    grid-template-columns: 1fr;
  }

  #customerFilters {
    grid-template-columns: 1fr;
  }

  .customer-search {
    grid-column: auto;
  }

  .customer-pagination,
  .section-head-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-detail-heading {
    align-items: flex-start;
  }
}
