/* ============================================ */
/* CHGARDENER Enterprise - Design System        */
/* ============================================ */

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

:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --sidebar-bg: #111827;
    --accent: #10b981;
    --accent-hover: #059669;
    --secondary: #3b82f6;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --sidebar-width: 260px;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    line-height: 1.5;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Layout Shell */
#app {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 100;
}

.sidebar-header {
    background: white;
    padding: 24px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.logo { display:flex; align-items:center; justify-content:center; width: 100%; font-size: 1.25rem; font-weight: 700; font-family: 'Outfit', sans-serif; color: var(--text-primary); }
.brand-logo { width: 100%; max-width: 180px; max-height: 120px; object-fit: contain; }
.text-accent { color: var(--accent); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 0 16px; overflow-y: auto; }
.nav-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin: 16px 0 8px 12px; opacity: 0.6; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.nav-item i { width: 18px; height: 18px; transition: transform 0.2s; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.nav-item:hover i { transform: translateX(2px); }
.nav-item.active { background: rgba(16, 185, 129, 0.1); color: var(--accent); }
.nav-item.active i { color: var(--accent); }

.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid var(--border); }
.user-profile { display: flex; align-items: center; gap: 12px; }
.avatar { width: 32px; height: 32px; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 600; }
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.72rem; color: var(--text-secondary); }

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.05), transparent 60%);
}

.top-header {
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}

#view-title { font-size: 1.5rem; font-weight: 700; }

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Common UI Components */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.9rem;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 15px rgba(16, 185, 129, 0.3); }

.btn-secondary { background: var(--border); color: var(--text-primary); }
.btn-secondary:hover { background: #475569; }

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

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: #0f172a;
    border: 1px solid var(--border);
    color: white;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--accent); }

/* Dashboard Grid */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.stat-card { display: flex; align-items: center; gap: 20px; }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.stat-icon.green { background: rgba(16, 185, 129, 0.2); color: var(--accent); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.2); color: var(--secondary); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); }

/* Map Styling */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}
#routeMap { height: 100%; width: 100%; }

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center; justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}
.modal { width: 100%; max-width: 600px; }
.hidden { display: none !important; }

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Badges */
.badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge.paid { background: rgba(16, 185, 129, 0.2); color: var(--accent); }
.badge.pending { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

/* Animation Utils */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
