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

:root {
    /* Color Palette - Light Mode (Default) */
    --primary: #0df280;
    --primary-hover: #0bc568;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

    /* Surface Tokens */
    --card-radius: 8px;
    --font-family: 'Lexend', sans-serif;
}

:root[data-theme="dark"] {
    /* Color Palette - Dark Mode (Stitch Design) */
    --bg-main: #111814;
    /* Default Background */
    --bg-dark: #102219;
    /* Deep Green Background (Metrics) */
    --bg-card: #1a241f;
    --surface-dark: #182c23;
    /* Darker Surface (Metrics Cards) */
    --surface-highlight: #1e362b;
    /* Highlight Surface */
    --text-main: #f1f5f9;
    --text-muted: #9cbaab;
    --border: #283930;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

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

/* Layout utilities */
.sidebar {
    width: 280px;
    background-color: #111814;
    /* Match Stitch Sidebar Bg */
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: all 0.3s ease;
}

.main-content {
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
    background-color: var(--bg-main);
}

/* UI Components based on Stitch Design */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--card-radius);
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #111814;
    /* Dark text on primary */
    box-shadow: 0 0 15px rgba(13, 242, 128, 0.3);
    /* Stitch Glow */
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(13, 242, 128, 0.5);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    /* Muted text for secondary */
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-color: var(--primary);
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 242, 128, 0.2);
}

/* Nav Link Styles */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--card-radius);
    transition: all 0.2s ease;
    margin: 0.25rem 1rem;
}

.nav-link:hover {
    color: var(--text-main);
    background-color: rgba(13, 242, 128, 0.05);
}

.nav-link.active {
    color: #0f172a;
    background-color: var(--primary);
}

.nav-link i {
    width: 20px;
    height: 20px;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-emerald {
    background-color: rgba(13, 242, 128, 0.1);
    color: var(--primary);
}

.badge-blue {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge-red {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Dashboard Cards */
.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Theme Toggle styles */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
}