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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-info {
    font-size: 14px;
    color: #7f8c8d;
}

h1 {
    color: #2c3e50;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    text-decoration: none;
    display: inline-block;
}

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

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-toggle .arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.dropdown.open .arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 1000;
    display: none;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #3498db;
}

/* Header actions responsive */
@media (max-width: 1024px) {
    .actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .dropdown-toggle {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .dropdown-menu {
        min-width: 200px;
    }
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

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

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

.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
    white-space: nowrap;
    min-width: 80px;
}

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

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    margin: 0 2px;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-card .positive {
    color: #27ae60;
}

.stat-card .negative {
    color: #e74c3c;
}

.campaigns-table {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.campaigns-table h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

th, td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: middle;
}

th:last-child, 
td:last-child {
    text-align: center;
    width: 100px;
    min-width: 100px;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #7f8c8d;
}

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

td.positive {
    color: #27ae60;
    font-weight: 600;
}

td.negative {
    color: #e74c3c;
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.close:hover {
    color: #000;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

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

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Melhorias para modais */
.modal-content h2 {
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 20px;
        max-height: 95vh;
    }
    
    .actions {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .btn {
        font-size: 12px;
        padding: 8px 16px;
    }
}

.accounts-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.account-type {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.account-type h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.accounts-table {
    margin-top: 15px;
}

/* Network badges */
.network-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 2px;
    color: white;
}

.network-awin {
    background-color: #FF6B35;
}

.network-rakuten {
    background-color: #BF0A30;
}

.network-amazon {
    background-color: #FF9900;
}

.network-none {
    background-color: #95a5a6;
}

/* Date filter */
.date-filter {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-form {
    margin: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-group:last-child {
    margin-bottom: 0;
    justify-content: flex-start;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 140px;
    white-space: nowrap;
}

.filter-group input[type="date"],
.filter-group select {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    min-width: 160px;
    transition: all 0.2s ease;
}

.filter-group select {
    cursor: pointer;
    min-width: 200px;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-group span {
    color: #7f8c8d;
    font-weight: 500;
    margin: 0 5px;
}

/* Responsive filter layout */
@media (max-width: 768px) {
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filter-group label {
        min-width: auto;
    }
    
    .filter-group input[type="date"],
    .filter-group select {
        width: 100%;
        min-width: auto;
    }
    
    .filter-group:last-child {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Campaign details */
.campaign-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    color: #7f8c8d;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

.google-account {
    font-size: 13px;
    color: #2c3e50;
    font-weight: 500;
}

/* Clean table styling */
.campaigns-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.campaigns-table td {
    font-size: 13px;
}

/* Better button styling */
.btn-small {
    padding: 4px 8px;
    font-size: 14px;
    border-radius: 3px;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    line-height: 1;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Responsive table adjustments */
@media (max-width: 1200px) {
    .campaigns-table {
        padding: 15px;
    }
    
    .campaigns-table table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px 6px;
    }
    
    .btn-small {
        padding: 3px 6px;
        font-size: 12px;
        min-width: 24px;
        height: 24px;
    }
}

@media (max-width: 768px) {
    .campaigns-table {
        padding: 10px;
        margin: 0 -10px;
    }
    
    table {
        min-width: 800px;
    }
    
    .campaigns-table table {
        font-size: 11px;
    }
    
    th, td {
        padding: 6px 4px;
    }
    
    .action-buttons {
        gap: 3px;
        min-width: 60px;
    }
    
    .btn-small {
        padding: 2px 4px;
        font-size: 11px;
        min-width: 22px;
        height: 22px;
    }
}