:root {
  --sm-primary: #176f5c;
  --sm-primary-dark: #0f4f42;
  --sm-primary-soft: #eaf5f1;
  --sm-accent: #dba33c;
  --sm-bg: #f3f7f5;
  --sm-surface: #ffffff;
  --sm-text: #1c2b28;
  --sm-muted: #687a75;
  --sm-border: #d8e4e0;
  --sm-danger: #a63b3b;
  --sm-shadow: 0 16px 48px rgba(18, 61, 53, 0.10);
}

html,
body,
button,
input,
select,
textarea,
#container {
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif !important;
}

html[data-theme="dark"],
:root {
  --primary: var(--sm-primary);
  --secondary: var(--sm-primary-dark);
  --accent: #ffffff;
  --header-color: #ffffff;
  --header-branding-color: #ffffff;
  --header-bg: var(--sm-primary-dark);
  --header-link-color: #ffffff;
  --breadcrumbs-fg: #ffffff;
  --breadcrumbs-link-fg: rgba(255, 255, 255, 0.82);
  --breadcrumbs-bg: #143f37;
  --link-fg: var(--sm-primary);
  --link-hover-color: var(--sm-primary-dark);
  --link-selected-fg: var(--sm-primary-dark);
  --button-fg: #ffffff;
  --button-bg: var(--sm-primary);
  --button-hover-bg: var(--sm-primary-dark);
  --default-button-bg: var(--sm-primary);
  --default-button-hover-bg: var(--sm-primary-dark);
  --body-fg: var(--sm-text);
  --body-bg: var(--sm-bg);
  --body-quiet-color: var(--sm-muted);
  --body-medium-color: #4f625d;
  --body-loud-color: #15231f;
  --darkened-bg: #edf4f1;
  --selected-bg: #e4f1ed;
  --selected-row: #edf7f4;
  --hairline-color: var(--sm-border);
  --border-color: var(--sm-border);
  --error-fg: var(--sm-danger);
  color-scheme: light;
}

body {
  background:
    radial-gradient(circle at 90% 0%, rgba(23, 111, 92, 0.08), transparent 30rem),
    var(--sm-bg) !important;
  color: var(--sm-text) !important;
}

#header {
  min-height: 74px;
  padding: 0 28px;
  background: linear-gradient(135deg, #0f4f42, #123a33) !important;
  box-shadow: 0 10px 35px rgba(15, 79, 66, 0.16);
  align-items: center;
}

#branding {
  min-width: 0;
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff !important;
  text-decoration: none !important;
}

.admin-brand__mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.admin-brand__text {
  display: grid;
  line-height: 1.45;
}

.admin-brand__text strong {
  font-size: 16px;
  font-weight: 800;
}

.admin-brand__text small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.68);
}

#user-tools {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

#user-tools a {
  padding: 7px 10px;
  border-radius: 9px;
  color: #fff !important;
}

#user-tools a:hover {
  background: rgba(255, 255, 255, 0.12);
}

div.breadcrumbs {
  padding: 12px 28px;
  background: #143f37 !important;
  border: 0;
  font-size: 12px;
}

#content {
  padding: 28px;
}

#content h1 {
  margin: 0 0 22px;
  color: var(--sm-text);
  font-size: 24px;
  font-weight: 800;
}

.module,
.inline-group,
#changelist .results,
.submit-row,
.dashboard #content-related,
.object-tools a,
.selector,
.calendarbox,
.clockbox {
  border-radius: 16px !important;
}

.module,
.inline-group,
#changelist .results,
.dashboard #content-related {
  overflow: hidden;
  border: 1px solid var(--sm-border) !important;
  background: var(--sm-surface) !important;
  box-shadow: var(--sm-shadow);
}

.module h2,
.module caption,
.inline-group h2 {
  padding: 13px 16px !important;
  background: linear-gradient(90deg, var(--sm-primary), #20836d) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.dashboard .module table th,
.dashboard .module table td {
  padding: 13px 15px;
}

.dashboard .module table th a {
  color: var(--sm-text);
  font-weight: 700;
}

.dashboard .module table tr:hover {
  background: var(--sm-primary-soft);
}

#changelist-filter {
  border-right: 1px solid var(--sm-border) !important;
  background: #fbfdfc !important;
}

#changelist-filter h2 {
  background: var(--sm-primary-dark) !important;
}

#changelist-filter h3 {
  color: var(--sm-text);
  font-weight: 800;
}

#changelist table thead th {
  padding: 13px 12px;
  background: #f4f8f6;
  color: var(--sm-muted);
  font-size: 12px;
}

#changelist table tbody td,
#changelist table tbody th {
  padding: 13px 12px;
  border-color: #e7efec;
}

#changelist table tbody tr:hover {
  background: #f0f7f4;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
textarea,
select,
.vTextField,
.vLargeTextField {
  min-height: 42px;
  padding: 9px 12px !important;
  border: 1px solid var(--sm-border) !important;
  border-radius: 11px !important;
  background: #fff !important;
  color: var(--sm-text) !important;
  outline: none;
  transition: 0.18s ease;
}

textarea,
.vLargeTextField {
  min-height: 120px;
  line-height: 1.9;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--sm-primary) !important;
  box-shadow: 0 0 0 3px rgba(23, 111, 92, 0.12) !important;
}

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
  min-height: 40px;
  padding: 9px 16px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--sm-primary) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

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

.deletelink,
.deletelink-box a {
  background: #fff0f0 !important;
  color: var(--sm-danger) !important;
}

.submit-row {
  padding: 14px !important;
  border: 1px solid var(--sm-border) !important;
  background: #fff !important;
  box-shadow: var(--sm-shadow);
}

.object-tools a {
  background: var(--sm-primary) !important;
  font-weight: 700;
}

.messagelist li {
  margin: 14px 28px 0;
  border-radius: 12px;
  border: 1px solid var(--sm-border);
  box-shadow: 0 8px 24px rgba(18, 61, 53, 0.06);
}

/* Login */
body.login {
  background:
    radial-gradient(circle at 20% 20%, rgba(23, 111, 92, 0.14), transparent 25rem),
    radial-gradient(circle at 90% 80%, rgba(219, 163, 60, 0.10), transparent 22rem),
    #edf4f1 !important;
}

body.login #container {
  width: min(450px, calc(100% - 32px));
  min-width: 0;
  margin: 8vh auto 0;
  border: 1px solid rgba(216, 228, 224, 0.9);
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 79, 66, 0.16);
}

body.login #header {
  min-height: 118px;
  padding: 24px 28px;
  justify-content: center;
  text-align: right;
}

body.login #branding {
  width: 100%;
}

body.login .admin-brand {
  width: 100%;
}

body.login .admin-brand__mark {
  width: 50px;
  height: 50px;
}

body.login .admin-brand__text strong {
  font-size: 18px;
}

body.login #content {
  padding: 28px;
}

body.login #content-main {
  width: 100%;
}

body.login .form-row {
  padding: 0 0 17px;
  border: 0;
}

body.login .form-row label {
  display: block;
  padding: 0 0 8px;
  color: var(--sm-text);
  font-size: 13px;
  font-weight: 700;
}

body.login .form-row input {
  width: 100%;
  min-height: 48px;
}

body.login .submit-row {
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none;
}

body.login .submit-row input {
  width: 100%;
  min-height: 48px;
  font-size: 14px;
}

body.login .errornote {
  margin: 0 0 18px;
  padding: 13px 14px;
  border: 1px solid #efcccc;
  border-radius: 12px;
  background: #fff3f3;
  color: var(--sm-danger);
  line-height: 1.8;
}

.admin-password-wrap {
  position: relative;
}

.admin-password-wrap input {
  padding-left: 78px !important;
}

.admin-password-toggle {
  position: absolute;
  left: 7px;
  top: 50%;
  min-height: 34px !important;
  padding: 5px 10px !important;
  transform: translateY(-50%);
  border: 0 !important;
  border-radius: 8px !important;
  background: var(--sm-primary-soft) !important;
  color: var(--sm-primary-dark) !important;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 767px) {
  #header {
    padding: 12px 16px;
  }

  .admin-brand__text small {
    display: none;
  }

  #content {
    padding: 18px 14px 34px;
  }

  div.breadcrumbs {
    padding: 11px 16px;
  }

  body.login #container {
    margin-top: 24px;
  }
}
