:root {
  color-scheme: light;
}

body {
  min-height: 100vh;
  background: #f3f4f7;
  color: #212631;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: #f3f4f7;
}

.login-card {
  width: min(100%, 430px);
  padding: 2rem;
  border: 1px solid #d8dbe0;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 1rem 3rem rgba(33, 38, 49, 0.12);
}

.login-brand {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.login-brand h1 {
  margin: 0;
  font-size: 1.75rem;
  color: #212631;
}

.brand-symbol {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 0.375rem;
  background: #5856d6;
  color: #fff;
  font-weight: 800;
}

.error-text {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  color: #d93737;
}

.app-closed,
.auth-closed {
  display: none;
}

.coreui-app {
  min-height: 100vh;
  background: #f3f4f7;
}

.sidebar {
  --cui-sidebar-width: 16rem;
  width: var(--cui-sidebar-width);
  min-height: 100vh;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  background: #fff;
  color: #3c4b64;
}

.sidebar-header {
  min-height: 4rem;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #212631;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-nav {
  height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 0.75rem;
}

.nav-title {
  margin: 1rem 0 0.35rem;
  padding: 0 0.75rem;
  color: #768192;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar .nav-link {
  width: 100%;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #3c4b64;
  text-align: left;
  text-decoration: none;
}

.sidebar .nav-link:hover {
  color: #212631;
  background: #ebedef;
}

.sidebar .nav-link.active {
  color: #fff;
  background: #5856d6;
}

.nav-icon {
  width: 1.35rem;
  text-align: center;
  color: #768192;
  font-size: 0.8rem;
  font-weight: 800;
}

.sidebar .nav-link.active .nav-icon {
  color: #fff;
}

.wrapper {
  padding-left: 16rem;
  background: #f3f4f7;
}

.header {
  background: #fff;
}

.header .container-fluid {
  min-height: 4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-toggler {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  color: #3c4b64;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-nav .nav-link {
  border: 0;
  background: transparent;
  color: #3c4b64;
}

.header-nav .nav-link:hover {
  color: #212631;
}

.breadcrumb {
  --cui-breadcrumb-divider-color: #768192;
  color: #768192;
}

.body {
  min-height: calc(100vh - 8rem);
}

.card {
  --cui-card-bg: #fff;
  --cui-card-border-color: #d8dbe0;
  --cui-card-color: #212631;
  box-shadow: 0 0.125rem 0.25rem rgba(33, 38, 49, 0.04);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.015);
  border-bottom-color: #d8dbe0;
  color: #212631;
  font-weight: 600;
}

.card-header-action {
  color: #0d6efd;
  font-size: 0.875rem;
  text-decoration: none;
}

.metric-card {
  min-height: 7rem;
}

.metric-card .fs-4 {
  margin-top: 0.45rem;
  color: #212631;
  overflow-wrap: anywhere;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8rem;
  gap: 1rem;
  align-items: end;
}

.switch-line {
  min-height: 2.375rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #3c4b64;
}

.search-input {
  max-width: 360px;
}

.credentials-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(13, 110, 253, 0.24);
  border-radius: 0.375rem;
  background: rgba(13, 110, 253, 0.06);
}

.connection-result {
  min-height: 2.25rem;
  display: none;
  align-items: center;
  padding: 0.625rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.connection-result:not(:empty) {
  display: flex;
}

.connection-result.success {
  border: 1px solid rgba(34, 151, 65, 0.32);
  background: rgba(34, 151, 65, 0.1);
  color: #146c2e;
}

.connection-result.error {
  border: 1px solid rgba(222, 90, 90, 0.32);
  background: rgba(222, 90, 90, 0.1);
  color: #b02a37;
}

.whatsapp-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.whatsapp-connection-data {
  display: grid;
  gap: 1rem;
}

.mini-status {
  min-height: 4.5rem;
  display: grid;
  gap: 0.35rem;
  padding: 0.875rem;
  border: 1px solid #d8dbe0;
  border-radius: 0.375rem;
  background: #f8f9fa;
}

.mini-status span {
  color: #768192;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mini-status strong {
  overflow-wrap: anywhere;
  color: #212631;
  font-size: 0.95rem;
}

.qr-box textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.qr-image {
  width: min(100%, 260px);
  height: auto;
  display: block;
  padding: 0.75rem;
  border: 1px solid #d8dbe0;
  border-radius: 0.375rem;
  background: #fff;
}

.email-list,
.event-list,
.category-editor {
  display: grid;
  gap: 0.75rem;
}

.email-item,
.event-item,
.category-row {
  padding: 0.875rem;
  border: 1px solid #d8dbe0;
  border-radius: 0.375rem;
  background: #f8f9fa;
}

.email-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.email-title {
  margin: 0 0 0.35rem;
  color: #212631;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.email-meta,
.event-item,
.email-snippet {
  color: #5c6873;
}

.email-snippet {
  margin: 0.5rem 0 0;
  line-height: 1.45;
}

.badge {
  align-self: start;
  border-radius: 50rem;
  padding: 0.35rem 0.6rem;
  background: rgba(13, 110, 253, 0.12);
  color: #0d6efd;
  font-size: 0.75rem;
  font-weight: 700;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(8rem, 0.5fr) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.category-row .secondary-action {
  min-height: 38px;
  border: 1px solid #d8dbe0;
  border-radius: 0.375rem;
  background: #fff;
  color: #3c4b64;
}

.theme-color {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.table {
  --cui-table-color: #3c4b64;
  --cui-table-border-color: #d8dbe0;
  font-size: 0.875rem;
}

.email-table {
  table-layout: fixed;
}

.email-table th {
  color: #768192;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.email-table th:nth-child(1),
.email-table td:nth-child(1) {
  width: 180px;
}

.email-table th:nth-child(4),
.email-table td:nth-child(4) {
  width: 150px;
}

.email-subject,
.email-from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-subject {
  color: #212631;
  font-weight: 600;
}

.footer {
  min-height: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid #d8dbe0;
  background: #fff;
  color: #5c6873;
  font-size: 0.875rem;
}

.footer a {
  color: #0d6efd;
  text-decoration: none;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
  }

  .sidebar-nav {
    height: auto;
  }

  .wrapper {
    padding-left: 0;
  }
}

@media (max-width: 575.98px) {
  .header .container-fluid {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .header-nav {
    flex-wrap: wrap;
  }

  .form-grid,
  .credentials-box,
  .email-item,
  .category-row,
  .footer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .footer .ms-auto {
    margin-left: 0 !important;
  }
}
