* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
    margin: 0;
    color: white;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Inter', 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;

    background:
        radial-gradient(circle at top left, rgba(0,255,170,0.15), transparent 30%),
        radial-gradient(circle at bottom right, rgba(0,255,120,0.12), transparent 30%),
        linear-gradient(135deg, #07131f, #0a1f1c, #07131f);

    background-attachment: fixed;
}

/* SIDEBAR */

.sidebar {
    width: 260px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(15px);
    padding: 24px 16px;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 28px;
    color: #6fffcf;
}

.menu-title {
    margin: 16px 0 8px;
    font-size: 12px;
    letter-spacing: 1.2px;
    color: #9aa;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 8px;
}

.sidebar ul li a {
    text-decoration: none;
    color: white;
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.45s ease, color 0.45s ease, transform 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease;
    will-change: transform, background-color, color, box-shadow, border-color;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: rgba(24,194,156,0.18);
    color: #6fffcf;
    border-color: rgba(111,255,207,0.26);
    box-shadow: 0 8px 18px rgba(24,194,156,0.14);
    transform: translateX(2px);
}
.sidebar {
    width: 260px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(15px);
    padding: 30px 20px;
    border-right: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 25px rgba(0,255,170,0.08);
}
.sidebar ul li a i {
    width: 20px;
    margin-right: 8px;
    font-size: 13px;
}
/* MAIN CONTENT */

.main {
    flex: 1;
    padding: 24px;
    width: 100%;
    max-width: none;
}

/* HEADER */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.search-bar input {
    width: 350px;
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.06);
    color: white;
}

.top-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.top-buttons a.top-btn,
.top-buttons button {
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(24,194,156,0.16);
    color: #d5fff2;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(111,255,207,0.2);
    min-width: 40px;
    height: 38px;
    font-size: 12px;
    font-weight: 500;
}

.top-buttons a.top-btn:hover,
.top-buttons button:hover {
    opacity: 1;
    background: rgba(24,194,156,0.25);
    border-color: rgba(111,255,207,0.34);
    transform: translateY(-2px);
}

.top-buttons a.top-btn i,
.top-buttons button i {
    font-size: 13px;
}
/* HERO */

.hero {
    background: rgba(255,255,255,0.06);
    padding: 40px;
    border-radius: 25px;
    margin-bottom: 30px;
    backdrop-filter: blur(15px);

    border: 1px solid rgba(255,255,255,0.08);

    box-shadow:
        0 0 30px rgba(0,255,170,0.06),
        inset 0 0 20px rgba(255,255,255,0.02);
}
.hero h1 {
    font-size: 40px;
    margin-bottom: 15px;
}

.hero p {
    color: #ccc;
    margin-bottom: 20px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-buttons button {
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: #18c29c;
    color: white;
}

/* STATUS CARDS */

.cards {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: rgba(255,255,255,0.06);
    padding: 25px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.card h3 {
    margin-bottom: 10px;
    color: #aaa;
}

.card p {
    font-size: 28px;
    font-weight: bold;
}
.card {
    background: rgba(255,255,255,0.06);
    padding: 25px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 0 20px rgba(0,255,170,0.05);
}
/* CONTENT SECTION */

.content-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
    width: 100%;
    max-width: none;
}

.content-section.full-width {
    grid-template-columns: 1fr;
}

.page-section {
    margin-top: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table-wrap.scroll {
    max-height: 480px;
    overflow-y: auto;
}

.table-wrap.scroll table {
    min-width: 760px;
}

.table-wrap.scroll th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(10, 20, 30, 0.95);
}

.chart-wrap {
    position: relative;
    height: 320px;
    max-height: 340px;
}

.history-card {
    max-height: 420px;
    overflow-y: auto;
}

.muted-small {
    opacity: 0.7;
    font-size: 12px;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

.graph-box,
.activity-box {
    background: rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 25px;
    min-height: 300px;
    width: 100%;
}
/* Embedded Flask iframe container */
.flask-container {
    width: 100%;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.15);
}

.flask-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
/* CONNECTION MAP */
.connection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 25px;
}

.connection-card {
    background: rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 0 18px rgba(0,255,170,0.04);
}

.connection-card h3 {
    margin-bottom: 8px;
    color: #18c29c;
}

.connection-list {
    margin: 0;
    padding-left: 18px;
    color: #e8f2f8;
}

.connection-list li {
    margin-bottom: 8px;
}

.connection-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #a7d8ff;
    font-weight: 600;
    text-align: center;
}

.score-circle {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 10px auto 12px;
    font-size: 28px;
    font-weight: 700;
    border: 3px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
}

.score-label {
    text-align: center;
    color: #dbe9f4;
    margin-bottom: 8px;
}

.score-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
    margin-top: 12px;
}

.score-fill {
    height: 100%;
    width: var(--score-width, 0%);
    background: linear-gradient(90deg, #18c29c, #2ec5ff);
    border-radius: 999px;
}

.connection-visual {
    display: grid;
    grid-template-columns: 1fr 90px 1.1fr 90px 1fr;
    gap: 18px;
    align-items: center;
    margin: 24px 0;
}

.node-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 22px;
    padding: 24px;
    min-height: 320px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    backdrop-filter: blur(12px);
}

.node-icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    background: rgba(255,255,255,0.12);
    margin-bottom: 16px;
}

.node-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.node-subtitle {
    opacity: 0.75;
    margin-bottom: 18px;
}

.big-score {
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
    margin: 16px 0 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.info-row span {
    opacity: 0.75;
}

.info-row strong {
    text-align: right;
}

.connection-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.arrow-line {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.45);
    position: relative;
}

.arrow-line.to-center::after {
    content: "";
    position: absolute;
    right: -2px;
    top: -6px;
    border-left: 12px solid rgba(255,255,255,0.65);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.arrow-line.from-right::before {
    content: "";
    position: absolute;
    left: -2px;
    top: -6px;
    border-right: 12px solid rgba(255,255,255,0.65);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.badge {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.badge.safe { background: rgba(52,211,153,.18); color: #34d399; }
.badge.suspicious { background: rgba(251,191,36,.18); color: #fbbf24; }
.badge.high { background: rgba(251,146,60,.18); color: #fb923c; }
.badge.danger { background: rgba(248,113,113,.18); color: #f87171; }

.score-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 22px 0;
}

.score-mini-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 18px;
}

.match-box,
.telegram-ready-box,
.evidence-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 20px;
    margin-top: 18px;
}

.evidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 1100px) {
    .connection-visual {
        grid-template-columns: 1fr;
    }

    .connection-arrow {
        transform: rotate(90deg);
        min-height: 55px;
    }

    .score-strip,
    .evidence-grid {
        grid-template-columns: 1fr;
    }
}

.risk-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.risk-safe { background: rgba(24,194,156,0.18); color: #8dffdf; }
.risk-suspicious { background: rgba(255,200,87,0.18); color: #ffe8a2; }
.risk-high { background: rgba(255,120,86,0.18); color: #ffbfad; }
.risk-danger { background: rgba(255,81,81,0.18); color: #ffb3b3; }

.match-box {
    background: rgba(24,194,156,0.08);
    border: 1px solid rgba(24,194,156,0.2);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.evidence-table th,
.evidence-table td {
    font-size: 13px;
}

/* ALERT STYLING */
/* UI fix only: restore Community dark theme after post function fix */
/* Community layout rewrite only: card feed design while keeping post feature */
.alert-item {
    background: rgba(18, 42, 37, 0.88);
    padding: 15px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    border-left: 4px solid #18c29c;
    color: #eefcf6;
}

.community-alert {
    background: linear-gradient(90deg, rgba(18, 194, 156, 0.17), rgba(18, 194, 156, 0.08));
    border: 1px solid rgba(20, 216, 166, 0.24);
    border-left: 4px solid #14d8a6;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    color: #eefcf6;
}

.community-alert-warning {
    background: linear-gradient(90deg, rgba(255, 200, 87, 0.12), rgba(255, 200, 87, 0.06));
    border-left-color: #fbbf24;
}

.card:hover,
.hero:hover,
.graph-box:hover,
.activity-box:hover {
    transform: translateY(-4px);
    transition: 0.3s ease;
}
.setup-input label {
    display: block;
    margin-bottom: 10px;
    color: #ccc;
}

.community-page {
    width: 100%;
}

.community-header {
    margin-bottom: 22px;
}

.community-header h1 {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 6px;
}

.community-header p {
    color: #a9c7bf;
    font-size: 14px;
}

.community-layout {
    display: grid;
    grid-template-columns: 0.38fr 0.62fr;
    gap: 22px;
    align-items: start;
}

.community-panel {
    background: rgba(10, 18, 19, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 0 22px rgba(0, 255, 170, 0.06);
}

.community-create-panel {
    position: sticky;
    top: 24px;
}

.community-panel-header h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.community-panel-header p {
    color: #9fb7ae;
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.community-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.community-field label {
    display: block;
    margin-bottom: 8px;
    color: #b7c9c5;
    font-size: 13px;
}

.community-form input,
.community-form select,
.community-form textarea,
.community-comment-input {
    width: 100%;
    background: #102724;
    color: #fff;
    border: 1px solid rgba(120, 255, 210, 0.18);
    border-radius: 14px;
    padding: 12px 14px;
    outline: none;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
}

.community-form input::placeholder,
.community-form textarea::placeholder,
.community-comment-input::placeholder {
    color: #7d948f;
}

.community-form input:focus,
.community-form select:focus,
.community-form textarea:focus,
.community-comment-input:focus {
    border-color: #14d8a6;
    box-shadow: 0 0 0 3px rgba(20, 216, 166, 0.12);
}

.community-form textarea {
    min-height: 150px;
    resize: vertical;
}

.community-submit,
.community-comment-btn {
    width: fit-content;
    padding: 12px 22px;
    font-weight: 700;
}

.community-feed-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.community-feed-header {
    margin-bottom: 4px;
}

.community-post-card {
    background: rgba(18, 40, 36, 0.95);
    border: 1px solid rgba(120, 255, 210, 0.14);
    border-left: 4px solid #14d8a6;
    border-radius: 22px;
    padding: 22px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.community-post-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.community-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    color: #dfeee9;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.community-pill-type {
    background: rgba(20, 216, 166, 0.12);
    color: #9cf8df;
}

.community-risk-safe { background: rgba(20, 216, 166, 0.12); color: #9cf8df; }
.community-risk-warning { background: rgba(251, 191, 36, 0.12); color: #ffd97a; }
.community-risk-danger { background: rgba(248, 113, 113, 0.12); color: #ffb8b8; }
.community-risk-neutral { background: rgba(255, 255, 255, 0.06); color: #dfeee9; }

.community-post-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #f6fbfa;
}

.community-post-content {
    color: #eef7f2;
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 14px;
}

.community-post-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #9fb7ae;
    font-size: 12px;
    margin-bottom: 14px;
}

.community-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.community-comment-item {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 12px 13px;
}

.community-comment-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #9fb7ae;
    font-size: 12px;
    margin-bottom: 6px;
}

.community-comment-item p {
    color: #eef7f2;
    font-size: 14px;
    line-height: 1.5;
}

.community-comment-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.community-empty {
    color: #b7c9c5;
    padding: 14px 0;
}

.community-page input,
.community-page select,
.community-page textarea {
    background: #102724 !important;
    color: #fff !important;
    border: 1px solid rgba(120, 255, 210, 0.18) !important;
}

@media (max-width: 980px) {
    .community-layout {
        grid-template-columns: 1fr;
    }

    .community-create-panel {
        position: static;
    }

    .community-comment-form {
        flex-direction: column;
        align-items: stretch;
    }

    .community-submit,
    .community-comment-btn {
        width: 100%;
    }
}

.setup-btn:hover {
    opacity: 0.8;
}

.graph-box canvas {
    width: 100% !important;
    max-width: 100% !important;
}
.alert-table {
    width: 100%;
    border-collapse: collapse;
}

.alert-table th,
.alert-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.alert-table th {
    color: #18c29c;
}

.danger {
    color: #ff5f5f;
    font-weight: bold;
}

.warning {
    color: #ffc857;
    font-weight: bold;
}

.safe {
    color: #6fffcf;
    font-weight: bold;
}
.login-body {

    justify-content: center;
    align-items: center;
}

.login-container {

    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {

    width: 420px;

    background: rgba(255,255,255,0.06);

    border: 1px solid rgba(255,255,255,0.08);

    backdrop-filter: blur(15px);

    border-radius: 25px;

    padding: 40px;

    text-align: center;

    box-shadow:
        0 0 30px rgba(0,255,170,0.08);
}

.login-logo {

    font-size: 60px;

    margin-bottom: 20px;

    color: #18c29c;
}

.login-card h1 {

    margin-bottom: 10px;
}

.login-card p {

    color: #bbb;

    margin-bottom: 30px;
}

.login-btn {

    width: 100%;
}

.telegram-btn {

    width: 100%;

    padding: 14px;

    border: none;

    border-radius: 12px;

    background: #229ED9;

    color: white;

    cursor: pointer;

    font-size: 15px;

    transition: 0.3s;
}

.telegram-btn:hover {

    opacity: 0.8;
}