* {
    box-sizing: border-box;
}

:root {
    --azul: #087ca7;
    --azul-escuro: #055f80;
    --laranja: #ff8700;
    --fundo: #eef3f8;
    --texto: #1f2937;
    --cinza: #64748b;
    --verde: #16a34a;
    --vermelho: #dc2626;
    --roxo: #7c3aed;
    --amarelo: #f59e0b;
    --sombra: 0 8px 24px rgba(15, 23, 42, .08);
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--fundo);
    color: var(--texto);
}

#menu-toggle {
    display: none;
}

.mobile-header {
    display: none;
}

.sidebar {
    width: 245px;
    height: 100vh;
    background: linear-gradient(180deg, var(--azul), var(--azul-escuro));
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    padding: 22px;
    z-index: 50;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.logo {
    background: var(--laranja);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 22px;
}

.brand small {
    display: block;
    opacity: .8;
    font-size: 12px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    padding: 12px 14px;
    margin: 8px 0;
    border-radius: 10px;
    font-weight: bold;
}

.sidebar a svg {
    width: 19px;
    height: 19px;
}

.sidebar a:hover {
    background: rgba(255,255,255,.16);
}

.overlay {
    display: none;
}

.main {
    margin-left: 245px;
    padding: 26px;
}

.topbar {
    background: white;
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: var(--sombra);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.topbar h1 {
    margin: 0;
    color: var(--azul);
}

.topbar p {
    margin: 6px 0 0;
    color: var(--cinza);
}

.userbox {
    background: #fff4e8;
    color: #c25f00;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: bold;
    white-space: nowrap;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.card {
    background: white;
    padding: 22px;
    border-radius: 18px;
    box-shadow: var(--sombra);
    border-left: 6px solid var(--laranja);
}

.card h2 {
    margin: 0;
    font-size: 28px;
}

.card p {
    margin: 8px 0 0;
    color: var(--cinza);
    font-weight: bold;
}

.box {
    background: white;
    padding: 22px;
    border-radius: 18px;
    box-shadow: var(--sombra);
    margin-bottom: 24px;
    overflow-x: auto;
}

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

input, select, button {
    width: 100%;
    padding: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
}

button, .btn {
    background: var(--laranja);
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 11px 13px;
    min-height: 42px;
}

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

.btn-red {
    background: var(--vermelho);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 760px;
}

th, td {
    padding: 13px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--azul);
    color: white;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
}

.pago {
    background: #dcfce7;
    color: #166534;
}

.aguardando {
    background: #fff7ed;
    color: #c2410c;
}

.atrasado {
    background: #fee2e2;
    color: #991b1b;
}

.alerta {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 14px;
    font-weight: bold;
    margin-bottom: 20px;
}

.sucesso {
    background: #dcfce7;
    color: #166534;
    padding: 15px;
    border-radius: 14px;
    font-weight: bold;
    margin-bottom: 20px;
}

.acoes {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.btn-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    color: white;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-icon:hover {
    transform: scale(1.06);
    opacity: 0.92;
}

.btn-pago {
    background: var(--verde);
}

.btn-cancelar {
    background: var(--amarelo);
}

.btn-whatsapp {
    background: #25d366;
}

.btn-pdf {
    background: var(--roxo);
}

.btn-delete {
    background: var(--vermelho);
}

.sem-contato {
    color: var(--vermelho);
    font-size: 12px;
    font-weight: bold;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: linear-gradient(135deg, var(--azul), #053b50);
}

.login-card {
    width: 100%;
    max-width: 390px;
    background: white;
    padding: 34px;
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(0,0,0,.2);
}

.login-card h1 {
    color: var(--azul);
    margin-top: 0;
}

.login-card input,
.login-card button {
    margin: 8px 0;
}

@media(max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media(max-width: 768px) {
    body {
        padding-top: 64px;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--azul);
        color: white;
        height: 64px;
        padding: 0 16px;
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        z-index: 80;
        box-shadow: 0 4px 18px rgba(0,0,0,.18);
    }

    .hamburger {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: rgba(255,255,255,.14);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hamburger svg {
        width: 24px;
        height: 24px;
    }

    .sidebar {
        transform: translateX(-105%);
        transition: .25s ease;
        width: 82%;
        max-width: 320px;
        padding-top: 24px;
    }

    #menu-toggle:checked ~ .sidebar {
        transform: translateX(0);
    }

    .overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 40;
    }

    #menu-toggle:checked ~ .overlay {
        display: block;
    }

    .main {
        margin-left: 0;
        padding: 14px;
    }

    .topbar {
        padding: 16px;
        border-radius: 16px;
        align-items: flex-start;
    }

    .topbar h1 {
        font-size: 22px;
    }

    .topbar p {
        font-size: 13px;
    }

    .userbox {
        display: none;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .card {
        padding: 18px;
    }

    .card h2 {
        font-size: 24px;
    }

    .box {
        padding: 16px;
        border-radius: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    input, select, button, .btn {
        min-height: 46px;
        font-size: 15px;
    }

    table {
        min-width: 0;
        display: block;
    }

    table tr:first-child {
        display: none;
    }

    table tbody,
    table tr,
    table td {
        display: block;
        width: 100%;
    }

    table tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        margin-bottom: 14px;
        padding: 12px;
        box-shadow: 0 5px 14px rgba(15, 23, 42, .06);
    }

    table td {
        border-bottom: none;
        padding: 8px 4px;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        text-align: right;
    }

    table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--cinza);
        text-align: left;
    }

    table td:last-child {
        display: block;
        text-align: left;
        padding-top: 12px;
    }

    table td:last-child::before {
        display: block;
        margin-bottom: 8px;
    }

    .acoes {
        flex-wrap: wrap;
    }

    .btn-icon {
        width: 46px;
        height: 46px;
        min-width: 46px;
    }
}

@media(max-width: 420px) {
    .mobile-header span {
        display: none;
    }

    .login-card {
        padding: 24px;
    }
}
