@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* SIEP - Sistema de Informação e Protocolo - Prefeitura de Uauá */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --azul-uaua: #2563eb;
    /* Tailwind Blue 600 */
    --azul-dark: #1e40af;
    /* Tailwind Blue 800 */
    --amarelo-uaua: #fbbf24;
    /* Tailwind Amber 400 */
    --vermelho-uaua: #ef4444;
    /* Tailwind Red 500 */
    --verde-uaua: #10b981;
    /* Tailwind Emerald 500 */
    --cinza-escuro: #1e293b;
    /* Tailwind Slate 800 */
    --cinza-medio: #64748b;
    /* Tailwind Slate 500 */
    --cinza-claro: #f8fafc;
    /* Tailwind Slate 50 */
    --cinza-borda: #e2e8f0;
    /* Tailwind Slate 200 */
    --branco: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--cinza-claro);
    color: var(--cinza-escuro);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* AÇÕES DE TRÂMITE */
.acoes-tramite {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
}

.acoes-tramite .btn {
    white-space: nowrap;
}

/* HEADER / NAVBAR */
header {
    background: linear-gradient(135deg, var(--azul-uaua) 0%, var(--azul-dark) 100%);
    color: var(--branco);
    padding: 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
}

/* lado esquerdo (brasão + título) */
.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brasao-logo {
    height: 50px;
    width: auto;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.header-title p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

/* lado direito (hamburguer no mobile) */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* navegação desktop */
.header-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

.header-nav a {
    color: var(--branco);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.header-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* link de usuários online e sino */
.header-online-link,
.header-bell-link {
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.header-online-link:hover,
.header-bell-link:hover {
    text-decoration: underline;
}

/* botão hamburguer (escondido no desktop) */
.menu-toggle {
    display: none;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    color: #fff;
    font-size: 1.3rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
}

/* MAIN CONTENT */
main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* CARDS E CONTAINERS */
.card {
    background: var(--branco);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--cinza-borda);
    margin-bottom: 2rem;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h1,
.card h2 {
    color: var(--azul-uaua);
    margin-bottom: 1.5rem;
}

/* LOGIN PAGE */
.login-container {
    max-width: 450px;
    margin: 4rem auto;
}

.login-card {
    background: var(--branco);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--azul-uaua);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--cinza-medio);
    font-size: 0.95rem;
}

/* FORMS */
form {
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--cinza-escuro);
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin-bottom: 1.25rem;
    background-color: var(--branco);
    box-shadow: var(--shadow-sm);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--azul-uaua);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* BUTTONS */
button,
.btn {
    background: var(--azul-uaua);
    color: var(--branco);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

button:hover,
.btn:hover {
    background: #2c4a8f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 91, 169, 0.3);
}

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

.btn-success:hover {
    background: #1b5e20;
}

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

.btn-danger:hover {
    background: #b71c1c;
}

.btn-warning {
    background: var(--amarelo-uaua);
    color: var(--cinza-escuro);
}

.btn-warning:hover {
    background: #ffc400;
}

/* Botões de ação no topo da tela de processos */
.processos-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-acao-topo {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
}

/* Botões de rodapé do formulário de processo */
.form-acoes {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .form-acoes {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .form-acoes .btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* Ajuda em link mais discreto */
.btn-acao-help {
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
    background: transparent;
    color: #3d5ba9;
    box-shadow: none;
}

.btn-acao-help:hover {
    background: rgba(61, 91, 169, 0.06);
}

/* Mobile: quebra melhor o cabeçalho e os botões */
@media (max-width: 768px) {
    .processos-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .processos-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .btn-acao-topo {
        padding: 0.35rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ALERTS / MENSAGENS */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #ffebee;
    color: var(--vermelho-uaua);
    border-left: 4px solid var(--vermelho-uaua);
}

.alert-success {
    background: #e8f5e9;
    color: var(--verde-uaua);
    border-left: 4px solid var(--verde-uaua);
}

.alert-info {
    background: #e3f2fd;
    color: var(--azul-uaua);
    border-left: 4px solid var(--azul-uaua);
}

/* FOOTER GLOBAIS (PREMIUM) */
.footer-siep {
    background-color: var(--cinza-escuro);
    color: var(--cinza-claro);
    font-size: 0.9rem;
    padding: 3rem 0 0 0;
    margin-top: 4rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 3rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.footer-brand strong {
    font-size: 1.2rem;
    color: var(--branco);
    letter-spacing: 0.05em;
}

.footer-brand span {
    font-size: 0.85rem;
    color: var(--cinza-medio);
}

.footer-credits {
    color: var(--cinza-borda);
    line-height: 1.5;
    font-size: 0.85rem;
}

.footer-credits strong {
    color: var(--branco);
}

.footer-title {
    color: var(--branco);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background-color: var(--azul-uaua);
    border-radius: 2px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
    color: var(--cinza-borda);
}

.footer-links span {
    font-weight: 600;
    color: var(--branco);
    margin-right: 0.25rem;
}

.footer-links a {
    color: var(--branco);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-links a:hover {
    color: #93c5fd;
    padding-left: 5px;
}

.footer-bottom {
    background-color: #0f172a;
    /* Slate 900 */
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--cinza-medio);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* DASHBOARD */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: var(--branco);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--cinza-borda);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dashboard-card h3 {
    color: var(--cinza-medio);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.dashboard-card .stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--cinza-escuro);
    line-height: 1;
    margin-top: auto;
}

/* TABELAS GLOBAIS (PREMIUM) */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
    border: 1px solid var(--cinza-borda);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

thead {
    background-color: var(--cinza-claro);
}

th,
td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--cinza-borda);
    color: var(--cinza-escuro);
}

th {
    font-weight: 600;
    color: var(--cinza-medio);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: var(--cinza-claro);
}

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

/* RESPONSIVIDADE DASHBOARD E TABELAS */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border-bottom: 1px solid var(--cinza-borda);
    }

    td {
        border: none;
        border-bottom: 1px solid var(--cinza-claro);
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td:before {
        position: absolute;
        top: 1rem;
        left: 1rem;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        content: attr(data-label);
        color: var(--cinza-medio);
        font-size: 0.8rem;
    }
}

/* SCROLL SUAVE */
div[style*="overflow-y: auto"] {
    scrollbar-width: thin;
    scrollbar-color: #3d5ba9 #f5f5f5;
}

div[style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 6px;
}

div[style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: #f5f5f5;
}

div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: #3d5ba9;
    border-radius: 3px;
}

/* RESPONSIVO GERAL (inclui header + ações de trâmite) */
@media (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    .acoes-tramite {
        flex-direction: column;
        align-items: stretch;
    }

    .header-container {
        padding: 0.5rem 0.75rem;
    }

    .header-left {
        flex: 1;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .brasao-logo {
        height: 42px;
    }

    .header-title h1 {
        font-size: 1.3rem;
    }

    .header-title p {
        font-size: 0.8rem;
    }

    .header-right {
        /* fica colado à direita no topo */
        align-self: flex-start;
    }

    .menu-toggle {
        display: inline-block;
    }

    /* nav dropdown no mobile (escondido até abrir) */
    .header-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--azul-uaua) 0%, #2c4a8f 100%);
        flex-direction: column;
        align-items: flex-start;
        padding: 0.6rem 1.1rem 0.8rem;
        gap: 0.3rem;
        display: none;
    }

    .header-nav.open {
        display: flex;
    }

    .header-nav a,
    .header-online-link,
    .header-bell-link {
        padding: 0.2rem 0;
        font-size: 0.95rem;
    }

    main {
        padding: 0 1rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}