:root {
    --background: #111315;
    --sidebar: #191c20;
    --panel: #1c2024;
    --border: #30353b;
    --red: #d62828;
    --red-light: #ff4545;
    --text: #f0f1f2;
    --muted: #929ba4;
    --green: #35c879;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.sidebar {
    position: fixed;
    width: 245px;
    height: 100vh;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
}

.tower-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
    border: 2px solid var(--red);
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 34px;
}

.side-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 5px;
    margin-bottom: 38px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 13px 15px;
    border-radius: 7px;
    font-size: 14px;
    transition: 0.2s;
}

nav a:hover,
nav a.active {
    background: #342124;
    color: white;
    border-left: 3px solid var(--red);
}

.sidebar-footer {
    margin-top: auto;
    text-align: center;
    color: #646d75;
    font-size: 10px;
    letter-spacing: 2px;
}

main {
    margin-left: 245px;
    padding: 30px 38px;
    min-height: 100vh;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 65px;
    height: 48px;
    border: 2px solid var(--red);
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: var(--red-light);
    font-weight: 900;
    letter-spacing: 2px;
}

.brand h1 {
    margin: 0;
    font-size: 21px;
}

.brand p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.header-status {
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    margin-right: 7px;
}

.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 35px 0 25px;
}

.welcome h2 {
    margin: 0;
    font-size: 25px;
}

.welcome p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.date {
    color: var(--muted);
    font-size: 12px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.card,
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 9px;
}

.card {
    padding: 22px;
    min-height: 130px;
}

.card-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1.3px;
}

.card-value {
    margin-top: 15px;
    font-size: 25px;
    font-weight: bold;
}

.online {
    color: var(--green);
}

.offline {
    color: var(--red-light);
}

.card-note {
    color: var(--muted);
    font-size: 11px;
    margin-top: 8px;
}

.panel {
    margin-top: 25px;
    min-height: 300px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 23px;
    border-bottom: 1px solid var(--border);
}

.panel-heading h3 {
    margin: 0;
    font-size: 16px;
}

.live-label {
    color: var(--green);
    font-size: 10px;
    letter-spacing: 1px;
}

.empty-state {
    text-align: center;
    padding: 45px 20px;
}

.empty-icon {
    font-size: 35px;
}

.empty-state h3 {
    margin: 15px 0 7px;
}

.empty-state p {
    color: var(--muted);
    font-size: 13px;
}

.button {
    display: inline-block;
    margin-top: 15px;
    padding: 11px 18px;
    background: var(--red);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 12px;
}

.button:hover {
    background: var(--red-light);
}

footer {
    margin-top: 35px;
    color: #626a72;
    font-size: 10px;
    letter-spacing: 1px;
    text-align: center;
}

footer span {
    color: var(--red);
    margin: 0 7px;
}

@media (max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .sidebar-footer {
        display: none;
    }

    nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    main {
        margin-left: 0;
        padding: 22px;
    }

    header {
        align-items: flex-start;
        gap: 15px;
        flex-direction: column;
    }

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

    .welcome {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 12px;
}

th {
    text-align: left;
    padding: 15px;
    background: #252a30;
    color: #e5e7eb;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--border);
    color: #cbd0d5;
}

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

tbody tr:last-child td {
    border-bottom: none;
}

/* Live FreeDMR monitor tables */
.live-monitor-content {
    padding: 15px;
    overflow-x: auto;
}

.live-monitor-content fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 12px;
}

.live-monitor-content legend {
    color: var(--red-light);
    font-weight: bold;
    padding: 0 8px;
}

.live-monitor-content table.lnksys,
.live-monitor-content table.stctg {
    width: 100%;
    min-width: 650px;
    table-layout: auto;
    border-collapse: collapse;
    margin: 8px 0 18px;
    background: var(--panel);
    color: var(--text);
}

.live-monitor-content table.lnksys th,
.live-monitor-content table.stctg th {
    background: #303840;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 7px;
    font-size: 10px;
}

.live-monitor-content table.lnksys td,
.live-monitor-content table.stctg td {
    background: #20252a;
    color: #d5d9de;
    border: 1px solid var(--border);
    padding: 9px 7px;
    font-size: 12px;
}

.live-monitor-content .connted-bkgnd,
.live-monitor-content .peer-conn {
    background: #244b36 !important;
    color: #9af0b8 !important;
}

.live-monitor-content .peer-disc {
    background: #642f2a !important;
    color: #ffaaa0 !important;
}

.live-monitor-content .location {
    color: #e0ad70;
    font-weight: bold;
}

.live-monitor-content .ts1-bkgnd {
    background: #303840 !important;
}

.live-monitor-content a {
    color: #70aaff;
}

.live-monitor-content .tooltip .tooltiptext {
    background: #303840;
    color: white;
    border: 1px solid var(--border);
    padding: 8px;
}

/* FreeDMR hotspot hover tooltips */
.live-monitor-content .tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    opacity: 1;
}

.live-monitor-content .tooltip .tooltiptext {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    width: 280px;
    left: 100%;
    top: -10px;
    background: #303840;
    color: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.6);
    padding: 10px;
    text-align: left;
    white-space: normal;
    transition: opacity 0.15s ease;
}

.live-monitor-content .tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

