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

:root {
    --primary: #3498db;
    --secondary: #2c3e50;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light: #ecf0f1;
    --dark: #34495e;
    --gray: #95a5a6;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
}

body {
    padding: 10px;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.header-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.btn-secondary:hover {
    background-color: #1a252f;
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* ===== CARDS (Mobile-first) ===== */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
    gap: 10px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    flex: 1;
}

.card-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.card-tag.status {
    background-color: var(--light);
    color: var(--dark);
}

.card-body {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.card-field {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.card-field-label {
    font-weight: 600;
    color: var(--dark);
    flex: 1;
}

.card-field-value {
    color: #777;
    text-align: right;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.card-actions .btn {
    flex: 1;
    min-width: 80px;
}

/* ===== ETAPA BADGE ===== */
.etapa-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

/* ===== FORMULÁRIOS ===== */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--secondary);
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== CHECKBOXES ===== */
.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-item label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

/* ===== TABELA (Mobile adaptado) ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th {
    background-color: var(--secondary);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

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

tr:hover {
    background-color: #f9f9f9;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--light);
    padding-bottom: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

/* ===== ALERT ===== */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--primary);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.empty-state-text {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ===== LOADING ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== DESKTOP (min-width: 768px) ===== */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }

    .header {
        padding: 30px;
    }

    .header h1 {
        font-size: 32px;
    }

    .header-actions {
        flex-wrap: nowrap;
    }

    .card {
        padding: 20px;
    }

    .cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .checkbox-group {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .modal-content {
        max-width: 600px;
    }

    table {
        font-size: 15px;
    }

    th, td {
        padding: 15px;
    }
}

/* ===== DESKTOP GRANDE (min-width: 1024px) ===== */
@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .checkbox-group {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== UTILITÁRIOS ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hidden {
    display: none !important;
}
