:root {
    --primary: #22C55E;
    --primary-dark: #16A34A;
    --secondary: #0F172A;
    --background: #FFFFFF;
    --surface: #F5F7FA;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --danger: #EF4444;
    --warning: #F59E0B;
    --border-radius: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--surface);
    color: var(--text-primary);
    padding-bottom: 80px; /* Space for bottom nav */
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities */
.container {
    padding: 0 16px;
    max-width: 600px;
    margin: 0 auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    gap: 8px;
}

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

.btn-primary:active {
    background-color: var(--primary-dark);
    transform: scale(0.98);
}

.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

/* Header */
.app-header {
    background: var(--primary);
    color: white;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: var(--shadow-md);
}

.user-balance {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 1000;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    gap: 4px;
}

.nav-item.active {
    color: var(--primary);
}

/* Grid Actions */
.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.icon-box {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    color: var(--primary);
}

.action-label {
    font-size: 12px;
    font-weight: 500;
}

/* Raffle List */
.raffle-card {
    overflow: hidden;
}

.raffle-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
}

.progress-bar {
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.5s ease;
}

/* Ticket Grid */
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 8px;
    padding: 10px 0;
}

.ticket-number {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border: 1px solid transparent;
}

.ticket-number.selected {
    background: var(--primary);
    color: white;
}

.ticket-number.sold {
    background: #FECACA;
    color: var(--danger);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Admin Styles */
.admin-body {
    background: #F1F5F9;
    padding-bottom: 0;
}

.admin-sidebar {
    width: 250px;
    background: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid #E2E8F0;
    padding: 20px;
    display: none; /* Mobile first hidden */
}

@media (min-width: 768px) {
    .admin-sidebar {
        display: block;
    }
    .admin-content {
        margin-left: 250px;
        padding: 20px;
    }
}
