:root {
  --sn-font-family: "Roboto Slab", "Rockwell", Georgia, serif;
  --sn-font-size: 15px;
  --sn-table-font-size: 14px;
  --sn-line-height: 1.55;
  --mm-primary: #00a1ff;
  --mm-primary-soft: color-mix(in srgb, var(--mm-primary) 10%, white);
  --mm-purple: #8965e5;
  --mm-page: #f6f8fc;
  --mm-card: #fff;
  --mm-text: #26334d;
  --mm-muted: #77839a;
  --mm-border: #e7ebf2;
  --mm-shadow: 0 4px 18px rgba(37, 53, 82, .055);
}

/* Consistent, readable typography across Django admin and embedded admin pages. */
html body,
html body #container,
html body #main,
html body #content,
html body #content-main,
html body #nav-sidebar {
  font-family: var(--sn-font-family) !important;
  font-size: var(--sn-font-size) !important;
  line-height: var(--sn-line-height) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html body #content h1,
html body .customer-detail h1 {
  font-size: clamp(1.45rem, 1.2rem + .65vw, 1.8rem) !important;
  line-height: 1.25 !important;
  font-weight: 750 !important;
  letter-spacing: -.035em !important;
}

html body #content h2,
html body .customer-detail h2 {
  font-size: 1.2rem !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  letter-spacing: -.02em !important;
}

html body #content h3,
html body .customer-detail h3 {
  font-size: 1.05rem !important;
  line-height: 1.4 !important;
  font-weight: 700 !important;
}

html body #content p,
html body #content li,
html body #content label,
html body #content .help,
html body #content .helptext,
html body #content .quiet {
  line-height: 1.55;
}

html body #content input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html body #content select,
html body #content textarea,
html body #content button,
html body #content .button,
html body #content input[type="submit"],
html body #content input[type="button"] {
  font-family: var(--sn-font-family) !important;
  font-size: .925rem !important;
}

html body #content input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html body #content select,
html body #content textarea {
  min-height: 40px;
  padding: 9px 11px;
}

html body #content textarea { min-height: 96px; }

html body #content input:focus-visible,
html body #content select:focus-visible,
html body #content textarea:focus-visible,
html body #content button:focus-visible,
html body #content a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--mm-primary) 26%, transparent);
  outline-offset: 2px;
}

html body #nav-sidebar a,
html body #nav-sidebar .sn-side-menu a { font-size: .9rem !important; line-height: 1.45 !important; }

html body #changelist table td,
html body #changelist table th,
html body .module table td,
html body .module table th,
html body .customer-detail .customer-table td,
html body .customer-detail .customer-table th,
html body .sn-dashboard table td,
html body .sn-dashboard table th {
  line-height: 1.45 !important;
  font-size: var(--sn-table-font-size, 13px) !important;
}

@media (max-width: 767px) {
  :root { --sn-font-size: 15px; --sn-table-font-size: 13px; }
  html body #content { padding-inline: 14px !important; }
  html body #content input:not([type="checkbox"]):not([type="radio"]),
  html body #content select,
  html body #content textarea { max-width: 100%; }
}

/* Larger, clearer type and a restrained horizontal entrance for admin pages. */
@keyframes sn-admin-slide-in {
  from { opacity: 0; transform: translate3d(20px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

html body #content { animation: sn-admin-slide-in .28s cubic-bezier(.2, .75, .25, 1) both; }
html body #content p,
html body #content li,
html body #content label,
html body #content .help,
html body #content .helptext,
html body #content .quiet { font-size: 15px !important; font-weight: 500 !important; line-height: 1.6 !important; }
html body #content .help,
html body #content .helptext,
html body #content .quiet { font-size: 13px !important; }
html body #content .form-row label,
html body #content .inline-related h3,
html body #content .module h2 { font-weight: 750 !important; }
html body #content input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html body #content select,
html body #content textarea,
html body #content button,
html body #content .button,
html body #content input[type="submit"],
html body #content input[type="button"] { font-size: 15px !important; font-weight: 650 !important; }
html body #content table th { font-weight: 750 !important; }
html body #nav-sidebar a,
html body #nav-sidebar .sn-side-menu a { font-size: 14px !important; font-weight: 650 !important; }
html body #header #sn-header-customer-search input { font-size: 14px !important; font-weight: 600 !important; }
html body #header #user-tools { font-size: 13px !important; font-weight: 650 !important; }

@media (prefers-reduced-motion: reduce) {
  html body #content { animation-duration: .01ms !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

html, body, #container, #main, #content {
  background: var(--mm-page) !important;
  color: var(--mm-text);
  font-family: var(--sn-font-family);
}

#header, #branding { background: #fff !important; }
#main, #content, #container { background: var(--mm-page) !important; }
.sn-brand-mark { background: var(--mm-primary) !important; }

#header {
  border-bottom: 1px solid var(--mm-border);
  box-shadow: 0 3px 14px rgba(31, 48, 76, .04);
}

#branding { border-right-color: var(--mm-border); }
#branding h1 { letter-spacing: -.35px; }
#nav-sidebar {
  border-right-color: var(--mm-border);
  box-shadow: 4px 0 18px rgba(34, 50, 78, .035);
}
#nav-sidebar .sn-side-heading {
  color: #929db1;
  font-size: 10px;
  letter-spacing: .075em;
}
#nav-sidebar .sn-side-menu a {
  min-height: 42px;
  margin: 2px 0;
  border-radius: 8px;
  transition: background .16s ease, color .16s ease;
}
#nav-sidebar .sn-side-menu a:hover,
#nav-sidebar .sn-side-menu a:focus-visible,
#nav-sidebar .current-model {
  background: var(--mm-primary-soft) !important;
  color: var(--mm-primary) !important;
}
#nav-sidebar .current-model a { color: var(--mm-primary) !important; }
#nav-sidebar .sn-side-icon { color: inherit; }
#nav-sidebar .sn-side-subheading { color: #65748d !important; }

#content { padding-top: 24px; }
#content h1, #content h2, #content h3,
.customer-detail h1, .customer-detail h2, .customer-detail h3 {
  color: #24324b;
  letter-spacing: -.2px;
}
.breadcrumbs {
  background: transparent !important;
  color: var(--mm-muted) !important;
}

.module, #changelist, .inline-group, .submit-row,
.customer-detail .detail-card, .customer-detail .summary-card,
.customer-detail .customer-tabs, .sn-dashboard .sn-card,
.sn-dashboard .sn-icon-card {
  background: var(--mm-card) !important;
  border: 1px solid var(--mm-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--mm-shadow) !important;
}
.module h2, .module caption, .inline-group h2,
#changelist-filter h2 {
  background: #fbfcfe !important;
  border-bottom-color: var(--mm-border) !important;
  color: #263650 !important;
}

#changelist table thead th, .module table thead th,
.sn-dashboard th, .customer-detail .customer-table th {
  background: var(--sn-table-header-bg, #f7f9fc) !important;
  color: var(--sn-table-header-text, #71809a) !important;
  border-color: var(--sn-table-border, var(--mm-border)) !important;
  font-weight: 700;
  letter-spacing: .045em;
}
#changelist table td, #changelist table th,
.module table td, .module table th,
.customer-detail .customer-table td, .customer-detail .customer-table th {
  border-color: var(--sn-table-border, #edf0f5) !important;
  padding: var(--sn-table-cell-padding, 9px) 12px !important;
  font-size: var(--sn-table-font-size, 12px) !important;
}
#changelist table tbody tr:nth-child(even), .module table tbody tr:nth-child(even),
.sn-dashboard table tbody tr:nth-child(even), .customer-detail .customer-table tbody tr:nth-child(even) {
  background: var(--sn-table-row-alt-bg, #fafbfd) !important;
}
#changelist table tbody tr:nth-child(odd), .module table tbody tr:nth-child(odd),
.sn-dashboard table tbody tr:nth-child(odd), .customer-detail .customer-table tbody tr:nth-child(odd) {
  background: var(--sn-table-row-bg, #ffffff) !important;
}
#changelist table, .module table, .sn-dashboard table, .customer-detail .customer-table {
  width: var(--sn-table-width, 100%) !important;
  font-size: var(--sn-table-font-size, 12px) !important;
}
#changelist table tbody tr:hover,
.customer-detail .customer-table tbody tr:hover {
  background: #f0f6ff !important;
}

input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
select, textarea, .vTextField, .vLargeTextField,
#toolbar input, #changelist-search input {
  border-color: #dce3ed;
  border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--mm-primary) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mm-primary) 16%, transparent) !important;
}

/* Keep Django's dual-list permission selectors tall enough to read and scroll. */
.selector {
  width: min(100%, 1100px) !important;
  max-width: 100% !important;
  min-height: 470px !important;
  overflow: visible !important;
}
.selector select,
.selector select[multiple],
select[multiple].selectfilter,
#id_permissions_from,
#id_permissions_to {
  box-sizing: border-box !important;
  height: 440px !important;
  min-height: 440px !important;
  max-height: none !important;
  overflow-y: auto !important;
  padding: 6px !important;
}

.button, input[type=submit], input[type=button], .submit-row input,
a.button, button.default, .object-tools a {
  border-radius: 8px !important;
  background: var(--mm-primary) !important;
  box-shadow: 0 4px 11px color-mix(in srgb, var(--mm-primary) 20%, transparent) !important;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.button:hover, input[type=submit]:hover, input[type=button]:hover,
a.button:hover, .object-tools a:hover {
  filter: brightness(.96);
  transform: translateY(-1px);
}
.button.default, .submit-row input.default { background: #263650 !important; }
.deletelink, .deletelink-box a { background: #e45d6b !important; }
.messagelist li { border-radius: 9px; box-shadow: var(--mm-shadow); }

#changelist-filter {
  border: 1px solid var(--mm-border);
  border-radius: 12px;
  box-shadow: var(--mm-shadow);
}
#changelist .paginator, .paginator {
  background: #fbfcfe !important;
  border-top-color: var(--mm-border) !important;
}

.sn-dashboard .sn-card, .sn-dashboard .sn-icon-card {
  border-radius: 12px !important;
  box-shadow: var(--mm-shadow) !important;
}
.sn-dashboard .sn-card-head { background: #fff; border-bottom-color: var(--mm-border); }
.sn-dashboard .sn-table-wrap th { background: #f7f9fc; }
.sn-dashboard .sn-icon:not(.green):not(.violet):not(.orange):not(.teal):not(.red) {
  background: var(--mm-primary) !important;
}
.sn-dashboard .sn-btn {
  background: var(--mm-primary) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 161, 255, .2) !important;
}
.customer-detail .customer-hero {
  background: linear-gradient(115deg, var(--mm-primary), color-mix(in srgb, var(--mm-primary) 72%, #8965e5)) !important;
  border-radius: 12px !important;
}
.customer-detail .customer-tabs { box-shadow: var(--mm-shadow) !important; }
.customer-detail .customer-tabs a { border-radius: 8px 8px 0 0; }
.customer-detail .customer-tabs a:first-child,
.customer-detail .customer-tabs a:hover { color: var(--mm-primary) !important; }

.home-wrap .metric, .home-wrap .panel {
  background: var(--mm-card) !important;
  border: 1px solid var(--mm-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--mm-shadow) !important;
}
.home-wrap .metric-label, .home-wrap .metric-note { color: var(--mm-muted) !important; }
.home-wrap .metric-value, .home-wrap .panel h2 { color: #26334d !important; }
.home-wrap .home-actions a {
  background: var(--mm-primary) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--mm-primary) 20%, transparent);
}
.home-wrap .quick-links a {
  border: 1px solid var(--mm-border) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #34415a !important;
}
.home-wrap .panel th {
  background: #f7f9fc !important;
  color: #71809a !important;
}
.home-wrap .panel td { border-bottom-color: #edf0f5 !important; }
.home-wrap .badge { background: var(--mm-primary-soft) !important; color: var(--mm-primary) !important; }

@media (max-width: 767px) {
  #content { padding-top: 17px; }
  .module, #changelist, .inline-group { border-radius: 10px !important; }
  .selector { min-height: 350px !important; }
  .selector select,
  .selector select[multiple],
  select[multiple].selectfilter,
  #id_permissions_from,
  #id_permissions_to { height: 320px !important; min-height: 320px !important; }
}
