* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}
.page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    padding: 32px;
}
.brand-wrap {
    text-align: center;
    margin-bottom: 40px;
    object-fit: contain;
    
}
.brand-logo {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-height: 150px;
    object-fit: center;
}
.logo-missing {
    background: #eef2ff;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    padding: 18px;
    color: #334155;
}
h1, h2 {
    margin-top: 0;
}
.subtitle {
    color: #64748b;
    margin-bottom: 22px;
}
.small-gap {
    margin-bottom: 0;
}
.helper-text,
.small-note {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-top: 14px;
}
.login-form {
    display: grid;
    gap: 10px;
}
.login-form label {
    font-weight: 600;
    margin-top: 6px;
}
.login-form input,
.chat-form input {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
}
.login-form button,
.logout-btn,
.secondary-btn,
.chat-form button {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.secondary-btn {
    background: #475569;
}
.chat-form button:disabled {
    opacity: 0.65;
    cursor: wait;
}
.login-form button {
    margin-top: 20px;
}
.alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.alert.success {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #86efac;
}
.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.dashboard-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}
.topbar {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 56px;
    margin-bottom: 22px;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.topbar-logo {
    width: 300px;
    height: 100px;
    object-fit: contain;
}
.topbar p {
    margin: 4px 0 0;
    color: #64748b;
}
.panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    padding: 22px;
    margin-bottom: 22px;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 14px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.stat-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    padding: 20px;
}
.stat-card strong {
    display: block;
    font-size: 28px;
    margin-top: 6px;
}
.stat-label {
    color: #64748b;
    font-size: 14px;
}
.examples-box {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.examples-box ul {
    margin: 10px 0 0 18px;
    padding: 0;
}
.chat-box {
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    border-radius: 14px;
    min-height: 240px;
    max-height: 460px;
    overflow-y: auto;
    padding: 14px;
    margin-bottom: 14px;
}
.chat-message {
    margin-bottom: 14px;
}
.chat-role {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}
.chat-bubble {
    border-radius: 14px;
    padding: 12px 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}
.chat-message.user .chat-bubble {
    background: #dbeafe;
}
.chat-message.assistant .chat-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
.chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    font-size: 14px;
}
th {
    background: #f8fafc;
    position: sticky;
    top: 0;
}
.mono {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
}
code {
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 6px;
}
@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .topbar-brand {
        align-items: flex-start;
    }
    .topbar-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .chat-form {
        grid-template-columns: 1fr;
    }
}


.left-note {
    text-align: left;
}
.demo-users-box {
    margin-top: 20px;
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 14px;
    padding: 14px 16px;
}
.user-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.user-chip {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 700;
}
.small-strong {
    font-size: 16px !important;
    line-height: 1.35;
}
.chart-panel.hidden {
    display: none;
}
.chart-wrap {
    height: 380px;
    position: relative;
}
.state-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}
.state-running,
.state-up {
    background: #dcfce7;
    color: #166534;
}
.state-attention {
    background: #fef3c7;
    color: #92400e;
}
.state-stopped,
.state-down {
    background: #fee2e2;
    color: #991b1b;
}
.state-unknown {
    background: #e2e8f0;
    color: #334155;
}
@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .topbar-brand {
        flex-direction: column;
        align-items: flex-start;
    }
    .topbar-logo {
        width: 220px;
        height: auto;
    }
}
