/* ============================================================
   THEME COMMUN POUR L'APPLICATION PWA
   ============================================================ */

:root {
    --primary: #1a472a;
    --primary-light: #2d6a4f;
    --primary-dark: #0d3b1f;
    --primary-rgb: 26, 71, 42;
    --secondary: #e8a87c;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #1a202c;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #edf2f7;
    --shadow: 0 2px 8px rgba(0,0,0,0.04);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* ============================================================
   APP HEADER
   ============================================================ */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 20px 16px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(26, 71, 42, 0.3);
}

.app-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-header-left .logo-small {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-header-left .logo-small img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.app-header-left .logo-small i {
    color: #fff;
    font-size: 20px;
}

.app-header-left h1 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.app-header-left .count-badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    margin-left: 6px;
}

.app-header-right {
    display: flex;
    gap: 8px;
}

.btn-header {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    text-decoration: none;
    position: relative;
}

.btn-header:active {
    transform: scale(0.92);
    background: rgba(255,255,255,0.2);
}

.btn-header .badge-top {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc2626;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 12px 12px 0;
}

/* ============================================================
   CARTE
   ============================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--secondary);
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
    text-decoration: none;
    min-height: 48px;
}

.btn:active {
    transform: scale(0.96);
}

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

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

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    min-height: 32px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

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

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.form-group label .required {
    color: #dc2626;
}

.input,
.textarea,
select {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.input:focus,
.textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.06);
    background: #fff;
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============================================================
   ALERTES
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

.alert-success {
    background: #f0fff4;
    color: #276749;
    border-left: 4px solid #38a169;
}

.alert-error {
    background: #fff5f5;
    color: #c53030;
    border-left: 4px solid #e53e3e;
}

.alert-warning {
    background: #fffff0;
    color: #975a16;
    border-left: 4px solid #ecc94b;
}

/* ============================================================
   BOTTOM NAV (PWA) - ICÔNES AGRANDIES
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 env(safe-area-inset-bottom, 12px);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 20px;
    transition: 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
    position: relative;
    min-width: 64px;
}

.bottom-nav .nav-item i {
    font-size: 28px;
    transition: 0.2s;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
}

.bottom-nav .nav-item.active i {
    transform: scale(1.15);
}

.bottom-nav .nav-item:active {
    transform: scale(0.92);
}

.bottom-nav .nav-item .badge-bottom {
    position: absolute;
    top: 0;
    right: 8px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive pour petits écrans */
@media (max-width: 480px) {
    .bottom-nav .nav-item i {
        font-size: 24px;
    }
    .bottom-nav .nav-item {
        font-size: 10px;
        padding: 4px 12px;
        min-width: 48px;
    }
}
/* ============================================================
   UTILITAIRES
   ============================================================ */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-12 {
    margin-top: 12px;
}

.mb-12 {
    margin-bottom: 12px;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state .icon {
    font-size: 48px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text);
    font-weight: 700;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .app-header-left h1 {
        font-size: 16px;
    }

    .card {
        padding: 16px;
    }

    .btn {
        font-size: 13px;
        padding: 10px 16px;
        min-height: 44px;
    }

    .container {
        padding: 8px 8px 0;
    }
}