:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; font-family: 'Inter', -apple-system, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-main); margin: 0; line-height: 1.5; -webkit-tap-highlight-color: transparent; }

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

header { 
    display: flex; justify-content: space-between; align-items: center; 
    background: white; padding: 15px 30px; border-radius: 15px; 
    box-shadow: var(--shadow); margin-bottom: 30px; flex-wrap: wrap; gap: 15px;
}
.brand h1 { margin: 0; font-size: 24px; color: var(--primary-color); font-weight: 800; }
.brand p { margin: 0; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

nav { display: flex; gap: 10px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 8px; transition: 0.3s; }
nav a:hover, nav a.active { background: #eff6ff; color: var(--primary-color); }

.btn { 
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 20px; border-radius: 12px; font-weight: 600; cursor: pointer; 
    border: none; transition: 0.3s; text-decoration: none; font-size: 14px; gap: 8px;
    min-height: 48px; /* Touch friendly */
}
.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--secondary-color); transform: translateY(-1px); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: white; padding: 25px; border-radius: 15px; box-shadow: var(--shadow); text-align: center; }
.stat-card h3 { margin: 0; font-size: 14px; color: var(--text-muted); text-transform: uppercase; }
.stat-card p { margin: 10px 0 0; font-size: 32px; font-weight: 800; color: var(--primary-color); }

table { width: 100%; border-collapse: separate; border-spacing: 0 10px; margin-top: -10px; }
th { text-align: left; padding: 15px; color: var(--text-muted); font-size: 13px; text-transform: uppercase; }
td { background: white; padding: 15px; font-size: 14px; vertical-align: middle; }
td:first-child { border-radius: 12px 0 0 12px; }
td:last-child { border-radius: 0 12px 12px 0; text-align: right; }
tr { box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: 0.3s; }
tr:hover td { background: #f1f5f9; }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: #e2e8f0; color: #475569; }

/* Modais Responsivos */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); }
.modal-content { 
    background: white; margin: 2% auto; padding: 30px; border-radius: 24px; 
    width: 95%; max-width: 650px; position: relative; max-height: 95vh; overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}
.close { position: absolute; right: 20px; top: 20px; font-size: 28px; cursor: pointer; color: var(--text-muted); z-index: 10; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; color: var(--text-main); }
.form-group input, .form-group select, .form-group textarea { 
    width: 100%; padding: 14px; border: 2px solid var(--border-color); border-radius: 12px; 
    font-size: 16px; transition: 0.3s; outline: none; background: #fcfcfc;
}
.form-group input:focus { border-color: var(--primary-color); background: white; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.premio-item { 
    background: #f8fafc; padding: 20px; border-radius: 16px; border: 1px dashed var(--border-color); 
    margin-bottom: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
}

.alert { padding: 15px; border-radius: 12px; margin-bottom: 20px; font-weight: 600; text-align: center; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Ajustes Mobile */
@media (max-width: 768px) {
    .container { padding: 10px; }
    header { padding: 20px; text-align: center; justify-content: center; border-radius: 0; margin: -10px -10px 20px -10px; }
    nav { justify-content: center; gap: 5px; }
    nav a { padding: 8px 12px; font-size: 12px; }
    
    .modal-content { margin: 0; width: 100%; height: 100%; max-height: 100vh; border-radius: 0; padding: 60px 20px 20px 20px; }
    .form-grid { grid-template-columns: 1fr; gap: 10px; }
    .premio-item { grid-template-columns: 1fr; padding: 15px; }
    
    .btn { width: 100%; }
    
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { position: absolute; top: -9999px; left: -9999px; }
    tr { margin-bottom: 15px; border-radius: 15px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid #f1f5f9; }
    td { text-align: right; padding-left: 45%; position: relative; border-radius: 0 !important; border-bottom: 1px solid #f1f5f9; min-height: 50px; }
    td:before { content: attr(data-label); position: absolute; left: 15px; width: 40%; text-align: left; font-weight: 700; color: var(--text-muted); font-size: 12px; }
    td:last-child { text-align: center; padding: 15px; background: #f8fafc; }
    
    .stats-grid { grid-template-columns: 1fr; }
}
