html,
body {
    height: 100%;
}

body {
    margin: 0;
    padding: 20px;
    background: #f4f4f4;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

main {
    max-width: 90%;
    margin: 0 auto;
    width: 100%;
    flex: 1 0 auto;
}

.public-footer,
.admin-footer,
footer {
    margin-top: auto;
}

.card {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

h1,
h2,
h3 {
    margin-top: 0;
    color: #222;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

table th {
    background: #f0f0f0;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    background: #222;
    color: #fff;
    border: 0;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

.alert {
    padding: 12px;
    background: #e7f3ff;
    border: 1px solid #b8dcff;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert.danger {
    background: #ffe7e7;
    border: 1px solid #ffb8b8;
    color: #990000;
}

footer {
    text-align: center;
    padding: 20px 0;
}

footer a {
    color: #222;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.refresh-text {
    font-size: 12px;
    color: #777;
    margin-top: 15px;
}

td.status-online,
table td.status-online {
    color: #00aa00 !important;
    font-weight: bold !important;
}

td.status-offline,
table td.status-offline {
    color: #ff0000 !important;
    font-weight: bold !important;
}

td.status-unknown,
table td.status-unknown {
    color: #777777 !important;
    font-weight: bold !important;
}

.admin-dashboard {
    max-width: 1300px;
}

.dashboard-hero {
    background: linear-gradient(135deg, #202020, #444444);
    color: #ffffff;
    padding: 30px;
    border-radius: 14px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}

.dashboard-hero h1 {
    color: #ffffff;
    margin-bottom: 8px;
}

.dashboard-hero p {
    margin: 0;
    color: #dddddd;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-actions a {
    background: #ffffff;
    color: #222222;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

.dashboard-actions .danger-link {
    background: #cc0000;
    color: #ffffff;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: #ffffff;
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.stat-card span {
    display: block;
    color: #666666;
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-card strong {
    font-size: 32px;
}

@media (max-width: 800px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.admin-footer {
    background: linear-gradient(135deg, #202020, #444444);
    color: #ffffff;
    padding: 14px 22px;
    margin-top: 30px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    box-shadow: 0 -4px 14px rgba(0,0,0,0.12);
}

.admin-footer strong {
    color: #ffffff;
}

.admin-footer-left {
    flex: 1;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-footer-centre {
    flex: 1;
    text-align: center;
    font-weight: bold;
}

.admin-footer-right {
    flex: 1;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.admin-footer-centre {
    text-align: center;
    font-weight: bold;
}

.admin-footer-right {
    text-align: right;
}

@media (max-width: 700px) {
    .admin-footer {
        flex-direction: column;
        text-align: center;
    }

    .admin-footer-left,
    .admin-footer-centre,
    .admin-footer-right {
        text-align: center;
    }
}
.log-viewer {
    background: #111111;
    color: #dddddd;
    padding: 15px;
    border-radius: 10px;
    max-height: 600px;
    overflow-y: auto;
    font-family: Consolas, monospace;
    font-size: 13px;
}

.log-line {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: pre-wrap;
    word-break: break-word;
}

.listen-icons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.listen-icons a {
    background: #222222;
    color: #ffffff;
    padding: 6px 9px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

.listen-icons a:hover {
    opacity: 0.85;
}

.public-footer {
    background: linear-gradient(135deg, #202020, #444444);
    color: #ffffff;
    padding: 14px 22px;
    margin-top: 30px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    box-shadow: 0 -4px 14px rgba(0,0,0,0.12);
}

.public-footer strong {
    color: #ffffff;
}

.public-footer-left {
    flex: 1;
    text-align: left;
}

.public-footer-right {
    flex: 1;
    text-align: right;
}

.public-footer-right a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}

.public-footer-right a:hover {
    text-decoration: underline;
}

.admin-login-page {
    max-width: 520px;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-hero {
    background: linear-gradient(135deg, #202020, #444444);
    color: #ffffff;
    padding: 30px;
    border-radius: 14px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}

.login-hero h1 {
    color: #ffffff;
    margin-bottom: 8px;
}

.login-hero p {
    margin: 0;
    color: #dddddd;
}

.login-card {
    background: #ffffff;
    padding: 26px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.login-card h2 {
    margin-top: 0;
    text-align: center;
}

.login-card button {
    width: 100%;
    margin-top: 5px;
}

.small-login-link {
    text-align: center;
    font-size: 13px;
}

.small-login-link a {
    color: #222222;
    font-weight: bold;
    text-decoration: none;
}

.small-login-link a:hover {
    text-decoration: underline;
}

table th,
table td {
    padding: 12px 16px;
}

.listen-icons {
    margin-left: 10px;
}

td.status-online,
td.status-offline,
td.status-unknown {
    padding-left: 24px !important;
}

.table-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-btn {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    color: #ffffff !important;
    transition: opacity 0.2s ease;
}

.table-btn:hover {
    opacity: 0.85;
}

.edit-btn {
    background: #1f6feb;
}

.delete-btn {
    background: #cc0000;
}

/* Logs page fixes */

.log-box,
.log-entry,
pre,
code {
    margin-left: 0 !important;
    padding-left: 12px !important;
    text-align: left !important;
}

.log-box *,
.log-entry * {
    text-indent: 0 !important;
    margin-left: 0 !important;
}

pre {
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.container,
.public-container {
    width: 90%;
    max-width: 90%;
    margin: 0 auto;
}