@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338CA;
    --secondary: #10B981; /* Emerald 500 */
    --accent: #F59E0B; /* Amber 500 */
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --danger: #EF4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .container { padding: 2rem; }
}

.header {
    background: var(--surface);
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

@media (min-width: 768px) {
    .header { padding: 1.5rem 2rem; }
}

.header-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

/* Forms & Buttons */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #F9FAFB;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}
.btn-secondary:hover {
    background-color: #059669;
    transform: scale(1.02);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
}

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

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #F3F4F6;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #F9FAFB;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-bonus {
    background-color: #FEF3C7;
    color: #D97706;
}
.badge-active {
    background-color: #D1FAE5;
    color: #059669;
}
.badge-expired {
    background-color: #FEE2E2;
    color: #DC2626;
}

/* Ranking Specific */
.rank-1 { background: linear-gradient(135deg, #FFD700, #FDB931); color: white; border-radius: 50%; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-weight: bold;}
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #E5E4E2); color: white; border-radius: 50%; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-weight: bold;}
.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: white; border-radius: 50%; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-weight: bold;}
.rank-other { font-weight: 600; color: var(--text-muted); display: inline-flex; width: 30px; justify-content: center;}

/* Utilities */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }

/* Dashboard layout */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.sidebar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.sidebar-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
    margin-right: 0.5rem;
}
.sidebar-link:hover, .sidebar-link.active {
    background: #EEF2FF;
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.main-content {
    padding: 1rem;
}

@media (min-width: 768px) {
    .dashboard-layout {
        display: grid;
        grid-template-columns: 250px 1fr;
    }
    .sidebar {
        border-right: 1px solid var(--border);
        border-bottom: none;
        padding: 2rem 0;
        display: block;
        overflow-x: visible;
        white-space: normal;
    }
    .sidebar-link {
        display: block;
        padding: 1rem 2rem;
        margin-right: 0;
        border-bottom: none;
        border-right: 4px solid transparent;
    }
    .sidebar-link:hover, .sidebar-link.active {
        background: #EEF2FF;
        border-bottom-color: transparent;
        border-right-color: var(--primary);
    }
    .main-content {
        padding: 2rem;
    }
}
