:root {
    --primary-color: #1a237e;
    --secondary-color: #0d47a1;
    --accent-color: #d50000;
    --bg-color: #f4f6f8;
    --surface-color: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 600px; /* Limita a largura em telas grandes para simular app mobile */
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--surface-color);
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Cabeçalho */
.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}
.status-indicator.online { background-color: var(--success-color); }

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Container Dinâmico */
.module-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: var(--bg-color);
}

/* Componentes Genéricos dos Módulos */
.card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-danger {
    background-color: var(--accent-color);
}

/* Navegação em Abas (Bottom Nav) */
.bottom-nav {
    display: flex;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom); /* Suporte para telas modernas de iPhone/Android */
    overflow-x: auto;
    overflow-y: hidden;
}

.tab-btn {
    flex: 1;
    min-width: 60px;
    background: none;
    border: none;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn .icon { font-size: 1.5rem; margin-bottom: 4px; }
.tab-btn .label { font-size: 0.75rem; font-weight: 500; }

.tab-btn.active {
    color: var(--primary-color);
    border-top: 3px solid var(--primary-color);
}

/* Componentes de Lista */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.list-item-photo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-color);
}

.list-item-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--border-color);
}

.list-item-content {
    flex: 1;
}

.list-item-content h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.list-item-content p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.list-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-color);
    transform: scale(1.1);
}

.btn-icon.btn-delete:hover {
    background: #ffebee;
    border-color: var(--accent-color);
}

/* Badges de Status */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.status-badge.ativo {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.inativo {
    background: #ffebee;
    color: #c62828;
}

.status-badge.ferias {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.afastado {
    background: #f3e5f5;
    color: #6a1b9a;
}

/* Formulários */
.form-card {
    background: var(--surface-color);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn-secondary {
    background-color: var(--text-secondary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background-color: #616161;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-header h2 {
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsividade */
@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .list-item {
        flex-direction: column;
    }
    
    .list-item-actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
    }
    
    .card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bottom-nav {
        padding-bottom: 10px;
    }
    
    .tab-btn .label {
        font-size: 0.7rem;
    }
}