* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f6fb;
    color: #172033;
}

.topbar {
    background: linear-gradient(135deg, #172033, #243b67);
    color: #ffffff;
    padding: 32px 18px;
}

.topbar h1 {
    margin: 0;
    font-size: 30px;
}

.topbar p {
    margin: 8px 0 0;
    opacity: 0.9;
}

.container {
    width: min(1100px, 94%);
    margin: 24px auto;
}

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 14px 35px rgba(25, 42, 70, 0.08);
}

.card h2 {
    margin-top: 0;
}

textarea {
    width: 100%;
    min-height: 230px;
    padding: 16px;
    border: 1px solid #d6dce8;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
}

button {
    margin-top: 14px;
    border: 0;
    border-radius: 12px;
    background: #243b67;
    color: #ffffff;
    padding: 13px 20px;
    font-size: 15px;
    cursor: pointer;
}

button:hover {
    background: #172033;
}

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

.metric {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 14px 35px rgba(25, 42, 70, 0.08);
}

.metric span {
    display: block;
    color: #667085;
    font-size: 13px;
    margin-bottom: 8px;
}

.metric strong {
    font-size: 26px;
}

.alert {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
}

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

th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
}

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

    .topbar h1 {
        font-size: 24px;
    }
}

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

    .card {
        padding: 16px;
    }
}

.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #172033, #31466f);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell {
    width: min(420px, 92%);
}

.login-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
}

.login-card h1 {
    margin: 0;
    font-size: 30px;
}

.login-card p {
    margin: 8px 0 22px;
    color: #667085;
}

.login-card label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 700;
    font-size: 14px;
}

.login-card input {
    width: 100%;
    border: 1px solid #d6dce8;
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 15px;
}

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

.topnav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.topnav a,
.button-link {
    display: inline-block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

.button-link {
    background: #243b67;
    color: #ffffff;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

@media (max-width: 720px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.danger-btn {
    background: #b91c1c;
    padding: 8px 12px;
    font-size: 13px;
}

.danger-btn:hover {
    background: #7f1d1d;
}

canvas {
    width: 100%;
    max-height: 360px;
}

.soft-body {
    background: #f6f8fb;
    color: #182230;
}

.soft-topbar {
    background: linear-gradient(135deg, #dbeafe, #eef2ff);
    color: #1e293b;
    border-bottom: 1px solid #dbe3ef;
}

.soft-topbar p {
    color: #475569;
}

.soft-topbar .topnav a {
    background: #ffffff;
    color: #1e3a8a;
    border: 1px solid #dbe3ef;
}

.soft-card,
.soft-metric {
    border: 1px solid #e4eaf3;
    box-shadow: 0 12px 28px rgba(30, 41, 59, 0.06);
}

.large-textarea {
    min-height: 320px;
    background: #fbfdff;
}

.result-area {
    min-height: 420px;
}

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

.suspect-line {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.suspect-line p {
    line-height: 1.7;
}

.suspect-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.suspect-head span {
    color: #64748b;
    font-size: 13px;
}

.suspect-line ul {
    margin: 8px 0 0;
    padding-left: 20px;
    color: #475569;
}

.risk-low {
    border-left: 6px solid #86efac;
}

.risk-medium {
    border-left: 6px solid #facc15;
}

.risk-high {
    border-left: 6px solid #f87171;
}

@media (max-width: 640px) {
    .suspect-head {
        flex-direction: column;
    }

    .large-textarea {
        min-height: 260px;
    }
}

input[type="text"],
input[type="file"] {
    width: 100%;
    border: 1px solid #d6dce8;
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 15px;
    background: #fbfdff;
    margin-bottom: 14px;
}

label {
    display: block;
    font-weight: 700;
    margin: 12px 0 6px;
}

.smart-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.smart-nav a {
    text-decoration: none;
    background: #ffffff;
    color: #1e3a8a;
    border: 1px solid #dbeafe;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.08);
}

.smart-nav a:hover {
    background: #eff6ff;
    transform: translateY(-1px);
}

.smart-nav .logout-link {
    color: #991b1b;
    border-color: #fecaca;
    background: #fff5f5;
}

.soft-body,
body {
    background:
        radial-gradient(circle at top left, rgba(219, 234, 254, 0.65), transparent 34%),
        linear-gradient(180deg, #f8fafc, #eef4fb);
}

.card,
.metric {
    border: 1px solid #e5edf8;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

button,
.button-link {
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.22);
}

button:hover,
.button-link:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
}

input[type="file"] {
    cursor: pointer;
    background: #ffffff;
    border: 1px dashed #93c5fd;
}

.upload-hint {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    padding: 12px 14px;
    border-radius: 16px;
    margin: 12px 0;
    font-size: 14px;
}

@media (max-width: 780px) {
    .smart-nav {
        justify-content: flex-start;
    }

    .smart-nav a {
        width: 100%;
        text-align: center;
    }
}

.action-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.small-action {
    display: inline-block;
    text-decoration: none;
    background: #eef2ff;
    color: #1e3a8a;
    border: 1px solid #c7d2fe;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}
