/* Defines shared colors, spacing, shadows, and sizes used by the interface */

/*LIGHT*/
:root {
  color-scheme: light;

  --bg: #f5f7fb;
  --bg-elevated: #eef3f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --panel-strong: #f1f5f9;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-soft-strong: #dbeafe;
  --primary-ring: rgba(37, 99, 235, 0.16);

  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;

  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #94a3b8;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-active: #2563eb;

  --topbar-bg: rgba(255, 255, 255, 0.94);
  --topbar-text: #0f172a;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 36px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --transition: 160ms ease;
}

/*DARK*/
body.dark {
  color-scheme: dark;

  --bg: #080d18;
  --bg-elevated: #0b1220;
  --panel: #101827;
  --panel-soft: #0d1523;
  --panel-strong: #162033;
  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --border: #243044;
  --border-strong: #334155;

  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-soft: rgba(59, 130, 246, 0.12);
  --primary-soft-strong: rgba(59, 130, 246, 0.2);
  --primary-ring: rgba(96, 165, 250, 0.22);

  --success: #4ade80;
  --success-soft: rgba(34, 197, 94, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --danger: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.16);

  --sidebar-bg: #070b14;
  --sidebar-border: #182235;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #7f8da3;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: #2563eb;

  --topbar-bg: rgba(16, 24, 39, 0.94);
  --topbar-text: #f8fafc;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.38);
}

/* Sets basic styles used by the whole page */
* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* Makes light and dark mode switch instantly */
body.theme-switching,
body.theme-switching *,
body.theme-switching *::before,
body.theme-switching *::after {
  transition: none !important;
  animation: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted) !important;
}

::selection {
  background: var(--primary-soft-strong);
}

/* styles the page scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* Styles buttons and their different states */
button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 650;
  line-height: 1.25;
  transition: transform var(--transition), background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), opacity var(--transition);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.17);
}

.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 7px 20px rgba(37, 99, 235, 0.22);
}

body.dark .primary {
  color: #07111f;
  box-shadow: 0 6px 20px rgba(96, 165, 250, 0.12);
}

.secondary {
  background: var(--panel-strong);
  color: var(--text-soft);
  border-color: var(--border);
}

.secondary:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
}

.ghost,
.dark-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}

.ghost:hover:not(:disabled),
.dark-ghost:hover:not(:disabled) {
  background: var(--panel-soft);
  border-color: var(--border-strong);
  color: var(--text);
}

.full {
  width: 100%;
}

.small-btn {
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
}

/* Styles the light and dark mode on/off */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  font-weight: 700;
}

.theme-toggle:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.32);
  color: var(--primary);
}

.theme-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  line-height: 1;
}

.topbar-theme-toggle {
  margin-right: 2px;
}

/* Styles the top nav bar */
.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--topbar-bg);
  color: var(--topbar-text);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  color: var(--text);
  font-size: 21px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.brand span {
  color: var(--primary);
  font-weight: 650;
}

.topbar small,
#roleLabel {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

#userEmail {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

/* Styles customer notification controls and history */
.notification-center {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notification-bell {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
}

.notification-bell:hover:not(:disabled),
.notification-bell[aria-expanded="true"] {
  transform: none;
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  color: var(--primary);
}

.notification-bell-icon {
  font-size: 17px;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--topbar-bg);
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 9px;
  line-height: 1;
  font-weight: 850;
}

.notification-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  width: min(380px, calc(100vw - 28px));
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
}

.notification-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px 12px;
  border-bottom: 1px solid var(--border);
}

.notification-menu-head strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.notification-menu-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.notification-text-btn,
.notification-view-all {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--primary);
  font-size: 11px;
}

.notification-text-btn:hover:not(:disabled),
.notification-view-all:hover:not(:disabled) {
  transform: none;
  background: var(--primary-soft);
}

.notification-menu-list {
  max-height: 390px;
  overflow-y: auto;
}

.notification-view-all {
  width: 100%;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  border-radius: 0;
  font-weight: 750;
}

.notification-list {
  display: grid;
}

.notification-item {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 10px;
  gap: 10px;
  align-items: start;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--panel);
  color: var(--text-soft);
  box-shadow: none;
  text-align: left;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item:hover:not(:disabled) {
  transform: none;
  background: var(--panel-soft);
}

.notification-item.unread {
  background: color-mix(in srgb, var(--primary-soft) 62%, var(--panel));
}

.notification-item-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 850;
}

.notification-item-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.notification-item-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.notification-item-message {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notification-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.notification-reference {
  overflow-wrap: anywhere;
}

.notification-unread-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.notification-empty {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.notification-page-card {
  padding: 0;
  overflow: hidden;
}

.notification-page-list .notification-item {
  grid-template-columns: 38px minmax(0, 1fr) 10px;
  padding: 16px 18px;
}

.notification-page-list .notification-item-icon {
  width: 38px;
  height: 38px;
}

/* Controls the sidebar & main page layout */
.layout {
  display: flex;
  min-height: calc(100vh - 70px);
}

.sidebar {
  width: 252px;
  flex: 0 0 252px;
  position: sticky;
  top: 70px;
  align-self: flex-start;
  height: calc(100vh - 70px);
  overflow-y: auto;
  padding: 18px 12px 24px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar::before {
  content: "WORKSPACE";
  display: block;
  padding: 4px 12px 10px;
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.nav {
  position: relative;
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 650;
}

.nav::before {
  content: "•";
  width: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  color: var(--sidebar-muted);
  font-size: 15px;
  font-weight: 800;
}

.nav[data-section="dashboard"]::before { content: "▦"; }
.nav[data-section="inventory"]::before { content: "▤"; }
.nav[data-section="transactions"]::before { content: "↕"; }
.nav[data-section="customers"]::before { content: "◉"; }
.nav[data-section="pickups"]::before { content: "⇄"; }
.nav[data-section="notifications"]::before { content: "●"; }
.nav[data-section="sales"]::before { content: "S"; }
.nav[data-section="users"]::before { content: "♙"; }
.nav[data-section="reports"]::before { content: "▥"; }
.nav[data-section="profile"]::before { content: "○"; }
.nav[data-section="help"]::before { content: "✦"; }

.nav:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav:hover::before {
  color: #ffffff;
}

.nav.active {
  background: linear-gradient(135deg, var(--sidebar-active), #1d4ed8);
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.28);
}

.nav.active::before {
  color: #ffffff;
}

.content {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 30px 32px 48px;
}

.section {
  display: none;
  animation: sectionIn 180ms ease;
}

.section.active {
  display: block;
}

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Styles page titles & page action buttons */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: clamp(25px, 2vw, 31px);
  line-height: 1.15;
  font-weight: 820;
  letter-spacing: -0.035em;
}

.page-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.page-actions button {
  margin: 0;
}

/* Styles content cards & panels */
.card,
.metric {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card {
  padding: 22px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
}

.card:hover {
  border-color: var(--border-strong);
}

.card > h2:first-child {
  margin-top: 0;
}

.card h2,
.card h3 {
  color: var(--text);
  letter-spacing: -0.02em;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 760;
}

/* Styles the dashboard summary cards */
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metrics-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 18px 18px 17px;
  border-radius: 14px;
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  opacity: 0.8;
}

.metric span {
  display: block;
  min-height: 35px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(22px, 2vw, 29px);
  line-height: 1.1;
  font-weight: 820;
  letter-spacing: -0.035em;
}

/* Controls grid layouts and chart sizes */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.chart-card {
  min-height: 345px;
}

.chart-card h2 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 750;
}

.chart-card canvas {
  width: 100% !important;
  height: 265px !important;
}

/* Styles search and filter controls */
.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.filters-4 { grid-template-columns: 2fr 1fr 1fr 1fr; }
.filters-5 { grid-template-columns: 2fr 1.1fr 1.2fr 1fr 1fr; }
.filters-compact-2 { grid-template-columns: 2fr 1fr; }

.filter-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.filter-button-wrap {
  display: flex;
  align-items: end;
  min-height: 42px;
}

.filter-button-wrap button {
  width: 100%;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  margin: -3px 0 14px;
}

/* Styles inputs, labels, and forms */
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 11px;
  background: var(--panel);
  color: var(--text);
  caret-color: var(--primary);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--border-strong) 68%, var(--primary));
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

input[readonly] {
  background: var(--panel-soft);
  color: var(--muted);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

label {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
}

label input,
label select,
label textarea {
  display: block;
  margin-top: 7px;
  font-weight: 450;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compact-grid { gap: 12px; }
.wide { grid-column: 1 / -1; }
.form-grid .wide.primary { width: 100%; }

/* Styles data tables and table rows */

/* Shows secondary information inside table cells */
.table-subtext {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.compact-table-wrap {
  border: 0;
  border-radius: 0;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

.compact-table { min-width: 560px; }

th,
td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

td {
  color: var(--text-soft);
  font-size: 13px;
}

td strong {
  color: var(--text);
}

tbody tr {
  transition: background-color var(--transition);
}

tbody tr:hover {
  background: var(--primary-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.wrap-cell {
  min-width: 180px;
  max-width: 320px;
  white-space: normal;
}

.table-empty {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  white-space: normal;
}

/* Styles the customer action dropdown */
#customers th:last-child,
#customers td:last-child {
  width: 58px;
  min-width: 58px;
  text-align: center;
}

.customer-action-cell {
  padding: 7px 9px;
}

.customer-menu-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}

.customer-menu-btn:hover:not(:disabled),
.customer-menu-btn:focus-visible {
  transform: none;
  background: var(--panel-strong);
  border-color: var(--border);
  color: var(--text);
  outline: none;
}

.customer-row {
  cursor: default;
}

.customer-action-menu {
  position: fixed;
  z-index: 1000;
  width: 178px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.customer-action-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  box-shadow: none;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.customer-action-menu button:hover:not(:disabled),
.customer-action-menu button:focus-visible {
  transform: none;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
}

.customer-action-menu .customer-menu-danger {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  color: var(--danger);
}

.customer-action-menu .customer-menu-danger:hover:not(:disabled),
.customer-action-menu .customer-menu-danger:focus-visible {
  background: var(--danger-soft);
  color: var(--danger);
}

.customer-action-menu .customer-menu-activate {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  color: var(--success);
}

.customer-action-menu .customer-menu-activate:hover:not(:disabled),
.customer-action-menu .customer-menu-activate:focus-visible {
  background: var(--success-soft);
  color: var(--success);
}

/* Styles colored status labels */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.badge.in-stock,
.badge.active,
.badge.linked,
.badge.confirmed,
.badge.completed {
  background: var(--success-soft);
  color: var(--success);
}

.badge.low-stock,
.badge.pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.out-of-stock,
.badge.inactive {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.approved {
  background: var(--primary-soft-strong);
  color: var(--primary);
}

.badge.cancelled {
  background: var(--panel-strong);
  color: var(--muted);
}

/* Styles messages and helper text */
.message {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.message.success {
  color: var(--success);
}

.helper-text {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

/* Styles the login and registration screens */
.login-screen {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    overflow-x: hidden;
    padding: 24px;
    background: radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.16), transparent 34%), radial-gradient(circle at 88% 92%, rgba(124, 58, 237, 0.12), transparent 30%), var(--bg);
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 550px;
    margin-inline: auto;
    padding: 30px;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.login-card .brand {
  font-size: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 20px 0;
  padding: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.auth-tab {
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  box-shadow: none;
}

.auth-tab.active {
  background: var(--panel);
  color: var(--primary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.auth-form {
  display: grid;
  gap: 15px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 74px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 5px 8px;
  background: transparent;
  color: var(--primary);
  border: 0;
  font-size: 11px;
  font-weight: 750;
}

.password-toggle:hover:not(:disabled) {
  transform: translateY(-50%);
  background: var(--primary-soft);
}

/* Styles product item rows used in forms */
.item-builder {
  padding: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.item-builder h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
}

.item-builder .helper-text {
  margin: 0 0 14px;
}

.item-builder-controls {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
}

.item-builder-controls button {
  min-height: 42px;
  white-space: nowrap;
}

.item-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.item-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  white-space: normal;
}

.empty-state {
  padding: 14px;
  background: var(--panel);
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  text-align: center;
}


/* Styles popup windows */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  width: min(900px, 96vw);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  margin: -6px -4px 4px 8px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.modal-card h2 {
  margin-top: 0;
}

.modal-card h3 {
  margin-bottom: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 20px;
}

.detail-grid > div {
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-grid strong {
  color: var(--text);
}

/* Styles report and profile sections */
.export-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.print-report-header {
  display: none;
}

.profile-card {
  max-width: 860px;
}

.report-controls {
  margin-bottom: 18px;
}

.report-metrics {
  margin-bottom: 20px;
}

.report-card-head {
  align-items: flex-start;
  gap: 16px;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 14px;
  text-align: right;
}

.report-export-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.report-export-card h2 {
  margin-bottom: 4px;
}

.report-export-card .helper-text {
  margin: 0;
}

.report-export-actions {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  min-width: 330px;
}

.report-print-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  right: 0;
  bottom: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Styles the loading screen shown during requests */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.loading-overlay > div,
.loading-overlay {
  color: var(--text);
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(148, 163, 184, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Styles temporary notification messages */
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 15px;
  background: var(--text);
  color: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 13px;
  font-weight: 650;
}

#toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Controls elements that depend on the user's role */
.admin-only-section,
.customer-only-section,
.customer-only {
  display: none;
}

/* Styles the floating XTECH AI help chat */

/* Shows page-specific questions above the AI conversation. */
.ai-quick-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 12px;
  overflow-x: auto;
  background: var(--panel);
  scrollbar-width: thin;
}

.ai-suggestion-chip {
  flex: 0 0 auto;
  max-width: 250px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text-soft);
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.ai-suggestion-chip:hover:not(:disabled) {
  transform: none;
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  background: var(--primary-soft);
  color: var(--text);
}

/* Places the assistant label and Copy control on one line. */
.chat-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 5px;
}

.chat-message-meta .chat-message-label {
  margin: 0;
}

.chat-message.user .chat-message-meta {
  justify-content: flex-end;
}

.chat-copy-btn {
  padding: 2px 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 10px;
  font-weight: 700;
}

.chat-copy-btn:hover:not(:disabled) {
  transform: none;
  background: var(--panel-strong);
  color: var(--text);
}

/* Animates three dots while the AI response is being generated. */
.ai-typing-bubble {
  width: fit-content;
  min-width: 54px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
}

.ai-typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: aiTypingDot 1.1s infinite ease-in-out;
}

.ai-typing-bubble span:nth-child(2) {
  animation-delay: 0.14s;
}

.ai-typing-bubble span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes aiTypingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 16px 20px;
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at 10% 0%, var(--primary-soft), transparent 32%),
    var(--panel-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0 0 18px;
}

.chat-message.assistant {
  justify-content: flex-start;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  box-shadow: var(--shadow-xs);
}

.chat-message-content {
  max-width: 90%;
  min-width: 0;
}

.chat-message.user .chat-message-content {
  max-width: 82%;
}

.chat-message-label {
  margin: 0 0 5px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chat-message.user .chat-message-label {
  margin-right: 2px;
  text-align: right;
}

.chat-bubble {
  padding: 15px 16px;
  overflow-wrap: anywhere;
  background: var(--panel);
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 8px 16px 16px 16px;
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  line-height: 1.65;
}

.chat-message.user .chat-bubble {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  border-radius: 16px 6px 16px 16px;
  white-space: pre-wrap;
}

body.dark .chat-message.user .chat-bubble {
  color: #07111f;
}

.chat-bubble p {
  margin: 0 0 10px;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble h2,
.chat-bubble h3,
.chat-bubble h4,
.chat-bubble h5 {
  margin: 2px 0 9px;
  color: var(--text);
  line-height: 1.32;
  letter-spacing: -0.015em;
}

.chat-bubble h2 {
  font-size: 17px;
}

.chat-bubble h3 {
  font-size: 15px;
}

.chat-bubble h4,
.chat-bubble h5 {
  font-size: 14px;
}

.chat-bubble strong {
  color: var(--text);
  font-weight: 800;
}

.chat-bubble em {
  color: var(--text-soft);
}

.chat-bubble del {
  color: var(--muted);
}

.chat-bubble ol,
.chat-bubble ul {
  margin: 10px 0 13px;
  padding-left: 24px;
}

.chat-bubble ul {
  list-style-type: disc;
}

.chat-bubble ol {
  list-style-type: decimal;
}

.chat-bubble li {
  margin: 0 0 7px;
  padding-left: 3px;
  line-height: 1.55;
}

.chat-bubble li::marker {
  color: var(--primary);
  font-weight: 800;
}

.chat-bubble li:last-child {
  margin-bottom: 0;
}

.chat-bubble code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}


/* Styles section dividers inside AI answers */
.chat-bubble .ai-divider {
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: var(--border);
  opacity: 0.8;
}

.ai-note {
  margin-top: 10px;
  padding: 10px 11px;
  background: var(--primary-soft);
  color: var(--text-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-left: 3px solid var(--primary);
  border-radius: 8px;
}

.chat-form {
  padding: 13px 14px 14px;
  background: var(--panel);
}

.chat-input-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.chat-input-row {
  display: flex;
  gap: 9px;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  min-height: 46px;
  max-height: 120px;
  padding: 11px 12px;
  resize: none;
  line-height: 1.45;
}

.chat-input-row button {
  min-width: 72px;
  min-height: 46px;
  align-self: stretch;
}

/* Shows the current total number of units in inventory */
.inventory-summary {
  display: flex;
  margin-bottom: 20px;
}

.inventory-stock-metric {
  width: min(320px, 100%);
}

/* Makes the remaining dashboard attention card use the full width */
.dashboard-attention-card {
  width: 100%;
}

/* Positions the AI button in the bottom-right corner */
.ai-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  min-width: 112px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 70%, transparent);
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.28);
  font-weight: 800;
}

.ai-bubble:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--primary-hover);
}

body.dark .ai-bubble {
  color: #07111f;
}

.ai-bubble-icon {
  font-size: 18px;
  line-height: 1;
}

.ai-bubble-label {
  font-size: 13px;
}

/* Styles the popup window used by the AI assistant */
.ai-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 79;
  width: min(500px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.ai-chat-panel.hidden {
  display: none !important;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 14px 14px 16px;
  background: var(--panel);
  border-bottom: 0;
}

.ai-chat-header > div:first-child {
  min-width: 0;
}

.ai-chat-header strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 820;
}

.ai-chat-header span {
  display: block;
  max-width: 300px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-header-btn {
  padding: 6px 8px;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
  font-size: 11px;
}

.ai-header-btn:hover:not(:disabled) {
  transform: none;
  background: var(--panel-strong);
  color: var(--text);
}

.ai-close-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

/* Adjusts the layout for smaller screens */
@media (max-width: 1380px) {
  .metrics-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 > :last-child {
    grid-column: 1 / -1;
  }

  .filters-5 {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .sidebar {
    width: 218px;
    flex-basis: 218px;
  }

  .content {
    padding: 24px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-3 > :last-child {
    grid-column: auto;
  }

  .metrics,
  .metrics-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filters,
  .filters-4,
  .filters-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .export-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    position: relative;
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .notification-menu {
    position: fixed;
    top: 72px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100dvh - 92px);
  }

  #userEmail {
    max-width: 100%;
    flex: 1 1 180px;
  }

  .layout {
    display: block;
    min-height: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    height: auto;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding: 9px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .sidebar::before {
    display: none;
  }

  .nav {
    width: auto;
    min-width: max-content;
    min-height: 39px;
    margin: 0;
    padding: 8px 10px;
  }

  .nav::before {
    width: 18px;
    flex-basis: 18px;
  }

  .content {
    padding: 20px 16px 36px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .form-grid,
  .filters,
  .filters-4,
  .filters-5,
  .filters-compact-2,
  .item-builder-controls,
  .item-row,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .metrics,
  .metrics-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric span {
    min-height: 0;
  }

   .login-card {
       width: 100%;
       max-width: 550px;
       margin-inline: auto;
       padding: 22px;
   }

  .auth-tabs {
    grid-template-columns: 1fr;
  }

  .chat-input-row {
    flex-direction: column;
  }

  .chat-bubble {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .ai-bubble {
    right: 14px;
    bottom: 14px;
    min-width: 52px;
    width: 52px;
    padding: 0;
  }

  .ai-bubble-label {
    display: none;
  }

  .ai-chat-panel {
    right: 10px;
    bottom: 76px;
    width: calc(100vw - 20px);
    height: min(600px, calc(100vh - 96px));
  }

  .metrics,
  .metrics-6,
  .export-grid {
    grid-template-columns: 1fr;
  }

  .page-actions button {
    flex: 1 1 100%;
  }

  .theme-label {
    display: none;
  }

  .theme-toggle {
    width: 38px;
    padding: 7px;
  }

  .login-header {
    align-items: flex-start;
  }

  .login-card .brand {
    font-size: 21px;
  }
}


@media (max-width: 480px) {
    .login-screen {
        padding: 12px;
    }

    .login-card {
        width: 100%;
        max-width: 100%;
        margin-inline: auto;
        padding: 20px;
    }

    .login-header {
        align-items: flex-start;
    }

    .login-card .brand {
        font-size: 21px;
    }
}

@media (max-width: 760px) {
  .report-export-card {
    align-items: stretch;
    flex-direction: column;
  }

  .report-export-actions {
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .report-meta {
    justify-content: flex-start;
    text-align: left;
  }
}

/* Adjusts the layout when printing reports */
@media print {
  @page { margin: 12mm; }

  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 11px;
  }

  .topbar,
  .sidebar,
  .page-head,
  .no-print,
  #toast,
  .loading-overlay,
  .modal {
    display: none !important;
  }

  .layout,
  .content {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .section { display: none !important; }
  #reports { display: block !important; }

  .print-report-header {
    display: block;
    margin-bottom: 16px;
  }

  .report-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .metric,
  .card {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .metric { padding: 10px; }
  .metric strong { font-size: 17px; }
  .card { padding: 0; border: 0; }
  .card-head .muted { display: none; }
  .table-wrap { overflow: visible; border: 0; }

  table,
  .compact-table {
    min-width: 0;
    font-size: 9px;
  }

  th,
  td {
    padding: 6px 5px;
    white-space: normal;
    color: #111827 !important;
    border-color: #e5e7eb !important;
  }

  th {
    position: static;
    background: #f3f4f6 !important;
  }
}
/* Styles the sign-in method choices */
.signin-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.signin-method {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 14px;
  background: var(--panel-soft);
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: none;
  text-align: left;
}

.signin-method strong {
  color: var(--text);
  font-size: 13px;
}

.signin-method span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.signin-method:hover:not(:disabled) {
  transform: none;
  border-color: var(--primary);
  background: var(--primary-soft);
}

.signin-method.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.auth-method-panel {
  display: grid;
  gap: 14px;
}

.auth-method-note {
  margin: -4px 0 0;
}

/* Styles the authenticator setup and verification steps */
.security-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 12px;
}

.security-step-head > div {
  min-width: 0;
}

.security-step-head strong,
.security-step-head small {
  display: block;
}

.security-step-head strong {
  color: var(--text);
  font-size: 13px;
}

.security-step-head small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

.security-step-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.totp-qr {
  min-height: 204px;
  display: grid;
  place-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.totp-qr img,
.totp-qr canvas {
  max-width: 180px;
  width: 180px;
  height: 180px;
}

.totp-secret-wrap {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.totp-secret-wrap span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.totp-secret-wrap code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 620px) {
  .signin-methods {
    grid-template-columns: 1fr;
  }
}



/* Styles the emailed one-time code step */
.otp-code-input {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.32em;
  font-variant-numeric: tabular-nums;
}

.otp-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 420px) {
  .otp-secondary-actions {
    grid-template-columns: 1fr;
  }
}


/* Styles the Account & Security page */
.security-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.security-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.security-card-head h2,
.security-password-card h2 {
  margin-top: 0;
  margin-bottom: 6px;
}

.security-shield {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 19px;
  font-weight: 900;
  border: 1px solid color-mix(in srgb, var(--success) 26%, var(--border));
}

.security-details {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.security-details > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.security-details > div:last-child {
  border-bottom: 0;
}

.security-details span {
  color: var(--muted);
}

.security-details strong {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.security-reset-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.security-reset-box p {
  margin: 4px 0 0;
}

.security-password-form {
  margin-top: 18px;
}

.password-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}

.password-requirements strong {
  grid-column: 1 / -1;
  color: var(--text-soft);
  font-size: 12px;
}

.password-requirements span::before {
  content: "✓";
  margin-right: 7px;
  color: var(--success);
  font-weight: 900;
}

@media (max-width: 980px) {
  .security-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .security-reset-box,
  .security-details > div {
    align-items: stretch;
    flex-direction: column;
  }

  .security-details strong {
    text-align: left;
  }

  .password-requirements {
    grid-template-columns: 1fr;
  }
}


/* Keeps the forgot-password action compact under the password field */
.auth-inline-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.text-link {
  width: auto;
  min-height: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link:disabled {
  cursor: wait;
  opacity: 0.65;
}

/* Shows the live Email OTP resend cooldown */
.otp-cooldown {
  min-height: 20px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

#resendEmailOtp:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}
