/* ============================================================
   Easy Services - Panel Admin
   css/admin.css
   ============================================================ */

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

:root {
    --admin-bar-height: 64px;
    --admin-tile-radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: #f0f4f8;
    color: var(--es-text);
    min-height: 100vh;
    padding-bottom: calc(var(--admin-bar-height) + 20px);
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #0d1b2a 0%, #0a1628 100%);
}
.login-box {
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.logo-circle {
    width: 64px; height: 64px;
    background: var(--es-blue);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(9,127,197,.35);
}
.login-logo h1 { font-size: 1.25rem; font-weight: 700; margin: 0; }
.login-logo p  { font-size: .82rem; color: var(--es-text-muted); margin: 4px 0 0; }
.btn-login {
    display: block; width: 100%;
    padding: 13px;
    background: var(--es-blue);
    color: #fff;
    border: none;
    border-radius: var(--es-radius);
    font-size: 1rem; font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s;
    font-family: inherit;
}
.btn-login:hover { background: var(--es-blue-dark); transform: translateY(-1px); }
.login-env {
    text-align: center; margin-top: 16px;
    font-size: .75rem; color: var(--es-text-muted);
}

/* ============================================================
   HEADER ADMIN
   ============================================================ */
.admin-header {
    background: #fff;
    border-bottom: 1px solid rgba(9,127,197,.15);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
}
.admin-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 1rem;
    color: var(--es-blue); text-decoration: none;
    letter-spacing: -.01em;
}
.admin-brand span {
    color: var(--es-text-muted);
    font-weight: 400; font-size: .82rem;
}
.admin-header-right {
    display: flex; align-items: center; gap: 10px;
    font-size: .82rem; color: var(--es-text-muted);
}
.badge-env {
    background: #fef3c7; color: #92400e;
    border-radius: 6px; padding: 3px 8px;
    font-size: .70rem; font-weight: 700;
}
.btn-logout {
    background: none;
    border: 1px solid var(--es-grey-border);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: .82rem;
    color: var(--es-danger);
    cursor: pointer;
    text-decoration: none;
    transition: background .18s;
    font-family: inherit;
}
.btn-logout:hover { background: #fee2e2; }

/* ============================================================
   MAIN
   ============================================================ */
.admin-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px 16px;
}
.admin-page-title {
    font-size: 1.55rem; font-weight: 800;
    margin-bottom: 4px; color: var(--es-text);
    letter-spacing: -.02em;
}
.admin-page-subtitle {
    color: var(--es-text-muted);
    font-size: .88rem;
    margin-bottom: 28px;
}

/* ============================================================
   RECHERCHE
   ============================================================ */
.admin-search-wrap { margin-bottom: 32px; }
.admin-search {
    display: flex; align-items: center;
    background: #fff;
    border: 2px solid var(--es-grey-border);
    border-radius: 50px;
    padding: 10px 20px; gap: 10px;
    transition: border-color .2s, box-shadow .2s;
}
.admin-search:focus-within {
    border-color: var(--es-blue);
    box-shadow: 0 0 0 3px rgba(9,127,197,.1);
}
.admin-search i { color: var(--es-text-muted); font-size: .9rem; }
.admin-search input {
    border: none; outline: none; flex: 1;
    font-size: .92rem; background: none; font-family: inherit;
}
.admin-search-results {
    background: #fff;
    border: 1px solid var(--es-grey-border);
    border-radius: 14px;
    margin-top: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
    display: none;
}
.admin-search-results.visible { display: block; }
.admin-search-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--es-text);
    transition: background .15s;
    border-bottom: 1px solid var(--es-grey-border);
}
.admin-search-item:last-child { border-bottom: none; }
.admin-search-item:hover { background: var(--es-blue-light); }
.admin-search-item-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--es-blue-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--es-blue); font-size: .85rem; flex-shrink: 0;
}
.admin-search-item-title { font-weight: 600; font-size: .88rem; }
.admin-search-item-type { font-size: .75rem; color: var(--es-text-muted); }

/* ============================================================
   CARDS ADMIN
   ============================================================ */
.admin-card {
    background: #fff;
    border-radius: var(--admin-tile-radius);
    border: 1px solid var(--es-grey-border);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.admin-card-title {
    font-size: .80rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--es-text-muted);
    padding-bottom: 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--es-grey-border);
}

/* ============================================================
   DASHBOARD TILES
   ============================================================ */
.dashboard-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.dashboard-tile {
    background: #fff;
    border-radius: var(--admin-tile-radius);
    border: 1px solid var(--es-grey-border);
    padding: 22px 18px;
    text-decoration: none;
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
    text-align: center;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    position: relative; overflow: hidden;
}
.dashboard-tile::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--tile-color, var(--es-blue));
    transform: scaleX(0);
    transition: transform .25s;
    transform-origin: left;
}
.dashboard-tile:hover {
    border-color: var(--tile-color, var(--es-blue));
    box-shadow: 0 8px 28px rgba(0,0,0,.09);
    transform: translateY(-3px);
}
.dashboard-tile:hover::before { transform: scaleX(1); }
.tile-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    background: var(--tile-color, var(--es-blue));
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.tile-label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--es-text);
}

/* ============================================================
   TABLEAUX
   ============================================================ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.admin-table th {
    background: var(--es-grey-bg);
    padding: 10px 14px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--es-text-muted);
    border-bottom: 2px solid var(--es-grey-border);
    white-space: nowrap;
}
.admin-table th:first-child { border-radius: 10px 0 0 0; }
.admin-table th:last-child  { border-radius: 0 10px 0 0; }
.admin-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--es-grey-border);
    vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--es-grey-bg); }

/* ============================================================
   BADGES
   ============================================================ */
.badge-es {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem; font-weight: 700;
    white-space: nowrap;
}
.badge-publie  { background: #dcfce7; color: #166534; }
.badge-brouillon { background: #fef3c7; color: #92400e; }
.badge-archive { background: var(--es-grey-bg); color: var(--es-text-muted); }
.badge-actif   { background: #dcfce7; color: #166534; }
.badge-inactif { background: #fee2e2; color: #991b1b; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-group { margin-bottom: 0; }
.form-label {
    display: block;
    font-size: .80rem;
    font-weight: 600;
    color: var(--es-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--es-grey-border);
    border-radius: var(--es-radius-sm);
    font-size: .92rem;
    color: var(--es-text);
    background: #fff;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--es-blue);
    box-shadow: 0 0 0 3px rgba(9,127,197,.1);
}
.form-control::placeholder { color: var(--es-grey-dark); opacity: .6; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ============================================================
   BOUTONS ADMIN
   ============================================================ */
.btn-admin {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px;
    border-radius: 9px;
    font-size: .875rem; font-weight: 600;
    cursor: pointer; border: 2px solid transparent;
    text-decoration: none; transition: all .18s;
    font-family: inherit; white-space: nowrap;
}
.btn-admin-primary {
    background: var(--es-blue); color: #fff;
    box-shadow: 0 4px 12px rgba(9,127,197,.25);
}
.btn-admin-primary:hover {
    background: var(--es-blue-dark);
    box-shadow: 0 6px 16px rgba(9,127,197,.35);
    transform: translateY(-1px);
    color: #fff;
}
.btn-admin-outline {
    background: #fff; color: var(--es-text);
    border-color: var(--es-grey-border);
}
.btn-admin-outline:hover {
    border-color: var(--es-blue);
    color: var(--es-blue);
    background: var(--es-blue-light);
}
.btn-admin-danger {
    background: #fee2e2; color: var(--es-danger);
    border-color: #fecaca;
}
.btn-admin-danger:hover { background: #fecaca; }
.btn-admin-sm { padding: 5px 10px; font-size: .78rem; }

/* ============================================================
   BARRE BAS (actions)
   ============================================================ */
.admin-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--admin-bar-height);
    background: var(--es-blue);
    display: flex; align-items: center;
    padding: 0 20px;
    gap: 6px;
    overflow-x: auto;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(9,127,197,.3);
}
.bar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.9);
    border-radius: 8px;
    font-size: .82rem; font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,.15);
    cursor: pointer; font-family: inherit;
    transition: background .18s, color .18s;
    flex-shrink: 0;
}
.bar-btn:hover, .bar-btn.active {
    background: rgba(255,255,255,.22);
    color: #fff;
}
.bar-btn i { font-size: .9rem; }

/* ============================================================
   MCDO CONFIG
   ============================================================ */
.mcdo-wrap {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}
.mcdo-question {
    font-size: 1.25rem; font-weight: 700;
    margin-bottom: 24px; color: var(--es-text);
}
.mcdo-field {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.05rem;
    border: 2px solid var(--es-grey-border);
    border-radius: var(--es-radius);
    text-align: center;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.mcdo-field:focus {
    border-color: var(--es-blue);
    box-shadow: 0 0 0 3px rgba(9,127,197,.1);
}
.mcdo-saved {
    font-size: .88rem; font-weight: 600;
    color: var(--es-success);
    margin-top: 10px; min-height: 20px;
}
.mcdo-nav {
    display: flex; gap: 12px; justify-content: center;
    margin-top: 32px;
}
.mcdo-progress {
    font-size: .80rem; color: var(--es-text-muted);
    margin-bottom: 28px;
}
.mcdo-progress-bar-wrap {
    height: 4px; background: var(--es-grey-border);
    border-radius: 2px; margin-bottom: 32px; overflow: hidden;
}
.mcdo-progress-bar {
    height: 100%; background: var(--es-blue);
    border-radius: 2px; transition: width .4s ease;
}

/* ============================================================
   UTILITAIRES ADMIN
   ============================================================ */
.text-muted  { color: var(--es-text-muted) !important; }
.text-center { text-align: center; }
.d-flex      { display: flex; }
.d-none      { display: none !important; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.mt-2  { margin-top: .5rem !important; }
.mt-3  { margin-top: 1rem !important; }
.mt-4  { margin-top: 1.5rem !important; }
.mb-2  { margin-bottom: .5rem !important; }
.mb-4  { margin-bottom: 1.5rem !important; }
.mb-0  { margin-bottom: 0 !important; }
.p-0   { padding: 0 !important; }
.py-4  { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5  { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.small { font-size: .82rem; }
.img-fluid { max-width: 100%; height: auto; }

/* ============================================================
   TILES DASHBOARD
   ============================================================ */
.tiles-group-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: var(--es-text-muted);
    margin: 28px 0 12px;
}
.tiles-group-label:first-of-type { margin-top: 8px; }

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 16px;
    border-radius: var(--admin-tile-radius);
    text-decoration: none;
    font-weight: 700;
    font-size: .88rem;
    text-align: center;
    transition: transform .2s, box-shadow .2s, filter .2s;
    color: #fff;
    border: none;
    position: relative;
    overflow: hidden;
}
.tile i { font-size: 1.8rem; opacity: .9; }
.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    filter: brightness(1.08);
    color: #fff;
}

.tile-badge {
    background: rgba(255,255,255,.25);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .72rem;
    font-weight: 600;
    display: inline-block;
}

/* Couleurs tiles */
.tile-primary   { background: linear-gradient(135deg, #097fc5, #0669a3); box-shadow: 0 4px 16px rgba(9,127,197,.3); }
.tile-success   { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 16px rgba(16,185,129,.3); }
.tile-warning   { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 16px rgba(245,158,11,.3); }
.tile-teal      { background: linear-gradient(135deg, #0891b2, #0e7490); box-shadow: 0 4px 16px rgba(8,145,178,.3); }
.tile-purple    { background: linear-gradient(135deg, #8b5cf6, #7c3aed); box-shadow: 0 4px 16px rgba(139,92,246,.3); }
.tile-secondary { background: linear-gradient(135deg, #475569, #334155); box-shadow: 0 4px 16px rgba(71,85,105,.2); }

/* ============================================================
   BARRE BAS ADMIN (footer navigation)
   ============================================================ */
.admin-bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--admin-bar-height);
    background: var(--es-blue);
    display: flex;
    align-items: center;
    z-index: 200;
    box-shadow: 0 -4px 20px rgba(9,127,197,.35);
}

.bar-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 72px;
    min-width: 72px;
    height: 100%;
    background: rgba(0,0,0,.2);
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-size: .68rem;
    font-weight: 600;
    border-right: 1px solid rgba(255,255,255,.12);
    transition: background .18s;
    flex-shrink: 0;
}
.bar-home i { font-size: 1.3rem; }
.bar-home:hover { background: rgba(0,0,0,.3); color: #fff; }

.bar-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    overflow-x: auto;
    height: 100%;
    flex: 1;
    scrollbar-width: none;
}
.bar-scroll::-webkit-scrollbar { display: none; }
