/* CRM T2 Soluções - Estilos Profissionais */

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

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --secondary: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f3f4f6;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-light: #6b7280;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light);
    color: var(--text);
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-left h1 {
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===== MENU ===== */
.menu {
    background: white;
    display: flex;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.menu-item {
    padding: 15px 25px;
    text-decoration: none;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.menu-item:hover {
    color: var(--primary);
    background-color: rgba(102, 126, 234, 0.05);
}

.menu-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: rgba(102, 126, 234, 0.05);
}

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    padding: 30px;
}

.main h2 {
    margin-bottom: 30px;
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
}

.main h3 {
    margin-bottom: 20px;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
}

/* ===== CARDS ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary);
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.card-label {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

.card.card-warning {
    border-top-color: var(--danger);
}

.card.card-warning .card-value {
    color: var(--danger);
}

/* ===== SECTIONS ===== */
.section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.table thead {
    background-color: var(--light);
}

.table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border);
}

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

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.03);
}

.table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.01);
}

/* ===== FORMS ===== */
.form-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: rgba(102, 126, 234, 0.02);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--light);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

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

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 6px 14px;
    background-color: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== ALERTS ===== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: var(--danger);
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-left-color: var(--success);
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-left-color: var(--warning);
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-left-color: var(--info);
}

/* ===== INFO ===== */
.info {
    color: var(--text-light);
    font-style: italic;
    padding: 20px;
    text-align: center;
    background-color: var(--light);
    border-radius: 8px;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== FILTER ===== */
.filter-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-section input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.filter-section input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--text);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    font-size: 13px;
    opacity: 0.8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .header-left h1 {
        font-size: 20px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .menu {
        flex-wrap: wrap;
    }

    .menu-item {
        flex: 1;
        text-align: center;
        padding: 12px 15px;
        font-size: 12px;
    }

    .main {
        padding: 20px;
    }

    .main h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

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

    .card {
        padding: 15px;
    }

    .card-value {
        font-size: 28px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 10px 8px;
    }

    .form-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .filter-section {
        flex-direction: column;
    }

    .filter-section input,
    .filter-section .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 18px;
    }

    .main {
        padding: 15px;
    }

    .main h2 {
        font-size: 18px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 12px;
    }

    .card-value {
        font-size: 24px;
    }

    .section {
        padding: 15px;
    }

    .table {
        font-size: 11px;
    }

    .table th,
    .table td {
        padding: 8px 6px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
