:root,
html[data-theme="light"] {
  color-scheme: light;
  --primary: #087f6f;
  --secondary: #075f55;
  --accent: #fff;
  --primary-fg: #fff;
  --body-fg: #182925;
  --body-bg: #fff;
  --body-quiet-color: #596962;
  --body-medium-color: #596962;
  --body-loud-color: #182925;
  --header-color: #fff;
  --header-branding-color: #fff;
  --header-bg: #075f55;
  --header-link-color: #fff;
  --breadcrumbs-fg: #596962;
  --breadcrumbs-link-fg: #075f55;
  --breadcrumbs-bg: #f4f7f5;
  --link-fg: #075f55;
  --link-hover-color: #087f6f;
  --link-selected-fg: #075f55;
  --hairline-color: #dce5e1;
  --border-color: #dce5e1;
  --darkened-bg: #f4f7f5;
  --selected-bg: #e7efeb;
  --selected-row: #e7f5f0;
  --button-bg: #087f6f;
  --button-fg: #fff;
  --button-hover-bg: #075f55;
  --default-button-bg: #075f55;
  --default-button-hover-bg: #064a42;
  --close-button-bg: #596962;
  --close-button-hover-bg: #3f5048;
  --delete-button-bg: #b44336;
  --delete-button-hover-bg: #92372c;
  --green-fg: #207345;
  --orange-fg: #946200;
  --deal-bg: #edf4f9;
  --memo-bg: #eef7ee;
  --task-bg: #fff4e8;
  --font-family-primary: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #70cfba;
  --secondary: #123c32;
  --body-fg: #e3ede8;
  --body-bg: #17251f;
  --body-quiet-color: #a5b7ad;
  --body-medium-color: #a5b7ad;
  --body-loud-color: #e3ede8;
  --header-bg: #123c32;
  --breadcrumbs-fg: #a5b7ad;
  --breadcrumbs-link-fg: #9bddcd;
  --breadcrumbs-bg: #1e3027;
  --link-fg: #9bddcd;
  --link-hover-color: #70cfba;
  --link-selected-fg: #9bddcd;
  --hairline-color: #384d43;
  --border-color: #384d43;
  --darkened-bg: #1e3027;
  --selected-bg: #294336;
  --selected-row: #244a3a;
  --button-bg: #176f5e;
  --button-hover-bg: #125749;
  --default-button-bg: #176f5e;
  --default-button-hover-bg: #125749;
  --green-fg: #70cf96;
  --orange-fg: #edc36b;
  --deal-bg: #20333e;
  --memo-bg: #233c2a;
  --task-bg: #3c3221;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
    --primary: #70cfba;
    --secondary: #123c32;
    --body-fg: #e3ede8;
    --body-bg: #17251f;
    --body-quiet-color: #a5b7ad;
    --body-medium-color: #a5b7ad;
    --body-loud-color: #e3ede8;
    --header-bg: #123c32;
    --breadcrumbs-fg: #a5b7ad;
    --breadcrumbs-link-fg: #9bddcd;
    --breadcrumbs-bg: #1e3027;
    --link-fg: #9bddcd;
    --link-hover-color: #70cfba;
    --link-selected-fg: #9bddcd;
    --hairline-color: #384d43;
    --border-color: #384d43;
    --darkened-bg: #1e3027;
    --selected-bg: #294336;
    --selected-row: #244a3a;
    --button-bg: #176f5e;
    --button-hover-bg: #125749;
    --default-button-bg: #176f5e;
    --default-button-hover-bg: #125749;
    --green-fg: #70cf96;
    --orange-fg: #edc36b;
    --deal-bg: #20333e;
    --memo-bg: #233c2a;
    --task-bg: #3c3221;
  }
}

#header {
  min-height: 64px;
  flex-shrink: 0;
  gap: 12px 20px;
  flex-wrap: wrap;
}

#branding {
  min-width: 0;
}

#site-name a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.sir-crm-symbol { display: block; flex: none; width: 44px; height: 44px; object-fit: contain; }
.sir-crm-name { font-size: 28px; line-height: 1; font-weight: 800; }
.shtepial-crm-label { font-size: 14px; font-weight: 500; }

.shtepial-crm-navigation {
  flex-basis: 100%;
  font-size: 13px;
  padding-top: 10px;
  border-top: 1px solid #ffffff40;
}

.shtepial-crm-navigation a {
  display: inline-block;
  padding-block: 4px;
  overflow-wrap: anywhere;
}

.module h2,
.module caption,
.inline-group h2 {
  background: var(--darkened-bg);
  color: var(--body-fg);
  border-bottom: 1px solid var(--border-color);
}

.module caption a:link,
.module caption a:visited,
#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited {
  color: var(--link-fg);
}

.submit-row,
#changelist-filter {
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select,
.button,
.submit-row input {
  border-radius: 4px;
}

input[type="checkbox"],
input[type="radio"],
progress {
  accent-color: var(--primary);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  #header {
    gap: 10px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: 15px;
  }

  #branding { align-self: center; }

  #user-tools {
    float: none;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .shtepial-crm-navigation {
    flex-basis: auto;
    max-width: 100%;
    text-align: center;
  }
}
