
:root {
  --uds-brand-logo-height: 140px;
}

.uds-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.uds-brand-arrow {
  border: 1px solid #dee2e6;
  background: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 1.6rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #344050;
  box-shadow: 0 0.125rem 0.375rem rgba(0,0,0,.06);
}

.uds-brand-arrow:hover {
  background: #f8f9fa;
}

.uds-brand-logo-box {
  width: 420px;
  max-width: calc(100vw - 150px);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: .75rem;
}

.uds-brand-logo {
  max-width: 380px;
  max-height: var(--uds-brand-logo-height);
  object-fit: contain;
}

.uds-system-title {
  font-weight: 700;
  letter-spacing: .02em;
}

.uds-system-subtitle {
  color: #6c757d;
}

/* UDS login branding: compact logo size */
.login-brand-logo,
.brand-logo-img,
.brand-carousel img {
  max-width: 50% !important;
  max-height: 90px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

/* Login brand selector: compact, logo itself changes by clicking left/right half */
.uds-login-brand-clickable { cursor: pointer; user-select: none; }
.uds-login-brand-clickable .uds-brand-logo-box {
  max-width: 315px !important;
  min-height: 135px !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.uds-login-brand-clickable .uds-brand-logo {
  max-width: 50% !important;
  max-height: 90px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
.uds-brand-arrow { display: none !important; }

/* UDS compact login layout: reduce unused white space around brand logo */
.uds-login-brand-clickable .uds-brand-logo-box {
  max-width: 315px !important;
  min-height: 0 !important;
  height: 150px !important;
  padding: 10px 18px !important;
  margin: 0 auto !important;
}
.uds-login-brand-clickable .uds-brand-logo {
  max-width: 50% !important;
  max-height: 105px !important;
}
.uds-login-brand {
  margin-bottom: 10px !important;
}
#dealerName {
  display: inline-block;
  margin-top: 0 !important;
}
@media (max-height: 850px) {
  .uds-login-brand-clickable .uds-brand-logo-box {
    height: 120px !important;
    padding: 6px 14px !important;
  }
  .uds-login-brand-clickable .uds-brand-logo {
    max-height: 85px !important;
  }
}


/* UDS central sidebar behavior */
#udsSidebarHotzone {
  position: fixed;
  left: 0;
  top: 0;
  width: 14px;
  height: 100vh;
  z-index: 1050;
  background: transparent;
}

body.sidebar-collapsed .sidebar,
body.sidebar-collapsed #sidebar {
  margin-left: -260px !important;
  transition: margin-left .18s ease-in-out;
}

body:not(.sidebar-collapsed) .sidebar,
body:not(.sidebar-collapsed) #sidebar {
  transition: margin-left .18s ease-in-out;
}

@media (max-width: 991.98px) {
  body.sidebar-collapsed .sidebar,
  body.sidebar-collapsed #sidebar {
    margin-left: -260px !important;
  }
}


/* Dealer Dashboard / Cockpit */
.uds-mis-map {
  position: relative;
  height: 410px;
  border-radius: .5rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 45% 42%, rgba(59,125,221,.18) 0 0.5%, transparent 0.8%),
    radial-gradient(circle at 49% 48%, rgba(59,125,221,.18) 0 0.4%, transparent 0.7%),
    linear-gradient(135deg,#eef3f8,#ffffff);
  border: 1px solid #e5e9f2;
}
.uds-mis-map:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(163,174,190,.25) 49.5% 50.5%, transparent 51%),
    linear-gradient(0deg, transparent 0 49%, rgba(163,174,190,.25) 49.5% 50.5%, transparent 51%),
    radial-gradient(ellipse at 48% 46%, rgba(145,158,171,.20) 0 24%, transparent 25%),
    radial-gradient(ellipse at 43% 55%, rgba(145,158,171,.18) 0 14%, transparent 15%),
    radial-gradient(ellipse at 59% 53%, rgba(145,158,171,.15) 0 12%, transparent 13%);
  opacity: .9;
}
.uds-map-pin {
  position:absolute;
  transform:translate(-50%,-50%);
  width:18px;height:18px;border-radius:50%;
  background:#3b7ddd;
  box-shadow:0 0 0 8px rgba(59,125,221,.18);
  z-index:2;
}
.uds-map-pin strong {
  position:absolute; left:22px; top:-8px;
  white-space:nowrap; background:#fff; border:1px solid #e5e9f2; border-radius:6px; padding:3px 7px; font-size:12px;
}
.uds-mis-map .map-label {
  position:absolute; z-index:2; left:18px; top:16px; font-weight:700; color:#495057;
}
.stat { width:60px; height:60px; border-radius:50%; background:#dceaff; display:flex; align-items:center; justify-content:center; color:#3b7ddd; }

/* OpenStreetMap / Leaflet MIS map */
.uds-mis-map {
  height: 430px !important;
  min-height: 430px !important;
  background: #eef3f8;
}
.uds-mis-map .leaflet-container,
.leaflet-container.uds-mis-map {
  height: 430px !important;
}
.uds-mis-map .leaflet-popup-content {
  margin: 10px 12px;
}


/* Dashboard KPI cards: consistent size across sidebar states/devices */
.uds-kpi-row > [class*="col-"],
.uds-dashboard-row > [class*="col-"] {
  margin-bottom: 1rem;
}

.uds-kpi-card {
  min-height: 150px;
  height: 100%;
}

.uds-kpi-body {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.uds-kpi-content {
  min-width: 0;
  flex: 1 1 auto;
}

.uds-kpi-content .card-title {
  min-height: 2.4em;
  margin-bottom: .35rem;
  line-height: 1.2;
}

.uds-kpi-content h1 {
  font-size: clamp(1.55rem, 1.4vw + 1rem, 2rem);
  line-height: 1.1;
  margin-bottom: .25rem;
  white-space: nowrap;
}

.uds-kpi-content .text-muted {
  line-height: 1.25;
  min-height: 1.25em;
}

.stat,
.uds-kpi-stat {
  flex: 0 0 56px;
  width: 56px !important;
  height: 56px !important;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.stat svg,
.uds-kpi-stat svg,
.uds-kpi-stat .feather {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px;
  min-height: 24px;
  stroke-width: 2;
  display: block;
}

.uds-dashboard-row > .d-flex > .card {
  width: 100%;
}

@media (max-width: 575.98px) {
  .uds-kpi-card,
  .uds-kpi-body {
    min-height: 132px;
  }
  .uds-kpi-content .card-title {
    min-height: 0;
  }
  .stat,
  .uds-kpi-stat {
    flex-basis: 48px;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px;
    min-height: 48px;
  }
  .stat svg,
  .uds-kpi-stat svg,
  .uds-kpi-stat .feather {
    width: 22px !important;
    height: 22px !important;
  }
}

/* Mazda endpoint grouped catalog */
#endpointGroups .accordion-button {
  gap: .35rem;
}
#endpointGroups code {
  white-space: normal;
  word-break: break-word;
}
#groupSummary {
  position: sticky;
  top: 72px;
  z-index: 2;
  background: var(--bs-body-bg, #f5f7fb);
  padding: .35rem 0;
}

/* UDS user settings page and preferences */
html[data-uds-font="small"] body { font-size: .925rem; }
html[data-uds-font="large"] body { font-size: 1.075rem; }
html[data-uds-font="xlarge"] body { font-size: 1.18rem; }

html[data-uds-density="compact"] .card-body { padding: .85rem; }
html[data-uds-density="compact"] .table > :not(caption) > * > * { padding: .45rem .55rem; }
html[data-uds-density="spacious"] .card-body { padding: 1.65rem; }
html[data-uds-density="spacious"] .table > :not(caption) > * > * { padding: .95rem .85rem; }

html[data-uds-theme="dark"] body,
html[data-uds-theme="dark"] .main {
  background: #111827 !important;
  color: #e5e7eb;
}
html[data-uds-theme="dark"] .card,
html[data-uds-theme="dark"] .navbar-bg,
html[data-uds-theme="dark"] .dropdown-menu,
html[data-uds-theme="dark"] .modal-content {
  background: #1f2937 !important;
  color: #e5e7eb;
  border-color: #374151;
}
html[data-uds-theme="dark"] .text-muted,
html[data-uds-theme="dark"] .dropdown-item,
html[data-uds-theme="dark"] .text-dark {
  color: #cbd5e1 !important;
}
html[data-uds-theme="dark"] .form-control,
html[data-uds-theme="dark"] .form-select {
  background: #111827;
  color: #e5e7eb;
  border-color: #4b5563;
}
.uds-settings-preview {
  background: rgba(59,125,221,.06);
}

.delivery-table th { white-space: nowrap; font-size:.82rem; vertical-align:bottom; }
.delivery-table td { min-width:84px; }
.delivery-step { width:34px; height:34px; border-radius:50%; border:1px solid #cbd5e1; background:#fff; font-weight:700; cursor:pointer; }
.delivery-step.done { background:#3b7ddd; color:#fff; border-color:#3b7ddd; }
.delivery-step.open { color:#94a3b8; }
.delivery-step:hover { transform:scale(1.06); }

.uds-configurator-frame{width:100%;min-height:680px;border:1px solid #dee2e6;border-radius:.5rem;background:#fff}@media(max-width:991.98px){.uds-configurator-frame{min-height:520px}}


/* UDS mobile sidebar fix */
@media (max-width: 991.98px) {
  body.sidebar-collapsed .sidebar {
    margin-left: -260px !important;
    transform: translateX(-260px) !important;
  }
  body.sidebar-mobile-open .sidebar {
    margin-left: 0 !important;
    transform: translateX(0) !important;
    position: fixed;
    z-index: 1051;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
  }
  body.sidebar-mobile-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    z-index: 1040;
  }
}


/* UDS login width adjustment */
body.uds-login-page .card {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
body.uds-login-page .container,
body.uds-login-page .container-fluid {
  max-width: 760px;
}


/* UDS iOS PWA install hint */
.uds-ios-install-hint {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  padding: 14px 44px 14px 16px;
  border-radius: 14px;
  background: #222e3c;
  color: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
  font-size: .95rem;
}
.uds-ios-install-hint button {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
}


/* UDS login one-third narrower */
body.uds-login-page .card,
body.uds-login-page .auth-card,
body.uds-login-page .login-card {
  max-width: 420px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body.uds-login-page .container,
body.uds-login-page .container-fluid {
  max-width: 760px !important;
}
body.uds-login-page .row.justify-content-center > [class*="col-"] {
  max-width: 420px !important;
  flex: 0 0 420px !important;
}
@media (max-width: 575.98px) {
  body.uds-login-page .row.justify-content-center > [class*="col-"] {
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
}
