/*
 * Subreddar + Tabler shell adapter.
 * Existing PHP routes and body.collapsed behavior remain intact.
 */

:root {
    --sr-sidebar-expanded: 18rem;
    --sr-sidebar-collapsed: 4.75rem;
    --sr-sidebar-bg: #181919;
    --sr-sidebar-text: #e6e8eb;
    --sr-sidebar-border: rgba(255, 255, 255, 0.12);
    --sr-accent: #f04b23;
    --sr-accent-dark: #d93e1a;
    --sr-page-bg: #f5f7fb;
    --sr-card-bg: #ffffff;
    --sr-border: #e6e8ec;
    --sr-text: #182433;
    --sr-muted: #667382;
    --sr-shadow: 0 1px 2px rgba(24,36,51,.04), 0 8px 24px rgba(24,36,51,.06);
}

html, body { min-height: 100%; }
body { background: var(--sr-page-bg); color: var(--sr-text); }

.page-container {
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    min-height: 100vh;
    height: auto;
    padding: 8px;
    background: var(--sr-page-bg);
}

nav#sidebar_nav {
    position: sticky;
    top: 8px;
    left: auto;
    z-index: 1030;
    flex: 0 0 var(--sr-sidebar-expanded);
    width: var(--sr-sidebar-expanded);
    min-width: var(--sr-sidebar-expanded);
    max-width: var(--sr-sidebar-expanded);
    height: calc(100vh - 16px);
    min-height: 44rem;
    margin: 0;
    padding: 10px;
    overflow: visible;
    border: 0;
    border-radius: 16px;
    background: var(--sr-sidebar-bg);
    color: var(--sr-sidebar-text);
    box-shadow: 0 10px 30px rgba(24,25,25,.16);
    transition: width .18s ease, min-width .18s ease, max-width .18s ease, flex-basis .18s ease;
}

body.collapsed nav#sidebar_nav {
    flex-basis: var(--sr-sidebar-collapsed);
    width: var(--sr-sidebar-collapsed);
    min-width: var(--sr-sidebar-collapsed);
    max-width: var(--sr-sidebar-collapsed);
}

#sidebar_nav .sidebar-top {
    min-height: 94px;
    padding: 5px 0 12px;
}

#sidebar_nav .logo__wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 72px;
    padding: 8px;
}

#sidebar_nav .logo {
    display: block;
    width: 100%;
    max-width: 226px;
    height: 68px;
    margin: 0;
    object-fit: contain;
}

#sidebar_nav .logo-small {
    display: none;
    width: 42px;
    height: 42px;
    margin: 0;
    object-fit: contain;
}

body.collapsed #sidebar_nav .sidebar-top {
    min-height: 74px;
    padding-bottom: 8px;
}

body.collapsed #sidebar_nav .logo { display: none; }
body.collapsed #sidebar_nav .logo-small { display: block; }

#sidebar_nav .sidebar-links {
    flex: 1 1 auto;
    padding: 8px 0;
    overflow-x: visible;
    overflow-y: auto;
    border: 0;
    scrollbar-width: thin;
}

#sidebar_nav .sidebar-links ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#sidebar_nav .sidebar-links li {
    display: block;
    margin: 0;
    padding: 0;
}

#sidebar_nav .sidebar-links li a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 9px 12px;
    border-radius: 9px;
    background: transparent;
    color: var(--sr-sidebar-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color .14s ease, color .14s ease, transform .14s ease;
}

#sidebar_nav .sidebar-links li a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

#sidebar_nav .sidebar-links li a.active,
#sidebar_nav .sidebar-links li a.active:hover {
    background: var(--sr-accent);
    color: #fff;
    box-shadow: 0 5px 14px rgba(240,75,35,.22);
}

#sidebar_nav .sidebar-links li a svg {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin: 0;
    stroke: currentColor !important;
    color: inherit;
}

#sidebar_nav .sidebar-links .link {
    margin-left: 14px;
    white-space: nowrap;
}

#sidebar_nav .nav-line {
    height: 1px;
    margin: 12px 2px 10px;
    padding: 0;
    border: 0;
    background: var(--sr-sidebar-border);
}

body.collapsed #sidebar_nav .sidebar-links li {
    display: flex;
    justify-content: center;
}

body.collapsed #sidebar_nav .sidebar-links li a {
    justify-content: center;
    width: 44px;
    min-width: 44px;
    padding: 9px;
}

#sidebar_nav .tooltip { position: relative; z-index: auto; }

#sidebar_nav .tooltip .tooltip__content {
    top: 50%;
    left: calc(100% + 12px);
    z-index: 1080;
    min-width: max-content;
    padding: 7px 10px;
    visibility: hidden;
    transform: translateY(-50%);
    border: 0;
    border-radius: 7px;
    background: #111827;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.24);
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
}

body.collapsed #sidebar_nav .tooltip:hover .tooltip__content {
    visibility: visible;
}

#sidebar_nav .sidebar-bottom {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
    min-height: 64px;
    height: auto;
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #e8eaf0;
    border-radius: 14px;
    background: #f5f6ff;
    color: #182433;
}

#sidebar_nav .sidebar-profile-img {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0 8px 0 0;
}

#sidebar_nav .sidebar-profile-img .imgimg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--sr-accent);
    color: #fff;
}

#sidebar_nav .sidebar-profile-img svg {
    width: 28px;
    height: 28px;
}

#sidebar_nav .sidebar-profile-info {
    display: flex;
    min-width: 0;
    margin: 0;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    color: #182433;
    font-size: 12px;
    line-height: 1.25;
}

#sidebar_nav .sidebar-profile-info strong {
    overflow: hidden;
    color: #182433;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#sidebar_nav .sidebar-profile-info span {
    overflow: hidden;
    margin-top: 2px;
    color: #667382;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#sidebar_nav .sidebar-profile-info form { display: inline !important; }

#sidebar_nav .sidebar-profile-info button {
    min-height: 0;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #52606d !important;
    font-size: inherit;
    font-weight: 500;
    text-decoration: none !important;
}

#sidebar_nav .sidebar-profile-info button:hover {
    color: var(--sr-accent) !important;
}

#sidebar_nav .sidebar-settings {
    display: flex;
    flex: 0 0 auto;
    margin-left: auto;
}

#sidebar_nav .sidebar-settings a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    border: 1px solid #e2e5ea;
    border-radius: 9px;
    background: #fff;
    color: #344054;
}

#sidebar_nav .sidebar-settings a:hover {
    border-color: #d0d5dd;
    color: var(--sr-accent);
}

body.collapsed #sidebar_nav .sidebar-bottom {
    min-height: 104px;
    padding: 8px 6px;
    flex-direction: column;
    justify-content: center;
}

body.collapsed #sidebar_nav .sidebar-profile-img {
    margin: 0 0 7px;
}

body.collapsed #sidebar_nav .sidebar-profile-info { display: none; }
body.collapsed #sidebar_nav .sidebar-settings { margin: 0; }

#sidebar_nav .sidebar-bottom .expand-arrow,
body.collapsed #sidebar_nav .sidebar-bottom .expand-arrow {
    position: absolute;
    top: -44px;
    right: -23px;
    left: auto;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    border: 3px solid var(--sr-page-bg);
    border-radius: 50%;
    background: #000;
    color: #fff;
    box-shadow: 0 5px 16px rgba(0,0,0,.25);
    cursor: pointer;
    transition: transform .14s ease, background-color .14s ease;
}

#sidebar_nav .sidebar-bottom .expand-arrow:hover {
    background: var(--sr-accent);
    transform: scale(1.04);
}

#sidebar_nav .expand-arrow .expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    line-height: 1;
}

#sidebar_nav .expand-arrow .chevron-collapse { display: flex !important; }
#sidebar_nav .expand-arrow .chevron-expand { display: none !important; }
body.collapsed #sidebar_nav .expand-arrow .chevron-collapse { display: none !important; }
body.collapsed #sidebar_nav .expand-arrow .chevron-expand { display: flex !important; }

.page-container > .right-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    width: auto;
    min-height: calc(100vh - 16px);
    margin: 0;
    padding: 22px 30px 48px;
    background: var(--sr-page-bg);
    color: var(--sr-text);
}

.right-content h1 {
    margin: 18px 0 26px;
    color: var(--sr-text);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 650;
    letter-spacing: -.025em;
}

.right-content h1 .i_wrap {
    width: 42px;
    height: 42px;
    margin-right: 12px;
    padding: 7px;
    border: 1px solid var(--sr-border);
    border-radius: 10px;
    background: var(--sr-card-bg);
    color: #52606d;
    box-shadow: 0 1px 2px rgba(24,36,51,.04);
    font-size: 24px;
}

.right-content h2,
.right-content h3,
.right-content h4 {
    color: var(--sr-text);
    letter-spacing: -.015em;
}

.right-content p,
.right-content .text-muted { color: var(--sr-muted); }

.right-content input[type="text"],
.right-content input[type="email"],
.right-content input[type="password"],
.right-content input[type="tel"],
.right-content input[type="number"],
.right-content input[type="date"],
.right-content input[type="time"],
.right-content select,
.right-content textarea {
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid #d8dce2;
    border-radius: 7px;
    background: #fff;
    color: var(--sr-text);
    box-shadow: none;
}

.right-content textarea { min-height: 96px; }

.right-content input:focus,
.right-content select:focus,
.right-content textarea:focus {
    border-color: var(--sr-accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(240,75,35,.14);
}

.right-content button,
.right-content input[type="submit"],
.right-content .btn,
.right-content .pure-button {
    border-radius: 7px;
}

#subred_system_box {
    gap: 16px;
    min-height: 54px;
    margin: 0 0 18px;
    padding: 12px 16px;
    border: 1px solid var(--sr-border);
    border-radius: 10px;
    background: var(--sr-card-bg);
    box-shadow: 0 1px 2px rgba(24,36,51,.03);
}

#subred_dash_scorebox {
    gap: 0;
    height: auto;
    min-height: 118px;
    margin-bottom: 24px;
    padding: 12px;
    border: 1px solid var(--sr-border);
    border-radius: 12px;
    background: var(--sr-card-bg);
    box-shadow: var(--sr-shadow);
}

#subred_dash_scorebox .subred_dash_sbox {
    min-width: 0;
    height: 88px;
    padding: 8px 14px;
    border-right: 1px solid var(--sr-border);
    background: transparent;
}

#subred_dash_scorebox .subred_dash_icon {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    padding: 14px;
    border: 1px solid var(--sr-border);
    border-radius: 10px;
    background: #fff;
    color: #52606d;
    box-shadow: 0 4px 12px rgba(24,36,51,.08);
}

#subred_dash_scorebox .subred_dash_icon svg {
    width: 34px;
    height: 34px;
}

#subred_dash_scorebox .subred_dash_amt {
    min-width: 0;
    height: 70px;
    padding-left: 12px;
    align-items: flex-start;
    justify-content: center;
}

#subred_dash_scorebox .subred_dash_amt span {
    flex-grow: 0;
    justify-content: flex-start;
    color: var(--sr-text);
    font-size: clamp(23px, 2.4vw, 31px);
    font-weight: 500;
    line-height: 1.05;
}

#subred_dash_scorebox .subred_dash_amt strong {
    margin-top: 7px;
    padding: 0;
    color: var(--sr-accent);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    text-align: left;
}

.right-content table.dataTable {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--sr-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(24,36,51,.03);
}

.right-content table.dataTable thead th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--sr-border);
    background: #f8fafc;
    color: #52606d;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.right-content table.dataTable tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf0f3;
    color: #344054;
    vertical-align: middle;
}

@media (max-width: 1100px) {
    .page-container > .right-content {
        padding-right: 20px;
        padding-left: 24px;
    }

    #subred_dash_scorebox { flex-wrap: wrap; }

    #subred_dash_scorebox .subred_dash_sbox {
        width: 50%;
        border-bottom: 1px solid var(--sr-border);
    }
}

@media (max-width: 768px) {
    .page-container { padding: 5px; }

    nav#sidebar_nav {
        top: 5px;
        height: calc(100vh - 10px);
    }

    .page-container > .right-content {
        padding: 18px 14px 36px;
    }

    #subred_system_box {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    #subred_dash_scorebox .subred_dash_sbox {
        width: 100%;
        border-right: 0;
    }
}


/*
 * Sidebar compatibility repair.
 *
 * Tabler remains available for components, but the established Subreddar
 * shell continues controlling navigation layout and collapse behavior.
 */
#sidebar_nav .sidebar-links {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#sidebar_nav .sidebar-links ul {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-direction: column;
}

#sidebar_nav .sidebar-links li {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#sidebar_nav .sidebar-links li a {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#sidebar_nav .sidebar-links li a svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#sidebar_nav .sidebar-links .link {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.collapsed #sidebar_nav .sidebar-links li {
    display: flex !important;
}

body.collapsed #sidebar_nav .sidebar-links .link {
    display: none !important;
}

body.collapsed #sidebar_nav .sidebar-links .tooltip__content {
    display: block;
}

/* BEGIN SUBREDDAR TOOLTIP AND METRIC REFINEMENT */

/*
 * Allow collapsed navigation tooltips to extend outside the narrow
 * sidebar instead of being clipped by its scrolling container.
 */
#sidebar_nav .sidebar-links,
#sidebar_nav .sidebar-links ul,
#sidebar_nav .sidebar-links li {
    overflow: visible !important;
}

#sidebar_nav .tooltip {
    position: relative !important;
}

#sidebar_nav .tooltip .tooltip__content {
    position: absolute !important;
    top: 50% !important;
    left: calc(100% + 14px) !important;
    z-index: 99999 !important;

    display: block !important;
    width: max-content;
    min-width: max-content;
    max-width: 240px;

    padding: 8px 11px;
    border: 0;
    border-radius: 7px;

    background: #111827;
    color: #fff;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.24);

    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden !important;
    pointer-events: none;

    transform: translate(5px, -50%);
    transition:
        opacity 120ms ease,
        transform 120ms ease,
        visibility 120ms ease;
}

body.collapsed
#sidebar_nav
.tooltip:hover
.tooltip__content,
body.collapsed
#sidebar_nav
.tooltip:focus
.tooltip__content,
body.collapsed
#sidebar_nav
.tooltip:focus-within
.tooltip__content {
    opacity: 1;
    visibility: visible !important;
    transform: translate(0, -50%);
}

/*
 * Display the four dashboard metrics in one compact row on desktop.
 */
#subred_dash_scorebox {
    display: grid !important;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 0 !important;
    align-items: stretch !important;

    min-height: 0 !important;
    height: auto !important;

    padding: 10px !important;
}

#subred_dash_scorebox .subred_dash_sbox {
    display: flex !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 78px;
    height: auto !important;

    padding: 8px 12px !important;

    border-right:
        1px solid var(--sr-border) !important;
    border-bottom: 0 !important;

    background: transparent !important;
}

#subred_dash_scorebox
.subred_dash_sbox:last-child {
    border-right: 0 !important;
}

#subred_dash_scorebox .subred_dash_icon {
    flex: 0 0 54px !important;

    width: 54px !important;
    height: 54px !important;

    padding: 11px !important;

    border-radius: 9px !important;
}

#subred_dash_scorebox
.subred_dash_icon svg {
    width: 30px !important;
    height: 30px !important;
}

#subred_dash_scorebox .subred_dash_amt {
    min-width: 0 !important;
    height: auto !important;

    padding-left: 11px !important;

    align-items: flex-start !important;
    justify-content: center !important;
}

#subred_dash_scorebox
.subred_dash_amt span {
    flex-grow: 0 !important;

    font-size:
        clamp(21px, 2vw, 28px) !important;
    line-height: 1.05 !important;

    white-space: nowrap;
}

#subred_dash_scorebox
.subred_dash_amt strong {
    margin-top: 6px !important;

    font-size: 9px !important;
    line-height: 1.1 !important;

    white-space: normal;
}

/*
 * Two columns on smaller screens, then one column on phones.
 */
@media (max-width: 900px) {
    #subred_dash_scorebox {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    #subred_dash_scorebox
    .subred_dash_sbox:nth-child(2) {
        border-right: 0 !important;
    }

    #subred_dash_scorebox
    .subred_dash_sbox:nth-child(-n+2) {
        border-bottom:
            1px solid var(--sr-border) !important;
    }
}

@media (max-width: 560px) {
    #subred_dash_scorebox {
        grid-template-columns: 1fr;
    }

    #subred_dash_scorebox
    .subred_dash_sbox {
        border-right: 0 !important;
        border-bottom:
            1px solid var(--sr-border) !important;
    }

    #subred_dash_scorebox
    .subred_dash_sbox:last-child {
        border-bottom: 0 !important;
    }
}

/* END SUBREDDAR TOOLTIP AND METRIC REFINEMENT */

/* BEGIN SUBREDDAR DASHBOARD CARDS */

.subred_dashboard_card {
    display: block !important;
    width: 100%;
    margin: 24px 0 0 !important;
    padding: 0 !important;

    overflow: hidden;

    border: 1px solid var(--sr-border);
    border-radius: 12px;

    background: var(--sr-card-bg);
    box-shadow:
        0 1px 2px rgba(24, 36, 51, 0.03),
        0 8px 24px rgba(24, 36, 51, 0.04);

    color: var(--sr-text);
    font-size: 14px !important;
}

.subred_card_heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 76px;
    padding: 16px 20px;

    border-bottom: 1px solid var(--sr-border);
}

.subred_card_heading h2 {
    margin: 2px 0 0;
    padding: 0;

    color: var(--sr-text);
    font-size: 20px;
    font-weight: 650;
    line-height: 1.2;
}

.subred_card_eyebrow {
    display: block;

    color: #7b8794;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.075em;
    line-height: 1.2;
}

.subred_card_heading > .badge {
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 650;
}

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

.subred_plan_usage,
.subred_plan_remaining {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-height: 86px;
    padding: 18px 20px;
}

.subred_plan_usage {
    border-right: 1px solid var(--sr-border);
}

.subred_plan_usage strong,
.subred_plan_remaining strong {
    color: var(--sr-text);
    font-size: 22px;
    font-weight: 650;
    line-height: 1.15;
}

.subred_plan_usage span,
.subred_plan_remaining span {
    margin-top: 5px;

    color: var(--sr-muted);
    font-size: 12px;
}

/*
 * Recent Sweeps table.
 */
.subred_sweeps_card .table-responsive {
    width: 100%;
    overflow-x: auto;
}

#recent_sweeps_table {
    width: 100%;
    min-width: 760px;
    margin: 0 !important;

    border: 0;
    border-collapse: separate;
    border-spacing: 0;

    background: #fff;
    box-shadow: none;
}

#recent_sweeps_table thead th {
    padding: 11px 16px;

    border: 0;
    border-bottom: 1px solid var(--sr-border);

    background: #f8fafc;
    color: #667382;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-transform: uppercase;

    white-space: nowrap;
}

#recent_sweeps_table tbody td {
    padding: 12px 16px;

    border: 0;
    border-bottom: 1px solid #edf0f3;

    color: #344054;
    font-size: 12px;
    line-height: 1.35;
    vertical-align: middle;
}

#recent_sweeps_table tbody tr:last-child td {
    border-bottom: 0;
}

#recent_sweeps_table tbody tr:hover td {
    background: #fafbfc;
}

#recent_sweeps_table th:first-child,
#recent_sweeps_table td:first-child {
    width: 34%;
}

#recent_sweeps_table th:nth-child(2),
#recent_sweeps_table td:nth-child(2) {
    width: 130px;
}

#recent_sweeps_table th:last-child,
#recent_sweeps_table td:last-child {
    width: 178px;
}

#recent_sweeps_table .badge {
    padding: 5px 8px;

    border-radius: 6px;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.035em;
}

.subred-target-name {
    display: block;

    overflow: hidden;

    color: var(--sr-text);
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .subred_card_heading {
        min-height: 68px;
        padding: 14px 16px;
    }

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

    .subred_plan_usage {
        border-right: 0;
        border-bottom: 1px solid var(--sr-border);
    }
}

/* END SUBREDDAR DASHBOARD CARDS */

/* BEGIN SUBREDDAR SYSTEM STATUS STRIP */

#subred_system_box {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap;

    gap: 10px !important;

    min-height: 48px !important;
    height: auto !important;

    margin: 0 0 18px !important;
    padding: 7px 14px !important;

    border: 1px solid var(--sr-border);
    border-radius: 10px;

    background: #fff;
    box-shadow:
        0 1px 2px rgba(24, 36, 51, 0.025);
}

#subred_system_box > strong {
    flex: 0 0 auto;

    margin: 0 6px 0 0;

    color: #7b8794;

    font-size: 9px;
    font-weight: 700 !important;
    letter-spacing: 0.075em;
    line-height: 1.1;
    text-decoration: none !important;
    text-transform: uppercase;

    white-space: nowrap;
}

#subred_system_box > div {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;

    gap: 6px;

    min-width: 0;
    min-height: 30px;

    padding: 5px 9px;

    border: 1px solid #edf0f3;
    border-radius: 999px;

    background: #f8fafc;
    color: #52606d;

    font-size: 9px;
    font-weight: 600;
    line-height: 1;

    white-space: nowrap;
}

#subred_system_box > div > span {
    display: inline-flex;
    align-items: center;

    gap: 4px;

    line-height: 1;
}

#subred_system_box > div > span i {
    font-size: 10px;
}

/*
 * Tiny status dot, matching the existing icon status color.
 */
#subred_system_box > div > span::after {
    display: block;

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: currentColor;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);

    content: "";
}

#subred_system_box .status_good {
    color: #18a957;
}

#subred_system_box .status_degraded {
    color: #e5a500;
}

#subred_system_box .status_down {
    color: #d63939;
}

@media (max-width: 850px) {
    #subred_system_box {
        flex-wrap: wrap;
    }

    #subred_system_box > strong {
        width: 100%;
    }

    #subred_system_box > div {
        flex: 1 1 calc(50% - 8px);
    }
}

/* END SUBREDDAR SYSTEM STATUS STRIP */

/* BEGIN SUBREDDAR TARGETS PAGE */

.targets-page-actions {
    display: flex;
    justify-content: flex-end;

    margin: -54px 0 18px !important;
    padding: 0 !important;

    background: transparent !important;
}

.subred-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 38px;
    padding: 8px 14px;

    border: 1px solid var(--sr-accent) !important;
    border-radius: 7px;

    background: var(--sr-accent) !important;
    color: #fff !important;

    font-size: 13px;
    font-weight: 650;

    box-shadow:
        0 4px 12px rgba(240, 75, 35, 0.18);
}

.subred-primary-btn:hover {
    border-color: var(--sr-accent-dark) !important;
    background: var(--sr-accent-dark) !important;
    color: #fff !important;
}

.targets-add-card,
.targets-table-card {
    overflow: hidden;

    margin: 0 0 24px;

    border: 1px solid var(--sr-border);
    border-radius: 12px;

    background: #fff;

    box-shadow:
        0 1px 2px rgba(24, 36, 51, 0.03),
        0 8px 24px rgba(24, 36, 51, 0.04);
}

.targets-add-card .card-header,
.targets-table-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 72px;
    padding: 15px 20px;

    border-bottom: 1px solid var(--sr-border);
    background: #fff;
}

.targets-add-card .card-title,
.targets-table-card .card-title {
    margin: 2px 0 0;

    color: var(--sr-text);
    font-size: 20px;
    font-weight: 650;
    line-height: 1.2;
}

.targets-card-eyebrow {
    display: block;

    color: #7b8794;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.075em;
    line-height: 1.2;
}

.targets-add-card .card-body {
    padding: 18px 20px;
}

.targets-form {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 24px;
    align-items: end;
}

.targets-form-main {
    min-width: 0;
}

.targets-form .form-label {
    margin-bottom: 7px;

    color: #344054;
    font-size: 12px;
    font-weight: 650;
}

.targets-form .form-control {
    width: 100%;
    min-height: 42px;

    font-size: 14px;
}

.targets-options {
    display: flex;
    flex-wrap: wrap;

    gap: 10px 20px;

    margin-top: 14px;
}

.targets-options .form-check {
    display: inline-flex;
    align-items: center;

    min-height: 24px;
    margin: 0;
    padding-left: 0;
}

.targets-options .form-check-input {
    position: static;

    flex: 0 0 auto;

    width: 16px;
    height: 16px;

    margin: 0 7px 0 0;
}

.targets-options .form-check-input:checked {
    border-color: var(--sr-accent);
    background-color: var(--sr-accent);
}

.targets-options .form-check-label {
    color: #52606d;
    font-size: 12px;
    font-weight: 500;
}

.targets-form-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    min-width: 132px;
}

.targets-form-message {
    min-height: 18px;
    margin: 0 0 8px;

    color: var(--sr-muted);
    font-size: 11px;
    text-align: right;
}

.targets-count-summary {
    display: flex;
    align-items: center;

    gap: 8px;
}

.targets-count-summary span {
    padding: 6px 9px;

    border: 1px solid #e8ebef;
    border-radius: 999px;

    background: #f8fafc;
    color: #667382;

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

.targets-count-summary strong {
    color: var(--sr-text);
    font-weight: 700;
}

.targets-table-body {
    padding: 0 !important;
}

.targets-table-card .table-responsive {
    width: 100%;
    overflow-x: auto;
}

#targets_table {
    width: 100% !important;
    min-width: 1120px;

    margin: 0 !important;

    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;

    background: #fff;
    box-shadow: none !important;
}

#targets_table thead th {
    padding: 11px 13px;

    border: 0;
    border-bottom: 1px solid var(--sr-border);

    background: #f8fafc;
    color: #667382;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-transform: uppercase;

    white-space: nowrap;
}

#targets_table tbody td {
    padding: 13px;

    border: 0;
    border-bottom: 1px solid #edf0f3;

    color: #344054;
    font-size: 12px;
    line-height: 1.35;
    vertical-align: middle;
}

#targets_table tbody tr:last-child td {
    border-bottom: 0;
}

#targets_table tbody tr:hover td {
    background: #fafbfc;
}

#targets_table th:first-child,
#targets_table td:first-child {
    width: 19%;
}

#targets_table th:nth-child(2),
#targets_table td:nth-child(2) {
    width: 88px;
}

#targets_table th:nth-child(3),
#targets_table td:nth-child(3) {
    width: 132px;
}

#targets_table th:nth-child(4),
#targets_table td:nth-child(4) {
    width: 96px;
}

#targets_table th:nth-child(5),
#targets_table td:nth-child(5) {
    width: 98px;
}

#targets_table th:nth-child(6),
#targets_table td:nth-child(6),
#targets_table th:nth-child(7),
#targets_table td:nth-child(7) {
    width: 152px;
}

#targets_table th:last-child,
#targets_table td:last-child {
    width: 250px;
}

.target-keyphrase {
    display: block;

    overflow: hidden;

    color: var(--sr-text);
    font-weight: 650;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.target-search-scope,
.target-date {
    color: #52606d;
}

#targets_table .badge {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    padding: 5px 8px;
    border-radius: 6px;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.025em;
}

#targets_table .status-dot {
    display: inline-block;

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: currentColor;
}

.target-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;
}

.target-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    min-height: 30px;
    padding: 5px 8px;

    border-radius: 6px;

    font-size: 10px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.target-actions .btn i {
    font-size: 9px;
}

.target-actions .btn-ghost-danger {
    border-color: transparent;
    background: transparent;
    color: #d63939;
}

.target-actions .btn-ghost-danger:hover {
    border-color: #ffd5d5;
    background: #fff1f1;
    color: #c22f2f;
}

.target-actions .btn:disabled {
    opacity: 0.48;
    box-shadow: none;
    cursor: not-allowed;
}

.targets-table-card .dataTables_wrapper {
    padding: 0;
}

.targets-table-card .dataTables_length,
.targets-table-card .dataTables_filter {
    margin: 0;
    padding: 14px 16px;

    color: #667382;
    font-size: 11px;
}

.targets-table-card .dataTables_length {
    float: left;
}

.targets-table-card .dataTables_filter {
    float: right;
}

.targets-table-card .dataTables_filter input,
.targets-table-card .dataTables_length select {
    min-height: 34px;
    margin-left: 6px;
    padding: 6px 9px;

    border: 1px solid #d8dce2;
    border-radius: 6px;

    background: #fff;
}

.targets-table-card .dataTables_info,
.targets-table-card .dataTables_paginate {
    padding: 14px 16px !important;

    color: #667382 !important;
    font-size: 11px;
}

.targets-table-card .dataTables_paginate {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 3px;
}

.targets-table-card
.dataTables_wrapper
.dataTables_paginate
.paginate_button {
    min-width: 32px;
    min-height: 32px;

    margin: 0 !important;
    padding: 6px 9px !important;

    border: 1px solid transparent !important;
    border-radius: 6px !important;

    background: transparent !important;
    color: #52606d !important;
}

.targets-table-card
.dataTables_wrapper
.dataTables_paginate
.paginate_button.current {
    border-color: #d8dce2 !important;
    background: #fff !important;
    color: var(--sr-text) !important;
}

@media (max-width: 760px) {
    .targets-page-actions {
        margin-top: 0 !important;
    }

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

    .targets-form-actions {
        align-items: stretch;
    }

    .targets-form-message {
        text-align: left;
    }

    .targets-table-heading {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 10px;
    }
}

/* END SUBREDDAR TARGETS PAGE */

/* BEGIN SUBREDDAR ALERTS PAGE */

.alerts-table-card {
    overflow: hidden;
    margin: 0 0 24px;
    border: 1px solid var(--sr-border);
    border-radius: 12px;
    background: #fff;
    box-shadow:
        0 1px 2px rgba(24, 36, 51, 0.03),
        0 8px 24px rgba(24, 36, 51, 0.04);
}

.alerts-table-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--sr-border);
    background: #fff;
}

.alerts-table-card .card-title {
    margin: 2px 0 0;
    color: var(--sr-text);
    font-size: 20px;
    font-weight: 650;
    line-height: 1.2;
}

.alerts-card-eyebrow {
    display: block;
    color: #7b8794;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.075em;
    line-height: 1.2;
}

.alerts-count-summary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alerts-count-summary > span {
    padding: 6px 9px;
    border: 1px solid #e8ebef;
    border-radius: 999px;
    background: #f8fafc;
    color: #667382;
    font-size: 10px;
    font-weight: 600;
}

.alerts-count-summary > .alerts-count-unread {
    border-color: #ffdcca;
    background: #fff5ef;
    color: #c2411d;
}

.alerts-count-summary strong {
    color: var(--sr-text);
    font-weight: 700;
}

.alerts-table-body {
    padding: 0 !important;
}

.alerts-table-card .table-responsive {
    width: 100%;
    overflow-x: auto;
}

#alerts_table {
    width: 100% !important;
    min-width: 1320px;
    margin: 0 !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
    background: #fff;
    box-shadow: none !important;
}

#alerts_table thead th {
    padding: 11px 13px;
    border: 0;
    border-bottom: 1px solid var(--sr-border);
    background: #f8fafc;
    color: #667382;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

#alerts_table tbody td {
    padding: 13px;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    color: #344054;
    font-size: 12px;
    line-height: 1.4;
    vertical-align: middle;
}

#alerts_table tbody tr:last-child td {
    border-bottom: 0;
}

#alerts_table tbody tr:hover td {
    background: #fafbfc;
}

#alerts_table .alert-row-unread td {
    background: #fffdfb;
}

#alerts_table .alert-row-unread:hover td {
    background: #fff9f5;
}

#alerts_table .alert-row-unread td:first-child {
    box-shadow: inset 3px 0 0 var(--sr-accent);
}

#alerts_table th:nth-child(1),
#alerts_table td:nth-child(1) {
    width: 86px;
}

#alerts_table th:nth-child(2),
#alerts_table td:nth-child(2) {
    width: 92px;
}

#alerts_table th:nth-child(3),
#alerts_table td:nth-child(3) {
    width: 150px;
}

#alerts_table th:nth-child(4),
#alerts_table td:nth-child(4) {
    width: 140px;
}

#alerts_table th:nth-child(5),
#alerts_table td:nth-child(5) {
    width: 150px;
}

#alerts_table th:nth-child(6),
#alerts_table td:nth-child(6) {
    min-width: 300px;
    width: 32%;
}

#alerts_table th:nth-child(7),
#alerts_table td:nth-child(7),
#alerts_table th:nth-child(8),
#alerts_table td:nth-child(8) {
    width: 155px;
}

#alerts_table th:nth-child(9),
#alerts_table td:nth-child(9) {
    width: 260px;
}

#alerts_table .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.alert-status-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.alert-target-name {
    display: block;
    overflow: hidden;
    color: var(--sr-text);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alert-subreddit {
    color: #3567a7;
    font-weight: 600;
    white-space: nowrap;
}

.alert-author,
.alert-date {
    color: #52606d;
}

.alert-author {
    display: block;
    overflow: hidden;
    max-width: 150px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alert-mention-excerpt {
    display: -webkit-box;
    overflow: hidden;
    max-width: 430px;
    color: #344054;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.alert-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.alert-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.alert-actions .btn i {
    font-size: 9px;
}

.alert-actions .btn-ghost-danger {
    border-color: transparent;
    background: transparent;
    color: #d63939;
}

.alert-actions .btn-ghost-danger:hover {
    border-color: #ffd5d5;
    background: #fff1f1;
    color: #c22f2f;
}

.alert-actions .btn:disabled {
    opacity: 0.48;
    box-shadow: none;
    cursor: not-allowed;
}

.alerts-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 28px;
    flex-direction: column;
    color: #7b8794;
    text-align: center;
}

.alerts-empty-state i {
    margin-bottom: 12px;
    color: #98a2b3;
    font-size: 28px;
}

.alerts-empty-state strong {
    color: var(--sr-text);
    font-size: 14px;
}

.alerts-empty-state span {
    margin-top: 5px;
    font-size: 12px;
}

.alerts-table-card .dataTables_wrapper {
    padding: 0;
}

.alerts-table-card .dataTables_length,
.alerts-table-card .dataTables_filter {
    margin: 0;
    padding: 14px 16px;
    color: #667382;
    font-size: 11px;
}

.alerts-table-card .dataTables_length {
    float: left;
}

.alerts-table-card .dataTables_filter {
    float: right;
}

.alerts-table-card .dataTables_filter input,
.alerts-table-card .dataTables_length select {
    min-height: 34px;
    margin-left: 6px;
    padding: 6px 9px;
    border: 1px solid #d8dce2;
    border-radius: 6px;
    background: #fff;
}

.alerts-table-card .dataTables_info,
.alerts-table-card .dataTables_paginate {
    padding: 14px 16px !important;
    color: #667382 !important;
    font-size: 11px;
}

.alerts-table-card .dataTables_paginate {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}

.alerts-table-card
.dataTables_wrapper
.dataTables_paginate
.paginate_button {
    min-width: 32px;
    min-height: 32px;
    margin: 0 !important;
    padding: 6px 9px !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: #52606d !important;
}

.alerts-table-card
.dataTables_wrapper
.dataTables_paginate
.paginate_button.current {
    border-color: #d8dce2 !important;
    background: #fff !important;
    color: var(--sr-text) !important;
}

@media (max-width: 760px) {
    .alerts-table-heading {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 10px;
    }
}

/* END SUBREDDAR ALERTS PAGE */

/* BEGIN SUBREDDAR ALERT WATCHLIST */
.alerts-count-summary > .alerts-count-watchlisted {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-color: #fde68a;
    background: #fffbeb;
    color: #a16207;
}

.alerts-count-watchlisted i {
    color: #eab308;
    font-size: 10px;
}

#alerts_table {
    min-width: 1370px;
}

#alerts_table .alert-row-unread td:first-child {
    box-shadow: none;
}

/* #alerts_table .alert-row-unread td:nth-child(2) {
    box-shadow: inset 3px 0 0 var(--sr-accent);
} */

#alerts_table .alert-row-watchlisted td {
    background: #fffef8;
}

#alerts_table .alert-row-watchlisted:hover td {
    background: #fffbeb;
}

#alerts_table th:nth-child(1),
#alerts_table td:nth-child(1) {
    width: 48px;
    padding-right: 5px;
    text-align: center;
}

#alerts_table th:nth-child(2),
#alerts_table td:nth-child(2) {
    width: 86px;
}

#alerts_table th:nth-child(3),
#alerts_table td:nth-child(3) {
    width: 92px;
}

#alerts_table th:nth-child(4),
#alerts_table td:nth-child(4) {
    width: 150px;
}

#alerts_table th:nth-child(5),
#alerts_table td:nth-child(5) {
    width: 140px;
}

#alerts_table th:nth-child(6),
#alerts_table td:nth-child(6) {
    width: 150px;
}

#alerts_table th:nth-child(7),
#alerts_table td:nth-child(7) {
    min-width: 300px;
    width: 32%;
}

#alerts_table th:nth-child(8),
#alerts_table td:nth-child(8),
#alerts_table th:nth-child(9),
#alerts_table td:nth-child(9) {
    width: 155px;
}

#alerts_table th:nth-child(10),
#alerts_table td:nth-child(10) {
    width: 260px;
}

.alert-watchlist-heading {
    text-align: center;
}

.alert-watchlist-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #98a2b3;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        transform 0.15s ease;
}

.alert-watchlist-toggle i {
    font-size: 15px;
}

.alert-watchlist-toggle:hover {
    color: #ca8a04;
    background: #fef9c3;
    transform: translateY(-1px);
}

.alert-watchlist-toggle.is-active {
    color: #eab308;
    background: #fffbeb;
}

.alert-watchlist-toggle:focus-visible {
    outline: 2px solid #facc15;
    outline-offset: 2px;
}

.alert-watchlist-toggle:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}
/* END SUBREDDAR ALERT WATCHLIST */

