:root {
    --azul: #2554e0;
    --azul-escuro: #1b3fb0;
    --texto-azul: #1d3fb8;
    --fundo: #eef1f5;
    --card-bg: #ffffff;
    --cinza-borda: #d7dbe2;
    --cinza-texto: #4a4f57;
    --erro: #c53030;
    --erro-bg: #fdecec;
    --sucesso-bg: #eafaf0;
    --sucesso-borda: #2f9e58;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--fundo);
    color: #202124;
}

.topbar {
    height: 6px;
    background: #2b2b2b;
    width: 100%;
}

.page {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}

.card {
    background: var(--card-bg);
    width: 100%;
    max-width: 560px;
    padding: 32px 40px 40px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(20, 30, 60, 0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    color: #14171c;
    letter-spacing: -0.5px;
}

.logo span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--azul);
    letter-spacing: 1px;
    margin-top: -4px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--texto-azul);
    margin: 0;
}

.section-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--texto-azul);
    margin: 0 0 20px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--texto-azul);
    margin-bottom: 6px;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid var(--cinza-borda);
    border-radius: 8px;
    margin-bottom: 20px;
    background: #fff;
    color: #202124;
    appearance: auto;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(37, 84, 224, 0.15);
}

button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--azul);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

button:hover {
    background: var(--azul-escuro);
}

button:active {
    transform: scale(0.99);
}

button:disabled {
    background: #9aa7c4;
    cursor: not-allowed;
}

.status {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.status.loading {
    background: #eef1f5;
    color: var(--cinza-texto);
}

.status.erro {
    background: var(--erro-bg);
    color: var(--erro);
    border: 1px solid rgba(197, 48, 48, 0.25);
}

.status.ok {
    background: var(--sucesso-bg);
    color: #14532d;
    border: 1px solid var(--sucesso-borda);
}

.resultado {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 8px;
    background: var(--sucesso-bg);
    border: 1px solid var(--sucesso-borda);
    font-size: 14px;
    color: #1c3d2a;
    line-height: 1.6;
}

.resultado strong {
    color: #14532d;
}

@media (max-width: 480px) {
    .card {
        padding: 24px 22px 28px;
    }
}

#logo-trigger {
    cursor: pointer;
    user-select: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 23, 28, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-box {
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    padding: 28px 28px 24px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-admin-box {
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-box h3 {
    margin: 0 0 18px;
    color: var(--texto-azul);
    font-size: 19px;
}

.modal-box h4 {
    margin: 0 0 12px;
    color: var(--texto-azul);
    font-size: 15px;
}

.admin-section {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--cinza-borda);
}

.admin-section:last-of-type {
    border-bottom: none;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.modal-actions button {
    width: auto;
    flex: 1;
}

.btn-secundario {
    background: #eef1f5;
    color: var(--cinza-texto);
}

.btn-secundario:hover {
    background: #e2e6ec;
}

.btn-primario {
    background: var(--azul);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--cinza-texto);
    cursor: pointer;
    width: auto;
    padding: 4px;
}

.modal-close:hover {
    color: #202124;
}

.resultado a {
    color: #14532d;
    font-weight: 600;
    word-break: break-all;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f7f8fa;
    border: 1px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 13px;
}

.admin-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #202124;
}

.admin-item-info strong {
    color: var(--texto-azul);
}

.admin-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.admin-item-actions button {
    width: auto;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-mini-editar {
    background: #eef1f5;
    color: var(--texto-azul);
}

.btn-mini-editar:hover {
    background: #e2e6ec;
}

.btn-mini-excluir {
    background: var(--erro-bg);
    color: var(--erro);
}

.btn-mini-excluir:hover {
    background: #f9d8d8;
}

.admin-item-vazio {
    font-size: 13px;
    color: var(--cinza-texto);
    padding: 8px 0;
}

.admin-item.editando {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.admin-item.editando input {
    margin-bottom: 0;
    padding: 8px 10px;
    font-size: 13px;
}

.admin-item.editando .admin-item-actions {
    justify-content: flex-end;
}
