:root {
  --primary: #202124;
  --secondary: #314b5f;
  --accent: #d41421;
  --primary-fg: #ffffff;
  --body-bg: #f4f6f8;
  --body-fg: #171717;
  --body-quiet-color: #667085;
  --body-loud-color: #101828;
  --breadcrumbs-bg: #ffffff;
  --breadcrumbs-fg: #667085;
  --link-fg: #2f6f8f;
  --link-hover-color: #d41421;
  --hairline-color: #d8dee6;
  --border-color: #d8dee6;
  --selected-bg: #fff5f5;
  --selected-row: #fff5f5;
  --button-bg: #d41421;
  --button-hover-bg: #aa101a;
  --default-button-bg: #2f6f8f;
  --default-button-hover-bg: #245972;
  --delete-button-bg: #b42318;
  --delete-button-hover-bg: #7a271a;
  --object-tools-bg: #2f6f8f;
  --object-tools-hover-bg: #245972;
  --font-family-primary: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-family-monospace: "Cascadia Mono", Consolas, monospace;
}

body {
  background: var(--body-bg);
  color: var(--body-fg);
}

#container {
  min-width: 0;
}

#header {
  min-height: 72px;
  padding: 0 28px;
  background: #ffffff;
  color: var(--body-fg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

#branding {
  min-width: min(520px, 54vw);
}

.ke-admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
}

.ke-admin-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

#site-name {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 800;
}

#site-name a:link,
#site-name a:visited {
  color: #171717;
}

.ke-admin-subtitle {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

#user-tools {
  color: #667085;
  font-size: 12px;
}

#user-tools a,
#logout-form button {
  color: #2f6f8f;
  font-weight: 700;
  border: 0;
}

.ke-admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ke-admin-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #d8dee6;
  border-radius: 6px;
  color: #344054;
  background: #ffffff;
  font-weight: 750;
  font-size: 12px;
}

.ke-admin-actions a:hover {
  color: #ffffff;
  background: #d41421;
  border-color: #d41421;
}

.breadcrumbs {
  padding: 13px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  color: #667085;
}

.breadcrumbs a {
  color: #2f6f8f;
  font-weight: 750;
}

.main {
  background: var(--body-bg);
}

#nav-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  color: #101828;
}

#nav-filter {
  width: calc(100% - 22px);
  margin: 12px 11px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  min-height: 36px;
}

#nav-sidebar .module th,
#nav-sidebar .module caption {
  background: #314b5f;
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0.05em;
}

#nav-sidebar table {
  background: #ffffff;
}

#nav-sidebar th,
#nav-sidebar td {
  background: #ffffff;
  color: #101828;
}

#nav-sidebar .module th,
#nav-sidebar .module th a,
#nav-sidebar .module caption,
#nav-sidebar .module caption a {
  background: #314b5f;
  color: #ffffff;
}

#nav-sidebar a,
#nav-sidebar a:link,
#nav-sidebar a:visited {
  color: #1f5f7a;
  font-weight: 650;
}

#nav-sidebar .current-model {
  background: #fff5f5;
  border-left: 4px solid #d41421;
}

#nav-sidebar .current-model a,
#nav-sidebar .current-model a:link,
#nav-sidebar .current-model a:visited {
  color: #101828;
  font-weight: 800;
}

#nav-sidebar .addlink,
#nav-sidebar .addlink:link,
#nav-sidebar .addlink:visited,
#nav-sidebar .changelink,
#nav-sidebar .changelink:link,
#nav-sidebar .changelink:visited {
  color: #15803d;
}

#content {
  padding: 28px;
}

#content h1 {
  color: #101828;
  font-size: 28px;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0 0 20px;
}

.module,
.inline-group {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.module h2,
.module caption,
.inline-group h2 {
  padding: 13px 16px;
  background: #314b5f;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
}

#changelist {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

#changelist .changelist-form-container {
  border: 0;
}

#changelist table thead th {
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
}

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

th,
td {
  border-bottom-color: #edf1f5;
}

.row1 {
  background: #ffffff;
}

.row2 {
  background: #fbfcfd;
}

#changelist-filter {
  border-left: 1px solid var(--border-color);
  background: #ffffff;
}

#changelist-filter h2 {
  background: #314b5f;
  color: #ffffff;
}

#changelist-filter h3 {
  color: #101828;
  font-weight: 800;
}

#toolbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 14px;
}

#toolbar form input[type="text"] {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  min-height: 36px;
  padding: 0 12px;
}

fieldset.module {
  margin-bottom: 18px;
}

.form-row {
  border-bottom-color: #edf1f5;
  padding: 14px 16px;
}

label {
  color: #344054;
  font-weight: 750;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
textarea,
select,
.vTextField {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  min-height: 36px;
  padding: 7px 10px;
  background: #ffffff;
}

textarea {
  min-height: 110px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2f6f8f;
  box-shadow: 0 0 0 3px rgba(47, 111, 143, 0.14);
  outline: 0;
}

.submit-row {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
  border-radius: 6px;
  min-height: 36px;
  font-weight: 800;
}

.object-tools a,
.object-tools a:link,
.object-tools a:visited {
  border-radius: 6px;
  font-weight: 800;
}

.messagelist li {
  border-radius: 8px;
  margin: 0 0 12px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.errornote,
ul.errorlist {
  border-radius: 8px;
}

.paginator {
  border-top: 1px solid var(--border-color);
  background: #ffffff;
}

body.login {
  background:
    linear-gradient(135deg, rgba(212, 20, 33, 0.08), rgba(47, 111, 143, 0.1)),
    #f4f6f8;
}

body.login #container {
  width: min(460px, calc(100% - 36px));
  min-width: 0;
  margin: 8vh auto 0;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.14);
}

body.login #header {
  min-height: 0;
  display: block;
  padding: 28px 26px 24px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: none;
}

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

body.login .ke-admin-brand {
  min-height: 0;
  align-items: center;
}

body.login .ke-admin-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}

body.login #site-name {
  font-size: 21px;
  line-height: 1.18;
  white-space: normal;
}

body.login .ke-admin-subtitle {
  max-width: 340px;
  font-size: 12px;
  line-height: 1.35;
}

body.login #content {
  padding: 26px;
  background: #ffffff;
}

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

body.login .form-row {
  padding: 0;
  margin: 0 0 16px;
  border-bottom: 0;
}

body.login .form-row label {
  display: block;
  margin: 0 0 7px;
  color: #101828;
  font-size: 14px;
}

body.login .form-row input {
  width: 100%;
  min-height: 44px;
  border-radius: 7px;
  font-size: 15px;
}

body.login .submit-row {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  text-align: left;
}

body.login .submit-row input[type="submit"] {
  width: 100%;
  min-height: 44px;
  border-radius: 7px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
}

body.login .submit-row input[type="submit"]:hover {
  background: var(--button-hover-bg);
}

body.login .errornote {
  margin: 0 0 18px;
}

body.login .ke-admin-actions,
body.login #user-tools {
  display: none;
}

@media (max-width: 960px) {
  #header {
    padding: 0 16px;
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

  .ke-admin-actions {
    width: 100%;
    padding-bottom: 12px;
    overflow-x: auto;
  }

  #content {
    padding: 18px;
  }
}

.ke-dashboard-page #content {
  width: 100%;
  max-width: none;
}

.ke-dashboard-page #content-main {
  float: none;
  width: 100%;
  max-width: 1480px;
}

.ke-dashboard-page #content h1 {
  margin: 0;
}

.ke-dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.ke-dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  grid-column: span 5;
  min-height: 190px;
}

.ke-dashboard-hero p {
  margin: 8px 0 0;
  color: #667085;
  max-width: 720px;
  font-size: 15px;
}

.ke-eyebrow {
  margin: 0 0 8px !important;
  color: #d41421 !important;
  font-size: 12px !important;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ke-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.ke-dashboard-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 6px;
  border: 1px solid #d8dee6;
  background: #ffffff;
  color: #344054;
  font-weight: 800;
}

.ke-dashboard-actions a:first-child {
  color: #ffffff;
  background: #d41421;
  border-color: #d41421;
}

.ke-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  grid-column: span 7;
}

.ke-stat-grid.compact .ke-stat-card strong {
  font-size: 28px;
}

.ke-stat-grid.compact {
  grid-column: span 12;
}

.ke-stat-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  color: #101828;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  border-top: 4px solid #2f6f8f;
}

.ke-stat-card.good {
  border-top-color: #15803d;
}

.ke-stat-card.warn {
  border-top-color: #b54708;
}

.ke-stat-card.bad {
  border-top-color: #b42318;
}

.ke-stat-card span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ke-stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 38px;
  line-height: 1;
  color: #101828;
}

.ke-stat-card small {
  display: block;
  margin-top: 8px;
  color: #667085;
  font-size: 13px;
}

.ke-dashboard-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  grid-column: span 12;
}

.ke-panel {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.ke-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #314b5f;
  color: #ffffff;
}

.ke-panel-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  font-weight: 850;
}

.ke-panel-head a {
  color: #ffffff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ke-dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.ke-dashboard-table th,
.ke-dashboard-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  vertical-align: top;
}

.ke-dashboard-table th {
  color: #667085;
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  line-height: 1.25;
}

.ke-dashboard-table td {
  line-height: 1.35;
}

.ke-dashboard-table tr:last-child td {
  border-bottom: 0;
}

.ke-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.ke-chip.approved {
  color: #15803d;
  background: #f0fdf4;
}

.ke-chip.pending {
  color: #b54708;
  background: #fffaeb;
}

.ke-chip.rejected {
  color: #b42318;
  background: #fff1f3;
}

.ke-apps-panel .module {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ke-apps-panel .module caption {
  background: #f8fafc;
  color: #344054;
}

@media (max-width: 1100px) {
  .ke-dashboard {
    grid-template-columns: 1fr;
  }

  .ke-dashboard-hero,
  .ke-stat-grid,
  .ke-stat-grid.compact,
  .ke-dashboard-columns {
    grid-column: auto;
  }

  .ke-stat-grid,
  .ke-dashboard-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ke-dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .ke-stat-grid,
  .ke-dashboard-columns {
    grid-template-columns: 1fr;
  }
}
