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

:root {
    /* --- Brand Semantic Colors --- */
    --primary-main: #0f172a;
    /* Deep Slate */
    --primary-light: #1e293b;
    /* Lighter Slate for hover/surfaces */
    --primary-dark: #020617;
    /* Darkest Slate */

    --accent-main: #10b981;
    /* Emerald 500 */
    --accent-hover: #059669;
    /* Emerald 600 */
    --accent-light: #d1fae5;
    /* Emerald 100 for tint backgrounds */
    --accent-subtle: rgba(16, 185, 129, 0.1);

    /* --- Functional Colors --- */
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;

    /* --- Neutral Scales --- */
    --bg-body: #f1f5f9;
    /* Slate 100 */
    --bg-surface: #ffffff;
    /* Pure White */
    --bg-surface-alt: #f8fafc;
    /* Slate 50 */

    --text-main: #1e293b;
    /* Slate 800 */
    --text-secondary: #64748b;
    /* Slate 500 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --text-inverse: #ffffff;

    --border-color: #e2e8f0;
    /* Slate 200 */

    /* --- Metrics --- */
    --nav-width-desktop: 280px;
    --nav-height-mobile: 70px;
    --header-height: 70px;

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* --- Shadows --- */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-up: 0 -4px 6px -1px rgb(0 0 0 / 0.1);

    /* --- Transitions --- */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Typography --- */
/* Loading Bar (Top) */
#loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-main);
    z-index: 99999;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-main);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Prevent horizontal scroll on mobile */
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--primary-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* --- Layout Structure --- */
.app-layout-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar (Desktop Only) */
.sidebar {
    width: var(--nav-width-desktop);
    background: var(--primary-main);
    color: var(--text-inverse);
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 50;
    display: none;
    /* Hidden by default (Mobile First) */
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
    font-weight: 500;
}

.sidebar-nav-item i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
}

.sidebar-nav-item.active {
    background: var(--accent-main);
    color: white;
}

/* Main Content Area */
.main-content {
    flex: 1;
    width: 100%;
    /* Ensure it fills width */
    margin-left: 0;
    /* Default (Mobile) */
    display: flex;
    flex-direction: column;
    padding-bottom: calc(var(--nav-height-mobile) + 2rem);
    /* Space for bottom nav */
}

/* Header (Responsive) */
.top-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.header-user-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height-mobile);
    background: var(--bg-surface);
    box-shadow: var(--shadow-up);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    width: 100%;
    height: 100%;
    transition: var(--transition-fast);
}

.mobile-nav-item i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: var(--transition-fast);
}

.mobile-nav-item.active {
    color: var(--accent-main);
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
}

/* Floating Action Button (Center Mobile) */
.mobile-fab {
    position: relative;
    top: -25px;
    background: var(--accent-main);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    border: 4px solid var(--bg-body);
    /* Cutout effect matches body bg usually, but nav is white. */
    /* If nav is white, border should be white? No, visual cutout looks better if it matches nav or transparent. */
    /* Let's make it match the nav background so it looks like it sits on top */
    border-color: var(--bg-surface);
    transition: var(--transition-normal);
}

.mobile-fab:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
}

/* --- Responsive Breakpoints (Desktop) --- */
@media (min-width: 992px) {
    .sidebar {
        display: flex;
        /* Show Sidebar */
    }

    .main-content {
        margin-left: var(--nav-width-desktop);
        /* Push content */
        padding-bottom: 2rem;
        /* Remove bottom nav space */
    }

    .mobile-bottom-nav {
        display: none;
        /* Hide Bottom Nav */
    }

    /* Adjust Header if needed */
    /* .top-header { } */
}


/* --- Global Component Utilities --- */

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-light);
}

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

.btn-accent:hover {
    background: var(--accent-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-surface-alt);
    border-color: var(--text-muted);
}

/* Form Controls */
.form-control,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-main);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Avatars */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

/* Utilities */
.text-accent {
    color: var(--accent-main);
}

.bg-accent-subtle {
    background-color: var(--accent-light);
    color: var(--accent-hover);
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

/* Google Maps Fixes */
.pac-container {
    z-index: 99999 !important;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: none;
    margin-top: 5px;
}