/* ============================================================
   RESET & BASE LAYOUT
============================================================ */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f7f7f7;
    color: #222;
}

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #111;
    color: #fff;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    font-size: 22px;
    font-weight: bold;
    padding-left: 20px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar ul, .sidebar li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar ul.menu li {
    margin: 5px 0;
}

.sidebar ul.menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #ddd;
    text-decoration: none;
    font-size: 16px;
    transition: 0.2s;
}

.sidebar ul.menu li a:hover {
    background: #333;
    color: #fff;
}

.sidebar ul.menu li.active a {
    background: #ff9800;
    color: #000;
}

/* Logout */
.sidebar .logout {
    margin-top: auto;
    padding: 20px;
}

.sidebar .logout a {
    color: #ff5555;
    display: flex;
    gap: 10px;
    font-size: 16px;
    text-decoration: none;
}

.sidebar .logout a:hover {
    color: #ff7777;
}

/* ============================================================
   CONTENT
============================================================ */
.content {
    margin-left: 260px;
    padding: 20px 40px;
}

h1, h2 {
    font-weight: 600;
    margin-bottom: 20px;
}

/* ============================================================
   TABLES
============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

table th {
    background: #fafafa;
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

table tr:hover td {
    background: #f5f5f5;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary { background: #ff9800; color: #fff; }
.btn-warning { background: #ff5722; color: #fff; }
.btn-success { background: #4caf50; color: #fff; }
.btn-danger  { background: #d32f2f; color: #fff; }

/* ============================================================
   BADGES
============================================================ */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}
.badge-ok   { background: #4caf50; }
.badge-warn { background: #ff9800; }
.badge-bad  { background: #d32f2f; }

/* ============================================================
   FORMS
============================================================ */
form input, form select, form textarea {
    padding: 8px;
    width: 280px;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin: 5px 0 15px 0;
}

form textarea { width: 400px; }

/* ============================================================
   DASHBOARD CARDS
============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.card-title {
    font-size: 16px;
    color: #666;
}

.card-value {
    font-size: 34px;
    font-weight: bold;
    margin-top: 10px;
    color: #222;
}

/* ============================================================
   ACTION ICONS
============================================================ */
.action-icons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.action-icons a {
    color: #333;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-icons a:hover {
    color: #000;
}

/* Tooltips */
.action-icons a .tooltip {
    visibility: hidden;
    opacity: 0;
    background: #000;
    color: #fff;
    border-radius: 4px;
    padding: 4px 8px;
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translate(-50%, 120%);
    transition: opacity 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
}

.action-icons a:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* ============================================================
   MODE CONSULTANT → GRISAGE COMPLET
============================================================ */

/* Désactive et grise un bouton */
.btn-primary.consult-disabled {
    opacity: 0.35 !important;
    filter: grayscale(100%) !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/* Désactive une action */
.action-icons a.consult-disabled {
    opacity: 0.25 !important;
    filter: grayscale(100%) brightness(0.6) !important;
    color: #999 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/* Désactive l’icône dedans */
.action-icons a.consult-disabled .material-icons {
    opacity: 0.25 !important;
    filter: grayscale(100%) brightness(0.6) !important;
    color: #999 !important;
}

/* ===================================================================
   CORRECTION GLOBALE : enlever le trait sous toutes les icônes actions
=================================================================== */

.action-icons a,
.action-icons a:hover,
.action-icons a:focus,
.action-icons a:active {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
}

.action-icons .material-icons {
    text-decoration: none !important;
}

/* ============================================
   PERMISSIONS GLOBAL UI HANDLING
============================================ */

.hidden-by-role {
    display: none !important;
}

.disabled-by-role,
a.disabled-by-role,
button.disabled-by-role {
    opacity: 0.35 !important;
    filter: grayscale(100%) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    color: #999 !important;
}

.disabled-by-role .material-icons {
    opacity: 0.3 !important;
}

/* ============================================
   ROLE PERMISSIONS UI HANDLING
============================================ */

.disabled-by-role {
    opacity: 0.35 !important;
    filter: grayscale(100%) !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    color: #999 !important;
}

.disabled-by-role .material-icons {
    opacity: 0.3 !important;
    filter: grayscale(100%) !important;
}

