/* =========================================
   1. VARIABLES & THEME SETUP
   ========================================= */
:root {
    /* Brand Colors - Emerald & Slate Scheme */
    --primary-color: #10b981;       /* Emerald 500 */
    --primary-dark: #059669;        /* Emerald 600 */
    --secondary-color: #64748b;     /* Slate 500 */
    --accent-color: #f59e0b;        /* Amber 500 (Alerts/Highlights) */
    
    /* Surface Colors */
    --bg-body: #f1f5f9;             /* Slate 100 */
    --bg-card: #ffffff;
    --text-main: #1e293b;           /* Slate 800 */
    --text-muted: #64748b;          /* Slate 500 */
    
    /* UI Properties */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --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);
    --font-main: 'Inter', sans-serif;
    
    /* Bootstrap Overrides */
    --bs-primary: var(--primary-color);
    --bs-body-bg: var(--bg-body);
    --bs-body-font-family: var(--font-main);
    --bs-border-radius: var(--radius-sm);
}

[data-bs-theme="dark"] {
    --bg-body: #0f172a;             /* Slate 900 */
    --bg-card: #1e293b;             /* Slate 800 */
    --text-main: #f8fafc;           /* Slate 50 */
    --text-muted: #94a3b8;          /* Slate 400 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
}

/* =========================================
   2. GLOBAL TYPOGRAPHY & RESET
   ========================================= */
body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

/* =========================================
   3. COMPONENTS
   ========================================= */

/* Cards (Modern SaaS Look) */
.card {
    background-color: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

[data-bs-theme="dark"] .card-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Inputs & Forms (Touch Friendly) */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    border: 1px solid #e2e8f0;
    background-color: var(--bg-card);
}

[data-bs-theme="dark"] .form-control, 
[data-bs-theme="dark"] .form-select {
    border-color: #334155;
    background-color: #0f172a;
    color: var(--text-main);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); /* Emerald Glow */
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

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

/* =========================================
   4. NAVIGATION (MOBILE APP STYLE)
   ========================================= */

/* Top Navbar */
.navbar-dark.bg-dark {
    background-color: #064e3b !important; /* Dark Emerald for Brand Consistency */
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
}

/* Bottom Navigation (App Tab Bar) */
.bottom-nav-container {
    background-color: var(--bg-card) !important;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-bottom: env(safe-area-inset-bottom); /* iPhone X+ Safe Area */
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    height: auto;
    min-height: 65px;
}

[data-bs-theme="dark"] .bottom-nav-container {
    background-color: #1e293b !important;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.bottom-nav-container .nav-link {
    color: var(--text-muted) !important;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
    margin: 0 4px;
    padding: 8px 0;
}

.bottom-nav-container .nav-link i {
    font-size: 1.2rem;
    margin-bottom: 4px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bottom-nav-container .nav-link.active,
.bottom-nav-container .nav-link.text-success {
    color: var(--primary-color) !important;
    background-color: rgba(16, 185, 129, 0.08); /* Soft Green highlight */
    font-weight: 600;
}

.bottom-nav-container .nav-link.active i {
    transform: translateY(-2px);
}

.bottom-nav-container .nav-link:active {
    transform: scale(0.95);
}

/* Floating Action Button (FAB) Style for Main Actions */
.fab-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    z-index: 1000;
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
    color: white;
}