/* App shell layout (authenticated /app/* pages) */
.cw-app {
    --cw-shell-bg: #F8FAFC;
    --cw-sidebar-width: 256px;
    --cw-sidebar-collapsed-width: 72px;
    display: flex;
    min-height: 100vh;
    background: var(--cw-shell-bg);
    color: var(--cw-ink, #0F172A);
}

.cw-sidebar {
    width: var(--cw-sidebar-width);
    flex-shrink: 0;
    background: #fff;
    color: #334155;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--cw-border, #E2E8F0);
    box-shadow: 1px 0 0 rgba(15, 23, 42, 0.02);
    transition: width 0.18s ease;
}

.cw-app.is-collapsed .cw-sidebar { width: var(--cw-sidebar-collapsed-width); }
.cw-app.is-collapsed .cw-sidebar-brand { padding: 18px 12px 14px; }
.cw-app.is-collapsed .cw-sidebar-logo { justify-content: center; gap: 0; }
.cw-app.is-collapsed .cw-sidebar-logo > span { display: none; }
.cw-app.is-collapsed .cw-nav-label { display: none; }
.cw-app.is-collapsed .cw-nav-link { justify-content: center; padding: 10px 0; gap: 0; }
.cw-app.is-collapsed .cw-nav-link.active::before { display: none; }
.cw-app.is-collapsed .cw-sidebar-nav,
.cw-app.is-collapsed .cw-sidebar-footer { padding-left: 10px; padding-right: 10px; }
.cw-app.is-collapsed .cw-nav-logout { padding: 0; }
.cw-app.is-collapsed .cw-sidebar-toggle .cw-icon-sidebar { transform: rotate(180deg); }

.cw-sidebar-toggle {
    position: absolute;
    top: 18px;
    right: -14px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--cw-border, #E2E8F0);
    color: #64748B;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    z-index: 10;
    padding: 0;
}
.cw-sidebar-toggle:hover { color: var(--cw-primary, #DC2626); }

.cw-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cw-content {
    flex: 1;
    padding: 32px 40px;
    width: 100%;
    box-sizing: border-box;
}

/* Shared shell icons */
.cw-nav-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex: 0 0 auto;
    background: currentColor;
    -webkit-mask: var(--cw-icon) center / contain no-repeat;
    mask: var(--cw-icon) center / contain no-repeat;
    transition: transform 0.18s ease;
}
.cw-icon-dashboard { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 11 9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E"); }
.cw-icon-scans { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7'/%3E%3Cpath d='M21 3v6h-6'/%3E%3C/svg%3E"); }
.cw-icon-findings { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E"); }
.cw-icon-channels { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m10 9 6 3-6 3z' fill='black' stroke='none'/%3E%3C/svg%3E"); }
.cw-icon-domain-rules { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M12 3a15 15 0 0 1 0 18'/%3E%3Cpath d='M12 3a15 15 0 0 0 0 18'/%3E%3C/svg%3E"); }
.cw-icon-settings { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21v-7'/%3E%3Cpath d='M4 10V3'/%3E%3Cpath d='M12 21v-9'/%3E%3Cpath d='M12 8V3'/%3E%3Cpath d='M20 21v-5'/%3E%3Cpath d='M20 12V3'/%3E%3Ccircle cx='4' cy='12' r='2'/%3E%3Ccircle cx='12' cy='10' r='2'/%3E%3Ccircle cx='20' cy='14' r='2'/%3E%3C/svg%3E"); }
.cw-icon-admin { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='M9 12l2 2 4-5'/%3E%3Cpath d='M12 7v1'/%3E%3C/svg%3E"); }
.cw-icon-user { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.cw-icon-billing { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M7 15h3'/%3E%3C/svg%3E"); }
.cw-icon-signout { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E"); }
.cw-icon-help { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 1 1 5.82 1c-.5 1-1.91 1.5-2.41 2.5'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.cw-icon-privacy { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='M9 12l2 2 4-5'/%3E%3C/svg%3E"); }
.cw-icon-support { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2 11 13'/%3E%3Cpath d='m22 2-7 20-4-9-9-4z'/%3E%3C/svg%3E"); }
.cw-icon-feature { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H7l-4 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h5'/%3E%3C/svg%3E"); }
.cw-icon-more { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E"); }
.cw-icon-close { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E"); }
.cw-icon-sidebar { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18 9 12l6-6'/%3E%3C/svg%3E"); }

/* Sidebar brand */
.cw-sidebar-brand {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cw-border, #E2E8F0);
}
.cw-sidebar-logo,
.cw-mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #0F172A;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0;
}
.cw-sidebar-logo {
    gap: 14px;
}
.cw-sidebar-logo .cw-wordmark {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    justify-content: center;
    line-height: 0.95;
}
.cw-sidebar-logo img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: contain;
}
.cw-mobile-brand img {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    object-fit: contain;
}
.cw-wordmark {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    justify-content: center;
    min-width: 0;
    line-height: 1;
}
.cw-wordmark-1,
.cw-wordmark-2 {
    display: block;
}
.cw-sidebar-logo .cw-wordmark-1 {
    color: #0F172A;
    font-size: 18px;
}
.cw-mobile-brand .cw-wordmark-1 {
    color: #0F172A;
    font-size: 18px;
}
.cw-sidebar-logo .cw-wordmark-2 {
    color: var(--cw-primary, #DC2626);
    font-size: 18px;
    margin-top: 0;
}
.cw-mobile-brand .cw-wordmark-2 {
    color: var(--cw-primary, #DC2626);
    font-size: 18px;
    margin-top: 0;
}

/* Sidebar nav */
.cw-sidebar-nav {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.cw-sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--cw-border, #E2E8F0);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cw-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
.cw-nav-link:hover {
    background: #F1F5F9;
    color: #0F172A;
}
.cw-nav-link.active {
    background: #FEF2F2;
    color: #B91C1C;
}
.cw-nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 999px;
    background: var(--cw-primary, #DC2626);
}
.cw-nav-label {
    min-width: 0;
}
.cw-nav-user-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.cw-nav-logout {
    margin: 0;
    padding: 0;
}

/* Mobile shell */
.cw-mobile-topbar,
.cw-mobile-tabbar,
.cw-mobile-menu-backdrop,
.cw-mobile-menu {
    display: none;
}

@media (max-width: 760px) {
    .cw-app {
        display: block;
        min-height: 100dvh;
        padding-top: 58px;
    }
    .cw-sidebar {
        display: none;
    }
    .cw-main {
        display: block;
        min-height: 100dvh;
    }
    .cw-content {
        padding: 20px 16px calc(100px + env(safe-area-inset-bottom));
    }

    .cw-mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 60;
        height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 16px;
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid var(--cw-border, #E2E8F0);
        backdrop-filter: blur(12px);
    }
    .cw-mobile-brand {
        min-width: 0;
    }
    .cw-mobile-brand > .cw-wordmark {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .cw-mobile-menu-button,
    .cw-mobile-menu-close {
        width: 40px;
        height: 40px;
        border-radius: 999px;
        border: 1px solid var(--cw-border, #E2E8F0);
        background: #fff;
        color: #334155;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    }

    .cw-mobile-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid var(--cw-border, #E2E8F0);
        box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.08);
        backdrop-filter: blur(12px);
    }
    .cw-mobile-tab {
        min-width: 0;
        min-height: 56px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #64748B;
        text-decoration: none;
        font-family: inherit;
        font-size: 11px;
        font-weight: 700;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 5px 3px;
    }
    .cw-mobile-tab .cw-nav-icon {
        width: 21px;
        height: 21px;
    }
    .cw-mobile-tab span:last-child {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .cw-mobile-tab:hover,
    .cw-mobile-tab.active {
        color: #B91C1C;
        background: #FEF2F2;
    }
    .cw-mobile-tab-button {
        cursor: pointer;
    }

    .cw-mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 70;
        display: block;
        border: 0;
        padding: 0;
        opacity: 0;
        pointer-events: none;
        background: rgba(15, 23, 42, 0.34);
        transition: opacity 0.18s ease;
    }
    .cw-mobile-menu {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(80px + env(safe-area-inset-bottom));
        z-index: 80;
        display: block;
        max-height: min(72vh, 520px);
        overflow: auto;
        padding: 10px;
        background: #fff;
        border: 1px solid var(--cw-border, #E2E8F0);
        border-radius: 18px;
        box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
        transform: translateY(calc(100% + 110px));
        transition: transform 0.2s ease;
    }
    .cw-mobile-menu-handle {
        width: 42px;
        height: 4px;
        margin: 2px auto 12px;
        border-radius: 999px;
        background: #CBD5E1;
    }
    .cw-mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 0 2px 12px;
        border-bottom: 1px solid var(--cw-border, #E2E8F0);
    }
    .cw-mobile-menu-title {
        font-size: 17px;
        font-weight: 800;
        color: #0F172A;
    }
    .cw-mobile-menu-subtitle {
        max-width: 250px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #64748B;
        font-size: 13px;
    }
    .cw-mobile-menu-links {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding-top: 10px;
    }
    .cw-mobile-menu-links .cw-nav-link {
        color: #334155;
        padding: 12px;
        border-radius: 12px;
    }
    .cw-mobile-menu-links .cw-nav-link.active {
        color: #B91C1C;
    }
    .cw-mobile-menu-separator {
        height: 1px;
        margin: 6px 2px;
        background: var(--cw-border, #E2E8F0);
    }
    .cw-app.is-mobile-menu-open .cw-mobile-menu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .cw-app.is-mobile-menu-open .cw-mobile-menu {
        transform: translateY(0);
    }
    body.cw-mobile-menu-lock {
        overflow: hidden;
    }
}

/* ----- Shared in-app page styles ----- */
.cw-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cw-border, #E2E8F0);
}
.cw-page-header h1 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 700;
    color: var(--cw-ink, #0F172A);
    letter-spacing: -0.01em;
}
.cw-page-header .cw-page-sub {
    margin: 0;
    color: #475569;
    font-size: 14px;
}
.cw-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
}
.cw-btn-primary { background: var(--cw-primary, #DC2626); color: #fff; }
.cw-btn-primary:hover { background: #B91C1C; }
.cw-btn:disabled {
    cursor: not-allowed;
    box-shadow: none;
}
.cw-btn-primary:disabled,
.cw-btn-primary:disabled:hover {
    background: #CBD5E1;
    border-color: #CBD5E1;
    color: #475569;
}
.cw-btn-secondary {
    background: #fff;
    color: var(--cw-ink, #0F172A);
    border-color: var(--cw-border, #E2E8F0);
}
.cw-btn-secondary:hover { background: #F8FAFC; }
.cw-btn-secondary:disabled,
.cw-btn-secondary:disabled:hover {
    background: #F1F5F9;
    border-color: #E2E8F0;
    color: #94A3B8;
}
.cw-btn-danger {
    background: #fff;
    color: #B91C1C;
    border-color: #FECACA;
}
.cw-btn-danger:hover { background: #FEF2F2; }

.cw-card {
    background: #fff;
    border: 1px solid var(--cw-border, #E2E8F0);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.cw-card h2 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--cw-ink, #0F172A);
}
.cw-card .muted { color: #64748B; font-size: 14px; margin: 0; }

.cw-empty {
    background: #F8FAFC;
    border: 1px dashed var(--cw-border, #E2E8F0);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    color: #475569;
}
.cw-empty h2 { color: var(--cw-ink, #0F172A); margin: 0 0 8px; font-size: 18px; }
.cw-empty p { margin: 0 0 16px; }

.cw-personal-data-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.cw-personal-data-actions form {
    margin: 0;
}

.cw-table-shell {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border: 1px solid var(--cw-border, #E2E8F0);
    border-radius: 12px;
    overflow: hidden;
}
.cw-table th, .cw-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--cw-border, #E2E8F0);
    vertical-align: middle;
}
.cw-table tr:last-child td { border-bottom: none; }
.cw-table th {
    background: #F8FAFC;
    font-weight: 600;
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cw-table .truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
    .cw-page-header {
        align-items: stretch;
    }

    .cw-page-actions {
        width: 100%;
    }

    .cw-page-actions .cw-btn,
    .cw-page-actions select {
        justify-content: center;
        min-width: min(100%, 148px);
    }

    .cw-table-shell {
        overflow-x: visible;
    }

    .cw-mobile-card-table {
        display: block;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .cw-mobile-card-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .cw-mobile-card-table tbody {
        display: grid;
        gap: 10px;
    }

    .cw-mobile-card-table tr {
        display: grid;
        gap: 8px;
        padding: 12px;
        border: 1px solid var(--cw-border, #E2E8F0);
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .cw-mobile-card-table th,
    .cw-mobile-card-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        min-width: 0;
        padding: 0;
        border-bottom: 0;
        font-size: 14px;
        text-align: right;
    }

    .cw-mobile-card-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 42%;
        color: #64748B;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-align: left;
        text-transform: uppercase;
    }

    .cw-mobile-card-table td[data-label=""]::before {
        display: none;
    }

    .cw-mobile-card-table .truncate {
        width: auto !important;
        max-width: none !important;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .cw-mobile-card-table td > a {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .cw-mobile-card-table .cw-badge {
        white-space: nowrap;
    }

    .cw-mobile-card-table .cw-mobile-select {
        justify-content: flex-start;
    }

    .cw-mobile-card-table .cw-mobile-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        padding-top: 6px;
        border-top: 1px solid var(--cw-border, #E2E8F0);
        text-align: left !important;
        white-space: normal !important;
    }

    .cw-mobile-card-table .cw-mobile-actions::before {
        width: 100%;
        max-width: none;
    }

    .cw-mobile-card-table .cw-mobile-actions .cw-btn {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
        min-width: 96px;
    }
}

.cw-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #F1F5F9;
    color: #334155;
}
.cw-badge-critical { background: #FEE2E2; color: #991B1B; }
.cw-badge-high { background: #FFEDD5; color: #9A3412; }
.cw-badge-medium { background: #FEF3C7; color: #854D0E; }
.cw-badge-low { background: #DBEAFE; color: #1E40AF; }
.cw-badge-success { background: #DCFCE7; color: #166534; }
.cw-badge-muted { background: #F1F5F9; color: #475569; }

.cw-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.cw-filters select, .cw-filters input[type="text"] {
    padding: 7px 10px;
    border: 1px solid var(--cw-border, #E2E8F0);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}

/* Domain rules page */
.cw-rule-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px 16px;
}
.cw-rule-legend li {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}
.cw-rule-legend .cw-badge {
    flex: 0 0 auto;
}
.cw-rule-counts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cw-rule-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--cw-border, #E2E8F0);
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: #475569;
}
.cw-rule-count-chip:hover {
    border-color: #94A3B8;
}
.cw-rule-count-chip.is-active {
    border-color: #DC2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}
.cw-rule-count {
    font-weight: 600;
    color: #0F172A;
}
.cw-rule-type-select {
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}
.cw-rule-type-select:hover, .cw-rule-type-select:focus {
    border-color: var(--cw-border, #E2E8F0);
    background: #fff;
}
.cw-rule-label-input {
    border: 1px solid transparent;
    padding: 4px 6px;
    border-radius: 6px;
    min-width: 140px;
    font-family: inherit;
    font-size: 14px;
    background: transparent;
}
.cw-rule-label-input:hover, .cw-rule-label-input:focus {
    border-color: var(--cw-border, #E2E8F0);
    background: #fff;
}

/* Admin page */
.cw-admin-page {
    display: grid;
    gap: 18px;
}

.cw-admin-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 12px;
}

.cw-admin-kpi {
    border: 1px solid var(--cw-border, #E2E8F0);
    border-radius: 12px;
    background: #fff;
    padding: 16px;
}

.cw-admin-kpi-label {
    color: #64748B;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cw-admin-kpi-value {
    margin-top: 6px;
    color: #0F172A;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.cw-admin-kpi-note {
    margin-top: 8px;
    color: #475569;
    font-size: 13px;
}

.cw-admin-kpi.tone-blue {
    border-color: #BFDBFE;
    background: #EFF6FF;
}

.cw-admin-kpi.tone-green {
    border-color: #BBF7D0;
    background: #F0FDF4;
}

.cw-admin-kpi.tone-yellow {
    border-color: #FDE68A;
    background: #FFFBEB;
}

.cw-admin-kpi.tone-red {
    border-color: #FECACA;
    background: #FEF2F2;
}

.cw-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}

.cw-admin-panel {
    margin-bottom: 0;
}

.cw-admin-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.cw-admin-panel-head h2 {
    margin: 0;
}

.cw-admin-activity-list {
    display: grid;
    gap: 10px;
}

.cw-admin-activity {
    border: 1px solid var(--cw-border, #E2E8F0);
    border-radius: 10px;
    padding: 12px;
    background: #F8FAFC;
}

.cw-admin-activity-detail {
    margin-top: 4px;
    color: #0F172A;
    font-size: 14px;
}

.cw-admin-activity-meta {
    margin-top: 4px;
    color: #64748B;
    font-size: 12px;
}

.cw-admin-error-row td {
    color: #991B1B;
    background: #FEF2F2;
    font-size: 13px;
}

.cw-admin-code {
    display: inline-block;
    max-width: 170px;
    overflow: hidden;
    color: #64748B;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.cw-admin-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cw-admin-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--cw-border, #E2E8F0);
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    padding: 6px 10px;
}

.cw-admin-pill strong {
    color: #0F172A;
}

@media (max-width: 1120px) {
    .cw-admin-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 760px) {
    .cw-admin-kpis {
        grid-template-columns: 1fr;
    }
}

/* Blazor error */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
