:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-soft: #1f2937;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --online: #10b981;
    --offline: #ef4444;
    --unknown: #f59e0b;
}

* {
    box-sizing: border-box;
}

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

a {
    color: #60a5fa;
}

.container {
    width: min(1200px, 92vw);
    margin: 2rem auto;
}

.page-header h1 {
    margin-bottom: 0.3rem;
}

.page-header p {
    margin-top: 0;
    color: var(--muted);
}

.tool-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tool-card,
.detail-card {
    background: var(--panel);
    border: 1px solid #243041;
    border-radius: 14px;
    padding: 1rem;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.tool-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.status {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}

.status.online {
    background: color-mix(in srgb, var(--online) 25%, transparent);
    color: #6ee7b7;
}

.status.offline {
    background: color-mix(in srgb, var(--offline) 25%, transparent);
    color: #fca5a5;
}

.status.unknown {
    background: color-mix(in srgb, var(--unknown) 25%, transparent);
    color: #fcd34d;
}

dl {
    margin: 1rem 0;
}

dt {
    color: var(--muted);
    font-size: 0.85rem;
}

dd {
    margin: 0 0 0.7rem;
    word-break: break-word;
}

.card-actions {
    display: flex;
    gap: 0.6rem;
}

.btn {
    text-decoration: none;
    background: #2563eb;
    color: white;
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
}

.btn.secondary {
    background: var(--panel-soft);
}

.error {
    color: #fca5a5;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem 1.2rem;
}

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

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

.history-table th,
.history-table td {
    border-bottom: 1px solid #243041;
    text-align: left;
    padding: 0.55rem;
    vertical-align: top;
}
