/* ============================================================
   SHADOWKINGS — SHADOW NETWORK
   CLANDESTINE INTELLIGENCE COMMAND CHAMBER
   ============================================================ */

.shadow-network-panel {
    --sn-surface: rgba(16, 10, 25, 0.92);
    --sn-violet: #8c4cff;
    --sn-violet-bright: #b98cff;
    --sn-text: #eee8f8;
    --sn-muted: #9e91ad;
    --sn-border: rgba(142, 77, 255, 0.34);
    --sn-border-strong: rgba(161, 100, 255, 0.62);

    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;

    padding: 34px clamp(18px, 3vw, 48px) 28px;

    color: var(--sn-text);

    background:
        radial-gradient(circle at 50% -10%,
            rgba(100, 35, 170, 0.20),
            transparent 38%),
        radial-gradient(circle at 12% 55%,
            rgba(70, 20, 120, 0.10),
            transparent 30%),
        linear-gradient(180deg,
            rgba(12, 8, 18, 0.99),
            rgba(5, 5, 9, 0.99));

    border: 1px solid var(--sn-border-strong);

    box-shadow:
        inset 0 0 70px rgba(0, 0, 0, 0.72),
        inset 0 0 18px rgba(126, 58, 215, 0.10),
        0 0 32px rgba(77, 26, 140, 0.35);

    font-family: "Cinzel", Georgia, "Times New Roman", serif;
}

/* ATMOSPHERE */

.sn-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.22;

    background-image:
        linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.01) 1px, transparent 1px);

    background-size: 48px 48px;
}

.sn-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 140px rgba(0,0,0,0.72);
}

/* CLOSE */

.shadow-network-panel .panel-close-btn {
    position: absolute;
    top: 18px;
    right: 24px;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(165, 111, 255, 0.38);
    border-radius: 50%;

    background: rgba(13, 8, 20, 0.72);
    color: #d9c7f5;

    font-family: Arial, sans-serif;
    font-size: 29px;
    line-height: 1;

    cursor: pointer;
    z-index: 100;

    box-shadow:
        inset 0 0 12px rgba(115, 52, 190, 0.10),
        0 0 12px rgba(95, 39, 165, 0.15);

    transition: 0.18s ease;
}

.shadow-network-panel .panel-close-btn:hover {
    color: #fff;
    border-color: rgba(190, 143, 255, 0.82);
    transform: scale(1.08);

    box-shadow:
        inset 0 0 14px rgba(142, 77, 255, 0.18),
        0 0 18px rgba(142, 77, 255, 0.42);
}

/* ============================================================
   COMMAND HEADER
   ============================================================ */

.sn-command-header {
    width: min(1500px, 100%);
    margin: 0 auto 22px;
    position: relative;
    z-index: 2;
}

.sn-command-eyebrow {
    margin-bottom: 10px;
    color: var(--sn-muted);
    text-align: center;
    font-size: 10px;
    letter-spacing: 0.38em;
    text-transform: uppercase;
}

.sn-header-main {
    text-align: center;
}

.sn-title-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 22px;
    max-width: 900px;
    margin: 0 auto;
}

.sn-title-rule {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(163, 100, 255, 0.58),
        transparent
    );
}

.sn-title {
    margin: 0;
    color: #f4ecff;
    font-size: clamp(26px, 3vw, 44px);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    text-shadow:
        0 0 8px rgba(155, 89, 255, 0.46),
        0 0 26px rgba(105, 38, 185, 0.30);
}

.sn-motto {
    margin-top: 8px;
    color: #c9b8df;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 14px;
    font-style: italic;
    letter-spacing: 0.035em;
}

.sn-intel-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
    gap: 18px;

    margin-top: 24px;
    padding: 14px 18px;

    border-top: 1px solid rgba(142, 77, 255, 0.26);
    border-bottom: 1px solid rgba(142, 77, 255, 0.26);

    background: linear-gradient(
        90deg,
        rgba(37, 17, 55, 0.28),
        rgba(12, 8, 18, 0.48),
        rgba(37, 17, 55, 0.28)
    );
}

.sn-intel-label {
    margin-bottom: 5px;
    color: var(--sn-violet-bright);
    font-size: 10px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
}

.sn-description {
    color: #cfc4db;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    line-height: 1.55;
}

.sn-intel-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    text-align: right;
}

.sn-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #cdb9ed;
    font-size: 10px;
    letter-spacing: 0.16em;
}

.sn-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9b67e8;
    box-shadow: 0 0 7px rgba(155, 103, 232, 0.9);
}

.sn-stats {
    color: var(--sn-muted);
    font-size: 11px;
    letter-spacing: 0.05em;
}

/* HEADER ACTIONS */

.sn-header-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.sn-command-btn,
.sn-header-actions button {
    min-height: 34px;
    padding: 7px 14px;

    border: 1px solid var(--sn-border);
    border-radius: 3px;

    background: linear-gradient(
        180deg,
        rgba(49, 27, 68, 0.68),
        rgba(24, 13, 34, 0.76)
    );

    color: #cfc1df;
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    cursor: pointer;

    transition: 0.18s ease;
}

.sn-command-btn:hover,
.sn-header-actions button:hover {
    color: #fff;
    border-color: rgba(170, 112, 255, 0.72);

    background: linear-gradient(
        180deg,
        rgba(91, 43, 135, 0.72),
        rgba(45, 20, 67, 0.82)
    );

    box-shadow: 0 0 12px rgba(120, 57, 196, 0.26);
}

.sn-header-actions .sn-danger-btn {
    border-color: rgba(190, 74, 91, 0.40);
    color: #d7a5ad;

    background: linear-gradient(
        180deg,
        rgba(69, 24, 34, 0.58),
        rgba(31, 12, 17, 0.76)
    );
}

.sn-header-actions .sn-danger-btn:hover {
    color: #ffe3e7;
    border-color: rgba(220, 91, 110, 0.72);
    box-shadow: 0 0 12px rgba(175, 50, 70, 0.22);
}

/* ============================================================
   TABS
   ============================================================ */

.sn-tabs {
    width: min(1500px, 100%);
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin: 0 auto 12px;
    position: relative;
    z-index: 2;
}

.sn-tab {
    min-height: 47px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 9px 12px;

    border: 1px solid rgba(131, 75, 200, 0.27);

    background: linear-gradient(
        180deg,
        rgba(31, 18, 43, 0.66),
        rgba(14, 9, 21, 0.80)
    );

    color: #9e91ad;
    cursor: pointer;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;

    transition: 0.18s ease;
}

.sn-tab-index {
    color: #67577a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 9px;
}

.sn-tab:hover {
    color: #ded2ed;
    border-color: rgba(148, 84, 231, 0.48);

    background: linear-gradient(
        180deg,
        rgba(53, 27, 76, 0.72),
        rgba(21, 12, 31, 0.84)
    );
}

.sn-tab-active {
    color: #f3ebff;
    border-color: rgba(166, 102, 255, 0.68);

    background: linear-gradient(
        180deg,
        rgba(78, 37, 113, 0.82),
        rgba(33, 16, 49, 0.90)
    );

    box-shadow:
        inset 0 -2px 0 rgba(178, 120, 255, 0.68),
        0 0 15px rgba(101, 45, 166, 0.22);
}

.sn-tab-active .sn-tab-index {
    color: #b58ae8;
}

/* ============================================================
   WORKSPACE
   ============================================================ */

.sn-workspace {
    width: min(1500px, 100%);
    min-height: 390px;
    margin: 0 auto;
    position: relative;
    z-index: 2;

    border: 1px solid rgba(136, 79, 205, 0.30);

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(72, 30, 108, 0.13),
            transparent 40%
        ),
        rgba(7, 6, 11, 0.72);

    box-shadow:
        inset 0 0 45px rgba(0,0,0,0.48),
        0 8px 28px rgba(0,0,0,0.28);
}

.sn-workspace-heading {
    min-height: 34px;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;

    padding: 7px 13px;

    border-bottom: 1px solid rgba(134, 77, 204, 0.25);
    background: rgba(24, 13, 34, 0.64);

    color: #746984;
    font-size: 8px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.sn-workspace-heading-left {
    display: flex;
    align-items: center;
    gap: 7px;
}

.sn-classification-mark {
    width: 6px;
    height: 6px;

    border: 1px solid rgba(176, 121, 255, 0.72);
    transform: rotate(45deg);

    box-shadow: 0 0 6px rgba(151, 88, 240, 0.40);
}

.sn-workspace-heading-center {
    color: #9885ad;
}

.sn-workspace-heading-right {
    text-align: right;
}

.sn-dynamic-container {
    min-height: 350px;
    padding: clamp(18px, 2.5vw, 34px);
    color: var(--sn-text);
}

/* ============================================================
   DYNAMIC SECTIONS
   ============================================================ */

.sn-section {
    animation: snReveal 0.22s ease;
}

@keyframes snReveal {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

.sn-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;

    color: #e8ddf5;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;

    text-shadow: 0 0 8px rgba(123, 66, 198, 0.30);
}

.sn-section-title::before {
    content: "";
    width: 3px;
    height: 22px;

    background: linear-gradient(180deg, #a76cff, #52248b);
    box-shadow: 0 0 8px rgba(144, 78, 230, 0.50);
}

.sn-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    margin-left: 4px;

    background: linear-gradient(
        90deg,
        rgba(142, 77, 255, 0.35),
        transparent
    );
}

.sn-empty,
.sn-ops-placeholder {
    padding: 22px;

    border: 1px dashed rgba(130, 78, 190, 0.28);
    background: rgba(19, 12, 27, 0.42);

    color: #85788f;
    text-align: center;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-style: italic;
}

/* OVERVIEW */

.sn-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.sn-overview-card {
    min-height: 104px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    position: relative;
    overflow: hidden;

    padding: 17px;

    border: 1px solid rgba(139, 82, 209, 0.30);
    border-radius: 3px;

    background: linear-gradient(
        145deg,
        rgba(40, 21, 57, 0.66),
        rgba(14, 9, 21, 0.78)
    );

    box-shadow:
        inset 0 0 20px rgba(105, 49, 166, 0.06),
        0 5px 18px rgba(0,0,0,0.22);

    transition: 0.18s ease;
}

.sn-overview-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;

    width: 42px;
    height: 1px;

    background: rgba(177, 118, 255, 0.78);
}

.sn-overview-card:hover {
    transform: translateY(-2px);
    border-color: rgba(159, 97, 239, 0.52);

    box-shadow:
        inset 0 0 24px rgba(108, 49, 170, 0.09),
        0 8px 22px rgba(0,0,0,0.30);
}

.sn-overview-label {
    margin-bottom: 8px;
    color: #8f819e;
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.sn-overview-value {
    color: #f0e8fa;
    font-size: 22px;
    font-weight: 600;
}

/* AGENTS */

.sn-agent-list {
    display: grid;
    gap: 10px;
}

.sn-agent-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;

    min-height: 78px;
    padding: 14px 16px;

    border: 1px solid rgba(137, 79, 207, 0.29);
    border-left: 3px solid rgba(143, 80, 224, 0.58);

    background: linear-gradient(
        90deg,
        rgba(40, 20, 57, 0.62),
        rgba(14, 9, 20, 0.68)
    );
}

.sn-agent-row:hover {
    border-color: rgba(159, 96, 239, 0.50);
}

.sn-agent-name {
    margin-bottom: 7px;
    color: #f0e7fa;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sn-agent-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: #9f91ae;
    font-size: 11px;
}

.sn-agent-actions button,
.sn-invite-actions button {
    padding: 7px 12px;

    border: 1px solid rgba(170, 74, 91, 0.36);
    border-radius: 3px;

    background: rgba(60, 22, 30, 0.40);
    color: #c99ba3;

    font-family: inherit;
    font-size: 9px;
    letter-spacing: 0.10em;
    text-transform: uppercase;

    cursor: pointer;
}

.sn-agent-actions button:hover,
.sn-invite-actions button:hover {
    border-color: rgba(210, 92, 111, 0.68);
    color: #ffe1e6;
    background: rgba(96, 30, 42, 0.55);
}

/* CONTROLS */

.sn-invite-controls,
.sn-message-compose,
.sn-logistics-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 16px;
    padding: 13px;

    border: 1px solid rgba(136, 78, 204, 0.26);
    background: rgba(25, 14, 36, 0.52);
}

.shadow-network-panel input,
.shadow-network-panel textarea {
    box-sizing: border-box;
    min-height: 38px;
    padding: 9px 11px;

    border: 1px solid rgba(130, 78, 190, 0.34);
    border-radius: 2px;
    outline: none;

    background: rgba(5, 5, 9, 0.78);
    color: #e9dff5;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 12px;
}

.shadow-network-panel input:focus,
.shadow-network-panel textarea:focus {
    border-color: rgba(164, 99, 245, 0.70);

    box-shadow:
        0 0 0 1px rgba(140, 76, 255, 0.16),
        0 0 12px rgba(111, 49, 180, 0.15);
}

.shadow-network-panel textarea {
    min-height: 86px;
    resize: vertical;
}

.shadow-network-panel input::placeholder,
.shadow-network-panel textarea::placeholder {
    color: #665d70;
}

.sn-invite-controls input {
    flex: 1 1 280px;
}

.sn-message-compose {
    display: grid;
    grid-template-columns:
        minmax(180px, 0.35fr)
        minmax(300px, 1fr)
        auto;
}

.sn-message-compose textarea {
    min-height: 70px;
}

.sn-logistics-controls {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        minmax(150px, 1fr)
        minmax(110px, 0.5fr)
        auto;
}

.sn-invite-controls button,
.sn-message-compose button,
.sn-logistics-controls button {
    min-height: 38px;
    padding: 8px 16px;

    border: 1px solid rgba(151, 91, 226, 0.48);
    border-radius: 2px;

    background: linear-gradient(
        180deg,
        rgba(70, 35, 101, 0.72),
        rgba(32, 17, 46, 0.84)
    );

    color: #dfd2ed;
    font-family: inherit;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
}

/* INVITES */

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

.sn-invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 12px 14px;

    border: 1px solid rgba(136, 79, 204, 0.28);
    background: rgba(27, 15, 39, 0.58);
}

.sn-invite-name {
    color: #e8ddf4;
    font-size: 13px;
}

/* MESSAGES */

.sn-message-list {
    display: grid;
    gap: 10px;
}

.sn-message-row {
    padding: 15px 17px;

    border: 1px solid rgba(134, 77, 201, 0.27);
    border-left: 3px solid rgba(134, 78, 207, 0.48);

    background: linear-gradient(
        100deg,
        rgba(33, 18, 47, 0.66),
        rgba(13, 9, 19, 0.72)
    );
}

.sn-message-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;

    margin-bottom: 10px;
    padding-bottom: 8px;

    border-bottom: 1px solid rgba(129, 76, 191, 0.20);

    color: #91849e;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sn-message-time {
    margin-left: auto;
}

.sn-message-body {
    color: #d8cfe2;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    line-height: 1.6;
}

/* LOGISTICS */

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

.sn-logistics-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 13px 15px;

    border: 1px solid rgba(135, 79, 202, 0.27);
    background: rgba(27, 15, 39, 0.57);
}

.sn-logistics-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    color: #d8cde4;
    font-size: 11px;
}

.sn-logistics-time {
    color: #786e82;
    font-size: 10px;
}

/* OPERATIONS */

.sn-ops-description {
    margin-bottom: 14px;
    color: #b9acc7;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    line-height: 1.6;
}

.sn-ops-list {
    display: grid;
    gap: 9px;
    margin-top: 16px;
}

.sn-ops-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 14px 16px;

    border: 1px solid rgba(138, 80, 207, 0.30);
    border-left: 3px solid rgba(143, 79, 224, 0.55);

    background: linear-gradient(
        90deg,
        rgba(39, 20, 56, 0.64),
        rgba(14, 9, 20, 0.70)
    );
}

.sn-ops-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    color: #dcd1e8;
    font-size: 11px;
}

.sn-ops-time {
    color: #786d82;
    font-size: 10px;
}

/* AGENT-ONLY VIEW */

.sn-agent-overview {
    max-width: 760px;
    padding: 20px;

    border: 1px solid rgba(138, 80, 206, 0.30);
    border-left: 3px solid rgba(157, 92, 239, 0.60);

    background: linear-gradient(
        100deg,
        rgba(38, 20, 55, 0.64),
        rgba(13, 9, 19, 0.72)
    );

    color: #cfc4d9;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    line-height: 1.65;
}

.sn-highlight {
    color: #c9a8f2;
    font-weight: 600;
}

/* FOOTER */

.sn-footer {
    width: min(1000px, 90%);

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;

    margin: 25px auto 0;

    position: relative;
    z-index: 2;
}

.sn-footer-line {
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(128, 72, 198, 0.30),
        transparent
    );
}

.sn-footer-text {
    color: #574e61;
    font-size: 8px;
    letter-spacing: 0.32em;
    text-align: center;
    text-transform: uppercase;
}

/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 900px) {

    .shadow-network-panel {
        padding: 60px 14px 24px;
    }

    .shadow-network-panel .panel-close-btn {
        top: 12px;
        right: 14px;
        width: 40px;
        height: 40px;
    }

    .sn-title-group {
        grid-template-columns: 24px auto 24px;
        gap: 10px;
    }

    .sn-intel-strip {
        grid-template-columns: 1fr;
    }

    .sn-intel-status {
        align-items: flex-start;
        text-align: left;
    }

    .sn-tabs {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 6px;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .sn-tabs::-webkit-scrollbar {
        display: none;
    }

    .sn-tab {
        flex: 0 0 auto;
        min-width: 132px;
    }

    .sn-workspace-heading {
        grid-template-columns: 1fr auto;
    }

    .sn-workspace-heading-center {
        display: none;
    }

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

    .sn-message-compose {
        grid-template-columns: 1fr;
    }

    .sn-logistics-controls {
        grid-template-columns: 1fr 1fr;
    }

    .sn-logistics-controls button {
        grid-column: 1 / -1;
    }
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {

    .shadow-network-panel {
        min-height: 100dvh;
        padding: 58px 10px 20px;
    }

    .sn-title-group {
        grid-template-columns: 12px auto 12px;
    }

    .sn-title {
        font-size: 22px;
        letter-spacing: 0.10em;
    }

    .sn-motto {
        font-size: 12px;
    }

    .sn-intel-strip {
        margin-top: 18px;
        padding: 12px;
    }

    .sn-header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .sn-header-actions .sn-danger-btn {
        grid-column: 1 / -1;
    }

    .sn-tab {
        min-width: 122px;
        min-height: 44px;
        padding: 8px 11px;
        font-size: 9px;
    }

    .sn-workspace-heading-right {
        display: none;
    }

    .sn-dynamic-container {
        padding: 13px;
    }

    .sn-overview-grid {
        grid-template-columns: 1fr;
    }

    .sn-overview-card {
        min-height: 84px;
    }

    .sn-overview-value {
        font-size: 19px;
    }

    .sn-agent-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sn-agent-actions button {
        width: 100%;
    }

    .sn-invite-row,
    .sn-logistics-row,
    .sn-ops-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .sn-invite-actions,
    .sn-invite-actions button {
        width: 100%;
    }

    .sn-message-header {
        flex-direction: column;
    }

    .sn-message-time {
        margin-left: 0;
    }

    .sn-logistics-controls {
        grid-template-columns: 1fr;
    }

    .sn-logistics-controls button {
        grid-column: auto;
    }

    .sn-footer {
        width: 100%;
        gap: 8px;
    }

    .sn-footer-text {
        font-size: 7px;
        letter-spacing: 0.20em;
    }
}


/* ============================================================
   SHADOW NETWORK — CLOSE BUTTON LAYER FIX
   Decorative layers must NEVER intercept panel controls.
   ============================================================ */

.shadow-network-panel {
    isolation: isolate;
}

.shadow-network-panel .sn-atmosphere,
.shadow-network-panel .sn-vignette {
    pointer-events: none !important;
    z-index: 0 !important;
}

.shadow-network-panel .sn-command-header,
.shadow-network-panel .sn-tabs,
.shadow-network-panel .sn-workspace,
.shadow-network-panel .sn-footer {
    position: relative;
    z-index: 2;
}

.shadow-network-panel .sn-close-btn,
.shadow-network-panel .panel-close-btn {
    position: absolute !important;
    top: 18px !important;
    right: 24px !important;

    z-index: 2147483647 !important;

    pointer-events: auto !important;
    touch-action: manipulation;

    cursor: pointer !important;
}


/* ============================================================
   AGENT INTELLIGENCE
   SERVER-PROJECTED INTELLIGENCE DISPLAY
   ============================================================ */

.sn-agent-intelligence {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}


/* ------------------------------------------------------------
   INTELLIGENCE CARD
   ------------------------------------------------------------ */

.sn-intelligence-card {
    position: relative;
    overflow: hidden;

    border: 1px solid rgba(137, 79, 207, 0.32);
    border-left: 3px solid rgba(143, 80, 224, 0.62);

    background:
        linear-gradient(
            145deg,
            rgba(40, 20, 57, 0.70),
            rgba(12, 8, 18, 0.82)
        );

    box-shadow:
        inset 0 0 24px rgba(105, 49, 166, 0.07),
        0 6px 20px rgba(0, 0, 0, 0.24);

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.sn-intelligence-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 72px;
    height: 1px;

    background:
        linear-gradient(
            90deg,
            rgba(184, 140, 255, 0.90),
            transparent
        );
}

.sn-intelligence-card:hover {
    border-color: rgba(164, 99, 245, 0.52);

    box-shadow:
        inset 0 0 28px rgba(108, 49, 170, 0.10),
        0 9px 25px rgba(0, 0, 0, 0.32);

    transform: translateY(-1px);
}


/* ------------------------------------------------------------
   CARD TITLE
   ------------------------------------------------------------ */

.sn-intelligence-card-title {
    padding: 11px 14px;

    border-bottom: 1px solid rgba(134, 77, 204, 0.22);

    background:
        linear-gradient(
            90deg,
            rgba(50, 25, 72, 0.58),
            rgba(20, 11, 29, 0.42)
        );

    color: #b98cff;

    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}


/* ------------------------------------------------------------
   CARD BODY
   ------------------------------------------------------------ */

.sn-intelligence-card-body {
    padding: 15px;

    color: #d5c9e2;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 12px;
    line-height: 1.55;
}

.sn-intelligence-card-body strong {
    display: block;

    margin-bottom: 7px;

    color: #f0e7fa;

    font-family: "Cinzel", Georgia, "Times New Roman", serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


/* ------------------------------------------------------------
   INTELLIGENCE META
   ------------------------------------------------------------ */

.sn-intelligence-meta {
    margin-top: 4px;

    color: #8f819e;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px;
    line-height: 1.5;
}


/* ------------------------------------------------------------
   INTELLIGENCE DATA GROUPS
   ------------------------------------------------------------ */

.sn-intelligence-data {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;

    margin-top: 12px;
}

.sn-intelligence-data-item {
    padding: 8px 9px;

    border: 1px solid rgba(130, 78, 190, 0.22);

    background: rgba(5, 5, 9, 0.38);
}

.sn-intelligence-data-label {
    margin-bottom: 3px;

    color: #75687f;

    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sn-intelligence-data-value {
    color: #ddd2e9;

    font-size: 11px;
    font-weight: 600;
}


/* ------------------------------------------------------------
   SEAT INTELLIGENCE
   ------------------------------------------------------------ */

.sn-intelligence-seat {
    grid-column: 1 / -1;
}

.sn-intelligence-seat .sn-intelligence-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sn-intelligence-seat-id {
    color: #75687f;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 9px;
    letter-spacing: 0.06em;
}


/* ------------------------------------------------------------
   SEAT STAT GRID
   ------------------------------------------------------------ */

.sn-intelligence-seat-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;

    margin-top: 12px;
}

.sn-intelligence-seat-stat {
    min-height: 48px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 8px 9px;

    border: 1px solid rgba(130, 78, 190, 0.22);

    background:
        linear-gradient(
            145deg,
            rgba(28, 15, 40, 0.62),
            rgba(6, 6, 10, 0.48)
        );
}

.sn-intelligence-seat-stat-label {
    margin-bottom: 4px;

    color: #75687f;

    font-size: 8px;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.sn-intelligence-seat-stat-value {
    color: #e4d9ee;

    font-family: "Cinzel", Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-weight: 600;
}


/* ------------------------------------------------------------
   OWNER / TROOP / HERO / BUILDING / ARCANE / SHIELD / RESOURCE
   DATA
   ------------------------------------------------------------ */

.sn-intelligence-owner {
    margin-bottom: 9px;

    color: #cbb9dd;

    font-size: 11px;
}

.sn-intelligence-owner strong {
    display: inline;

    margin: 0;

    font-size: 11px;
}

.sn-intelligence-resource-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;

    margin-top: 10px;
}

.sn-intelligence-resource {
    padding: 7px 8px;

    border: 1px solid rgba(130, 78, 190, 0.18);

    background: rgba(4, 4, 8, 0.34);
}

.sn-intelligence-resource-label {
    display: block;

    margin-bottom: 3px;

    color: #6f6378;

    font-size: 8px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

.sn-intelligence-resource-value {
    color: #d7cbe3;

    font-size: 11px;
    font-weight: 600;
}


/* ------------------------------------------------------------
   FORWARD ACTION
   ------------------------------------------------------------ */

.sn-intelligence-card .sn-command-btn {
    margin-top: 13px;
}

.sn-intelligence-card .sn-command-btn:disabled {
    opacity: 0.58;

    cursor: default;

    box-shadow: none;
}


/* ------------------------------------------------------------
   SCOUT REPORT
   ------------------------------------------------------------ */

.sn-intelligence-scout {
    grid-column: 1 / -1;
}

.sn-intelligence-scout-data {
    margin-top: 10px;

    padding: 10px 11px;

    border-left: 2px solid rgba(143, 80, 224, 0.42);

    background: rgba(5, 5, 9, 0.38);

    color: #bcaecb;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px;
    line-height: 1.55;
}


/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 1100px) {

    .sn-tabs {
        grid-template-columns: repeat(4, 1fr);
    }

    .sn-agent-intelligence {
        grid-template-columns: 1fr;
    }

    .sn-intelligence-seat,
    .sn-intelligence-scout {
        grid-column: auto;
    }

    .sn-intelligence-seat-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 700px) {

    .sn-tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    .sn-intelligence-data {
        grid-template-columns: 1fr;
    }

    .sn-intelligence-seat-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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


@media (max-width: 460px) {

    .sn-tabs {
        grid-template-columns: 1fr;
    }

    .sn-intelligence-seat-stats,
    .sn-intelligence-resource-grid {
        grid-template-columns: 1fr;
    }

    .sn-intelligence-card-body {
        padding: 12px;
    }
}


/* ============================================================
   SHADOW NETWORK — MEMBERSHIP / CREATION WORKSPACE
   ============================================================
   Used by renderMembershipWorkspace().

   IMPORTANT:
   This styles only the dynamic membership controls introduced
   by the dual-role Shadow Network system.

   It does NOT alter:
   - network authority
   - Agent / Spymaster relationships
   - backend routes
   - intelligence projection
   - existing dashboard shell
   ============================================================ */


/* ------------------------------------------------------------
   MEMBERSHIP WORKSPACE STRUCTURE
   ------------------------------------------------------------ */

.sn-dynamic-container > .sn-section {
    width: 100%;
    box-sizing: border-box;
}


/*
 * renderMembershipWorkspace() can contain multiple nested
 * .sn-section blocks. Give those internal command areas their
 * own visual separation without creating giant full-screen
 * panels.
 */

.sn-dynamic-container .sn-section .sn-section {
    margin-top: 24px;
    padding-top: 22px;

    border-top: 1px solid rgba(139, 82, 209, 0.22);
}


/* ------------------------------------------------------------
   FORM
   ------------------------------------------------------------ */

.sn-form {
    width: min(720px, 100%);

    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;

    margin: 18px auto 0;
    padding: 20px;

    box-sizing: border-box;

    border: 1px solid rgba(139, 82, 209, 0.30);
    border-left: 3px solid rgba(143, 80, 224, 0.58);

    background:
        linear-gradient(
            145deg,
            rgba(35, 18, 50, 0.64),
            rgba(11, 8, 17, 0.76)
        );

    box-shadow:
        inset 0 0 24px rgba(105, 49, 166, 0.06),
        0 6px 20px rgba(0, 0, 0, 0.20);
}


/* ------------------------------------------------------------
   LABELS
   ------------------------------------------------------------ */

.sn-form-label {
    display: block;

    margin-top: 7px;
    margin-bottom: 2px;

    color: #9f8daf;

    font-family: "Cinzel", Georgia, "Times New Roman", serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.sn-form-label:first-child {
    margin-top: 0;
}


/* ------------------------------------------------------------
   MEMBERSHIP INPUTS
   ------------------------------------------------------------ */

.shadow-network-panel .sn-input {
    width: 100%;
    max-width: 100%;

    box-sizing: border-box;

    border: 1px solid rgba(136, 79, 204, 0.34);

    background:
        linear-gradient(
            180deg,
            rgba(8, 6, 12, 0.92),
            rgba(14, 9, 20, 0.88)
        );

    color: #eee5f8;
}


/*
 * Keep creation fields compact.
 * The global Shadow Network textarea is intentionally larger
 * for messaging, but the network description does not need to
 * consume the dashboard.
 */

.shadow-network-panel textarea.sn-input {
    min-height: 92px;
    max-height: 180px;
}


/* ------------------------------------------------------------
   CREATE / ACCEPT / DECLINE COMMAND BUTTONS
   ------------------------------------------------------------ */

.sn-form > .sn-command-btn {
    width: auto;
    min-width: 220px;

    justify-self: center;

    margin-top: 12px;
}


/*
 * When invitation Accept + Decline buttons share the same
 * form, present them as a compact command group.
 */

.sn-form > .sn-command-btn + .sn-command-btn {
    margin-top: 2px;
}


/* ------------------------------------------------------------
   DANGER ACTION OUTSIDE HEADER
   ------------------------------------------------------------ */

.sn-form .sn-danger-btn {
    border-color: rgba(190, 74, 91, 0.40);

    color: #d7a5ad;

    background:
        linear-gradient(
            180deg,
            rgba(69, 24, 34, 0.58),
            rgba(31, 12, 17, 0.76)
        );
}

.sn-form .sn-danger-btn:hover {
    color: #ffe3e7;

    border-color: rgba(220, 91, 110, 0.72);

    background:
        linear-gradient(
            180deg,
            rgba(96, 30, 42, 0.68),
            rgba(42, 15, 22, 0.82)
        );

    box-shadow:
        0 0 12px rgba(175, 50, 70, 0.22);
}


/* ------------------------------------------------------------
   MEMBERSHIP INFORMATION
   ------------------------------------------------------------ */

/*
 * Empty/status text inside the membership workspace should
 * read as an information strip rather than a massive card.
 */

.sn-dynamic-container .sn-section .sn-empty {
    max-width: 900px;

    margin-left: auto;
    margin-right: auto;

    padding: 15px 18px;

    line-height: 1.6;
}


/* ------------------------------------------------------------
   CURRENT AGENT RELATIONSHIP
   ------------------------------------------------------------ */

.sn-dynamic-container .sn-section > .sn-overview-grid {
    margin-bottom: 20px;
}


/* ------------------------------------------------------------
   MOBILE
   ------------------------------------------------------------ */

@media (max-width: 600px) {

    .sn-form {
        width: 100%;

        margin-top: 14px;
        padding: 15px;
    }

    .sn-form > .sn-command-btn {
        width: 100%;
        min-width: 0;
    }

    .sn-dynamic-container .sn-section .sn-section {
        margin-top: 18px;
        padding-top: 18px;
    }
}




/* ============================================================
   SHADOW NETWORK — NATIVE SELECT OPTION VISIBILITY
   ============================================================
   Native browser dropdown menus do not reliably inherit the
   dark gradient used by .sn-input.

   Keep option foreground/background explicit so accepted
   Shadow Network Agents remain visibly selectable.
   ============================================================ */

.shadow-network-panel select.sn-input {
    color: #eee5f8;
    background-color: #0e0914;
}

.shadow-network-panel select.sn-input option {
    color: #eee5f8;
    background-color: #0e0914;
}

.shadow-network-panel select.sn-input option:checked {
    color: #ffffff;
    background-color: #24142f;
}



/* ============================================================
   SHADOW NETWORK MESSAGE DELETE
   ============================================================ */

.shadow-network-panel .sn-message-header {
    display: flex;
    align-items: center;
    gap: 12px;
}


.shadow-network-panel .sn-message-delete {
    margin-left: auto;

    appearance: none;
    -webkit-appearance: none;

    min-width: 64px;
    height: 26px;

    padding: 0 10px;

    border: 1px solid rgba(170, 55, 75, 0.65);
    border-radius: 2px;

    background:
        linear-gradient(
            180deg,
            rgba(55, 16, 32, 0.92),
            rgba(25, 8, 18, 0.96)
        );

    color: #d98a9b;

    font-family: "Cinzel", serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;

    line-height: 24px;

    cursor: pointer;

    box-shadow:
        inset 0 0 8px rgba(120, 35, 70, 0.12);

    transition:
        background 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        box-shadow 160ms ease;
}


.shadow-network-panel .sn-message-delete:hover {
    background:
        linear-gradient(
            180deg,
            rgba(85, 20, 38, 0.95),
            rgba(38, 9, 22, 0.98)
        );

    border-color: rgba(205, 75, 100, 0.9);

    color: #f0a6b5;

    box-shadow:
        0 0 8px rgba(150, 45, 75, 0.25),
        inset 0 0 8px rgba(150, 45, 75, 0.12);
}


.shadow-network-panel .sn-message-delete:active {
    transform: translateY(1px);
}


.shadow-network-panel .sn-message-delete:disabled {
    opacity: 0.45;
    cursor: wait;
    box-shadow: none;
}
