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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 5px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Dashboard de Estatísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.stat-card.total {
    border-left: 5px solid #667eea;
}

.stat-card.purchased {
    border-left: 5px solid #28a745;
}

.stat-card.no-purchase {
    border-left: 5px solid #ffc107;
}

.stat-card.default {
    border-left: 5px solid #6c757d;
}

.stat-card.expired {
    border-left: 5px solid #dc3545;
}

.stat-icon {
    font-size: 3em;
}

.stat-info h3 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 0.95em;
}

/* Cards Mini para Relatórios */
.stat-card.mini {
    padding: 15px;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: default;
}

.stat-card.mini:hover {
    transform: none;
}

.mini-label {
    font-size: 0.85em;
    color: #666;
    text-align: center;
}

.mini-value {
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

/* Últimos Cadastros */
.recent-section,
.report-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.recent-section h2,
.report-section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* Relatórios */
.report-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.date-range {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-range label {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
}

.date-range input[type="date"] {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    min-width: 150px;
}

.date-range input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.report-totals {
    margin: 30px 0;
}

.report-totals h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recent-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
    transition: background 0.2s;
}

.recent-item:hover {
    background: #e9ecef;
}

.recent-item-info {
    flex: 1;
}

.recent-item-info h4 {
    color: #333;
    margin-bottom: 5px;
}

.recent-item-info p {
    color: #666;
    font-size: 0.9em;
}

.recent-item-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    min-width: 150px;
}

.status-purchased {
    background: #d4edda;
    color: #155724;
}

.status-no-purchase {
    background: #fff3cd;
    color: #856404;
}

.status-default {
    background: #e2e3e5;
    color: #383d41;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

/* Filtros */
.filter-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.filter-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-box select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 200px;
}

.filter-box select:focus {
    outline: none;
    border-color: #667eea;
}

.filter-box input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filter-box input:focus {
    outline: none;
    border-color: #667eea;
}

/* Lista de Usuários */
.users-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.users-section h2 {
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.user-count {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    flex: 1;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-search {
    background: #667eea;
    color: white;
}

.btn-search:hover {
    background: #5568d3;
}

.btn-clear {
    background: #6c757d;
    color: white;
}

.btn-clear:hover {
    background: #5a6268;
}

.btn-refresh {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-refresh:hover {
    background: #218838;
}

.table-container {
    overflow-x: auto;
}

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

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: left;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    color: #555;
}

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

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

.action-btn {
    padding: 6px 12px;
    margin: 0 3px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-view {
    background: #17a2b8;
    color: white;
}

.btn-view:hover {
    background: #138496;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 16px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* 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);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

.modal-content h3 {
    color: #333;
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    margin-bottom: 25px;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
    flex: 1;
}

.btn-danger:hover {
    background: #c82333;
}

#user-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin: 15px 0;
}

#user-details p {
    margin: 10px 0;
    color: #333;
}

#user-details strong {
    color: #667eea;
    display: inline-block;
    min-width: 150px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Paginação */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px 0;
}

.btn-pagination {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    font-size: 13px;
}

.btn-pagination:hover:not(:disabled) {
    background: #5568d3;
}

.btn-pagination:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    padding: 0 15px;
    color: #555;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5em;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        font-size: 2em;
    }

    .stat-info h3 {
        font-size: 2em;
    }

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

    .filter-box select,
    .filter-box input,
    .btn-search,
    .btn-clear {
        width: 100%;
    }

    .recent-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .recent-item-status {
        width: 100%;
    }

    .users-section,
    .filter-section,
    .recent-section {
        padding: 20px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}
