/* ═══════════════════════════════════════════════════════════════
   ÉCOLE DE VOILE — Design maritime raffiné
   Palette : bleu marine profond / blanc ivoire / or cuivré
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --navy:       #0b1e3d;
    --navy-mid:   #132a50;
    --navy-light: #1c3a6e;
    --navy-card:  #162544;
    --sky:        #2196f3;
    --sky-light:  #4fc3f7;
    --gold:       #c9a84c;
    --gold-light: #e8c96b;
    --white:      #f0f4f8;
    --ivory:      #e8ecf0;
    --text:       #c8d8e8;
    --text-dim:   #8aaabb;
    --danger:     #e53935;
    --danger-bg:  #1a0a0a;
    --success:    #43a047;
    --success-bg: #0a1a0a;
    --warn:       #fb8c00;
    --radius:     10px;
    --shadow:     0 4px 24px rgba(0,0,0,0.4);
    --border:     1px solid #1e3a6e;
}

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

html { font-size: 15px; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--navy);
    color: var(--text);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(33,150,243,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(201,168,76,0.04) 0%, transparent 50%);
}

/* ─── HEADER / NAV ─────────────────────────────────────────── */
.site-header {
    background: linear-gradient(135deg, #081629 0%, #0d2040 100%);
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
    position: sticky; top: 0; z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 2rem;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: .8rem;
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(201,168,76,0.6));
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--gold-light);
    line-height: 1.1;
}

.logo-sub {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: .7rem;
    color: var(--text-dim);
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* NAV */
.main-nav {
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
}

.nav-group {
    position: relative;
}

.nav-group > a,
.nav-link {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    transition: all .2s;
    white-space: nowrap;
    min-height: 44px; /* Taille cible tactile recommandée */
}

.nav-link:hover,
.nav-group > a:hover {
    background: var(--navy-light);
    color: var(--sky-light);
}

.nav-link.active {
    background: var(--navy-light);
    color: var(--sky-light);
    border-bottom: 2px solid var(--sky);
}

.nav-icon { font-size: 1rem; }

/* ─── LAYOUT ────────────────────────────────────────────────── */
.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    gap: .6rem;
}

.page-subtitle {
    font-size: .85rem;
    color: var(--text-dim);
    margin-top: .2rem;
}

/* ─── CARDS ─────────────────────────────────────────────────── */
.card {
    background: var(--navy-card);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    background: var(--navy-mid);
    border-bottom: var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--sky-light);
}

.card-body { padding: 1.5rem; }

/* ─── TABLES ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

thead th {
    background: var(--navy-mid);
    color: var(--sky-light);
    font-weight: 600;
    padding: .75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--navy-light);
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: .5px;
    font-size: .8rem;
    text-transform: uppercase;
}

tbody tr {
    border-bottom: 1px solid rgba(30,58,110,0.5);
    transition: background .15s;
}

tbody tr:hover { background: rgba(33,150,243,0.05); }

tbody td {
    padding: .7rem 1rem;
    color: var(--text);
    vertical-align: middle;
}

tbody tr:last-child { border-bottom: none; }

.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-haute { background: rgba(251,140,0,.2); color: var(--warn); border: 1px solid rgba(251,140,0,.3); }
.badge-basse { background: rgba(33,150,243,.2); color: var(--sky-light); border: 1px solid rgba(33,150,243,.3); }
.badge-ok    { background: rgba(67,160,71,.2);  color: #81c784; border: 1px solid rgba(67,160,71,.3); }
.badge-pers  { background: rgba(201,168,76,.15); color: var(--gold-light); border: 1px solid rgba(201,168,76,.3); }

/* ─── FORMS ─────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
}

.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.form-group.full { grid-column: 1 / -1; }

label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .5px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    background: var(--navy-mid);
    border: var(--border);
    border-radius: 6px;
    color: var(--white);
    padding: .6rem .9rem;
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(33,150,243,0.15);
}

select option { background: var(--navy-mid); }

textarea { resize: vertical; min-height: 80px; }

.check-group {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem 0;
}

.check-group input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--sky);
    cursor: pointer;
}

.check-group label {
    text-transform: none;
    font-size: .9rem;
    color: var(--text);
    cursor: pointer;
    font-weight: 400;
}

.form-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--navy-light);
}

.form-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--sky-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}

.btn-primary   { background: var(--sky); color: #fff; }
.btn-primary:hover { background: #1976d2; box-shadow: 0 4px 12px rgba(33,150,243,0.3); }

.btn-gold      { background: var(--gold); color: #0b1e3d; }
.btn-gold:hover { background: var(--gold-light); box-shadow: 0 4px 12px rgba(201,168,76,0.3); }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c62828; }

.btn-outline   { background: transparent; color: var(--sky-light); border: 1px solid var(--navy-light); }
.btn-outline:hover { border-color: var(--sky); color: var(--sky-light); background: rgba(33,150,243,0.08); }

.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #388e3c; }

.btn-sm { padding: .3rem .7rem; font-size: .78rem; }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ─── ALERTS ─────────────────────────────────────────────────── */
.alert {
    padding: .9rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-left: 4px solid;
}

.alert-success { background: var(--success-bg); border-color: var(--success); color: #a5d6a7; }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger);  color: #ef9a9a; }
.alert-warn    { background: rgba(251,140,0,.08); border-color: var(--warn); color: #ffcc80; }
.alert-info    { background: rgba(33,150,243,.08); border-color: var(--sky); color: #90caf9; }

/* ─── DASHBOARD STATS ────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--navy-card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sky), var(--gold));
}

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--sky-light);
    font-weight: 700;
    line-height: 1;
    margin-bottom: .4rem;
}

.stat-label {
    font-size: .75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: .5rem;
    display: block;
}

/* ─── PREVIEW BOX ────────────────────────────────────────────── */
.preview-box {
    background: var(--navy-mid);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-top: 1.5rem;
}

.preview-title {
    font-family: 'Playfair Display', serif;
    color: var(--gold-light);
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.preview-line {
    display: flex;
    justify-content: space-between;
    padding: .35rem 0;
    border-bottom: 1px dotted rgba(30,58,110,0.8);
    font-size: .9rem;
}

.preview-line:last-child { border-bottom: none; }

.preview-label { color: var(--text-dim); }
.preview-val   { color: var(--text); font-weight: 600; }

.preview-total {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-top: .3rem;
    border-top: 2px solid var(--gold);
}

.saison-badge {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 4px;
    font-size: .75rem;
    margin-left: .5rem;
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-dim);
    font-size: .8rem;
    border-top: 1px solid var(--navy-light);
    margin-top: 3rem;
}

/* ─── UTILITIES ──────────────────────────────────────────────── */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-gold   { color: var(--gold-light); }
.text-sky    { color: var(--sky-light); }
.text-dim    { color: var(--text-dim); }
.text-danger { color: #ef9a9a; }
.text-success{ color: #a5d6a7; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.fw-bold { font-weight: 700; }

.sep {
    border: none;
    border-top: 1px solid var(--navy-light);
    margin: 1.5rem 0;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */

/* Tablettes et petits écrans (iPad, etc.) */
@media (max-width: 1024px) {
    .grid { 
        grid-template-columns: 1fr !important; /* On empile les colonnes du dashboard et des fiches */
    }
    
    .header-inner { 
        flex-direction: column; 
        align-items: center; 
        padding: 1rem;
    }

    .main-nav { 
        justify-content: center;
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 colonnes sur tablette paysage */
    }
    
    .page-wrapper {
        padding: 1rem;
    }
}

/* Tablettes en mode portrait et mobiles larges */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr; /* 2 colonnes sur tablette portrait */
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-group {
        width: 100%;
    }

    .btn {
        justify-content: center;
    }
}

/* Mobiles */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid, .form-grid-2, .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .main-nav {
        font-size: 0.75rem;
    }
}

/* ─── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card, .stat-card, .alert {
    animation: fadeIn .3s ease;
}

/* ─── PRINT ──────────────────────────────────────────────────── */
@media print {
    .site-header, .btn, .btn-group, .site-footer { display: none !important; }
    body { background: white; color: black; }
    table { font-size: 11px; }
}
