* { box-sizing: border-box; }

body {
    margin: 0;
    background: #0f172a;
    color: #e2e8f0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
}

a { color: #38bdf8; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    border-bottom: 1px solid #1e293b;
    background: rgba(15, 23, 42, 0.7);
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand { font-weight: 700; font-size: 1.1rem; color: #f8fafc; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
    padding: 6px 12px;
    border-radius: 6px;
    color: #cbd5e1;
    font-weight: 500;
}
.topbar nav a:hover { background: #1e293b; text-decoration: none; }
.topbar nav a.active { background: #f1f5f9; color: #0f172a; }
.hint { margin-left: auto; font-size: 0.75rem; color: #64748b; }

.content { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    border: 1px solid #1e293b;
    background: #111827;
    border-radius: 12px;
    padding: 16px;
}
.kpi-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; }
.kpi-value { font-size: 1.6rem; font-weight: 700; color: #f8fafc; margin: 4px 0; }
.kpi-sub { font-size: 0.75rem; color: #64748b; }

.panel {
    border: 1px solid #1e293b;
    background: #111827;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    overflow-x: auto;
}
.panel h2 { margin: 0 0 12px; font-size: 0.9rem; color: #cbd5e1; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filters input, .filters select {
    background: #111827;
    border: 1px solid #334155;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 0.85rem;
}
.filters button {
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 0.85rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th {
    text-align: left;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: #94a3b8;
    border-bottom: 1px solid #1e293b;
    padding: 8px 10px;
}
tbody td { padding: 8px 10px; border-bottom: 1px solid rgba(30, 41, 59, 0.6); color: #e2e8f0; }
tbody tr:hover { background: rgba(30, 41, 59, 0.4); }
tbody tr.row-link { cursor: pointer; }
td.muted, span.muted { color: #64748b; }
td.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.badge-green { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
.badge-gray { background: #1e293b; color: #94a3b8; border-color: #334155; }
.badge-red { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
.badge-amber { background: #451a03; color: #fcd34d; border-color: #78350f; }

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid #1e293b;
    font-size: 0.8rem;
    color: #94a3b8;
}
.pagination-links { display: flex; gap: 12px; }
.pagination-links .disabled { color: #475569; }

.error-banner {
    border: 1px solid #7f1d1d;
    background: rgba(69, 10, 10, 0.4);
    border-radius: 10px;
    padding: 14px 16px;
    color: #fecaca;
}
.error-title { margin: 0 0 4px; font-weight: 600; }
.error-message { margin: 0 0 6px; font-size: 0.85rem; color: #fca5a5; }
.error-hint { margin: 0; font-size: 0.78rem; color: #f87171; }

.empty-state { text-align: center; padding: 32px 0; color: #64748b; }

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.field-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.field-value { font-size: 0.9rem; color: #f1f5f9; margin-top: 2px; }

.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-title h1 { margin: 0; font-size: 1.3rem; }

.back-link { display: inline-block; margin-bottom: 16px; font-size: 0.85rem; }
