/* Cashback Family - Main Stylesheet */
:root {
    /* Light theme */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --transition: all 0.3s ease;
}

.dark-theme {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #2d2d2d;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --border-color: #495057;
    --primary-color: #5a6ff0;
    --primary-hover: #6b7ff0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    min-height: 100vh;
    padding: 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    border-radius: var(--radius);
    padding: 12px 20px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

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

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
}

/* Main layout */
.container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.sidebar {
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    margin-bottom: 15px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: var(--radius);
    color: var(--text-secondary);
}

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

.content {
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    border-left: 5px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
}

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

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.card-icon {
    font-size: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

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

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

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

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

tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    gap: 50px;
    flex-wrap: wrap;
}

.login-card {
    background-color: var(--bg-secondary);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 450px;
}

.login-info {
    max-width: 400px;
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 500;
}

.error-message {
    color: var(--danger-color);
    margin-top: 15px;
    text-align: center;
}

/* Calendar */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.calendar-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Loading spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .login-container {
        flex-direction: column;
    }
}