:root {
  color-scheme: light;
  --md-sys-color-primary: #0b57d0;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d3e3fd;
  --md-sys-color-on-primary-container: #041e49;
  --md-sys-color-secondary: #51606f;
  --md-sys-color-secondary-container: #d5e3f3;
  --md-sys-color-on-secondary-container: #0e1d2a;
  --md-sys-color-tertiary: #006a6a;
  --md-sys-color-tertiary-container: #9cf1f0;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-success: #146c43;
  --md-sys-color-success-container: #d1f4dc;
  --md-sys-color-surface: #ffffff;
  --md-sys-color-surface-dim: #d8dde6;
  --md-sys-color-surface-container-low: #f6f8fc;
  --md-sys-color-surface-container: #eef3f9;
  --md-sys-color-surface-container-high: #e6ecf4;
  --md-sys-color-outline: #6f7885;
  --md-sys-color-outline-variant: #c6d0dc;
  --md-sys-color-on-surface: #18202b;
  --md-sys-color-on-surface-variant: #465465;
  --md-elevation-1: 0 1px 2px rgba(29, 27, 32, 0.16), 0 1px 3px rgba(29, 27, 32, 0.10);
  --md-elevation-2: 0 2px 6px rgba(29, 27, 32, 0.16), 0 1px 2px rgba(29, 27, 32, 0.10);
  --md-elevation-3: 0 4px 10px rgba(29, 27, 32, 0.18), 0 2px 4px rgba(29, 27, 32, 0.12);
  --md-radius: 8px;
}

body.theme-aa-1,
body.theme-aa-2,
body.theme-aa-3,
body.theme-aa-4,
body.theme-aa-5,
body.theme-aa-6,
body.theme-aa-7,
body.theme-aa-8,
body.theme-aa-9,
body.theme-aa-11,
body.theme-aa-12,
body.theme-aa-13,
body.theme-aa-15 {
  --md-sys-color-primary: #0b57d0;
  --md-sys-color-primary-container: #d3e3fd;
  --md-sys-color-on-primary-container: #041e49;
}

body.theme-aa-14 {
  color-scheme: dark;
  --md-sys-color-primary: #8ab4f8;
  --md-sys-color-on-primary: #041e49;
  --md-sys-color-primary-container: #1f3b66;
  --md-sys-color-on-primary-container: #d3e3fd;
  --md-sys-color-secondary: #bec7d2;
  --md-sys-color-secondary-container: #34475a;
  --md-sys-color-on-secondary-container: #dbe7f5;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-error-container: #5f1414;
  --md-sys-color-success: #9bd7ad;
  --md-sys-color-success-container: #173f2a;
  --md-sys-color-surface: #111827;
  --md-sys-color-surface-container-low: #0f172a;
  --md-sys-color-surface-container: #182235;
  --md-sys-color-surface-container-high: #202b3f;
  --md-sys-color-outline: #8993a1;
  --md-sys-color-outline-variant: #334155;
  --md-sys-color-on-surface: #e5e7eb;
  --md-sys-color-on-surface-variant: #b6c2d1;
  --md-elevation-1: 0 1px 2px rgba(0, 0, 0, 0.34), 0 1px 3px rgba(0, 0, 0, 0.22);
  --md-elevation-2: 0 2px 8px rgba(0, 0, 0, 0.38);
  --md-elevation-3: 0 8px 24px rgba(0, 0, 0, 0.42);
}

* {
  letter-spacing: 0;
}

body {
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font-family: "Roboto", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
}

a {
  color: var(--md-sys-color-primary);
}

a:hover {
  color: var(--md-sys-color-on-primary-container);
}

#wrapper,
#content-wrapper {
  background: var(--md-sys-color-surface-container-low);
}

.sidebar {
  width: 15rem !important;
  background: var(--md-sys-color-on-primary-container) !important;
  border-right: 1px solid var(--md-sys-color-primary);
  box-shadow: none;
}

.sidebar .sidebar-brand {
  min-height: 5.5rem;
  color: var(--md-sys-color-on-primary) !important;
}

.sidebar .sidebar-brand-icon img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  padding: 8px;
  background: var(--md-sys-color-surface);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--md-radius);
  box-shadow: var(--md-elevation-1);
}

.sidebar .sidebar-divider {
  border-top-color: rgba(255, 255, 255, 0.18) !important;
}

.sidebar .nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  min-height: 48px;
  margin: 3px 12px;
  padding: 0 16px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82) !important;
  font-weight: 500;
}

.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item .nav-link:focus {
  color: var(--md-sys-color-on-secondary-container) !important;
  background: var(--md-sys-color-primary-container);
}

.sidebar .nav-item .nav-link i {
  width: 20px;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
}

.sidebar .nav-item .nav-link span {
  font-size: 13px;
  font-weight: 500;
}

.sidebar-dark #sidebarToggle {
  background-color: var(--md-sys-color-secondary-container);
}

.topbar {
  min-height: 72px;
  margin-bottom: 24px !important;
  background: var(--md-sys-color-surface) !important;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  border-top: 4px solid var(--md-sys-color-primary);
  box-shadow: var(--md-elevation-1) !important;
}

.topbar h5 {
  color: var(--md-sys-color-primary) !important;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}

#sidebarToggleTop {
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
}

.container-fluid {
  max-width: 1440px;
  padding: 0 28px 36px;
}

.container-fluid > h3,
.container-fluid .h3 {
  margin: 4px 0 18px;
  color: var(--md-sys-color-on-surface) !important;
  font-size: 24px;
  font-weight: 700;
}

.card,
.modal-content,
.table-responsive,
.panel-actions {
  border: 1px solid var(--md-sys-color-outline-variant) !important;
  border-radius: var(--md-radius) !important;
  background: var(--md-sys-color-surface);
  box-shadow: var(--md-elevation-1) !important;
}

.card {
  border-top: 3px solid var(--md-sys-color-primary) !important;
}

.card-header,
.modal-header {
  min-height: 56px;
  align-items: center;
  background: var(--md-sys-color-surface-container) !important;
  border-bottom: 1px solid var(--md-sys-color-outline-variant) !important;
}

.card-header h6,
.modal-header h5 {
  color: var(--md-sys-color-on-surface);
  font-weight: 700;
}

.panel-actions,
.d-flex.flex-wrap.mb-3 {
  align-items: center;
  gap: 10px;
  margin-bottom: 18px !important;
  padding: 12px;
  background: var(--md-sys-color-primary-container);
}

.btn {
  min-height: 40px;
  border-radius: 8px;
  border-width: 0;
  padding: 9px 18px;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none !important;
}

.btn i {
  font-size: 0.95em;
}

.btn-mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--md-sys-color-primary) !important;
  color: var(--md-sys-color-on-primary) !important;
}

.btn-primary:hover {
  background: var(--md-sys-color-primary) !important;
  filter: brightness(0.92);
}

.btn-success {
  background: var(--md-sys-color-success-container) !important;
  color: #064e2e !important;
}

.btn-success:hover {
  background: #b6e7c5 !important;
}

.btn-danger {
  background: var(--md-sys-color-error-container) !important;
  color: var(--md-sys-color-error) !important;
}

.btn-danger:hover {
  background: #ffc8c1 !important;
}

.btn-dark,
.btn-secondary {
  background: var(--md-sys-color-secondary-container) !important;
  color: #1d192b !important;
}

.btn-dark:hover,
.btn-secondary:hover {
  background: #c8d8ea !important;
}

.btn-sm {
  min-height: 34px;
  padding: 7px 12px;
}

.form-control,
select.form-control {
  min-height: 48px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface);
}

.form-control::placeholder {
  color: var(--md-sys-color-on-surface-variant);
}

.form-control:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.16);
}

label,
.control-label {
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}

#search {
  max-width: 520px;
  margin-bottom: 18px !important;
  background: var(--md-sys-color-surface);
}

.table-responsive {
  overflow: auto;
}

.table {
  margin-bottom: 0;
  color: var(--md-sys-color-on-surface);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 15px 16px;
  border: 0;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-color: var(--md-sys-color-outline-variant);
}

.table td[data-label="Nome"] {
  color: var(--md-sys-color-on-surface);
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.status-active {
  background: var(--md-sys-color-success-container);
  color: #064e2e;
}

.status-expired {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-error);
}

.appearance-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.appearance-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  background: var(--md-sys-color-surface-container-low);
  cursor: pointer;
}

.appearance-option:has(input:checked) {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
}

.appearance-option input {
  margin-top: 4px;
  accent-color: var(--md-sys-color-primary);
}

.appearance-option strong {
  display: block;
  margin-bottom: 6px;
  color: var(--md-sys-color-on-surface);
  font-size: 16px;
}

.appearance-option small {
  display: block;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.4;
}

body.theme-aa-14 .form-control,
body.theme-aa-14 select.form-control {
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
}

body.theme-aa-14 .table tbody tr:hover,
body.theme-aa-14 .table td:nth-child(even) {
  background: var(--md-sys-color-surface-container);
}

.table tbody tr:hover {
  background: var(--md-sys-color-surface-container-low);
}

.table td[data-label="DNS"] {
  max-width: 430px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  word-break: break-word;
}

.table th:nth-child(3),
.table td[data-label="Expiração"],
.table td[data-label="ExpiraÃ§Ã£o"] {
  min-width: 118px;
  white-space: nowrap;
}

.badge-danger {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-error);
}

.modal-content {
  overflow: hidden;
}

.modal-footer {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
}

.scrollBtn {
  width: 44px !important;
  height: 44px !important;
  border-radius: 8px !important;
  background: var(--md-sys-color-primary) !important;
  color: var(--md-sys-color-on-primary) !important;
  box-shadow: var(--md-elevation-3);
}

body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(135deg, var(--md-sys-color-on-primary-container), var(--md-sys-color-primary)),
    url("../img/background.jpg") center / cover;
}

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  text-align: center;
  pointer-events: auto;
}

body.theme-aa-14 .login-card {
  background: rgba(17, 24, 39, 0.94);
}

.login-logo {
  width: min(220px, 72vw);
  max-height: 150px;
  object-fit: contain;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--md-sys-color-surface);
  box-shadow: var(--md-elevation-2);
}

.login-card h1 {
  margin: 0 0 6px;
  color: var(--md-sys-color-on-surface);
  font-size: 24px;
  font-weight: 700;
}

.login-name {
  margin: 0 0 20px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}

.login-form {
  position: relative;
  z-index: 20;
  display: grid;
  gap: 12px;
  margin: 0;
  pointer-events: auto;
}

.login-form .form-control {
  position: relative;
  z-index: 21;
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
}

.login-form .btn {
  position: relative;
  z-index: 21;
  min-height: 52px;
}

.login-meta {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}

.login-page .wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.login-page .wrapper > br,
.login-page .container > br {
  display: none;
}

.login-page .container {
  width: 100%;
}

.login-page .container[style],
.login-page div[style*="width:400px"] {
  width: min(100%, 430px) !important;
  max-width: 430px;
  margin: 0 auto !important;
}

.login-page .center {
  width: 100%;
}

.login-page .center > center,
.login-page form,
.login-page .card-body {
  padding: 0 22px;
}

.login-page .center {
  padding: 26px 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 251, 254, 0.92);
  box-shadow: 0 16px 44px rgba(29, 27, 32, 0.28);
}

.login-page img.center {
  width: min(230px, 76vw) !important;
  height: auto !important;
  max-height: 150px;
  object-fit: contain;
  padding: 16px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--md-sys-color-surface);
  box-shadow: var(--md-elevation-2);
}

.login-page h3,
.login-page h5 {
  color: var(--md-sys-color-on-surface) !important;
}

.login-page h3 {
  font-weight: 700;
}

.login-page form {
  margin-top: 18px;
}

.login-page form .form-control {
  min-height: 50px;
  color: var(--md-sys-color-on-surface) !important;
  background: var(--md-sys-color-surface);
}

.login-page form .btn {
  min-height: 50px;
  margin-top: 4px;
}

.login-page .panel-body p {
  margin-bottom: 6px;
  color: var(--md-sys-color-on-surface-variant) !important;
}

@media (max-width: 991.98px) {
  .login-page {
    overflow-y: auto;
    -webkit-text-size-adjust: 100%;
  }

  .login-shell {
    align-items: flex-start;
    padding: 18px 14px 28px;
  }

  .login-card {
    width: 100%;
    padding: 22px 18px;
  }

  .login-logo {
    width: min(190px, 68vw);
    max-height: 120px;
  }

  .container-fluid {
    padding: 0 14px 24px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform 0.22s ease, width 0.22s ease;
    box-shadow: var(--md-elevation-3);
  }

  body.mobile-menu-open .sidebar,
  .sidebar.toggled {
    width: 13rem !important;
    min-width: 13rem !important;
    overflow-y: auto;
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar .nav-item .nav-link {
    min-height: 44px;
    margin: 3px 10px;
    padding: 0 14px;
    justify-content: flex-start;
  }

  .sidebar .nav-item .nav-link i {
    width: 20px;
    font-size: 15px;
  }

  .sidebar .sidebar-brand {
    min-height: 4.8rem;
  }

  .sidebar .sidebar-brand-icon img {
    width: 50px;
    height: 50px;
    padding: 6px;
  }

  .sidebar .nav-item .nav-link span,
  .sidebar.toggled .nav-item .nav-link span {
    display: inline;
    font-size: 13px;
  }

  body.mobile-menu-open::before,
  body.sidebar-toggled::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(24, 32, 43, 0.36);
  }

  #content-wrapper {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .panel-actions,
  .d-flex.flex-wrap.mb-3 {
    padding: 12px;
  }

  .btn-mobile {
    width: 100%;
  }

  .table-responsive {
    border: 0 !important;
    background: transparent;
    box-shadow: none !important;
  }

  table thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  .table tbody tr {
    margin-bottom: 14px;
    padding: 8px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 8px;
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-elevation-1);
  }

  .table td {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    padding: 9px 10px;
    text-align: right;
    border: 0;
    border-radius: 6px;
  }

  .table td + td {
    margin-top: 4px;
  }

  .table td:nth-child(even) {
    background: var(--md-sys-color-surface-container-low);
  }

  .table td::before {
    content: attr(data-label);
    position: static;
    flex: 0 0 38%;
    width: auto;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 700;
    text-align: left;
  }

  .table td[data-label="DNS"] {
    max-width: none;
    display: block;
    text-align: left;
    white-space: normal;
  }

  .table td[data-label="DNS"]::before {
    display: block;
    margin-bottom: 5px;
  }

  .table td[data-label="Ações"] {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .table td[data-label="Ações"]::before {
    margin-right: auto;
  }
}
