
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --background: #f4f7fb;
    --white: #ffffff;
    --text: #172033;
    --muted: #718096;
    --border: #e3e9f2;
}

body {
    font-family: Arial, sans-serif;
    background: var(--background);
    color: var(--text);
}

.sidebar {
    position: fixed;
    width: 255px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 45px;
}

.brand-icon {
    width: 43px;
    height: 43px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 23px;
    font-weight: bold;
}

.brand h2 {
    font-size: 19px;
}

.brand span {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.nav-link {
    padding: 14px;
    text-decoration: none;
    color: #536174;
    border-radius: 9px;
    font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
    background: #edf3ff;
    color: var(--primary);
}

.sidebar-bottom {
    margin-top: auto;
    font-size: 12px;
    color: var(--muted);
    padding: 12px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #16a34a;
    border-radius: 50%;
    margin-right: 6px;
}

.main-content {
    margin-left: 255px;
    padding: 35px 45px;
    max-width: 1500px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.topbar h1 {
    font-size: 25px;
    margin-bottom: 7px;
}

.topbar p,
.section-heading p {
    color: var(--muted);
    font-size: 13px;
}

.system-status {
    font-size: 12px;
    background: white;
    padding: 11px 15px;
    border: 1px solid var(--border);
    border-radius: 20px;
}

.welcome {
    background: linear-gradient(115deg, #e9f1ff, #f5f8ff);
    border: 1px solid #dce8ff;
    border-radius: 15px;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eyebrow {
    color: var(--primary);
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1.5px;
}

.welcome h2 {
    font-size: 24px;
    margin: 12px 0;
}

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

.welcome-icon {
    font-size: 55px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 22px 0 40px;
}

.stat-card,
.scanner-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 23px;
}

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

.stat-card h2 {
    margin: 12px 0 6px;
    font-size: 23px;
}

.stat-card small {
    color: #16a34a;
    font-size: 11px;
}

.scanner-section {
    margin-bottom: 25px;
    scroll-margin-top: 25px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-heading h2 {
    margin: 8px 0;
    font-size: 20px;
}

.section-icon {
    background: #edf3ff;
    color: var(--primary);
    padding: 15px;
    border-radius: 12px;
    font-size: 23px;
}

.scanner-form {
    display: flex;
    flex-direction: column;
}

.scanner-form label {
    font-size: 13px;
    font-weight: bold;
    margin: 13px 0 8px;
}

.scanner-form input,
.scanner-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 13px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    background: #fbfcfe;
}

.scanner-form input:focus,
.scanner-form textarea:focus {
    border-color: var(--primary);
    background: white;
}

.scanner-form textarea {
    resize: vertical;
}

.scanner-form button {
    margin-top: 18px;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.scanner-form button:hover {
    background: var(--primary-dark);
}

.scanner-form button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.result {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfe;
    overflow-wrap: anywhere;
}

.hidden {
    display: none;
}

.result h3 {
    margin-bottom: 12px;
}

.result p {
    margin: 9px 0;
    font-size: 13px;
}

.result ul {
    padding-left: 20px;
    margin-top: 10px;
}

.result li {
    margin: 8px 0;
    font-size: 13px;
}

.result.positive {
    border-left: 4px solid #16a34a;
}

.result.warning {
    border-left: 4px solid #e59b19;
}

.result.danger {
    border-left: 4px solid #dc2626;
}

.result.neutral {
    border-left: 4px solid #64748b;
}

.result pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 12px;
    margin-top: 12px;
}

footer {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    padding: 30px 0;
}

@media (max-width: 850px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-bottom {
        margin-top: 15px;
    }

    .main-content {
        margin-left: 0;
        padding: 22px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

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

    .welcome h2 {
        font-size: 19px;
    }

    .welcome-icon {
        font-size: 35px;
    }
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: white;
}

.history-table th,
.history-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
}

.history-table th {
    background: #f5f8fc;
    color: #536174;
}

.history-table tr:hover {
    background: #f8faff;
}

#refresh-history {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--primary);
    cursor: pointer;
}

#refresh-history:hover {
    background: #edf3ff;
}

@media (max-width: 700px) {
    #history-container {
        overflow-x: auto;
    }

    .history-table {
        min-width: 650px;
    }
}
