[hidden] {
  display: none !important;
}

body.login-locked {
  overflow: hidden;
}

body.admin-body {
  background:
    radial-gradient(circle at 12% 8%, rgba(35,134,217,.14), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(203,164,88,.16), transparent 28%),
    #f4f7fb;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  padding: 32px 16px;
  overflow: hidden;
}

.login-bg,
.login-bg span {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(3,16,33,.96), rgba(11,39,73,.9)),
    url("assets/logo-bomdominio.png");
  background-size: cover, 460px;
  background-position: center;
  opacity: 1;
}

.login-bg span:first-child {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35,134,217,.42), transparent 68%);
}

.login-bg span:last-child {
  width: 520px;
  height: 520px;
  right: -160px;
  bottom: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(203,164,88,.34), transparent 68%);
}

.login-card {
  position: relative;
  width: min(480px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 34px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 34px 120px rgba(0,0,0,.28);
  backdrop-filter: blur(20px);
}

.login-logo {
  display: grid;
  place-items: center;
  width: 230px;
  min-height: 96px;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid rgba(12,21,36,.1);
  border-radius: 24px;
  background: white;
}

.login-logo img {
  width: 190px;
}

.admin-kicker {
  display: inline-flex;
  color: #1268b3;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.login-card h1,
.admin-topbar h2 {
  margin-top: 8px;
  color: #031021;
  font-family: "Sora", "Inter", sans-serif;
  letter-spacing: -.055em;
}

.login-card h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.login-card p {
  margin-top: 12px;
  color: #526176;
}

.login-form {
  margin-top: 24px;
}

.login-form label {
  display: block;
  margin: 15px 0 8px;
  color: #031021;
  font-weight: 900;
}

.login-form input,
.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  border: 1px solid rgba(12,21,36,.14);
  border-radius: 16px;
  outline: none;
  padding: 14px 15px;
  color: #1e293b;
  background: #f8fafc;
  transition: border .2s ease, box-shadow .2s ease, background .2s ease;
}

.login-form input:focus,
.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
  border-color: rgba(18,104,179,.5);
  background: white;
  box-shadow: 0 0 0 4px rgba(18,104,179,.1);
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.password-row button {
  border: 0;
  border-radius: 16px;
  padding: 0 14px;
  color: white;
  background: #071a33;
  font-weight: 900;
}

.login-form .btn {
  width: 100%;
  margin-top: 22px;
}

.login-error {
  min-height: 22px;
  color: #b42318 !important;
  font-weight: 800;
}

.back-site {
  display: inline-flex;
  margin-top: 18px;
  color: #1268b3;
  font-weight: 900;
}

.admin-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px 1fr;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  color: white;
  background:
    radial-gradient(circle at 30% 0%, rgba(35,134,217,.24), transparent 34%),
    linear-gradient(180deg, #031021, #071a33);
}

.admin-brand {
  display: grid;
  place-items: center;
  min-height: 98px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255,255,255,.96);
}

.admin-brand img {
  width: 190px;
}

.admin-menu {
  display: grid;
  gap: 8px;
  margin-top: 30px;
}

.admin-menu button,
.sidebar-footer button,
.sidebar-footer a {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.05);
  font-weight: 900;
  text-align: left;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.admin-menu button:hover,
.admin-menu button.active,
.sidebar-footer button:hover,
.sidebar-footer a:hover {
  color: white;
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border: 1px solid rgba(12,21,36,.1);
  border-radius: 28px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 18px 44px rgba(3,16,33,.08);
  backdrop-filter: blur(20px);
}

.admin-topbar h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.topbar-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action,
.ghost-action,
.link-button,
.copy-inline {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 900;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.primary-action {
  color: white;
  background: linear-gradient(135deg, #1268b3, #071a33);
  box-shadow: 0 12px 26px rgba(18,104,179,.18);
}

.ghost-action,
.link-button,
.copy-inline {
  color: #071a33;
  background: #eef3f8;
}

.primary-action:hover,
.ghost-action:hover,
.link-button:hover,
.copy-inline:hover {
  transform: translateY(-2px);
}

.admin-view {
  display: none;
  margin-top: 22px;
}

.admin-view.active {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.summary-card,
.panel-card,
.table-shell,
.settings-card {
  border: 1px solid rgba(12,21,36,.1);
  border-radius: 28px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 16px 42px rgba(3,16,33,.07);
}

.summary-card {
  padding: 24px;
}

.summary-card span,
.panel-card-head span,
.settings-card > span {
  color: #68778c;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  color: #031021;
  font-family: "Sora", sans-serif;
  font-size: 2.35rem;
  letter-spacing: -.06em;
}

.summary-card.danger strong {
  color: #b42318;
}

.summary-card.success strong {
  color: #0b7a44;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 16px;
  margin-top: 16px;
}

.panel-card {
  padding: 24px;
}

.panel-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.panel-card h3 {
  margin-top: 6px;
  color: #031021;
  font-size: 1.35rem;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid rgba(12,21,36,.1);
  border-radius: 18px;
  background: #f8fafc;
}

.compact-item strong {
  color: #071a33;
}

.compact-item small {
  color: #68778c;
  font-weight: 700;
}

.toolbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.search-box {
  flex: 1 1 360px;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(12,21,36,.12);
  border-radius: 999px;
  padding: 0 18px;
  outline: none;
  background: white;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-pills button {
  min-height: 40px;
  border: 1px solid rgba(12,21,36,.1);
  border-radius: 999px;
  padding: 0 14px;
  color: #526176;
  background: white;
  font-weight: 900;
}

.filter-pills button.active {
  color: white;
  background: #071a33;
}

.table-shell {
  overflow: auto;
}

.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(12,21,36,.09);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #68778c;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: #f8fafc;
}

.admin-table td {
  color: #334155;
}

.admin-table td strong {
  display: block;
  color: #071a33;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-action {
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  font-weight: 900;
  color: #071a33;
  background: #eef3f8;
}

.table-action.danger {
  color: #b42318;
  background: #fff1f0;
}

.table-action.success {
  color: #0b7a44;
  background: #edfdf4;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .78rem;
  font-weight: 900;
}

.status.active,
.status.pago {
  color: #0b7a44;
  background: #eafaf1;
}

.status.inativo {
  color: #68778c;
  background: #eef3f8;
}

.status.pendente,
.status.due {
  color: #965b00;
  background: #fff7e6;
}

.status.overdue {
  color: #b42318;
  background: #fff1f0;
}

.settings-card p {
  margin-top: 12px;
  color: #526176;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.settings-grid div {
  padding: 18px;
  border: 1px solid rgba(12,21,36,.1);
  border-radius: 18px;
  background: #f8fafc;
}

.settings-grid span,
.settings-grid strong {
  display: block;
}

.settings-grid span {
  color: #68778c;
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-grid strong {
  margin-top: 6px;
  color: #071a33;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(3,16,33,.58);
  backdrop-filter: blur(8px);
}

.modal-root.active {
  display: grid;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  border-radius: 30px;
  background: white;
  box-shadow: 0 34px 120px rgba(0,0,0,.32);
}

.modal-card.large {
  width: min(980px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid rgba(12,21,36,.1);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
}

.modal-head h3 {
  color: #031021;
}

.modal-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #071a33;
  background: #eef3f8;
  font-size: 1.3rem;
  font-weight: 900;
}

.modal-body {
  padding: 24px;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: #071a33;
  font-weight: 900;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.alert-list {
  display: grid;
  gap: 12px;
}

.alert-item {
  padding: 16px;
  border: 1px solid rgba(12,21,36,.1);
  border-left: 5px solid #cba458;
  border-radius: 18px;
  background: #f8fafc;
}

.alert-item.overdue {
  border-left-color: #b42318;
}

.alert-item strong,
.alert-item span,
.alert-item small {
  display: block;
}

.alert-item strong {
  color: #071a33;
}

.alert-item span {
  color: #526176;
  margin-top: 4px;
}

.alert-item small {
  margin-top: 8px;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 900;
  padding: 14px 18px;
  border-radius: 999px;
  color: white;
  background: #031021;
  box-shadow: 0 18px 44px rgba(3,16,33,.28);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  font-weight: 900;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1120px) {
  .admin-app {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    min-height: auto;
  }

  .admin-menu {
    grid-template-columns: repeat(4, 1fr);
  }

  .sidebar-footer {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 16px;
  }

  .summary-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .admin-main {
    padding: 16px;
  }

  .admin-topbar,
  .toolbar,
  .panel-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions,
  .toolbar {
    width: 100%;
  }

  .primary-action,
  .ghost-action,
  .link-button {
    width: 100%;
  }

  .admin-menu,
  .summary-grid,
  .dashboard-grid,
  .settings-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full {
    grid-column: auto;
  }
}

.secure-note {
  border-color: rgba(11,122,68,.18);
  background: rgba(11,122,68,.07);
}

.login-screen[hidden], .admin-app[hidden] {
  display: none !important;
}

.login-help { margin-top: 14px; color: #526176; font-size: .9rem; font-weight: 700; }


.login-form {
  margin-top: 28px;
}

.login-form .btn {
  margin-top: 26px;
}

.login-error {
  margin-top: 14px;
  padding: 0;
  min-height: 22px;
}

.login-card::after {
  content: "Ambiente seguro";
  position: absolute;
  top: 28px;
  right: 28px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #0b7a44;
  background: rgba(21, 170, 94, .1);
  border: 1px solid rgba(21, 170, 94, .18);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .login-card::after {
    position: static;
    display: inline-flex;
    margin-bottom: 16px;
  }
}
