/* SIGOSE - Styles principaux (mobile-first) */

/* ---------- Base ---------- */
body.sigose-body {
    background: var(--sigose-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Navbar ---------- */
.sigose-navbar {
    background: var(--sigose-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.sigose-navbar .navbar-brand,
.sigose-navbar .nav-link {
    color: #fff !important;
}
.sigose-navbar .nav-link:hover { opacity: .85; }
.sigose-navbar .navbar-toggler {
    border-color: rgba(255,255,255,.5);
}
.sigose-navbar .navbar-toggler-icon {
    filter: invert(1);
}

/* ---------- Layout (sidebar + main) ---------- */
.sigose-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}
.sigose-sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    min-height: calc(100vh - 56px);
}
.sigose-main {
    flex: 1;
    min-width: 0;
}
.sigose-main-full { flex: 1; }

.sigose-menu-group { margin-bottom: 0.5rem; }
.sigose-menu-title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #374151;
    padding: .4rem .6rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    border-left: 4px solid transparent;
}
.sigose-menu-link {
    display: block;
    padding: .45rem .8rem;
    color: #374151;
    text-decoration: none;
    font-size: .92rem;
    border-radius: 6px;
    margin: 2px 4px;
}
.sigose-menu-link:hover {
    background: #f3f4f6;
    color: var(--sigose-primary);
}
.sigose-menu-link.active {
    background: var(--sigose-primary);
    color: #fff;
    font-weight: 500;
}

/* Sidebar responsive : cachée sous 992px */
@media (max-width: 991.98px) {
    .sigose-sidebar {
        position: fixed;
        left: -260px;
        top: 56px;
        z-index: 1030;
        transition: left .25s ease;
        box-shadow: 4px 0 12px rgba(0,0,0,.1);
    }
    .sigose-sidebar.open { left: 0; }
    .sigose-main { width: 100%; }
}

/* ---------- Footer ---------- */
.sigose-footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

/* ---------- Panels du dashboard ---------- */
.sigose-panel-tile {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-left: 4px solid var(--sigose-primary);
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}
.sigose-panel-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.1);
    color: inherit;
}
.sigose-panel-tile .icon {
    font-size: 2rem;
    margin-bottom: .5rem;
    display: block;
}
.sigose-panel-tile .title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: .25rem;
}
.sigose-panel-tile .subtitle {
    font-size: .85rem;
    color: #6b7280;
}
.sigose-panel-tile.ops   { border-left-color: var(--sigose-panel-ops);   }
.sigose-panel-tile.ops   .icon { color: var(--sigose-panel-ops); }
.sigose-panel-tile.se    { border-left-color: var(--sigose-panel-se);    }
.sigose-panel-tile.se    .icon { color: var(--sigose-panel-se); }
.sigose-panel-tile.fin   { border-left-color: var(--sigose-panel-fin);   }
.sigose-panel-tile.fin   .icon { color: var(--sigose-panel-fin); }
.sigose-panel-tile.param { border-left-color: var(--sigose-panel-param); }
.sigose-panel-tile.param .icon { color: var(--sigose-panel-param); }
.sigose-panel-tile.sys   { border-left-color: var(--sigose-panel-sys);   }
.sigose-panel-tile.sys   .icon { color: var(--sigose-panel-sys); }

/* ---------- Feu tricolore ---------- */
.feu {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: .3rem;
    vertical-align: middle;
    box-shadow: inset 0 0 3px rgba(0,0,0,.15);
}
.feu-rouge { background: #ef4444; }
.feu-jaune { background: #f59e0b; }
.feu-vert  { background: #10b981; }

.badge-rouge { background: #ef4444 !important; color: #fff; }
.badge-jaune { background: #f59e0b !important; color: #fff; }
.badge-vert  { background: #10b981 !important; color: #fff; }

/* ---------- Cartes de données ---------- */
.sigose-card {
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    margin-bottom: 1rem;
}
.sigose-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: .5rem;
    margin-bottom: .75rem;
    border-bottom: 1px solid #eef2f6;
}
.sigose-card-header h5 { margin: 0; font-size: 1.05rem; }

/* ---------- Mur de photos (login) ---------- */
.login-select-box {
    max-width: 500px;
    margin: 3rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    text-align: center;
}
.login-choice-btn {
    display: block;
    width: 100%;
    padding: 1.5rem 1rem;
    border: 2px solid var(--sigose-primary);
    background: #fff;
    border-radius: 10px;
    margin: .75rem 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--sigose-primary);
    text-decoration: none;
    transition: all .15s ease;
}
.login-choice-btn:hover {
    background: var(--sigose-primary);
    color: #fff;
}
.login-choice-btn i { font-size: 1.5rem; margin-right: .5rem; vertical-align: middle; }

.photo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 1.5rem auto;
}
.photo-tile {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: .6rem;
    text-align: center;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.photo-tile:hover {
    border-color: var(--sigose-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.photo-tile img,
.photo-tile .placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: .4rem;
    background: linear-gradient(135deg, var(--sigose-primary), var(--sigose-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
}
.photo-tile .nom {
    font-size: .85rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.2;
    word-break: break-word;
}
.photo-tile .role {
    font-size: .7rem;
    color: #6b7280;
}

/* Écran de saisie du mot de passe (après clic sur photo) */
.password-panel {
    max-width: 380px;
    margin: 3rem auto;
    background: #fff;
    border-radius: 14px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.password-panel img,
.password-panel .placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    display: block;
    background: linear-gradient(135deg, var(--sigose-primary), var(--sigose-secondary));
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
}
.password-panel .placeholder { display: flex; }
.password-input {
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: .5rem;
    padding: .75rem;
    max-width: 220px;
    margin: 1rem auto;
    display: block;
    border: 2px solid #d1d5db;
    border-radius: 8px;
}
.password-input:focus {
    outline: none;
    border-color: var(--sigose-primary);
    box-shadow: 0 0 0 3px rgba(15, 123, 63, .15);
}

/* ---------- Tables ---------- */
.sigose-table-actions {
    white-space: nowrap;
    width: 1%;
}
.sigose-table-actions .btn {
    padding: .2rem .4rem;
    margin: 0 1px;
}

/* ---------- Boutons ---------- */
.btn-primary {
    background-color: var(--sigose-primary);
    border-color: var(--sigose-primary);
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: color-mix(in srgb, var(--sigose-primary) 85%, black);
    border-color: color-mix(in srgb, var(--sigose-primary) 85%, black);
}
.btn-outline-primary {
    color: var(--sigose-primary);
    border-color: var(--sigose-primary);
}
.btn-outline-primary:hover {
    background-color: var(--sigose-primary);
    border-color: var(--sigose-primary);
    color: #fff;
}

/* ---------- Formulaires ---------- */
.form-label { font-weight: 500; margin-bottom: .3rem; }
.required::after { content: " *"; color: #ef4444; }

/* ---------- Utilitaires ---------- */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
