:root {
    /* Brand Colors */
    --dill: #747E5B;
    /* Primary Brand Text, Headings */
    --marshmallow: #FFFAEF;
    /* Backgrounds */
    --banana-cream: #FFCE70;
    /* CTA Buttons, Highlights */
    --bombay-brown: #9C532F;
    /* Deep Contrast Text, Accents */

    /* Mapped Variables */
    --primary: var(--dill);
    --primary-dark: #5c6347;
    /* Darker Dill */
    --primary-contrast: white;

    --secondary: var(--bombay-brown);

    --accent: var(--bombay-brown);
    /* Using Bombay Brown for accents/danger-ish tones */
    --success: #10b981;
    --warning: #f59e0b;

    --background: var(--marshmallow);
    --surface: #ffffff;

    --text-main: var(--dill);
    --text-light: #8e947c;
    /* Lighter Dill */
    --text-contrast: var(--bombay-brown);

    --border: #e6e2d3;
    /* Warm border matching marshmallow */
    --radius: 16px;
    /* Slightly rounder for friendlier vibe */
    --shadow: 0 4px 15px -1px rgba(116, 126, 91, 0.1), 0 2px 4px -1px rgba(116, 126, 91, 0.06);
    --glass: rgba(255, 255, 255, 0.85);
    /* More opaque for warmth */
    --glass-border: rgba(255, 255, 255, 0.6);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    /* Soft warm gradient overlay */
    background-image: radial-gradient(at 100% 0%, hsla(38, 90%, 90%, 0.4) 0, transparent 50%),
        radial-gradient(at 0% 0%, hsla(78, 20%, 90%, 0.4) 0, transparent 50%);
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand,
.page-title {
    font-family: 'Darker Grotesque', sans-serif;
    color: var(--dill);
    font-weight: 700;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--surface);
    /* Or maybe slightly tinted? Keep surface for cleanliness */
    border-right: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background-color: #fffdf7;
    /* Very subtle warm tint */
}

.brand {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dill);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-light);
    border-radius: var(--radius);
    transition: all 0.2s;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.nav-link:hover,
.nav-link.active {
    background: var(--banana-cream);
    color: var(--bombay-brown);
    /* High contrast on yellow */
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    padding: 2rem;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
}

/* Components */
.card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
    font-size: 1rem;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--banana-cream);
    color: var(--bombay-brown);
    box-shadow: 0 4px 10px -1px rgba(255, 206, 112, 0.5);
}

.btn-primary:hover {
    background: #ffc452;
    /* Slightly darker banana */
    color: #7a3e20;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--dill);
}

.btn-outline:hover {
    background: white;
    border-color: var(--dill);
    color: var(--dill);
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Darker Grotesque', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--dill);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
    font-size: 1rem;
    color: var(--text-main);
    transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--banana-cream);
    box-shadow: 0 0 0 4px rgba(255, 206, 112, 0.2);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

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

.table th {
    font-weight: 600;
    color: var(--text-light);
    background: rgba(248, 250, 252, 0.5);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Grid Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-info p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.5);
    /* Black w/ opacity */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 2rem;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius);
    position: relative;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-btn {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}