* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f8fafc;
    color: #0f172a;
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

.topbar {
    background: #7f1d1d;
    color: white;
    padding: 14px 0;
    margin-bottom: 18px;
    box-shadow: 0 10px 24px rgba(127, 29, 29, 0.2);
}

.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    font-size: 18px;
    margin: 0;
    letter-spacing: 0.2px;
}

nav a {
    color: #fecaca;
    text-decoration: none;
    margin-left: 16px;
}

nav a:hover {
    color: #ffffff;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
    border: none;
}

.hero .eyebrow,
.hero .subtext,
.hero h2,
.hero-chip {
    color: #ffffff !important;
}

.hero h2 {
    margin: 4px 0 8px;
    font-size: 24px;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1.2px;
    color: #ffffff;
}

.subtext {
    margin: 0;
    color: #ffffff;
}

.hero-chip {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff !important;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.metric-card {
    border-top: 4px solid #b91c1c;
}

.metric-card h3 {
    margin-bottom: 4px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
}

.metric-value {
    margin: 2px 0 0;
    font-size: 26px;
    font-weight: 700;
    color: #111827;
}

.metric-caption {
    margin: 4px 0 0;
    font-size: 11px;
    color: #6b7280;
}

.filters {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 4px;
}

input,
select,
button {
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
}

button {
    background: #b91c1c;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background: #991b1b;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: #111827;
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody tr:nth-child(even) {
    background: #fcfcfd;
}

tbody tr:hover {
    background: #fff7f7;
}

.action-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.action-inline {
    display: grid;
    grid-template-columns: 0.8fr 0.8fr 1.3fr auto;
    gap: 4px;
}

.action-form input,
.action-form select {
    padding: 6px 8px;
    font-size: 12px;
}

.status {
    font-size: 12px;
    border-radius: 12px;
    padding: 4px 9px;
    display: inline-block;
    font-weight: 600;
}

.status.open {
    background: #fee2e2;
    color: #991b1b;
}

.status.monitor {
    background: #fef3c7;
    color: #92400e;
}

.status.blocked {
    background: #ddd6fe;
    color: #5b21b6;
}

.status.closed {
    background: #dcfce7;
    color: #166534;
}

.grid-2 {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

.muted {
    color: #64748b;
    font-size: 13px;
}

.trend-grid {
    display: grid;
    grid-template-columns: 1.3fr 1.1fr;
    gap: 16px;
}

.severity-bar {
    display: flex;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: #f3f4f6;
    margin-top: 6px;
}

.severity-segment {
    height: 100%;
}

.severity-segment.high {
    background: #fecaca;
}

.severity-segment.medium {
    background: #fde68a;
}

.severity-segment.low {
    background: #bbf7d0;
}

.legend {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fraud-type-list {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.fraud-type-list li {
    display: grid;
    grid-template-columns: 0.9fr 1.6fr auto;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 4px;
}

.fraud-label {
    color: #111827;
}

.fraud-bar-wrap {
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
    height: 8px;
}

.fraud-bar {
    height: 100%;
    background: #fecaca;
}

.fraud-count {
    color: #6b7280;
    font-size: 11px;
}

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

    .summary-grid,
    .filters,
    .grid-2,
    .trend-grid {
        grid-template-columns: 1fr;
    }

    .action-inline {
        grid-template-columns: 1fr;
    }
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.pill-high {
    background: #fee2e2;
    color: #b91c1c;
}

.pill-medium {
    background: #fef3c7;
    color: #b45309;
}

.pill-low {
    background: #ecfdf3;
    color: #15803d;
}
