:root {
    --roxo: #6f42c1;
    --cinza-claro: #f8f9fa;
    --lilas: #b185db;
    --roxo-escuro: #5a32a3;
    --cinza-medio: #e9ecef;
    --texto-escuro: #343a40;
    --sucesso: #28a745;
    --perigo: #dc3545;
    --aviso: #ffc107;
    --info: #17a2b8;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--cinza-claro);
    color: var(--texto-escuro);
}

/* Navbar */
.navbar {
    background: var(--roxo);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 1rem;
    list-style: none;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    background: var(--lilas);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.card-header {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--roxo);
    border-bottom: 2px solid var(--lilas);
    padding-bottom: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--texto-escuro);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--cinza-medio);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--roxo);
    box-shadow: 0 0 0 2px var(--lilas);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: var(--roxo-escuro);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--cinza-claro);
    color: var(--texto-escuro);
    border: 1px solid var(--cinza-medio);
}

.btn-secondary:hover {
    background: var(--cinza-medio);
}

.btn-success {
    background: var(--sucesso);
    color: white;
}

.btn-danger {
    background: var(--perigo);
    color: white;
}

.btn-warning {
    background: var(--aviso);
    color: var(--texto-escuro);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--cinza-medio);
}

.table th {
    background: var(--roxo);
    color: white;
    font-weight: 600;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--sucesso);
    color: white;
}

.badge-warning {
    background: var(--aviso);
    color: var(--texto-escuro);
}

.badge-danger {
    background: var(--perigo);
    color: white;
}

.badge-info {
    background: var(--lilas);
    color: white;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: var(--lilas);
    color: white;
    border: 1px solid var(--roxo);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--cinza-claro);
    border-top-color: var(--roxo);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--lilas);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--texto-escuro);
}

/* Grid */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-menu {
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--roxo);
        display: none;
        padding: 1rem;
    }
    
    .navbar-menu.active {
        display: flex;
    }
    
    .table {
        display: block;
        overflow-x: auto;
    }
    
    .row {
        grid-template-columns: 1fr;
    }
}
