:root {
    --background: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe3ec;
    --primary: #075985;
    --primary-hover: #0369a1;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
}

.btn-add-fila {
    margin-top: 10px;
}

* {
    box-sizing: border-box;
}



body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, #dbeafe 0, transparent 28%),
        var(--background);
}

main {
    width: min(1180px, calc(100% - 40px));
    margin: 40px auto;
    padding: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 35px rgb(15 23 42 / 8%);
}

h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.5px;
}

.subtitulo {
    margin: 8px 0 24px;
    color: var(--muted);
}

h2 {
    margin: 32px 0 16px;
    font-size: 19px;
}

.div-btn-export {
    margin-top: 10px;

}


.btn-exportar {
    background: var(--primary);
}

.mensagem {
    margin: 16px 0;
    padding: 13px 15px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
}

.mensagem.success {
    color: var(--success-text);
    background: var(--success-bg);
    border: 1px solid #bbf7d0;
}

.mensagem.error {
    color: var(--error-text);
    background: var(--error-bg);
    border: 1px solid #fecaca;
}



form > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

form > div:last-of-type {
    grid-column: 1 / -1;
}

label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition:
        border-color 150ms,
        box-shadow 150ms;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgb(2 132 199 / 15%);
}

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

button {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 700;
    color: white;
    background: var(--primary);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition:
        background 150ms,
        transform 150ms;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.tabela-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: #f1f5f9;
}

th {
    padding: 12px 14px;
    color: #475569;
    font-size: 11px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid #e8edf3;
}

tbody tr {
    transition: background 150ms;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.status-adiantado {
    color: #1d4ed8;
    background: #dbeafe;
}

.status-na_janela {
    color: #15803d;
    background: #dcfce7;
}

.status-atrasado {
    color: #b91c1c;
    background: #fee2e2;
}

@media (max-width: 700px) {
    main {
        width: min(100% - 20px, 1180px);
        margin: 10px auto;
        padding: 20px;
    }

    form {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    form > div:last-of-type,
    button {
        grid-column: auto;
    }

    button {
        width: 100%;
    }
}

/* Página de autenticação */

.login-page {
    min-height: 100vh;
    margin: 0;
    color: #0f172a;
    background:
        radial-gradient(
            circle at top right,
            rgba(14, 165, 233, 0.14),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #f8fafc 0%,
            #eaf2f8 100%
        );
}

.login-page *,
.login-page *::before,
.login-page *::after {
    box-sizing: border-box;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    width: 100%;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 420px);
    padding: 36px;
    border: 1px solid #dbe4ee;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.10),
        0 4px 14px rgba(15, 23, 42, 0.05);
}

.login-brand {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 24px;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #0369a1,
        #0284c7
    );
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.25);
}

.login-header {
    margin-bottom: 28px;
}

.login-header h1 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 28px;
    line-height: 1.2;
}

.login-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 20px;
}

.login-field {
    display: grid;
    gap: 8px;
}

.login-field label {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}



.login-field input::placeholder {
    color: #94a3b8;
}

.login-field input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.login-submit {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: #0369a1;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.login-submit:hover {
    background: #075985;
    box-shadow: 0 10px 20px rgba(3, 105, 161, 0.20);
    transform: translateY(-1px);
}

.login-submit:active {
    transform: translateY(0);
}

.login-card .mensage {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.login-card .mensage.error {
    border: 1px solid #fecaca;
    color: #991b1b;
    background: #fef2f2;
}

.login-card .mensage.success {
    border: 1px solid #bbf7d0;
    color: #166534;
    background: #f0fdf4;
}

.login-footer {
    margin-top: 24px;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 480px) {
    .login-shell {
        padding: 16px;
    }

    .login-card {
        padding: 28px 22px;
        border-radius: 16px;
    }
}

.login-page .login-shell {
    width: 100%;
    margin: 0;
    padding: 24px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.login-page .login-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.login-page .login-form > .login-field {
    display: grid;
    grid-column: auto;
    gap: 8px;
}

.login-page .login-field input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    color: #0f172a;
    background: #ffffff;
    font: inherit;
    font-size: 14px;
}

.login-page .login-submit {
    grid-column: auto;
    width: 100%;
    min-height: 46px;
    padding: 0 18px;
    justify-self: stretch;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;

}

.account-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;


}

.button-queue-submit {
    margin-top: 10px;
    width: 15%;
}

.header-home {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 10px auto;
}

.page-header .subtitulo {
    margin-bottom: 0;
}

.user-area {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
}

.user-name {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.page-header .logout-form {
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.page-header .logout-button {
    display: inline-flex;
    width: auto;
    min-height: 38px;
    grid-column: auto;
    align-items: center;
    justify-content: center;
    justify-self: auto;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    background: #ffffff;
}

.page-header .logout-button:hover {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
    }

    .user-area {
        width: 100%;
        justify-content: space-between;
    }
}

/* Página de acesso negado */

.error-page {
    min-height: 100vh;
    margin: 0;
    color: #0f172a;
    background:
        radial-gradient(
            circle at top right,
            rgba(239, 68, 68, 0.10),
            transparent 35%
        ),
        #f8fafc;
}

.error-page .error-shell {
    display: grid;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    place-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.error-card {
    width: min(100%, 460px);
    padding: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
    text-align: center;
}

.error-code {
    display: inline-flex;
    min-height: 42px;
    margin-bottom: 20px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #b91c1c;
    background: #fee2e2;
    font-size: 15px;
    font-weight: 800;
}

.error-card h1 {
    margin: 0 0 12px;
    font-size: 28px;
}

.error-card > p {
    margin: 0 auto;
    max-width: 360px;
    color: #64748b;
    line-height: 1.6;
}

.error-card .error-user {
    margin-top: 16px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.error-back {
    display: inline-flex;
    min-height: 44px;
    margin-top: 28px;
    padding: 0 18px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #ffffff;
    background: #075985;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.error-back:hover {
    background: #0369a1;
}

.profile-page {
    width: min(100% - 32px, 800px);
    margin: 48px auto;
}

.profile-card {
    overflow: hidden;
    background: var(--card, #ffffff);
    border: 1px solid var(--border, #dbe3ee);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgb(15 23 42 / 10%);
}

.profile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 32px;
    border-bottom: 1px solid var(--border, #dbe3ee);
}

.profile-header h1 {
    margin: 4px 0 8px;
}

.profile-header p {
    margin: 0;
    color: var(--muted, #64748b);
}

.profile-eyebrow {
    color: var(--primary, #0369a1) !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.profile-badge {
    padding: 6px 10px;
    color: #075985;
    background: #e0f2fe;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 32px;
    gap: 24px;
}

.profile-details div {
    min-width: 0;
}

.profile-details dt {
    margin-bottom: 6px;
    color: var(--muted, #64748b);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-details dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.profile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 32px;
    background: #f8fafc;
    border-top: 1px solid var(--border, #dbe3ee);
}

.profile-actions form {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

@media (max-width: 600px) {
    .profile-header {
        flex-direction: column;
    }

    .profile-details {
        grid-template-columns: 1fr;
    }

    .profile-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

.logout-button {
    text-decoration: none;
}