body {
    font-family: Arial, sans-serif;
    margin: 0px;
    padding: 0;
    box-sizing: border-box;
}

.login-body {
    margin: 40px;
}

.login-wrap {
    max-width: 320px;
}

.login-wrap input {
    width: 100%;
    padding: 8px;
    margin: 6px 0 14px 0;
    box-sizing: border-box;
}

.login-wrap button {
    padding: 8px 14px;
    cursor: pointer;
}

.login-error {
    margin-bottom: 14px;
    color: #d32f2f;
    font-weight: 600;
}

h1 {
    margin-bottom: 20px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.search-container {
    position: relative;
    display: inline-block;
}

.search-input {
    padding: 8px 30px 8px 10px;
    width: 360px;
    max-width: 90vw;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.clear-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    cursor: pointer;
    color: grey;
}

.reset-btn,
.logout-btn {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f7f7f7;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.reset-btn:hover,
.logout-btn:hover {
    background: #eee;
}

.count {
    font-size: 14px;
    color: #555;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

th {
    background-color: #f4f4f4;
}

/* lignes alternées pour les clients */
tbody tr.client-row:nth-child(4n+1) td,
tbody tr.client-row:nth-child(4n+2) td {
    background-color: #ffffff;
}

tbody tr.client-row:nth-child(4n+3) td,
tbody tr.client-row:nth-child(4n+4) td {
    background-color: #f7f7f7;
}

a {
    text-decoration: none;
}

.port-link {
    color: #1a73e8;
    font-weight: 500;
}

.port-link:visited {
    color: #1a73e8;
}

.port-link:hover {
    text-decoration: underline;
}

.sort-arrows,
.active-arrow,
.sort-header {
    text-decoration: none;
    color: inherit;
    margin-left: 5px;
    font-size: 12px;
}

.client-row td {
    background: #fff;
}

.client-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-btn {
    min-width: 28px;
    width: 28px;
    height: 28px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #f7f7f7;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
}

.toggle-btn:hover {
    background: #eee;
}

.toggle-btn.disabled {
    opacity: 0.45;
    cursor: default;
}

.client-name {
    font-weight: 600;
}

.device-name-link {
    color: #000;
    cursor: pointer;
    text-decoration: none;
}

.device-name-link:hover {
    text-decoration: underline;
}

.device-name-link.status-up {
    color: #1976d2 !important;
    font-weight: 600;
}

.device-name-link.status-down {
    color: #d32f2f !important;
    font-weight: 600;
}

.fai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    vertical-align: middle;
}

.fai-btn img {
    height: 18px;
    display: block;
}

.fai-result {
    margin-left: 8px;
    font-size: 12px;
    color: #444;
    vertical-align: middle;
}

.fai-result.ok {
    color: #1976d2;
    font-weight: 600;
}

.fai-result.err {
    color: #d32f2f;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #eef2f7;
    color: #334;
    border: 1px solid #d7dfe8;
}

.muted {
    color: #777;
}

.details-row {
    display: none;
}

.details-row.open {
    display: table-row;
}

.details-cell {
    background: #fbfbfb;
    padding: 0;
}

.submenu-wrap {
    padding: 10px 14px 14px 46px;
}

.device-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
}

.device-table th,
.device-table td {
    border: 1px solid #ddd;
    padding: 7px 8px;
    text-align: left;
}

.device-table th {
    background: #f0f3f6;
}

.device-table tbody tr:nth-child(even) {
    background-color: #f7f7f7;
}

.device-type {
    width: 84px;
    font-weight: 600;
}

.port-empty {
    color: #bbb;
}

.sdk-port {
    background-color: #c8f7c5;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.sdk-port.copied {
    background-color: #9fe89a;
}

.sdk-copy-value {
    display: inline-block;
    min-width: 48px;
}

.copy-feedback {
    margin-left: 8px;
    font-size: 12px;
    color: #2e7d32;
    font-weight: 700;
}

@media screen and (max-width: 768px) {
    table,
    th,
    td {
        font-size: 14px;
    }

    .search-input {
        width: 100%;
    }

    .submenu-wrap {
        padding-left: 12px;
        overflow-x: auto;
    }
}
