/**
 * Compact UI & High Contrast Style for GLPI (Snipe-IT inspired)
 * Perfectly balanced for both Light & Dark themes with maximum readability.
 */

/* ==========================================================================
   1. Ultra-Compact Table Layout & Padding
   ========================================================================== */

.table,
table.search-results,
table.tab_cadre_fixehov,
table.tab_cadre_fixe,
.card-table {
    font-size: 0.83rem !important;
    line-height: 1.35 !important;
}

/* Compact padding on all cells */
.table > :not(caption) > * > *,
table.search-results th,
table.search-results td,
table.tab_cadre_fixehov th,
table.tab_cadre_fixehov td,
.card-table th,
.card-table td {
    padding: 0.32rem 0.55rem !important;
    vertical-align: middle !important;
    height: auto !important;
}

/* Remove excessive spacing in cells */
table.search-results td p,
table.search-results td div,
table.search-results td ul {
    margin-bottom: 0 !important;
}

/* ==========================================================================
   2. Modern Table Header (Dark Slate Snipe-IT Style)
   ========================================================================== */

table.search-results thead th,
table.tab_cadre_fixehov thead th,
.card-table thead th,
.table thead th {
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    white-space: nowrap !important;
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-bottom: 2px solid #0f172a !important;
}

table.search-results thead th a,
table.search-results thead th .sort-indicator {
    color: #f8fafc !important;
}

/* ==========================================================================
   3. LIGHT THEME (High Contrast & Crisp Readability)
   ========================================================================== */

/* Main cell text: deep sharp dark for 100% legibility */
table.search-results td,
.table td {
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* Alternating zebra striping in light mode */
table.search-results tbody tr:nth-of-type(odd) {
    background-color: #ffffff !important;
}

table.search-results tbody tr:nth-of-type(even) {
    background-color: #f8fafc !important;
}

/* Row hover highlight */
table.search-results tbody tr:hover,
table.search-results tbody tr:hover > td {
    background-color: #e0f2fe !important;
    transition: background-color 0.1s ease-in-out;
}

/* Links & Names in light mode */
table.search-results td a {
    color: #1d4ed8 !important;
    text-decoration: none !important;
    font-weight: 500;
}

table.search-results td a:hover {
    color: #1e40af !important;
    text-decoration: underline !important;
}

/* Badges for Groups / Services / Entities (Snipe-IT pill style) */
td a[href*="group.form.php"],
td a[href*="entity.form.php"] {
    display: inline-block !important;
    padding: 0.12rem 0.5rem !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd !important;
    text-decoration: none !important;
    margin: 1px 0 !important;
}

td a[href*="group.form.php"]:hover,
td a[href*="entity.form.php"]:hover {
    background-color: #bae6fd !important;
    color: #0c4a6e !important;
}

/* ==========================================================================
   4. DARK THEME (When GLPI Dark Palette is Enabled)
   ========================================================================== */

:root[data-glpi-theme-dark="1"] table.search-results td,
[data-bs-theme="dark"] table.search-results td {
    color: #f1f5f9 !important;
    border-bottom: 1px solid #334155 !important;
}

:root[data-glpi-theme-dark="1"] table.search-results thead th,
[data-bs-theme="dark"] table.search-results thead th {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border-bottom: 2px solid #475569 !important;
}

:root[data-glpi-theme-dark="1"] table.search-results tbody tr:nth-of-type(odd),
[data-bs-theme="dark"] table.search-results tbody tr:nth-of-type(odd) {
    background-color: #181f2a !important;
}

:root[data-glpi-theme-dark="1"] table.search-results tbody tr:nth-of-type(even),
[data-bs-theme="dark"] table.search-results tbody tr:nth-of-type(even) {
    background-color: #1e2634 !important;
}

:root[data-glpi-theme-dark="1"] table.search-results tbody tr:hover,
:root[data-glpi-theme-dark="1"] table.search-results tbody tr:hover > td,
[data-bs-theme="dark"] table.search-results tbody tr:hover > td {
    background-color: #1e3a5f !important;
}

:root[data-glpi-theme-dark="1"] table.search-results td a,
[data-bs-theme="dark"] table.search-results td a {
    color: #60a5fa !important;
}

:root[data-glpi-theme-dark="1"] td a[href*="group.form.php"],
:root[data-glpi-theme-dark="1"] td a[href*="entity.form.php"],
[data-bs-theme="dark"] td a[href*="group.form.php"],
[data-bs-theme="dark"] td a[href*="entity.form.php"] {
    background-color: rgba(30, 58, 138, 0.4) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

/* ==========================================================================
   5. Avatars, Badges & Checkboxes
   ========================================================================== */

/* Compact initials avatar bubble */
.avatar,
.user-avatar,
td .avatar,
.avatar-xs {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    line-height: 22px !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
    margin-right: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
}

/* Phone numbers & dates compact nowrap */
td.phone,
td.cell-phone {
    white-space: nowrap !important;
}

/* Checkbox alignment */
.table th:first-child,
.table td:first-child,
.table .form-check-input {
    vertical-align: middle !important;
    margin: 0 !important;
}

/* ==========================================================================
   6. Status Icons (Activé / Inactif - Snipe-IT Style)
   ========================================================================== */

.status-badge-active {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    color: #16a34a !important; /* Green Check */
    font-size: 1.15rem !important;
    font-weight: 800 !important;
}

.status-badge-active i {
    font-size: 1.2rem !important;
    stroke-width: 3 !important;
}

.status-badge-inactive {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    color: #dc2626 !important; /* Red Cross */
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    opacity: 0.85 !important;
}

.status-badge-inactive i {
    font-size: 1.1rem !important;
    stroke-width: 3 !important;
}
