/* ============================================
   CREDENSHOW PRO - CSS COMPLETO
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f5f5f5;
    color: #1a1a2e;
    line-height: 1.5;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-box h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-box h2 {
    font-size: 14px;
    color: #888;
    font-weight: normal;
    margin-bottom: 32px;
}

.login-box input {
    width: 100%;
    padding: 14px 16px;
    margin: 8px 0;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.login-box button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.default-creds {
    margin-top: 24px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 12px;
    color: #888;
}

/* ============================================
   ADMIN CONTAINER & LAYOUT
   ============================================ */

.admin-container {
    min-height: 100vh;
    background: #f5f5f5;
}

/* Top Bar */
.top-bar {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-size: 14px;
    color: #666;
}

.logout-btn {
    color: #e53e3e;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: #c62828;
}

/* Sidebar */
.admin-layout {
    display: flex;
}

.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    min-height: calc(100vh - 64px);
    padding: 24px 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

.sidebar-item.active {
    background: #f0f4ff;
    color: #667eea;
    border-left-color: #667eea;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.btn-save {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

.btn-save:hover {
    transform: translateY(-1px);
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

/* ============================================
   STATS CARDS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.stat-card h3 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.stat-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.stat-card small {
    color: #999;
    font-size: 12px;
}

/* ============================================
   FILTERS BAR
   ============================================ */

.filters-bar {
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid #e0e0e0;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ============================================
   TABLES
   ============================================ */

.data-table {
    width: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    text-align: left;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* ============================================
   EVENT CARDS
   ============================================ */

.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.event-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: #667eea;
}

.event-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.event-info p {
    font-size: 13px;
    color: #666;
    margin: 4px 0;
}

.event-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-ativo {
    background: #e6f7e6;
    color: #2e7d32;
}

.status-inativo {
    background: #fee;
    color: #c62828;
}

.status-pendente {
    background: #fff3e0;
    color: #ed6c02;
}

/* Permission Badges */
.permission-badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.permission-admin {
    background: #e3f2fd;
    color: #1565c0;
}

.permission-gerente {
    background: #e8eaf6;
    color: #3949ab;
}

.permission-operador {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-edit {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-edit:hover {
    background: #bbdef5;
}

.btn-delete {
    background: #fee;
    color: #c62828;
}

.btn-delete:hover {
    background: #fcc;
}

/* ============================================
   FORMS
   ============================================ */

.form-card {
    background: white;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    padding: 32px;
    max-width: 600px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* ============================================
   ALERT MESSAGES
   ============================================ */

.alert-success {
    background: #e6f7e6;
    color: #2e7d32;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #2e7d32;
}

.alert-error {
    background: #fee;
    color: #c62828;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

.alert-warning {
    background: #fff3e0;
    color: #ed6c02;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #ed6c02;
}

/* ============================================
   INFO BOX
   ============================================ */

.info-box {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 16px;
    margin-top: 24px;
}

.info-box h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #667eea;
}

.info-box p {
    font-size: 14px;
    color: #555;
    margin: 4px 0;
}

/* ============================================
   ACCESS RAPID CARDS
   ============================================ */

.access-rapid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.access-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.access-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.access-card .icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.access-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.access-card p {
    font-size: 12px;
    color: #888;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 12px 0;
        overflow-x: auto;
    }
    
    .sidebar-menu {
        display: flex;
        gap: 4px;
        padding: 0 16px;
    }
    
    .sidebar-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 12px 20px;
    }
    
    .sidebar-item.active {
        border-left-color: transparent;
        border-bottom-color: #667eea;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0 16px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .event-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .event-status {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-card {
        padding: 20px;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .top-bar {
        flex-direction: column;
        height: auto;
        padding: 12px 16px;
        gap: 8px;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-icon {
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-save, .btn-cancel {
        text-align: center;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}