:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --surface: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --offline: #6b7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
    background-color: var(--primary);
    color: white;
    padding: 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.status-badge.online {
    background-color: var(--success);
}

.status-badge.offline {
    background-color: var(--offline);
}

.status-badge .icon-status {
    font-size: 1.1rem;
}

/* Main */
.app-main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    padding-bottom: 6rem; /* EspaÃ§o para o FAB */
}

.acoes-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.acoes-topo h2 {
    font-size: 1.5rem;
    color: var(--text-main);
}

.btn-sincronizar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--warning);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Lista e Cards */
.container-lista { 
    display: grid; 
    gap: 1rem; 
    grid-template-columns: repeat(5, 1fr); 
}

@media (max-width: 1200px) {
    .container-lista { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 992px) {
    .container-lista { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .container-lista { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .container-lista { grid-template-columns: 1fr; }
}

.estado-vazio {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.estado-vazio .material-symbols-outlined {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.card-patrimonio {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-left: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

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

.card-patrimonio.offline-badge::after {
    content: 'NÃ£o Sincronizado';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--warning);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-titulo {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}

.card-tag {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: monospace;
    background: var(--bg-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.card-detalhes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.detalhe-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.detalhe-item .material-symbols-outlined {
    font-size: 1rem;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    z-index: 20;
}

.fab:hover {
    transform: scale(1.05);
    background-color: var(--primary-hover);
}

.fab .material-symbols-outlined {
    font-size: 1.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--surface);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden; /* MantÃ©m os cantos arredondados com scroll interno */
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    z-index: 2;
}

.btn-fechar {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
}

.btn-fechar:hover {
    color: var(--danger);
}

.form-cadastro {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Inputs */
.grupo-input {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.grupo-input-duplo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

/* Radios Customizados */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: normal;
    transition: background 0.2s;
}

.radio-label:hover {
    background: var(--bg-color);
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--surface);
}

.btn-primario, .btn-secundario {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primario {
    background-color: var(--primary);
    color: white;
}

.btn-primario:hover {
    background-color: var(--primary-hover);
}

.btn-secundario {
    background-color: transparent;
    color: var(--text-muted);
}

.btn-secundario:hover {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* Responsivo Mobile */
@media (max-width: 600px) {
    .grupo-input-duplo {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .modal {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .fab {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

/* Estilos da Tela de Login */
.tela-login { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--primary); display: none; align-items: center; justify-content: center; z-index: 100; }
.tela-login.active { display: flex; }
.login-card { background: var(--surface); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 90%; max-width: 400px; text-align: center; }
.logo-login { font-size: 4rem; color: var(--primary); margin-bottom: 1rem; }
.login-card h2 { margin-bottom: 0.5rem; }
.login-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.btn-login { width: 100%; margin-top: 1rem; padding: 1rem; }
.mensagem-login { color: var(--danger); font-size: 0.85rem; margin-top: 1rem; }
/* Layout header para botão de sair */
.acoes-header { display: flex; gap: 1rem; align-items: center; }
.btn-icone-branco { background: rgba(255,255,255,0.2); border: none; color: white; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.btn-icone-branco:hover { background: rgba(255,255,255,0.4); }
/* Grupo de Input com Botão anexo */
.input-com-botao { display: flex; gap: 0.5rem; }
.input-com-botao input { flex: 1; }
.btn-icone { background: var(--primary); color: white; border: none; border-radius: 6px; padding: 0.75rem; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-icone:hover { background: var(--primary-hover); }
#reader { margin-top: 1rem; border-radius: 8px; overflow: hidden; }

