/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f4f6f8;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.login-bg {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #e9ecef;
}

.dashboard-bg {
    background-color: #f8f9fa;
}

/* Typography & Utilities */
h1, h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.error-msg {
    color: #e74c3c;
    background-color: #fadbd8;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: background-color 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: #0069ff;
    color: white;
}
.btn-primary:hover {
    background-color: #0056d2;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #475569;
}
.btn-secondary:hover {
    background-color: #cbd5e1;
}

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

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Navbar */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 0 20px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.nav-links a {
    text-decoration: none;
    color: #64748b;
    margin-left: 20px;
    font-weight: 500;
}

.nav-links a.active, .nav-links a:hover {
    color: #0069ff;
}

/* Container & Layout */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.filters input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    width: 250px;
}

.last-updated {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
    text-align: right;
}

/* Login Box */
.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #475569;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
}

/* Tables (Admin) */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #475569;
}

/* Dashboard Hierarchical View */
.client-group {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    overflow: hidden;
}

.client-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: #ffffff;
    transition: background-color 0.2s;
    border-bottom: 1px solid transparent;
}

.client-header:hover {
    background-color: #f8fafc;
}

.client-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.client-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.client-meta {
    font-size: 13px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
}

.expand-icon {
    font-size: 18px;
    color: #94a3b8;
    transition: transform 0.3s;
}

.client-group.expanded .expand-icon {
    transform: rotate(180deg);
}
.client-group.expanded .client-header {
    border-bottom: 1px solid #e2e8f0;
}

.campaigns-container {
    display: none;
    padding: 0;
    background-color: #fafafa;
}

.client-group.expanded .campaigns-container {
    display: block;
}

.campaigns-table {
    width: 100%;
    border-collapse: collapse;
}

.campaigns-table th, .campaigns-table td {
    padding: 10px 20px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.campaigns-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 500;
}

.campaigns-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Performance Select Styling */
.perf-select {
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-size: 12px;
    font-weight: 500;
    outline: none;
}
.perf-excelente { background-color: #dcfce7; color: #166534; border-color: #bbf7d0; }
.perf-boa { background-color: #fef9c3; color: #854d0e; border-color: #fef08a; }
.perf-ruim { background-color: #fee2e2; color: #991b1b; border-color: #fecaca; }
.perf-a_definir { background-color: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* Status Labels */
.status-label {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.status-active { background-color: #dcfce7; color: #166534; }
.status-inactive { background-color: #fee2e2; color: #991b1b; }

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

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}

.close-modal:hover {
    color: #333;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 16px;
}
