* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #15181b;
    color: #d9dde1;
    font-family: Verdana, Arial, sans-serif;
    font-size: 12px;
}

body {
    padding: 18px;
}

#dashboard {
    max-width: 1180px;
    margin: 0 auto;
    background: #202428;
    border: 1px solid #41474d;
    box-shadow: 0 0 18px rgba(0, 0, 0, .55);
}

.topbar {
    height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #2a659a;
    color: #fff;
    border-bottom: 1px solid #0e1114;
}

.title {
    font-size: 18px;
    font-weight: bold;
}

.instance {
    margin-left: 12px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 3px;
    font-family: monospace;
    font-weight: bold;
}

#clock {
    font-family: monospace;
    font-size: 15px;
}

.layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 10px;
    padding: 10px;
}

.panel {
    background: #1b1e21;
    border: 1px solid #454b51;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .35);
}

.panel-title {
    padding: 7px 9px;
    background: #2a659a;
    color: white;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: .4px;
}

.status-content {
    padding: 10px;
}

.status-block {
    text-align: center;
    padding-bottom: 10px;
}

.status-label {
    color: #9099a1;
    font-size: 10px;
    text-transform: uppercase;
}

.status-big {
    margin-top: 3px;
    color: #fff;
    font-family: monospace;
    font-size: 22px;
    font-weight: bold;
}

.status-row {
    min-height: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dotted #343a40;
}

.status-row span {
    color: #9da5ac;
}

.status-row strong {
    color: #eef1f3;
    font-family: monospace;
    text-align: right;
}

.separator {
    height: 10px;
}

.activity-column {
    min-width: 0;
}

.local-panel {
    margin-top: 10px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-family: "Courier New", monospace;
    font-size: 12px;
}

thead {
    background: #292e33;
}

th {
    padding: 6px 7px;
    text-align: left;
    color: #aeb7bf;
    border-bottom: 1px solid #4b535a;
    white-space: nowrap;
}

td {
    padding: 5px 7px;
    border-bottom: 1px solid #30353a;
    white-space: nowrap;
}

tbody tr:nth-child(even) {
    background: #1e2226;
}

tbody tr:hover {
    background: #292f34;
}

.empty {
    padding: 15px;
    text-align: center;
    color: #78818a;
}

.mode {
    font-weight: bold;
}

.mode-DMR {
    color: #72b7ff;
}

.mode-DSTAR {
    color: #ff9d65;
}

.source-Net {
    color: #8fd18f;
}

.source-LNet {
    color: #e5c76b;
}

.state-online,
.state-listening {
    color: #75d475 !important;
}

.state-rx {
    color: #68b9ff !important;
}

.state-tx {
    color: #ff7979 !important;
}

.state-offline,
.state-stale {
    color: #ff7979 !important;
}

footer {
    min-height: 30px;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #171a1d;
    border-top: 1px solid #41474d;
    color: #7f8992;
    font-size: 10px;
}

@media (max-width: 760px) {
    body {
        padding: 4px;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .status-panel {
        width: 100%;
    }

    .status-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0 14px;
    }

    .status-block {
        grid-column: 1 / -1;
    }

    .separator {
        display: none;
    }
}

/* Actions dashboard */
.dashboard-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.dashboard-button {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #4f7596;
    border-radius: 3px;
    background: #263d51;
    color: #dce9f4;
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    cursor: default;
}

.dashboard-button:hover {
    background: #2d4b64;
}

.gateway-secondary {
    margin-top: 10px;
}


/*
 * Gateway activity:
 * 7 lignes visibles, 20 conservées, défilement indépendant.
 */
.gateway-scroll {
    max-height: 220px;
    overflow-y: auto;
}

.gateway-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #292e33;
}

/* Dashboard identification / date / time */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: monospace;
    font-size: 14px;
}

.dashboard-name {
    font-family: Verdana, Arial, sans-serif;
    font-weight: bold;
}

#date,
#clock {
    white-space: nowrap;
}

footer strong {
    color: #aab2b9;
    font-weight: normal;
}

/*
 * ON4WX 2026-10-02:
 * Dashboard central multi-instance.
 */
.topbar-left {
    display: flex;
    align-items: center;
}

.instance-selector {
    display: inline-block;
    margin-left: 12px;
}

.instance-select {
    padding: 4px 24px 4px 8px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 3px;
    background: #245886;
    color: #fff;
    font-family: monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.instance-select:focus {
    outline: 1px solid rgba(255, 255, 255, .75);
}

.dashboard-actions a.dashboard-button {
    display: block;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 760px) {
    .topbar-left {
        min-width: 0;
    }

    .instance-selector {
        margin-left: 8px;
    }
}

/*
 * ON4WX 2026-10-02:
 * DVSwitch Client volontairement desactive.
 */
.dashboard-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.dashboard-button:disabled:hover {
    background: #263d51;
}
