/* Professional Design Update */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    /* More vibrant blue */
    --primary-hover: #1d4ed8;
    --accent-color: #0ea5e9;
    /* Sky blue */
    --bg-color: #f1f5f9;
    /* Lighter slate */
    --text-color: #334155;
    /* Soft dark */
    --text-muted: #64748b;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 40px;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5em;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    padding: 32px;
    margin-bottom: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
}

.btn-danger:hover {
    background-color: #fecaca;
}

.btn-secondary {
    background-color: var(--white);
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Navbar */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    margin-bottom: 40px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.025em;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-color);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-neutral {
    background-color: #f1f5f9;
    color: #475569;
}

/* Auth */
.auth-container {
    max-width: 420px;
    margin: 80px auto;
}

.auth-title {
    text-align: center;
    margin-bottom: 32px;
    font-size: 28px;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.container {
    animation: fadeIn 0.4s ease-out;
}

/* Responsive Design (Mobile App Feel) */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
        /* Space for bottom nav */
        padding-top: 10px;
    }

    .container {
        padding: 0 15px;
    }

    .navbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid #e2e8f0;
        border-bottom: none;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        padding: 0;
        height: 65px;
    }

    .nav-content {
        height: 100%;
        padding: 0;
        flex-direction: row;
        /* Keep row for icons */
        justify-content: center;
        width: 100%;
    }

    .logo {
        display: none;
        /* Hide text logo on mobile to save space */
    }

    .nav-links {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
        overflow-x: visible;
        gap: 0;
    }

    .nav-links a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        /* Small text */
        color: var(--text-muted);
        text-decoration: none;
        flex: 1;
        height: 100%;
        padding: 5px 0;
        border-radius: 0;
    }

    /* Make Emoji Icons bigger */
    .nav-links a::before {
        font-size: 20px;
        margin-bottom: 2px;
    }

    /* Hide the emoji text from the link content if possible, or style it. 
       Actually, the link text contains the emoji. e.g. "📊 Tableau de bord".
       We want to stack them: Emoji on top, Text bottom.
       We can't easily split emoji via CSS unless wrapped. 
       Workaround: Just font-size adjustment or using first-letter pseudo-element if valid, 
       but emoji isn't always distinct.
       
       Let's just center text and make it look like a tab.
    */

    .nav-links a.active {
        color: var(--primary-color);
        background: transparent;
        border-top: 2px solid var(--primary-color);
    }

    .nav-links a:hover {
        background: rgba(0, 0, 0, 0.02);
    }

    /* Stack Elements */
    .container>div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 15px !important;
    }

    h1 {
        margin-bottom: 20px;
        font-size: 1.8rem;
    }

    /* Better Cards */
    .card {
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        margin-bottom: 20px;
        padding: 20px;
    }

    /* Forms */
    form div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .form-control {
        font-size: 16px;
        /* Prevent zoom on iOS */
        padding: 12px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
        font-size: 16px;
        border-radius: 12px;
        margin-bottom: 10px;
    }

    /* Tables */
    .card table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll */
    }

    /* Quote Items */
    .item-row {
        flex-direction: column;
        background: #fff;
        border: 1px solid #eee;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        padding: 15px;
        border-radius: 12px;
        margin-bottom: 15px;
    }

    .col-action {
        position: absolute;
        top: 10px;
        right: 10px;
    }
}