* {
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
}

body {
    margin: 0;
    background: #f5f7fa;
    color: #1f2937;
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.topbar {
    align-items: center;
    background: #111827;
    color: #fff;
    display: flex;
    gap: 24px;
    min-height: 64px;
    padding: 0 28px;
}

.brand {
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.nav {
    display: flex;
    flex: 1;
    gap: 8px;
}

.nav a,
.logout {
    border-radius: 6px;
    color: #e5e7eb;
    padding: 9px 12px;
    text-decoration: none;
}

.nav a:hover,
.nav a.active,
.logout:hover {
    background: #374151;
    color: #fff;
}

.account {
    align-items: center;
    display: flex;
    gap: 12px;
    white-space: nowrap;
}

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

.panel,
.login-card {
    background: #fff;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.panel {
    padding: 28px;
}

h1 {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 12px;
}

p {
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
}

.alert {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    margin-bottom: 18px;
    padding: 12px;
}

.login-page {
    background: #eef2f7;
}

.login-shell {
    align-items: center;
    display: flex;
    min-height: 100vh;
    justify-content: center;
    padding: 24px;
}

.login-card {
    display: grid;
    gap: 16px;
    max-width: 420px;
    padding: 28px;
    width: 100%;
}

label {
    color: #374151;
    display: grid;
    font-weight: 700;
    gap: 7px;
}

input {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
    padding: 11px 12px;
    -webkit-user-select: text;
    user-select: text;
}

select {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
    padding: 11px 12px;
    -webkit-user-select: text;
    user-select: text;
}

button {
    background: #2563eb;
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 12px 16px;
}

button:hover {
    background: #1d4ed8;
}

.notice {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    color: #166534;
    margin-bottom: 18px;
    padding: 12px;
}

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

.section-heading h1 {
    margin: 0;
}

.user-create {
    align-items: end;
    border-bottom: 1px solid #e5e7eb;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr 180px auto;
    margin-bottom: 24px;
    padding-bottom: 24px;
}

.table-wrap {
    overflow-x: auto;
}

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

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

th {
    color: #4b5563;
    font-size: 13px;
    text-transform: uppercase;
}

.inline-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.inline-form input {
    min-width: 160px;
}

.danger {
    background: #dc2626;
}

.danger:hover {
    background: #b91c1c;
}

.muted {
    color: #6b7280;
    font-size: 14px;
}

.feed-window {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #3730a3;
    font-size: 14px;
    font-weight: 700;
    padding: 7px 11px;
    white-space: nowrap;
}

.spam-filter-summary {
    display: grid;
    font-size: 13px;
    gap: 6px;
    line-height: 1.45;
}

.spam-summary-row,
.spam-summary-active {
    overflow-wrap: anywhere;
}

.spam-summary-label {
    color: #475569;
    font-weight: 800;
}

.spam-filter-summary button.spam-shortcut,
.spam-filter-summary button.spam-clear-filter {
    background: transparent !important;
    border: 0;
    border-radius: 0;
    color: #1d4ed8 !important;
    cursor: pointer;
    display: inline;
    font: inherit;
    font-weight: 600;
    padding: 0;
    text-align: left;
}

.spam-filter-summary button.spam-shortcut:hover,
.spam-filter-summary button.spam-shortcut.active,
.spam-filter-summary button.spam-clear-filter:hover {
    background: transparent !important;
    color: #0f172a !important;
    text-decoration: underline;
}

.spam-filter-summary button.spam-clear-filter {
    margin-left: 10px;
}

.spam-feed {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.spam-record {
    background: #fff;
    border: 1px solid #d9e2ef;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    padding: 18px;
}

.spam-record-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.spam-actor {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.spam-avatar {
    align-items: center;
    background: #111827;
    border-radius: 8px;
    color: #fff;
    display: flex;
    flex: 0 0 42px;
    font-size: 14px;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    letter-spacing: 0;
    width: 42px;
}

.spam-actor-text {
    min-width: 0;
}

.spam-identity {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}

.spam-userline {
    color: #64748b;
    font-size: 13px;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.spam-record time {
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
}

.spam-flow {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.spam-destination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.spam-direction {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.target-chip,
.reason-chip {
    border-radius: 999px;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 7px 10px;
}

.target-chip.channel {
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    color: #155e75;
}

.target-chip.person {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.reason-chip {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.reason-chip::before {
    content: "Razon: ";
    color: #7c2d12;
    font-weight: 800;
}

.spam-message-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 14px;
    padding: 12px;
}

.spam-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.spam-message {
    color: #1f2937;
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    overflow-wrap: anywhere;
}

.spam-meta {
    background: #f9fafb;
    border: 1px solid #edf2f7;
    border-radius: 6px;
    display: grid;
    gap: 10px 14px;
    grid-template-columns: 130px 1fr;
    margin: 0;
    padding: 12px;
}

.spam-meta dt {
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.spam-meta dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.feed-status {
    color: #6b7280;
    padding: 16px 0;
    text-align: center;
}

.feed-sentinel {
    height: 1px;
}

.seen-page {
    display: grid;
    gap: 16px;
}

.seen-float-menu {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #d8dee8;
    border-radius: 6px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 6px;
    padding: 8px 10px;
    position: sticky;
    top: 8px;
    z-index: 30;
}

.seen-float-id {
    color: #111827;
    font-size: 11px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.seen-float-stats,
.seen-float-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.seen-float-stats span {
    color: #475569;
    font-size: 11px;
}

.seen-float-links a {
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.seen-float-links a:hover {
    text-decoration: underline;
}

.seen-hero {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.seen-hero h1,
.seen-section h2,
.seen-card h3 {
    margin: 0;
}

.seen-kicker {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.seen-pill {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #3730a3;
    font-weight: 800;
    padding: 7px 11px;
}

.seen-section {
    display: grid;
    gap: 14px;
}

.seen-summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.seen-summary div,
.seen-card,
.seen-ip-list div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
}

.seen-summary span,
.seen-card dt {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.seen-summary strong,
.seen-card dd,
.seen-ip-list p {
    overflow-wrap: anywhere;
}

.seen-note {
    font-size: 14px;
}

.seen-card-list,
.seen-ip-list {
    display: grid;
    gap: 12px;
}

.seen-card dl {
    display: grid;
    gap: 7px 12px;
    grid-template-columns: 130px 1fr;
    margin: 12px 0 0;
}

.seen-card dd {
    margin: 0;
}

.seen-ip-list p {
    margin-top: 5px;
}

#capture-blocked-overlay {
    align-items: center;
    background: #000;
    color: #fff;
    display: none;
    font-size: 24px;
    font-weight: 800;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    text-align: center;
    z-index: 99999;
}

#capture-blocked-overlay.visible {
    display: flex;
}

@media print {
    body > * {
        display: none !important;
    }

    body::before {
        align-items: center;
        background: #000;
        color: #fff;
        content: "screenshot no permitido. Admin avisado";
        display: flex;
        font-size: 24px;
        font-weight: 800;
        height: 100vh;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .nav {
        flex-wrap: wrap;
    }

    .account {
        justify-content: space-between;
        white-space: normal;
    }

    .user-create {
        grid-template-columns: 1fr;
    }

    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .spam-record-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .spam-meta {
        grid-template-columns: 1fr;
    }

    .spam-flow {
        align-items: flex-start;
        flex-direction: column;
    }

    .seen-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .seen-page.content {
        padding: 10px;
    }

    .seen-page .panel {
        border-radius: 6px;
        padding: 12px;
    }

    .seen-float-menu {
        gap: 4px;
        padding: 7px 8px;
        top: 4px;
    }

    .seen-float-stats {
        display: grid;
        gap: 2px;
    }

    .seen-float-links {
        gap: 4px 8px;
    }

    .seen-hero h1 {
        font-size: 22px;
    }

    .seen-kicker,
    .seen-pill {
        font-size: 11px;
    }

    .seen-section {
        gap: 10px;
    }

    .seen-section h2 {
        font-size: 18px;
    }

    .seen-summary {
        gap: 6px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seen-summary div,
    .seen-card,
    .seen-ip-list div {
        padding: 8px;
    }

    .seen-summary span,
    .seen-card dt {
        font-size: 10px;
    }

    .seen-summary strong,
    .seen-card dd,
    .seen-ip-list p {
        font-size: 12px;
    }

    .seen-card-list,
    .seen-ip-list {
        gap: 8px;
    }

    .seen-card h3 {
        font-size: 14px;
    }

    .seen-card dl {
        gap: 4px;
        grid-template-columns: 1fr;
        margin-top: 8px;
    }
}
