:root {
  --bg: #f3f7fb;
  --panel: #ffffff;
  --text: #102338;
  --muted: #4e657d;
  --line: #d9e3ee;
  --brand: #0c4a8a;
  --brand-dark: #073159;
  --ok: #167d43;
  --warn: #9a5b05;
  --danger: #b42318;
}

body.backend-page {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.backend-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.backend-sidebar {
  background: #062f57;
  color: #fff;
  padding: 24px 18px;
}

.backend-sidebar img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  margin-bottom: 14px;
}

.backend-sidebar h2 {
  margin: 0;
  font-size: 1.12rem;
}

.backend-sidebar p {
  margin: 8px 0 18px;
  color: #d4e5f8;
  font-size: 0.9rem;
}

.backend-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backend-nav a {
  color: #e8f2ff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
}

.backend-nav a.backend-nav-active,
.backend-nav a:hover {
  background: #fff;
  color: #062f57;
}

.backend-main {
  padding: 26px;
}

.backend-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.backend-top h1 {
  margin: 0;
  font-size: 1.62rem;
}

.backend-top p {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}

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

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.stat small {
  color: var(--muted);
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
}

label {
  font-weight: 600;
  font-size: 0.92rem;
  display: block;
  margin-bottom: 8px;
}

input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid #c8d8e9;
  padding: 10px;
  margin-top: 5px;
  font: inherit;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn-backend {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}

.btn-backend:hover {
  background: var(--brand-dark);
}

.btn-muted {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px;
  vertical-align: top;
}

.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-active {
  color: #0f5132;
  background: #d1fae5;
}

.status-inactive {
  color: #7c2d12;
  background: #ffedd5;
}

.flash-message {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-weight: 700;
}

.flash-success {
  background: #ddf8e7;
  color: #0f5132;
}

.flash-error {
  background: #ffe5e5;
  color: #7f1d1d;
}

.inline-form {
  display: inline;
}

.password-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.password-wrap input {
  margin-top: 0;
}

.password-toggle-btn {
  border: 1px solid #c8d8e9;
  background: #fff;
  color: var(--brand);
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.password-toggle-btn:hover {
  background: #eef6ff;
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.logo-thumb {
  width: 110px;
  height: 62px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
}

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ffd7a8;
  color: #7a4a08;
  background: #fff8e8;
  font-weight: 600;
}

.edital-card-client {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.edital-card-client img {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

@media (max-width: 980px) {
  .backend-shell {
    grid-template-columns: 1fr;
  }

  .stats,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

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

  .panel {
    padding: 12px;
    border-radius: 12px;
  }

  .backend-top h1 {
    font-size: 1.28rem;
    line-height: 1.25;
  }

  .backend-top p {
    font-size: 0.94rem;
  }

  .backend-nav a {
    padding: 9px 10px;
    font-size: 0.9rem;
  }

  table th,
  table td {
    font-size: 0.86rem;
    padding: 8px;
  }

  td .btn-backend,
  td .inline-form {
    display: block;
    width: 100%;
    margin-top: 6px;
  }

  .action-stack {
    display: grid;
    gap: 6px;
  }

  td .inline-form .btn-backend {
    width: 100%;
  }

  .form-actions .btn-backend,
  .form-actions .btn-muted,
  .form-actions .btn-danger,
  .form-actions a.btn-backend {
    width: 100%;
    text-align: center;
  }

  .password-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .password-toggle-btn {
    width: 100%;
  }

  .backend-sidebar {
    padding: 14px;
  }
}
