:root {
    --blue-950: #0b1f4b;
    --blue-900: #143f8f;
    --blue-700: #1f5fcf;
    --blue-600: #2e75e8;
    --blue-500: #4f91f4;
    --blue-100: #e7f0ff;
    --blue-050: #f5f9ff;
    --text-main: #10213f;
    --text-soft: #4a5d7f;
    --danger: #cf3d5d;
    --success: #1e7f5c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(160deg, var(--blue-050), #ffffff 55%);
    color: var(--text-main);
}

a {
    color: var(--blue-700);
}

.page-shell {
    width: min(1200px, 92%);
    margin: 28px auto;
}

.topbar {
    background: linear-gradient(120deg, var(--blue-950), var(--blue-700));
    color: #fff;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.topbar__title {
    margin: 0;
    font-size: clamp(1.4rem, 2.8vw, 2rem);
}

.topbar__subtitle {
    margin: 6px 0 0;
    color: #c9dbff;
}

.topbar__actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.badge-admin {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 8px 12px;
}

.alerts {
    margin: 14px 0;
    display: grid;
    gap: 8px;
}

.alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert-warning,
.alert-info {
    background: #eef4ff;
    color: #184289;
    border-color: #bfd3ff;
}

.alert-success {
    background: #e9faf4;
    color: var(--success);
    border-color: #b5e7d2;
}

.alert-danger {
    background: #fff0f3;
    color: #9f2443;
    border-color: #f7bccb;
}

.panel {
    margin-top: 16px;
    background-color: #fff;
    border: 1px solid #dfeaff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(16, 33, 63, 0.06);
}

.panel-title {
    margin: 0 0 8px;
    color: var(--blue-900);
}

.panel-subtitle {
    margin-top: 0;
    color: var(--text-soft);
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.search-form input,
.crud-form input {
    width: 100%;
    border: 1px solid #bfd3ff;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 0.98rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input:focus,
.crud-form input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(79, 145, 244, 0.2);
}

.actions-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.btn {
    border: 1px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(120deg, var(--blue-700), var(--blue-600));
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(120deg, var(--blue-900), var(--blue-700));
}

.btn-secondary {
    background: var(--blue-100);
    color: var(--blue-900);
    border-color: #c8dbff;
}

.btn-secondary:hover {
    background: #dceaff;
}

.btn-outline {
    background: #fff;
    border-color: #d6e3ff;
    color: var(--blue-900);
}

.btn-outline:hover {
    background: var(--blue-050);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e8efff;
    vertical-align: middle;
}

th {
    background-color: #b9d4ff;
    color: #123b76;
    font-size: 0.9rem;
}

tbody tr:nth-child(even) {
    background-color: #dfeeff;
}

tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

tbody tr:hover {
    background-color: #cfe5ff;
}

.telefone-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.whatsapp-link {
    display: inline-flex;
}

.whatsapp-icon {
    width: 18px;
    height: 18px;
}

.crud-actions {
    display: flex;
    gap: 8px;
}

.crud-actions form {
    margin: 0;
}

.botao-icone {
    border: 1px solid #d3e2ff;
    background: #fff;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--blue-900);
    cursor: pointer;
}

.botao-icone:hover {
    background: var(--blue-100);
}

.botao-icone.deletar {
    color: var(--danger);
}

.locked-text {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    color: var(--text-soft);
    padding: 20px;
}

.pagination {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination__summary {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.pagination__controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-link,
.page-current {
    border: 1px solid #d3e2ff;
    border-radius: 8px;
    padding: 7px 11px;
    text-decoration: none;
    font-size: 0.9rem;
}

.page-link {
    background: #fff;
    color: var(--blue-900);
}

.page-link:hover {
    background: var(--blue-100);
}

.is-disabled {
    background: #f2f5fb;
    color: #8fa2c6;
    border-color: #e1e8f8;
    pointer-events: none;
}

.page-current {
    background: var(--blue-050);
    color: var(--blue-900);
}

.panel-form {
    max-width: 620px;
    margin: 16px auto 0;
}

.panel-login {
    max-width: 460px;
}

.crud-form {
    display: grid;
    gap: 8px;
}

.crud-form label {
    margin-top: 6px;
    font-weight: 600;
    color: #1e3e77;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .page-shell {
        width: 95%;
        margin-top: 16px;
    }

    .search-form {
        flex-direction: column;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tbody tr {
        border: 1px solid #e2ecff;
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 8px;
    }

    td {
        border-bottom: none;
        padding: 8px 6px;
    }

    td::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        color: #31578d;
    }

    td:last-child::before {
        content: attr(data-label) ": ";
    }

    .pagination {
        flex-direction: column;
        align-items: flex-start;
    }
}