:root {
    --bg: #080a0f;
    --bg-soft: #0c0f15;
    --panel: rgba(17, 20, 28, .82);
    --panel-solid: #11141c;
    --panel-hover: #151923;
    --line: rgba(255, 255, 255, .075);
    --line-strong: rgba(255, 255, 255, .13);
    --text: #f4f6f8;
    --text-soft: #a2a9b5;
    --text-muted: #6f7785;
    --accent: #d8ff67;
    --accent-soft: rgba(216, 255, 103, .10);
    --danger: #ff7f87;
    --warning: #e6c76c;
    --success: #77dda1;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(
            circle at 15% -5%,
            rgba(216, 255, 103, .035),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            #090b10 0%,
            #07090d 100%
        );
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .18;
    background-image:
        linear-gradient(
            rgba(255,255,255,.018) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,.018) 1px,
            transparent 1px
        );
    background-size: 52px 52px;
    mask-image:
        linear-gradient(
            to bottom,
            rgba(0,0,0,.8),
            transparent 78%
        );
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(120px);
    opacity: .055;
}

.ambient-one {
    top: -250px;
    right: -160px;
    background: var(--accent);
}

.ambient-two {
    bottom: -300px;
    left: -240px;
    background: #5c72ff;
}

.page-enter {
    animation:
        pageReveal .55s
        cubic-bezier(.22,.8,.22,1)
        both;
}

@keyframes pageReveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background:
        rgba(8, 10, 15, .82);
    backdrop-filter:
        blur(20px)
        saturate(130%);
}

.identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.identity-mark,
.login-logo {
    display: grid;
    place-items: center;
    background:
        linear-gradient(
            145deg,
            #f0ffb1,
            var(--accent)
        );
    color: #10130a;
    font-weight: 900;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.14),
        0 12px 30px rgba(216,255,103,.10);
}

.identity-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 16px;
}

.identity-copy {
    line-height: 1.15;
}

.brand {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.subtitle {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.account {
    display: flex;
    align-items: center;
    gap: 13px;
}

.account-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.account-name {
    font-size: 13px;
    font-weight: 700;
}

.account-role {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.plan {
    padding: 6px 9px;
    border: 1px solid rgba(216,255,103,.20);
    border-radius: 7px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
}

.ghost-button,
.secondary {
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,.025);
    color: var(--text-soft);
}

.ghost-button {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition:
        color .2s ease,
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.ghost-button:hover {
    color: #fff;
    border-color: rgba(255,255,255,.18);
    background: rgba(255,255,255,.05);
    transform: translateY(-1px);
}

.app-shell {
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr);
    min-height: calc(100vh - 78px);
}

.sidebar {
    position: sticky;
    top: 78px;
    height: calc(100vh - 78px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px 14px 18px;
    border-right: 1px solid var(--line);
    background:
        rgba(9, 11, 16, .72);
    backdrop-filter: blur(14px);
}

.side-nav {
    display: grid;
    gap: 4px;
}

.nav-group-label {
    padding: 0 12px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .18em;
}

.admin-label {
    margin-top: 24px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    padding: 0 12px;
    border-radius: 9px;
    color: #858d9b;
    font-size: 13px;
    transition:
        color .22s ease,
        background .22s ease,
        transform .22s ease;
}

.nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    width: 2px;
    height: 0;
    border-radius: 999px;
    background: var(--accent);
    transition: height .22s ease;
}

.nav-link:hover {
    color: #dfe3e9;
    background: rgba(255,255,255,.028);
    transform: translateX(2px);
}

.nav-link.active {
    color: #f8fafc;
    background:
        linear-gradient(
            90deg,
            rgba(216,255,103,.075),
            rgba(255,255,255,.02)
        );
}

.nav-link.active::before {
    height: 21px;
}

.nav-icon {
    width: 25px;
    color: #58616f;
    font-family: ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: .06em;
}

.nav-link.active .nav-icon {
    color: var(--accent);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,.02);
}

.sidebar-footer strong,
.sidebar-footer span {
    display: block;
}

.sidebar-footer strong {
    font-size: 11px;
}

.sidebar-footer span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

.security-dot,
.live-dot,
.state-dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow:
        0 0 12px rgba(119,221,161,.55);
}

.content-shell {
    min-width: 0;
}

.content-inner {
    width: min(1420px, 100%);
    margin: 0 auto;
    padding: 48px 44px 90px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
}

.eyebrow,
.section-label,
.tiny-label {
    display: block;
    color: var(--accent);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .19em;
}

.page-header h1,
.page-head h1 {
    margin: 10px 0 9px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1;
    letter-spacing: -.045em;
}

.page-description,
.page-head p,
.muted {
    color: var(--text-soft);
}

.page-description {
    max-width: 620px;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
}

.live-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border: 1px solid rgba(119,221,161,.13);
    border-radius: 999px;
    color: #aab3bd;
    background: rgba(119,221,161,.045);
    font-size: 11px;
}

.live-dot {
    animation: pulseDot 2.3s ease-in-out infinite;
}

@keyframes pulseDot {
    0%,
    100% {
        opacity: .6;
        transform: scale(.85);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

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

.metric-card,
.premium-panel,
.card {
    border: 1px solid var(--line);
    background:
        linear-gradient(
            145deg,
            rgba(20,24,33,.88),
            rgba(13,16,23,.82)
        );
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.018),
        0 18px 45px rgba(0,0,0,.12);
    backdrop-filter: blur(14px);
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 150px;
    padding: 22px;
    border-radius: 14px;
    transition:
        transform .25s ease,
        border-color .25s ease,
        background .25s ease;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto -50px -70px auto;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: var(--accent);
    filter: blur(70px);
    opacity: 0;
    transition: opacity .3s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,.12);
}

.metric-card:hover::after {
    opacity: .045;
}

.metric-label,
.metric-caption {
    color: var(--text-muted);
    font-size: 10px;
}

.metric-label {
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.metric-value {
    margin-top: 22px;
    font-size: 26px;
    font-weight: 720;
    letter-spacing: -.035em;
}

.metric-muted {
    color: #626b78;
}

.metric-caption {
    margin-top: 8px;
}

.premium-panel,
.card {
    padding: 26px;
    border-radius: 15px;
}

.archive-panel {
    margin-bottom: 42px;
}

.panel-header,
.section-heading,
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.panel-header h2,
.section-heading h2 {
    margin: 8px 0 0;
    font-size: 20px;
    letter-spacing: -.025em;
}

.database-state {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 11px;
}

.state-dot.online {
    background: var(--success);
}

.state-dot.offline {
    background: var(--danger);
}

.archive-stats {
    display: grid;
    grid-template-columns:
        1.1fr 1fr 1fr;
    gap: 1px;
    margin-top: 25px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--line);
}

.archive-stat {
    padding: 18px;
    background: #0c0f15;
}

.archive-stat span,
.archive-stat strong {
    display: block;
}

.archive-stat span {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.archive-stat strong {
    margin-top: 9px;
    font-size: 13px;
    font-weight: 650;
}

.workspace-section {
    margin-top: 14px;
}

.tool-grid {
    display: grid;
    grid-template-columns:
        repeat(2,minmax(0,1fr));
    gap: 13px;
    margin-top: 18px;
}

.tool-card {
    position: relative;
    display: grid;
    grid-template-columns:
        38px minmax(0,1fr) 28px;
    align-items: start;
    gap: 17px;
    min-height: 155px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(18,22,30,.82),
            rgba(11,14,20,.74)
        );
    transition:
        transform .28s
        cubic-bezier(.22,.8,.22,1),
        border-color .28s ease,
        background .28s ease;
}

.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background:
        linear-gradient(
            120deg,
            transparent 20%,
            rgba(216,255,103,.025),
            transparent 80%
        );
    transform: translateX(-45%);
    transition:
        opacity .3s ease,
        transform .6s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(216,255,103,.16);
    background: var(--panel-hover);
}

.tool-card:hover::before {
    opacity: 1;
    transform: translateX(25%);
}

.tool-number {
    color: #4d5563;
    font-family: ui-monospace, monospace;
    font-size: 10px;
}

.tool-content {
    position: relative;
    z-index: 1;
}

.tool-content h3 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -.025em;
}

.tool-content p {
    max-width: 420px;
    margin: 11px 0 0;
    color: #7f8795;
    font-size: 12px;
    line-height: 1.65;
}

.tool-arrow {
    position: relative;
    z-index: 1;
    color: #59616e;
    font-size: 20px;
    transition:
        color .22s ease,
        transform .22s ease;
}

.tool-card:hover .tool-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

.card {
    margin-bottom: 17px;
}

.page-head {
    margin-bottom: 28px;
}

.form-grid {
    display: grid;
    grid-template-columns:
        repeat(3,minmax(0,1fr));
    gap: 15px;
}

.form-grid .wide {
    grid-column: 1 / -1;
}

label {
    display: block;
    color: #8d96a4;
    font-size: 11px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 8px;
    padding: 12px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    outline: none;
    color: #edf0f4;
    background: rgba(5,7,11,.72);
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(216,255,103,.28);
    background: #0b0e13;
    box-shadow:
        0 0 0 3px rgba(216,255,103,.035);
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    background: #eef3e2;
    color: #0d1009;
    font-weight: 760;
    font-size: 12px;
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow:
        0 9px 22px rgba(0,0,0,.18);
}

.secondary-link,
button.secondary {
    border-color: var(--line-strong);
    background: rgba(255,255,255,.025);
    color: #d7dbe1;
}

button.danger {
    background: rgba(255,127,135,.11);
    border-color: rgba(255,127,135,.18);
    color: #ff9ba2;
}

.form-actions {
    display: flex;
    align-items: end;
}

.inline-search {
    display: flex;
    gap: 10px;
}

.inline-search input {
    margin-top: 0;
}

.alert {
    margin-top: 16px;
    padding: 13px 14px;
    border-radius: 8px;
    font-size: 12px;
}

.alert.error {
    color: #ffb2b7;
    border: 1px solid rgba(255,127,135,.18);
    background: rgba(255,127,135,.065);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: #666f7c;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

td {
    color: #c8cdd5;
    font-size: 12px;
}

tbody tr {
    transition: background .18s ease;
}

tbody tr:hover {
    background: rgba(255,255,255,.018);
}

.message-cell {
    min-width: 360px;
    max-width: 720px;
    overflow-wrap: anywhere;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.empty {
    padding: 30px;
    color: #777f8c;
    text-align: center;
    font-size: 12px;
}

.timeline {
    display: grid;
    gap: 7px;
}

.timeline-row {
    display: grid;
    grid-template-columns:
        minmax(190px,.4fr)
        minmax(0,1fr);
    gap: 20px;
    padding: 12px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(6,8,12,.55);
    transition:
        border-color .2s ease,
        transform .2s ease;
}

.timeline-row:hover {
    border-color: var(--line);
    transform: translateX(2px);
}

.timeline-row span {
    color: #6d7582;
    font-size: 11px;
}

.timeline-row strong {
    font-size: 12px;
}

.review-grid {
    display: grid;
    grid-template-columns:
        repeat(2,minmax(0,1fr));
    gap: 13px;
}

.review-card {
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7,9,13,.46);
}

.review-top {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 14px;
}

.status {
    padding: 5px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: #aab1bc;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .06em;
}

.status.completed {
    color: #94e8b5;
    border-color: rgba(119,221,161,.22);
}

.status.cancelled {
    color: #ff9ca3;
    border-color: rgba(255,127,135,.22);
}

.status.claimed {
    color: #ecd785;
    border-color: rgba(230,199,108,.22);
}

.review-notes,
.result-box {
    margin-top: 14px;
    padding: 13px;
    border-radius: 8px;
    background: rgba(255,255,255,.025);
    white-space: pre-wrap;
}

.result-box {
    border: 1px solid rgba(119,221,161,.14);
}

.review-actions,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.review-actions form,
.table-actions form {
    margin: 0;
}

.complete-form {
    width: 100%;
}

.complete-form textarea {
    margin-bottom: 8px;
}

.small-text {
    margin-top: 12px;
    font-size: 10px;
}

.inline-admin {
    display: grid;
    grid-template-columns:
        minmax(120px,1fr)
        minmax(120px,1fr)
        auto;
    gap: 8px;
    margin-bottom: 8px;
}

.inline-admin select {
    margin: 0;
}

.upgrade-card {
    max-width: 630px;
    margin: 70px auto;
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    text-align: center;
}

.plan-current {
    margin: 22px 0;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255,255,255,.02);
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 36px;
}

.login-stage {
    width: min(1100px,100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        rgba(10,12,17,.77);
    box-shadow:
        0 45px 120px rgba(0,0,0,.45);
    backdrop-filter: blur(18px);
}

.login-brand-panel {
    position: relative;
    padding: 64px 58px;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(216,255,103,.07),
            transparent 33%
        ),
        linear-gradient(
            145deg,
            rgba(17,21,28,.96),
            rgba(8,10,14,.92)
        );
}

.login-brand-panel::after {
    content: "";
    position: absolute;
    right: -160px;
    bottom: -210px;
    width: 480px;
    height: 480px;
    border: 1px solid rgba(216,255,103,.065);
    border-radius: 50%;
    box-shadow:
        0 0 0 65px rgba(216,255,103,.018),
        0 0 0 130px rgba(216,255,103,.011);
}

.login-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 54px;
    border-radius: 14px;
    font-size: 21px;
}

.login-title {
    margin: 12px 0 14px;
    font-size: clamp(42px,6vw,70px);
    line-height: .94;
    letter-spacing: -.06em;
}

.login-intro {
    max-width: 530px;
    color: #8c95a2;
    font-size: 14px;
    line-height: 1.75;
}

.trust-list {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 22px;
    margin-top: 65px;
}

.trust-item {
    display: grid;
    grid-template-columns: 35px 1fr;
    gap: 12px;
}

.trust-index {
    color: #59616c;
    font-family: ui-monospace, monospace;
    font-size: 9px;
}

.trust-item strong,
.trust-item span {
    display: block;
}

.trust-item strong {
    margin-bottom: 5px;
    font-size: 12px;
}

.trust-item div span {
    max-width: 410px;
    color: #6f7784;
    font-size: 11px;
    line-height: 1.6;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 55px;
    border-left: 1px solid var(--line);
    background: rgba(7,9,13,.78);
}

.login-panel-inner {
    width: min(360px,100%);
}

.login-heading {
    margin-bottom: 30px;
}

.login-heading h2 {
    margin: 9px 0 8px;
    font-size: 27px;
    letter-spacing: -.035em;
}

.login-heading p {
    margin: 0;
    color: #747d89;
    font-size: 12px;
}

.login-form {
    display: grid;
    gap: 19px;
}

.login-form label span {
    display: block;
    margin-bottom: 7px;
}

.login-form input {
    margin: 0;
    min-height: 47px;
}

.login-button {
    min-height: 47px;
    margin-top: 4px;
    background:
        linear-gradient(
            135deg,
            #e8ffa0,
            var(--accent)
        );
}

.login-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    color: #5f6875;
    font-size: 10px;
}

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

    .sidebar {
        position: relative;
        top: auto;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .side-nav {
        grid-template-columns:
            repeat(3,minmax(0,1fr));
    }

    .nav-group-label,
    .sidebar-footer {
        display: none;
    }

    .metric-grid {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .login-stage {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        display: none;
    }

    .login-panel {
        min-height: 560px;
        border-left: 0;
    }
}

@media (max-width: 720px) {
    .topbar {
        height: auto;
        min-height: 70px;
        padding: 14px 16px;
    }

    .account-copy {
        display: none;
    }

    .content-inner {
        padding: 32px 17px 70px;
    }

    .page-header {
        flex-direction: column;
    }

    .metric-grid,
    .tool-grid,
    .form-grid,
    .review-grid,
    .archive-stats {
        grid-template-columns: 1fr;
    }

    .side-nav {
        display: flex;
        overflow-x: auto;
    }

    .sidebar {
        padding: 8px;
    }

    .nav-link {
        flex: 0 0 auto;
    }

    .inline-search {
        flex-direction: column;
    }

    .timeline-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .login-body {
        padding: 14px;
    }

    .login-stage {
        min-height: auto;
        border-radius: 16px;
    }

    .login-panel {
        padding: 34px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* =========================================
   PESTILENCE - USER ANALYSIS
   ========================================= */

.analysis-header {
    margin-bottom: 26px;
}

.analysis-header h1 {
    margin: 9px 0 8px;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1;
    letter-spacing: -.045em;
}


.analysis-search {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(17,20,28,.92),
            rgba(11,14,20,.82)
        );
}

.analysis-search-form {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: end;
    gap: 12px;
}

.analysis-input-wrap {
    min-width: 0;
}

.input-caption {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .15em;
}

.analysis-input-wrap input {
    min-height: 48px;
    margin: 0;
    padding: 0 15px;
    font-size: 14px;
}

.analysis-button {
    min-height: 48px;
    padding: 0 22px;
}


.subject-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255,255,255,.018);
}

.subject-label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .16em;
}

.subject-name {
    display: block;
    font-size: 16px;
    letter-spacing: -.02em;
}

.subject-status {
    padding: 6px 9px;
    border: 1px solid rgba(119,221,161,.18);
    border-radius: 999px;
    color: var(--success);
    background: rgba(119,221,161,.045);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
}


.analysis-metrics {
    display: grid;
    grid-template-columns:
        repeat(4,minmax(0,1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.analysis-metric {
    position: relative;
    min-height: 132px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background:
        linear-gradient(
            145deg,
            rgba(17,20,28,.88),
            rgba(10,13,18,.82)
        );
    transition:
        transform .22s ease,
        border-color .22s ease;
}

.analysis-metric:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
}

.analysis-metric-number {
    position: absolute;
    top: 15px;
    right: 16px;
    color: rgba(255,255,255,.15);
    font-family: ui-monospace, monospace;
    font-size: 9px;
}

.analysis-metric-label {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.analysis-metric-value {
    display: block;
    margin-top: 24px;
    font-size: 27px;
    line-height: 1;
    letter-spacing: -.04em;
}

.analysis-metric-date {
    display: block;
    margin-top: 22px;
    color: #d5dae1;
    font-family: ui-monospace, monospace;
    font-size: 11px;
    line-height: 1.55;
}


.analysis-layout {
    display: grid;
    grid-template-columns:
        minmax(0,1.55fr)
        minmax(310px,.65fr);
    gap: 14px;
    align-items: start;
}

.analysis-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.analysis-panel-head h2 {
    margin: 7px 0 0;
    font-size: 19px;
    letter-spacing: -.025em;
}

.record-count {
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: .08em;
}


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

.analysis-table th {
    padding: 11px 10px;
}

.analysis-table td {
    padding: 13px 10px;
}

.rank-cell {
    width: 42px;
    color: #505865;
    font-family: ui-monospace, monospace;
    font-size: 9px;
}

.channel-name {
    color: #e8ebef;
    font-size: 12px;
}

.message-count {
    display: inline-flex;
    min-width: 52px;
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255,255,255,.018);
    font-family: ui-monospace, monospace;
    font-size: 10px;
}

.date-cell {
    white-space: nowrap;
    color: #838c99;
    font-family: ui-monospace, monospace;
    font-size: 9px;
}


.history-panel {
    max-height: 670px;
    overflow: hidden;
}

.analysis-timeline {
    max-height: 570px;
    overflow-y: auto;
    padding-right: 6px;
}

.analysis-timeline::-webkit-scrollbar {
    width: 5px;
}

.analysis-timeline::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: rgba(255,255,255,.12);
}

.analysis-timeline-row {
    position: relative;
    display: grid;
    grid-template-columns: 12px minmax(0,1fr);
    column-gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.timeline-marker {
    width: 6px;
    height: 6px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow:
        0 0 12px rgba(216,255,103,.2);
}

.timeline-channel {
    color: #d8dce2;
    font-size: 12px;
    font-weight: 650;
}

.timeline-time {
    grid-column: 2;
    margin-top: 4px;
    color: #69717e;
    font-family: ui-monospace, monospace;
    font-size: 9px;
}


.analysis-empty {
    display: grid;
    gap: 7px;
    padding: 44px 20px;
    color: var(--text-muted);
    text-align: center;
}

.analysis-empty strong {
    color: var(--text);
    font-size: 16px;
}


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

    .analysis-metrics {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .history-panel {
        max-height: none;
    }
}

@media (max-width: 650px) {
    .analysis-search-form {
        grid-template-columns: 1fr;
    }

    .analysis-metrics {
        grid-template-columns: 1fr;
    }

    .analysis-button {
        width: 100%;
    }
}

/* Pestilence input cleanup */
.analysis-input-wrap input {
    background: #0b0e13 !important;
    color: #f3f5f7 !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    box-shadow: none !important;
}

.analysis-input-wrap input:focus {
    background: #0b0e13 !important;
    border-color: rgba(255,255,255,.22) !important;
    box-shadow:
        0 0 0 3px rgba(255,255,255,.025) !important;
}

.analysis-input-wrap input::selection {
    background: rgba(255,255,255,.14);
    color: #fff;
}

.analysis-input-wrap input:-webkit-autofill,
.analysis-input-wrap input:-webkit-autofill:hover,
.analysis-input-wrap input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f3f5f7 !important;
    -webkit-box-shadow:
        0 0 0 1000px #0b0e13 inset !important;
    transition:
        background-color 9999s ease-in-out 0s;
}

/* =========================================
   PESTILENCE GLOBAL FORM CLEANUP
   ========================================= */

input,
textarea,
select {
    background-color: #0b0e13 !important;
    color: #f3f5f7 !important;
    caret-color: #f3f5f7 !important;
    border-color: rgba(255,255,255,.10) !important;
    box-shadow: none !important;
}

input:focus,
textarea:focus,
select:focus {
    background-color: #0b0e13 !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.24) !important;
    box-shadow:
        0 0 0 3px rgba(255,255,255,.025) !important;
}

/* Chrome / Edge / Safari autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #f3f5f7 !important;

    -webkit-box-shadow:
        0 0 0 1000px #0b0e13 inset !important;

    box-shadow:
        0 0 0 1000px #0b0e13 inset !important;

    background-color: #0b0e13 !important;

    transition:
        background-color 999999s ease-in-out 0s !important;
}

/* Firefox autofill */
input:autofill,
textarea:autofill,
select:autofill {
    background: #0b0e13 !important;
    color: #f3f5f7 !important;
    box-shadow:
        0 0 0 1000px #0b0e13 inset !important;
}

/* Remove browser autofill highlight */
input::selection,
textarea::selection {
    background: rgba(255,255,255,.15);
    color: #fff;
}


/* ==========================================
   PESTILENCE PASSWORD SYSTEM
   ========================================== */

.password-setup-card {
    width: min(520px, calc(100% - 30px));
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        linear-gradient(
            145deg,
            rgba(18,22,29,.94),
            rgba(9,12,17,.94)
        );
    box-shadow:
        0 35px 100px rgba(0,0,0,.45);
}

.password-setup-card h1 {
    margin: 12px 0 10px;
    font-size: 34px;
    letter-spacing: -.04em;
}

.password-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.password-form input {
    min-height: 47px;
}

.password-main-button {
    width: 100%;
    min-height: 47px;
    margin-top: 8px;
}

.token-panel {
    max-width: 850px;
}

.token-warning {
    display: grid;
    gap: 6px;
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid rgba(230,199,108,.18);
    border-radius: 10px;
    background: rgba(230,199,108,.055);
}

.token-warning strong {
    color: #ead47f;
}

.token-warning span {
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.6;
}

.token-label {
    display: block;
    margin-bottom: 20px;
}

.token-copy-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 10px;
    margin-top: 8px;
}

.token-copy-row input {
    margin: 0;
    font-family: ui-monospace, monospace;
    font-size: 11px;
}

.copy-result {
    min-height: 24px;
    margin-bottom: 12px;
    color: var(--success);
    font-size: 11px;
}

@media (max-width: 650px) {
    .password-setup-card {
        padding: 28px 22px;
    }

    .token-copy-row {
        grid-template-columns: 1fr;
    }
}

/* Pestilence product workspace */

.case-create {
    display:grid;
    grid-template-columns:1fr 1.5fr auto;
    gap:10px;
    align-items:end;
}

.case-create input {
    margin:0;
    min-height:45px;
}

.case-grid,
.subject-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}

.case-card,
.subject-card {
    padding:20px;
    border:1px solid var(--line);
    border-radius:13px;
    background:rgba(15,18,25,.8);
    transition:
        transform .22s ease,
        border-color .22s ease;
}

.case-card:hover,
.subject-card:hover {
    transform:translateY(-3px);
    border-color:var(--line-strong);
}

.case-id {
    color:var(--text-muted);
    font:9px ui-monospace,monospace;
    letter-spacing:.1em;
}

.case-card h3 {
    margin:14px 0 8px;
}

.case-card p {
    color:var(--text-muted);
    font-size:12px;
    min-height:34px;
}

.case-meta {
    display:flex;
    justify-content:space-between;
    margin-top:20px;
    color:var(--text-muted);
    font-size:9px;
}

.subject-card strong,
.subject-card span {
    display:block;
}

.subject-card span {
    margin-top:7px;
    color:var(--text-muted);
    font-size:11px;
}

.profile-hero {
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:end;
    margin-bottom:28px;
}

.profile-hero h1 {
    margin:8px 0;
    font-size:44px;
    letter-spacing:-.045em;
}

.profile-actions {
    display:flex;
    gap:8px;
}

.profile-columns {
    display:grid;
    grid-template-columns:1.2fr .8fr;
    gap:14px;
}

.channel-row,
.history-line {
    display:flex;
    justify-content:space-between;
    gap:15px;
    padding:12px 0;
    border-bottom:1px solid var(--line);
}

.channel-row span,
.history-line span {
    color:var(--text-muted);
    font-size:10px;
}

.note-form textarea {
    min-height:110px;
}

.note-card {
    margin-top:10px;
    padding:13px;
    border:1px solid var(--line);
    border-radius:9px;
    background:rgba(255,255,255,.018);
}

.note-card p {
    margin:0 0 8px;
    white-space:pre-wrap;
    font-size:12px;
}

.note-card span {
    color:var(--text-muted);
    font-size:9px;
}

.history-card,
.notification-card {
    display:grid;
    grid-template-columns:180px 1fr 1fr;
    gap:16px;
    padding:14px 10px;
    border-bottom:1px solid var(--line);
    transition:background .2s ease;
}

.history-card:hover,
.notification-card:hover {
    background:rgba(255,255,255,.02);
}

.history-card span,
.history-card small,
.notification-card span {
    color:var(--text-muted);
    font-size:10px;
}

.notification-card {
    grid-template-columns:1fr auto;
}

.notification-card p {
    margin:5px 0 0;
    color:var(--text-muted);
    font-size:11px;
}

@media(max-width:850px) {
    .case-grid,
    .subject-grid,
    .profile-columns {
        grid-template-columns:1fr;
    }

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

    .profile-hero {
        align-items:flex-start;
        flex-direction:column;
    }

    .history-card {
        grid-template-columns:1fr;
    }
}

/* =========================================
   PESTILENCE HEADER / SIDEBAR FIX
   ========================================= */

.topbar {
    display: grid !important;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: center !important;
    gap: 20px !important;
}

.identity {
    min-width: 0;
}

.account {
    min-width: max-content;
    justify-self: end;
    flex-wrap: nowrap !important;
}

.app-shell {
    grid-template-columns: 235px minmax(0, 1fr) !important;
}

.sidebar {
    min-width: 235px;
    overflow: hidden;
}

.side-nav {
    min-width: 0;
}

.nav-link {
    width: 100%;
    min-width: 0;
}

.nav-link span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-shell {
    min-width: 0;
    overflow-x: hidden;
}

/* Medium screens */
@media (max-width: 1100px) {

    .topbar {
        grid-template-columns: 1fr auto !important;
        padding: 14px 18px !important;
    }

    .account-copy {
        display: none !important;
    }

    .app-shell {
        grid-template-columns: 205px minmax(0,1fr) !important;
    }

    .sidebar {
        min-width: 205px;
    }

    .nav-link {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Small screens */
@media (max-width: 760px) {

    .topbar {
        display: flex !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
    }

    .identity-copy .subtitle {
        display: none;
    }

    .app-shell {
        display: block !important;
    }

    .sidebar {
        position: relative !important;
        top: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        padding: 8px !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--line);
    }

    .side-nav {
        display: flex !important;
        gap: 5px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .nav-link {
        flex: 0 0 auto;
        width: auto;
        min-width: max-content;
    }

    .nav-group-label,
    .sidebar-footer {
        display: none !important;
    }
}


/* ========================================
   PESTILENCE ADMIN CLEAN LAYOUT
   ======================================== */

.admin-create-form {
    display: grid;
    grid-template-columns:
        minmax(240px, 1fr)
        minmax(210px, .55fr)
        auto;
    gap: 14px;
    align-items: end;
    margin-top: 22px;
}

.admin-create-form input,
.admin-create-form select {
    min-height: 45px;
    margin-top: 8px;
}

.admin-helper {
    margin: 16px 0 0;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.6;
}

.admin-user-name {
    color: #edf0f4;
}

.account-status,
.account-type {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
}

.account-status.active {
    color: var(--success);
    border-color: rgba(119,221,161,.18);
    background: rgba(119,221,161,.04);
}

.account-status.suspended {
    color: var(--danger);
    border-color: rgba(255,127,135,.18);
    background: rgba(255,127,135,.04);
}

.admin-type {
    color: var(--accent);
    border-color: rgba(216,255,103,.18);
    background: rgba(216,255,103,.04);
}

.admin-controls {
    min-width: 430px;
}

.admin-update-form {
    display: grid;
    grid-template-columns:
        minmax(130px,1fr)
        minmax(130px,1fr)
        auto;
    gap: 7px;
}

.admin-update-form select {
    margin: 0;
    min-height: 38px;
}

.admin-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 7px;
}

.admin-secondary-actions form {
    margin: 0;
}

.admin-secondary-actions button {
    min-height: 34px;
    padding: 7px 11px;
}

.admin-accounts-table td {
    vertical-align: middle;
}

@media (max-width: 900px) {

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

    .admin-controls {
        min-width: 330px;
    }

    .admin-update-form {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   PESTILENCE BROADCAST + DELETE CONTROLS
   ======================================== */

.broadcast-panel {
    border-color: rgba(216,255,103,.11);
}

.broadcast-form {
    display: grid;
    grid-template-columns:
        minmax(250px,1fr)
        minmax(180px,.4fr);
    gap: 15px;
    margin-top: 22px;
}

.broadcast-message {
    grid-column: 1 / -1;
}

.broadcast-form textarea {
    min-height: 115px;
}

.broadcast-form .form-actions {
    grid-column: 1 / -1;
}

.admin-delete-button {
    color: #ff9da4 !important;
    border: 1px solid rgba(255,127,135,.20) !important;
    background: rgba(255,127,135,.07) !important;
}

.admin-delete-button:hover {
    border-color: rgba(255,127,135,.38) !important;
    background: rgba(255,127,135,.12) !important;
}

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

    .broadcast-message,
    .broadcast-form .form-actions {
        grid-column: auto;
    }
}


/* ========================================
   PESTILENCE LIVE NOTIFICATIONS
   ======================================== */

.notification-nav {
    overflow: visible !important;
}

.notification-bell {
    position: relative;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    flex: 0 0 25px;
    color: #747d8b;
}

.notification-bell svg {
    width: 17px;
    height: 17px;
}

.notification-nav.active
.notification-bell {
    color: var(--accent);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;

    min-width: 17px;
    height: 17px;

    padding: 0 4px;

    border: 2px solid #0a0c11;
    border-radius: 999px;

    background: #ff5964;
    color: white;

    font-size: 8px;
    font-weight: 900;
    line-height: 13px;
    text-align: center;

    box-shadow:
        0 3px 12px
        rgba(255,89,100,.28);

    animation:
        notificationPop
        .32s
        cubic-bezier(.2,.9,.3,1.35);
}

@keyframes notificationPop {

    from {
        opacity: 0;
        transform: scale(.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* Toast stack */

.toast-stack {
    position: fixed;

    top: 94px;
    right: 24px;

    z-index: 9999;

    width:
        min(
            390px,
            calc(100vw - 32px)
        );

    display: grid;
    gap: 10px;

    pointer-events: none;
}


.pestilence-toast {
    position: relative;

    display: grid;

    grid-template-columns:
        38px
        minmax(0,1fr)
        26px;

    gap: 12px;

    padding: 17px;

    overflow: hidden;

    border:
        1px solid
        rgba(255,255,255,.10);

    border-radius: 13px;

    background:
        linear-gradient(
            145deg,
            rgba(20,23,31,.98),
            rgba(10,13,18,.98)
        );

    box-shadow:
        0 22px 65px
        rgba(0,0,0,.48);

    backdrop-filter:
        blur(22px)
        saturate(125%);

    opacity: 0;

    transform:
        translateX(30px)
        scale(.98);

    transition:
        opacity .3s ease,
        transform .3s
        cubic-bezier(.22,.8,.22,1);

    pointer-events: auto;
}


.pestilence-toast::before {
    content: "";

    position: absolute;

    left: 0;
    top: 0;
    bottom: 0;

    width: 2px;

    background: var(--accent);
}


.pestilence-toast.toast-visible {
    opacity: 1;

    transform:
        translateX(0)
        scale(1);
}


.toast-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border:
        1px solid
        rgba(216,255,103,.12);

    border-radius: 10px;

    color: var(--accent);

    background:
        rgba(216,255,103,.045);
}


.toast-icon svg {
    width: 18px;
    height: 18px;
}


.toast-content {
    min-width: 0;
}


.toast-label {
    display: block;

    margin-bottom: 5px;

    color: var(--accent);

    font-size: 8px;
    font-weight: 900;
    letter-spacing: .16em;
}


.toast-content strong {
    display: block;

    color: #f3f5f7;

    font-size: 13px;
}


.toast-content p {
    margin:
        6px 0 9px;

    color: #8e97a4;

    font-size: 11px;
    line-height: 1.55;

    overflow-wrap: anywhere;
}


.toast-content a {
    color: #d7dce3;

    font-size: 10px;
    font-weight: 700;
}


.toast-content a:hover {
    color: var(--accent);
}


.toast-close {
    width: 25px;
    height: 25px;

    min-height: 0;

    padding: 0;

    border: 0;

    background: transparent;

    color: #646d79;

    font-size: 20px;
    line-height: 1;

    box-shadow: none;
}


.toast-close:hover {
    color: white;

    background: transparent;

    box-shadow: none;

    transform: none;
}


/* Notification severity */

.toast-warning::before {
    background: #e8c962;
}

.toast-warning .toast-icon {
    color: #e8c962;
}

.toast-important::before {
    background: #ff7d85;
}

.toast-important .toast-icon {
    color: #ff8e95;
}

.toast-maintenance::before {
    background: #73a8ff;
}

.toast-maintenance .toast-icon {
    color: #86b4ff;
}


@media (max-width: 650px) {

    .toast-stack {
        top: 82px;
        right: 16px;
        left: 16px;

        width: auto;
    }
}

/* ========================================
   PESTILENCE PANEL SPACING CLEANUP
   ======================================== */

.content-inner > .premium-panel,
.content-inner > .card,
.content-inner > section.premium-panel {
    margin-bottom: 24px !important;
}

.content-inner > .premium-panel + .premium-panel,
.content-inner > .card + .card,
.content-inner > section.premium-panel + section.premium-panel {
    margin-top: 0 !important;
}

.broadcast-panel {
    margin-top: 0 !important;
    margin-bottom: 24px !important;
}

.admin-create-form {
    margin-bottom: 4px;
}

.premium-panel {
    border-color: rgba(255,255,255,.085);
}

.premium-panel:hover {
    border-color: rgba(255,255,255,.11);
}

/* ========================================
   PESTILENCE NOTIFICATION MANAGEMENT
   ======================================== */

.notification-cleanup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.notification-cleanup-actions form {
    margin: 0;
}

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

.delete-old-form input {
    width: 80px;
    margin: 0;
    min-height: 38px;
}

.delete-old-form span {
    color: var(--text-muted);
    font-size: 11px;
}

.notification-list {
    display: grid;
    gap: 9px;
}

.notification-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    padding: 16px;

    border: 1px solid var(--line);
    border-radius: 11px;

    background:
        rgba(255,255,255,.015);
}

.notification-row-main {
    display: grid;
    grid-template-columns: 9px minmax(0,1fr);
    gap: 12px;
}

.notification-row-main strong {
    display: block;
    margin-bottom: 6px;
}

.notification-row-main p {
    margin: 0;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.55;
}

.notification-time {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 9px;
}

.notification-type-dot {
    width: 7px;
    height: 7px;
    margin-top: 5px;
    border-radius: 50%;
    background: #7b8795;
}

.notification-type-dot.type-maintenance {
    background: #73a8ff;
}

.notification-type-dot.type-warning {
    background: #e8c962;
}

.notification-type-dot.type-important {
    background: #ff7d85;
}

.notification-row-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
}

.notification-row-actions form {
    margin: 0;
}

@media (max-width: 700px) {
    .notification-row {
        flex-direction: column;
    }

    .notification-row-actions {
        width: 100%;
    }
}

/* Preferences */

.notification-settings-link,
.admin-page-actions {
    display:flex;
    justify-content:flex-end;
    margin-bottom:16px;
}

.preference-list {
    display:grid;
    gap:8px;
}

.preference-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:17px;
    border:1px solid var(--line);
    border-radius:10px;
    background:rgba(255,255,255,.015);
}

.preference-row strong,
.preference-row span {
    display:block;
}

.preference-row strong {
    color:var(--text);
    font-size:13px;
}

.preference-row span {
    margin-top:5px;
    color:var(--text-muted);
    font-size:10px;
}

.preference-row input {
    width:19px !important;
    height:19px;
    flex:0 0 19px;
}

.preference-success {
    margin-bottom:15px;
    padding:13px 15px;
    border:1px solid rgba(119,221,161,.18);
    border-radius:9px;
    color:var(--success);
    background:rgba(119,221,161,.045);
}


/* Broadcast history */

.broadcast-history-row {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    padding:18px 0;
    border-bottom:1px solid var(--line);
}

.broadcast-history-row:last-child {
    border-bottom:0;
}

.broadcast-type {
    display:block;
    margin-bottom:6px;
    color:var(--accent);
    font-size:8px;
    font-weight:850;
    letter-spacing:.12em;
}

.broadcast-history-row p {
    margin:7px 0;
    color:var(--text-soft);
    font-size:11px;
    line-height:1.6;
}

.broadcast-meta {
    color:var(--text-muted);
    font-size:9px;
}

.broadcast-deleted {
    color:var(--danger);
    font-size:9px;
    font-weight:850;
}


/* Archive coverage */

.archive-coverage-bar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-bottom:14px;
    padding:13px 16px;
    border:1px solid var(--line);
    border-radius:10px;
    background:rgba(255,255,255,.018);
    color:var(--text-muted);
    font-size:10px;
}

.archive-coverage-bar span,
.archive-coverage-bar strong {
    display:block;
}

.archive-coverage-bar span {
    margin-bottom:4px;
    font-size:8px;
    font-weight:850;
    letter-spacing:.12em;
}

.archive-coverage-bar strong {
    color:var(--text);
    font-family:ui-monospace,monospace;
    font-size:10px;
}

.archive-warning {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-bottom:14px;
    padding:17px;
    border:1px solid rgba(230,199,108,.20);
    border-radius:11px;
    background:rgba(230,199,108,.055);
}

.archive-warning strong {
    color:#ead47f;
}

.archive-warning p {
    margin:5px 0 0;
    color:var(--text-soft);
    font-size:11px;
}

@media(max-width:700px) {
    .broadcast-history-row,
    .archive-coverage-bar,
    .archive-warning {
        flex-direction:column;
        align-items:flex-start;
    }
}

/* ========================================
   PESTILENCE CLIENT TROUBLESHOOTING
   ======================================== */

.client-admin-header {
    align-items:flex-start;
}

.client-status-badge {
    padding:7px 11px;
    border:1px solid var(--line);
    border-radius:999px;
    font-size:9px;
    font-weight:850;
    letter-spacing:.1em;
}

.client-status-badge.status-active {
    border-color:rgba(120,220,160,.22);
}

.client-status-badge.status-suspended {
    border-color:rgba(255,110,120,.25);
}

.client-metric-grid {
    display:grid;
    grid-template-columns:
        repeat(3,minmax(0,1fr));
    gap:12px;
    margin-bottom:24px;
}

.client-metric {
    margin:0 !important;
    min-height:92px;
}

.client-metric span {
    display:block;
    margin-bottom:9px;
    color:var(--text-muted);
    font-size:8px;
    font-weight:850;
    letter-spacing:.12em;
}

.client-metric strong {
    display:block;
    overflow-wrap:anywhere;
    color:var(--text);
    font-size:14px;
}

.client-admin-actions {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:18px;
}

.client-admin-actions form {
    margin:0;
}

.client-security-details {
    display:grid;
    grid-template-columns:
        repeat(4,minmax(0,1fr));
    gap:8px;
    margin-top:20px;
}

.client-security-details > div,
.client-work-grid > div {
    padding:13px;
    border:1px solid var(--line);
    border-radius:9px;
    background:rgba(255,255,255,.012);
}

.client-security-details span,
.client-work-grid span {
    display:block;
    margin-bottom:6px;
    color:var(--text-muted);
    font-size:8px;
    font-weight:800;
    letter-spacing:.08em;
}

.client-security-details strong,
.client-work-grid strong {
    overflow-wrap:anywhere;
    color:var(--text);
    font-size:10px;
}

.client-work-grid {
    display:grid;
    grid-template-columns:
        repeat(4,minmax(0,1fr));
    gap:8px;
    margin-top:17px;
}

.client-work-grid strong {
    font-size:20px;
}

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

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

.compact-table th,
.compact-table td {
    padding:11px 9px;
    border-bottom:1px solid var(--line);
    text-align:left;
    vertical-align:top;
    font-size:10px;
}

.compact-table th {
    color:var(--text-muted);
    font-size:8px;
    letter-spacing:.09em;
}

.ua-cell {
    max-width:420px;
    overflow-wrap:anywhere;
}

.admin-client-link {
    color:inherit;
    text-decoration:none;
    font-weight:750;
}

.admin-client-link:hover {
    text-decoration:underline;
}

@media(max-width:900px) {
    .client-metric-grid {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .client-security-details,
    .client-work-grid {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }
}

@media(max-width:560px) {
    .client-metric-grid,
    .client-security-details,
    .client-work-grid {
        grid-template-columns:1fr;
    }
}
