:root {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --border: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --font-sans: system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px
}

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

.brand {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px
}

.brand span {
    color: var(--accent);
    background: rgba(59, 130, 246, .1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 25px
}

.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

.side-stack {
    display: flex;
    flex-direction: column;
    gap: 20px
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, .10);
    gap: 10px;
}

.card-title {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px
}

.card-body {
    padding: 15px;
    flex: 1
}

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main)
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px
}

.stat-icon {
    font-size: 24px;
    opacity: .55
}

.db-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800
}

.table-responsive {
    overflow: auto;
    max-height: 680px
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap
}

th {
    text-align: left;
    padding: 10px 15px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 8px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: top;
}

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

tr:hover td {
    background: rgba(255, 255, 255, .03)
}

.mono {
    font-family: var(--font-mono);
    font-size: 12px
}

.text-right {
    text-align: right
}

.w-full {
    width: 100%
}

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

.row {
    display: flex;
    gap: 8px;
    align-items: center
}

.label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 12px
}

.btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn:hover {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, .05)
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white
}

.btn.primary:hover {
    opacity: .92
}

.btn.danger {
    color: var(--danger);
    border-color: rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .10);
}

.btn.danger:hover {
    background: rgba(239, 68, 68, .18)
}

.btn.xs {
    padding: 2px 10px;
    font-size: 11px;
    height: 26px;
    border-radius: 7px
}

input {
    background: rgba(0, 0, 0, .20);
    border: 1px solid var(--border);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    transition: border .2s;
    font-family: var(--font-mono);
    font-size: 13px;
}

input:focus {
    border-color: var(--accent)
}

.badge {
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
}

.badge.ok {
    background: rgba(16, 185, 129, .12);
    color: var(--success)
}

.badge.err {
    background: rgba(239, 68, 68, .12);
    color: var(--danger)
}

.badge.warn {
    background: rgba(245, 158, 11, .14);
    color: var(--warning)
}

.dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    display: inline-block
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .25);
    color: var(--danger);
}

.login-box {
    max-width: 420px;
    margin: 90px auto
}

.muted {
    color: var(--text-muted)
}

.host {
    color: #fff
}

.url {
    color: var(--text-muted);
    font-size: 11px;
    max-width: 620px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ip {
    color: var(--accent)
}

.mini {
    font-size: 11px
}

.empty {
    text-align: center;
    padding: 28px;
    color: var(--text-muted)
}

@media (max-width: 980px) {
    .main-grid {
        grid-template-columns: 1fr
    }

    .url {
        max-width: 100%
    }
}

@media (max-width: 520px) {
    .app-container {
        padding: 12px
    }

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

    .row {
        flex-direction: column;
        align-items: stretch
    }

    .btn {
        width: 100%
    }
}