:root,
html,
html[data-theme="auto"],
html[data-theme="light"],
html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #28505a;
  --secondary: #1b2d33;
  --accent: #8dd5da;
  --primary-fg: #e9eeeb;
  --body-fg: #e9eeeb;
  --body-bg: #111619;
  --body-quiet-color: #a5b3b9;
  --body-medium-color: #c4d0d4;
  --body-loud-color: #f4f7f5;
  --header-color: #e9eeeb;
  --header-branding-color: #8dd5da;
  --header-bg: #151c20;
  --header-link-color: #c4d0d4;
  --breadcrumbs-fg: #a5b3b9;
  --breadcrumbs-link-fg: #8dd5da;
  --breadcrumbs-bg: #181f23;
  --link-fg: #8dd5da;
  --link-hover-color: #bfe9ec;
  --link-selected-fg: #bfe9ec;
  --hairline-color: #263137;
  --border-color: #303c42;
  --error-fg: #f3a69e;
  --message-success-bg: #1d352a;
  --message-warning-bg: #3b301d;
  --message-error-bg: #3d2124;
  --darkened-bg: #181f23;
  --selected-bg: #20292e;
  --selected-row: #21333a;
  --button-fg: #edf8f8;
  --button-bg: #28505a;
  --button-hover-bg: #34616c;
  --default-button-bg: #28505a;
  --default-button-hover-bg: #34616c;
  --close-button-bg: #202c31;
  --close-button-hover-bg: #2a3a40;
  --delete-button-bg: #6a2f34;
  --delete-button-hover-bg: #843f45;
  --object-tools-bg: #202c31;
  --object-tools-hover-bg: #2a3a40;
  --font-family-primary: Vazirmatn, Vazir, 'Noto Sans Arabic', Tahoma, sans-serif;
}

html,
body {
  background: var(--body-bg) !important;
  color: var(--body-fg) !important;
  font-family: Vazirmatn, Vazir, 'Noto Sans Arabic', Tahoma, sans-serif !important;
  line-height: 1.8;
}

input,
select,
textarea,
button {
  font-family: inherit !important;
}

.theme-toggle {
  display: none !important;
}

#header {
  background: var(--header-bg) !important;
  color: var(--header-color) !important;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  gap: 14px;
  flex-wrap: wrap;
}

#branding {
  display: flex;
  align-items: center;
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--body-fg) !important;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none !important;
}

.admin-brand svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex: none;
}

.admin-brand .dot {
  color: #c5a675;
}

.admin-brand-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--body-quiet-color);
  border-right: 1px solid var(--border-color);
  padding-right: 10px;
  margin-right: 2px;
}

.admin-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 7px;
  background: #20292e;
  border: 1px solid var(--border-color);
  color: var(--body-fg) !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
}

.admin-nav-links a:hover {
  background: #28353c;
  border-color: var(--accent);
  color: var(--accent) !important;
}

#user-tools {
  font-size: 12px;
  color: var(--body-quiet-color);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#user-tools a,
#logout-form button {
  color: var(--accent) !important;
  font-size: 12px;
}

div.breadcrumbs {
  background: var(--breadcrumbs-bg) !important;
  border-bottom: 1px solid var(--border-color);
  color: var(--breadcrumbs-fg) !important;
  padding: 10px 24px;
  font-size: 12px;
}

#nav-sidebar {
  background: #151c20 !important;
  border-left: 1px solid var(--border-color) !important;
  border-right: 0 !important;
}

#nav-sidebar .current-model {
  background: #21333a !important;
}

#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited {
  color: var(--accent) !important;
}

#toggle-nav-sidebar {
  background: #151c20 !important;
  color: var(--body-quiet-color) !important;
  border-color: var(--border-color) !important;
}

#content {
  padding: 22px 24px;
}

.module,
fieldset.module,
.inline-group .tabular tr.has_original td {
  background: var(--darkened-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px;
}

.module {
  overflow: hidden;
  margin-bottom: 18px;
}

.module h2,
.module caption,
.inline-group h2 {
  background: #20292e !important;
  color: var(--body-fg) !important;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px !important;
  font-weight: 700;
  padding: 10px 14px !important;
}

#content-related {
  background: var(--darkened-bg) !important;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

#content-related .module {
  border: 0 !important;
  margin-bottom: 0;
}

#changelist {
  background: transparent !important;
}

#changelist #toolbar,
#changelist .actions,
.paginator {
  background: var(--darkened-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  color: var(--body-fg) !important;
  padding: 10px 12px !important;
  margin-bottom: 12px !important;
}

#changelist table,
.module table {
  background: var(--darkened-bg) !important;
  color: var(--body-fg) !important;
}

thead th {
  background: #20292d !important;
  color: var(--body-quiet-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
  font-size: 12px;
}

tbody tr {
  background: var(--darkened-bg) !important;
}

tbody tr:nth-child(odd),
tr.row1 {
  background: #181f23 !important;
}

tbody tr:nth-child(even),
tr.row2 {
  background: #1b2328 !important;
}

tbody tr:hover {
  background: #212c32 !important;
}

td,
th {
  border-bottom: 1px solid var(--hairline-color) !important;
  color: var(--body-fg);
}

#changelist-filter {
  background: var(--darkened-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px;
  overflow: hidden;
}

#changelist-filter h2 {
  background: #20292e !important;
  color: var(--body-fg) !important;
  border-bottom: 1px solid var(--border-color);
}

#changelist-filter li.selected a {
  color: var(--accent) !important;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea,
.vTextField,
.vURLField,
.vIntegerField {
  background: #11191d !important;
  color: var(--body-fg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  padding: 7px 10px !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent) !important;
  outline-offset: 1px;
}

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
  border-radius: 8px !important;
  border: 1px solid #3d717a !important;
  background: var(--button-bg) !important;
  color: var(--button-fg) !important;
  font-weight: 600;
  padding: 8px 14px !important;
}

.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.submit-row input:hover,
a.button:hover {
  background: var(--button-hover-bg) !important;
}

.submit-row {
  background: var(--darkened-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px;
  padding: 12px 16px !important;
}

.submit-row a.deletelink,
.deletelink {
  background: var(--delete-button-bg) !important;
  border-color: #9e4b52 !important;
  color: #fff !important;
  border-radius: 8px !important;
}

.object-tools a {
  background: var(--object-tools-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  color: var(--body-fg) !important;
}

.object-tools a:hover {
  background: var(--object-tools-hover-bg) !important;
  color: var(--accent) !important;
}

.errornote,
ul.errorlist {
  background: #3d2124 !important;
  border: 1px solid #84454c !important;
  color: #ffc8c2 !important;
  border-radius: 8px;
}

ul.messagelist li {
  border-bottom: 1px solid var(--border-color);
  color: var(--body-fg) !important;
}

.login #container {
  background: var(--darkened-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  margin-top: 8vh;
}

.login #header {
  border-radius: 12px 12px 0 0;
  justify-content: center;
}

.login .submit-row {
  background: transparent !important;
  border: 0 !important;
  padding: 12px 0 0 !important;
}

.login .submit-row input {
  width: 100%;
}

.help,
p.help,
form .form-row p.help {
  color: var(--body-quiet-color) !important;
}

@media (max-width: 767px) {
  #header {
    padding: 12px 14px;
  }
  #content {
    padding: 14px;
  }
  div.breadcrumbs {
    padding: 8px 14px;
  }
  .admin-nav-links {
    width: 100%;
  }
  #changelist-filter {
    margin-top: 14px;
  }
}
