:root {
  --ewo: #0096ff;
  --ewo-dark: #006fbf;
  --ewo-soft: #eef8ff;
  --ewo-panel: #ffffff;
  --ewo-page: #edf7fd;
  --ewo-line: #c5dce8;
  --ewo-ink: #1f2933;
  --ewo-muted: #647789;
  --luise-card-border: #b9e3ff;
  --luise-card-bg: #fbfdff;
  --luise-card-hover: #f4fbff;
  --luise-active-bg: #eef8ff;
  --luise-input-bg: #fbfdff;
  --luise-soft-band: #f2fbff;
  --luise-shadow: 0 2px 12px rgba(0, 111, 191, .08);
  --luise-shadow-hover: 0 5px 16px rgba(0, 111, 191, .13);
}

body {
  color: var(--ewo-ink);
  background: var(--ewo-page);
}

header {
  display: grid !important;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  min-height: 88px;
  align-items: center;
  gap: 18px;
  background: #fff;
  border-bottom: 4px solid var(--ewo);
  box-shadow: 0 2px 12px rgba(0, 111, 191, .09);
}

header .logo-home {
  grid-column: 1;
  grid-row: 1;
}

header > div:not(.auth-box):not(.cloud-status) {
  grid-column: 2;
  grid-row: 1;
}

header .auth-box {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

header .cloud-status {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  margin-left: 0;
}

header img,
.login-logo {
  object-fit: contain;
  object-position: left center;
}

header img {
  width: 150px;
  height: 58px;
}

h1 {
  letter-spacing: 0;
  color: #075985;
}

h2,
h3,
label span,
label {
  letter-spacing: 0;
}

:where(.app-nav a, .app-switch, .module-link, button, .secondary, .logout-button) {
  border-radius: 6px;
  font-weight: 900;
}

:where(.app-nav a, .app-switch, .module-link) {
  border: 1px solid #b9e3ff;
  background: var(--ewo-soft);
  color: var(--ewo-dark);
  text-decoration: none;
}

.app-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  order: 10;
  margin-left: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  flex: 1 0 100%;
  width: 100%;
  min-width: 0;
}

.app-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.app-nav a.active,
.app-nav a[aria-current="page"] {
  background: var(--ewo);
  border-color: var(--ewo);
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0, 70, 120, .22);
}

:where(.app-nav a:hover, .app-switch:hover, .module-link:hover) {
  background: #dff3ff;
}

.app-nav a.active:hover,
.app-nav a[aria-current="page"]:hover {
  background: var(--ewo-dark);
  color: #fff;
}

:where(.panel, .dashboard-panel, .metric, .login-card, .modal-card) {
  border-radius: 8px;
  border-color: var(--ewo-line);
  box-shadow: var(--luise-shadow);
}

:where(input, select, textarea) {
  border-radius: 6px;
  border-color: #bdd7e6;
  background: var(--luise-input-bg);
  color: var(--ewo-ink);
}

:where(input:focus, select:focus, textarea:focus) {
  outline: 3px solid #c7eaff;
  border-color: var(--ewo);
  background: #fff;
}

:where(.cloud-status, small) {
  color: var(--ewo-muted);
}

.dashboard-panel {
  border-color: var(--luise-card-border) !important;
  border-top: 5px solid var(--ewo) !important;
  background: #fff;
  padding: 14px;
}

:where(.panel-head, .dashboard-head, .section-head) {
  gap: 10px;
  margin-bottom: 12px;
}

:where(.panel-head p, .dashboard-head p, .section-head p) {
  color: var(--ewo-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

:where(.dashboard-count, .status-pill, .dashboard-type) {
  border-radius: 999px;
  font-weight: 900;
}

.dashboard-count {
  background: var(--ewo);
  color: #fff;
  padding: 8px 12px;
  min-width: 92px;
  text-align: center;
}

:where(.dashboard-list, .task-list, .lead-list, .customer-list, .history-list) {
  display: grid;
  gap: 8px;
}

:where(.dashboard-card, .task-card, .lead-card, .customer-card, .history-card, .technician-card) {
  border: 1px solid var(--luise-card-border) !important;
  border-radius: 8px !important;
  background: var(--luise-card-bg) !important;
  padding: 10px !important;
  box-shadow: none;
}

:where(.dashboard-card:hover, .task-card:hover, .lead-card:hover, .customer-card:hover, .history-card:hover) {
  border-color: var(--ewo) !important;
  background: var(--luise-card-hover) !important;
  box-shadow: var(--luise-shadow-hover);
}

:where(.dashboard-card.active, .task-card.active, .lead-card.active, .customer-card.active) {
  border-color: var(--ewo) !important;
  background: var(--luise-active-bg) !important;
  box-shadow: inset 4px 0 0 var(--ewo) !important;
}

:where(.dashboard-card-head, .task-head, .lead-card, .open-lead-card) {
  gap: 8px;
}

:where(.dashboard-card b, .task-card b, .lead-card b, .customer-card b, .history-card b, .technician-card b) {
  display: block;
  color: #075985;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

:where(.dashboard-card small, .task-card small, .lead-card small, .customer-card small, .history-card small, .technician-card small, .task-meta) {
  display: block;
  color: var(--ewo-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

:where(.dashboard-customer, .preview-row) {
  border-color: #d7edf9;
}

:where(.dash-pill, .pill, .status-pill) {
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  padding: 4px 8px;
}

:where(.dash-pill, .pill) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

:where(.dash-pill span, .pill::before) {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

:where(.dash-ok, .pill.ok, .status-pill.ok) {
  background: #e5f6eb !important;
  color: #17643a !important;
}

:where(.dash-open, .pill.open, .status-pill:not(.ok):not(.bad)) {
  background: #fff4cc !important;
  color: #704800 !important;
}

:where(.dash-ready, .pill.warn) {
  background: #fff3c7 !important;
  color: #5c4300 !important;
}

:where(.dash-bad, .pill.bad, .status-pill.bad) {
  background: #fde7e4 !important;
  color: #9d241b !important;
}

:where(.metric) {
  min-height: 82px;
  border-top: 5px solid var(--ewo);
  padding: 14px;
}

:where(.metric.open) {
  border-top-color: #f2a900;
}

:where(.note, .action-hint, .start-empty, .service-info-card, .empty) {
  line-height: 1.35;
  font-size: 13px;
}

:where(.note, .action-hint, .start-empty, .service-info-card) {
  border-radius: 8px;
  background: #f7fcff;
  border: 1px solid #cdeaff;
  border-left: 5px solid var(--ewo);
  color: #38566b;
  font-weight: 800;
}

:where(.panel-head h2, .dashboard-head h2, .section-head h3) {
  margin-bottom: 3px;
}

:where(.panel-head p, .dashboard-head p, .section-head p) {
  max-width: 680px;
}

:where(.quick-buttons, .overview-actions, .file-head-actions, .picker-actions, .actions) {
  gap: 8px;
}

:where(button, .module-link, .button-link) {
  min-height: 38px;
}

.simple-details {
  padding: 12px;
}

.simple-details > summary {
  cursor: pointer;
  color: #075985;
  font-weight: 900;
  list-style: none;
}

.simple-details > summary::-webkit-details-marker {
  display: none;
}

.simple-details > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--ewo);
  color: #fff;
}

.simple-details[open] > summary::before {
  content: "-";
}

.simple-details:not([open]) > :not(summary) {
  display: none !important;
}

:where(.metric b) {
  color: #075985;
  font-size: 30px;
  line-height: 1;
}

:where(.metric span) {
  color: var(--ewo-muted);
  font-weight: 900;
}

:where(.commandbar, .analysis-commandbar, .lead-customer-search) {
  border: 2px solid #9fd8ff !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #f7fcff 0%, #eef8ff 100%) !important;
  padding: 12px !important;
}

:where(.start-empty, .empty) {
  border-radius: 8px;
  line-height: 1.4;
}

:where(.start-empty) {
  border: 1px solid var(--luise-card-border) !important;
  background: var(--luise-soft-band) !important;
  color: #385064 !important;
}

:where(.empty.ok, .dashboard-empty) {
  border-color: #bfe7ce !important;
  background: #e5f6eb !important;
  color: #17643a !important;
}

:where(button) {
  min-height: 38px;
  letter-spacing: 0;
}

:where(button.secondary, .secondary) {
  background: #e8f6ff !important;
  color: var(--ewo-dark) !important;
  border: 1px solid #b9e3ff !important;
}

:where(button.secondary:hover, .secondary:hover) {
  background: #d5efff !important;
  color: var(--ewo-dark) !important;
}

:where(button.danger, .danger) {
  background: #b94136 !important;
  color: #fff !important;
}

:where(button.danger:hover, .danger:hover) {
  background: #942d25 !important;
}

:where(input[readonly], textarea[readonly], select:disabled) {
  background: #edf2f7 !important;
  color: #455a6b !important;
  font-weight: 800;
}

.lead-flow-main .open-leads-panel {
  border-top: 5px solid var(--ewo) !important;
}

.lead-flow-main .lead-work-panel {
  border-top: 5px solid var(--ewo) !important;
}

.lead-flow-main .lead-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.lead-flow-main .lead-card > div:last-child {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.lead-flow-main .lead-kpi-row {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.hidden {
  display: none !important;
}

.task-card.bad {
  border-color: #f0b0a9 !important;
  background: #fff8f7 !important;
}

.task-box-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)) !important;
  gap: 8px !important;
  width: 100%;
}

.task-box {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  min-height: 42px !important;
  width: 100% !important;
  border-radius: 8px !important;
  padding: 7px 9px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-align: left !important;
}

.task-box span {
  flex: 0 0 auto !important;
}

.task-box.ok {
  background: #e5f6eb !important;
  color: #17643a !important;
  border-color: #9bd6b1 !important;
}

.task-box.warn {
  background: #fff4cc !important;
  color: #704800 !important;
  border-color: #e1bd4e !important;
}

.task-box.bad {
  background: #fde7e4 !important;
  color: #9d241b !important;
  border-color: #f3b2aa !important;
}

.task-box.current {
  border-color: var(--ewo-dark) !important;
  box-shadow: inset 4px 0 0 var(--ewo) !important;
}

.task-box.ready {
  background: #fff3c7 !important;
  color: #5c4300 !important;
  border-color: #c99a18 !important;
  box-shadow: inset 4px 0 0 #c99a18 !important;
}

@media (max-width: 1180px) {
  header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  header .cloud-status {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    max-width: 100%;
  }

  .app-nav {
    grid-row: 3;
  }

  .app-nav {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

@media (max-width: 720px) {
  header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  header .auth-box {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
  }

  header .cloud-status {
    grid-row: 3;
  }

  .app-nav {
    grid-row: 4;
  }

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

.lead-flow-main .lead-card.lead-task-card {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.lead-flow-main .lead-card.lead-task-card > .task-box-row:last-child {
  justify-items: stretch !important;
}

.lead-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.lead-main {
  appearance: none;
  background: transparent !important;
  border: 0 !important;
  color: var(--ink) !important;
  padding: 0 !important;
  min-height: 0 !important;
  text-align: left;
  cursor: pointer;
}

.lead-main:hover {
  background: transparent !important;
}

.lead-card-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: start;
}

.lead-card .status-pill {
  max-width: 260px;
  white-space: normal;
  justify-content: center;
  text-align: center;
}

@media (max-width: 900px) {
  header {
    min-height: 0;
    flex-wrap: wrap;
  }
  .app-nav {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-left: 0;
  }
  .app-nav a {
    white-space: normal;
  }
  .lead-card-top {
    grid-template-columns: 1fr;
  }
  .lead-card-actions {
    justify-items: start;
  }
}

@media (max-width: 680px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-width: 0;
    overflow-x: hidden;
  }

  header {
    padding: 10px 12px !important;
    gap: 10px !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  header .logo-home,
  header > div:not(.auth-box):not(.cloud-status),
  header .auth-box,
  header .cloud-status,
  .app-nav {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
  }

  header .logo-home {
    justify-content: flex-start;
  }

  header img {
    width: min(138px, 46vw) !important;
    height: 48px !important;
  }

  header h1 {
    font-size: 21px !important;
    line-height: 1.1;
  }

  header small,
  .cloud-status {
    font-size: 11px !important;
    text-align: left !important;
  }

  .auth-box {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .app-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .app-nav a,
  button,
  .secondary,
  .module-link,
  .logout-button {
    min-height: 44px;
    padding: 10px 11px !important;
    font-size: 14px;
    line-height: 1.15;
    touch-action: manipulation;
  }

  main {
    width: 100%;
    padding: 10px !important;
    gap: 10px !important;
  }

  :where(.panel, .dashboard-panel, .metric, .login-card, .modal-card) {
    border-radius: 8px !important;
  }

  :where(.panel-head, .dashboard-head, .section-head) {
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }

  :where(.dashboard-card, .task-card, .lead-card, .customer-card, .history-card, .technician-card) {
    min-height: 52px;
    overflow-wrap: anywhere;
  }

  :where(input, select, textarea) {
    min-height: 44px;
    font-size: 16px;
  }

  :where(.quick-buttons, .overview-actions, .file-head-actions, .picker-actions, .actions) {
    grid-template-columns: 1fr !important;
  }
}
