/* SecurityAlert.ai - Executive / VIP Protection Center */

.vip-page,
.vip-page * {
    letter-spacing: 0;
}

.vip-page {
    padding-bottom: 64px;
}

.vip-loading {
    color: var(--text-tertiary);
    padding: 80px 20px;
    text-align: center;
}

.vip-loading .spinner {
    animation: vip-spin 0.7s linear infinite;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent);
    height: 32px;
    margin: 0 auto 16px;
    width: 32px;
}

@keyframes vip-spin {
    to { transform: rotate(360deg); }
}

.vip-hero {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.vip-kicker {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.vip-hero h1 {
    font-size: 1.7rem;
    line-height: 1.15;
    margin: 0 0 5px;
}

.vip-page .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0;
    max-width: 860px;
}

.vip-hero-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.vip-primary,
.vip-secondary,
.vip-action button,
.vip-finding-actions button,
.vip-finding-actions a,
.vip-detail-match,
.vip-person-row {
    font: inherit;
}

.vip-primary,
.vip-secondary,
.vip-action button,
.vip-finding-actions button,
.vip-finding-actions a {
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 750;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    text-decoration: none;
    white-space: nowrap;
}

.vip-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.vip-secondary,
.vip-action button,
.vip-finding-actions button,
.vip-finding-actions a {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.vip-primary:hover,
.vip-secondary:hover,
.vip-action button:hover,
.vip-finding-actions button:hover,
.vip-finding-actions a:hover {
    border-color: var(--accent);
    filter: brightness(1.08);
}

.vip-primary:focus-visible,
.vip-secondary:focus-visible,
.vip-action button:focus-visible,
.vip-finding-actions button:focus-visible,
.vip-finding-actions a:focus-visible,
.vip-page input:focus,
.vip-page select:focus,
.vip-page textarea:focus,
.vip-person-row:focus-visible,
.vip-detail-match:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

.vip-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 0;
    padding: 16px;
}

.vip-stat strong {
    display: block;
    font-size: 1.45rem;
    line-height: 1;
}

.vip-stat span {
    color: var(--text-tertiary);
    display: block;
    font-size: 0.72rem;
    font-weight: 750;
    margin-top: 8px;
    text-transform: uppercase;
}

.vip-stat.warn {
    border-color: color-mix(in srgb, var(--warn) 38%, var(--border-color));
}

.vip-stat.danger {
    background: var(--accent-soft);
    border-color: var(--accent-line);
}

.vip-ops-grid {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    margin-bottom: 18px;
}

.vip-panel,
.vip-detail-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.vip-panel {
    padding: 16px;
}

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

.vip-panel h2,
.vip-detail-head h2,
.vip-detail-section h3,
.vip-empty h3 {
    color: var(--text-primary);
    font-size: 0.98rem;
    margin: 0 0 4px;
}

.vip-panel p,
.vip-empty p,
.vip-detail-head p {
    color: var(--text-tertiary);
    font-size: 0.76rem;
    line-height: 1.45;
    margin: 0;
}

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

.vip-action {
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
}

.vip-action.critical {
    background: var(--accent-soft);
    border-color: var(--accent-line);
}

.vip-action.high,
.vip-action.medium {
    border-color: color-mix(in srgb, var(--warn) 45%, var(--border-color));
}

.vip-action strong {
    display: block;
    font-size: 0.88rem;
    margin-top: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.vip-action p {
    margin-top: 5px;
}

.vip-risk {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1;
    padding: 4px 7px;
    text-transform: uppercase;
    width: fit-content;
}

.vip-risk.critical {
    background: rgba(255, 59, 79, 0.16);
    border-color: rgba(255, 59, 79, 0.44);
    color: #ff7686;
}

.vip-risk.high,
.vip-risk.medium {
    background: rgba(245, 166, 35, 0.13);
    border-color: rgba(245, 166, 35, 0.42);
    color: #ffc25f;
}

.vip-risk.low {
    background: rgba(56, 211, 159, 0.1);
    border-color: rgba(56, 211, 159, 0.32);
    color: #55dcae;
}

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

.vip-health-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 0;
    padding: 12px;
}

.vip-health-item span,
.vip-health-item small,
.vip-source-pill span,
.vip-source-pill small {
    color: var(--text-tertiary);
    display: block;
    font-size: 0.7rem;
    line-height: 1.35;
}

.vip-health-item span,
.vip-source-pill span {
    font-weight: 750;
    text-transform: uppercase;
}

.vip-health-item strong,
.vip-source-pill strong {
    color: var(--text-primary);
    display: block;
    font-size: 1.05rem;
    margin-top: 6px;
    overflow-wrap: anywhere;
}

.vip-meter {
    background: var(--bg-tertiary);
    border-radius: 999px;
    display: block;
    height: 6px;
    overflow: hidden;
    width: 100%;
}

.vip-meter i {
    background: var(--accent);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.vip-health-item .vip-meter {
    margin: 10px 0 7px;
}

.vip-source-mix {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.vip-source-pill,
.vip-source-empty {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 0;
    padding: 10px;
}

.vip-source-empty {
    color: var(--text-tertiary);
    font-size: 0.76rem;
    grid-column: 1 / -1;
}

.vip-add-panel {
    margin-bottom: 18px;
}

.vip-add-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.vip-add-grid label,
.vip-edit-form label {
    color: var(--text-tertiary);
    display: grid;
    font-size: 0.72rem;
    font-weight: 750;
    gap: 6px;
    min-width: 0;
    text-transform: uppercase;
}

.vip-add-grid label.wide {
    grid-column: span 2;
}

.vip-add-grid .vip-primary {
    align-self: end;
}

.vip-page input,
.vip-page select,
.vip-page textarea {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.85rem;
    min-height: 38px;
    min-width: 0;
    padding: 8px 10px;
    width: 100%;
}

.vip-page textarea {
    min-height: 92px;
    resize: vertical;
}

.vip-form-status {
    color: var(--warn);
    font-size: 0.78rem;
    margin-top: 10px;
    min-height: 18px;
}

.vip-workbench {
    align-items: start;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
}

.vip-main {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.vip-toolbar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(220px, 1fr) 150px 150px auto;
    padding: 12px;
}

.vip-table {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.vip-table-head,
.vip-person-row {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(190px, 1.35fr) minmax(135px, 0.9fr) minmax(120px, 0.75fr) minmax(120px, 0.8fr) minmax(180px, 1.1fr);
}

.vip-table-head {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 0.67rem;
    font-weight: 800;
    padding: 10px 12px;
    text-transform: uppercase;
}

.vip-person-row {
    align-items: center;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    padding: 12px;
    text-align: left;
    width: 100%;
}

.vip-person-row:hover,
.vip-person-row.active {
    background: var(--bg-tertiary);
}

.vip-person-row.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.vip-person-row > span,
.vip-table-head span {
    min-width: 0;
}

.vip-person-main strong,
.vip-next-cell strong,
.vip-finding h3,
.vip-detail-match strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vip-person-main small,
.vip-next-cell small,
.vip-coverage-cell small,
.vip-detail-match small {
    color: var(--text-tertiary);
    display: block;
    font-size: 0.72rem;
    line-height: 1.35;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.vip-brand-cell {
    color: var(--text-secondary);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.vip-coverage-cell {
    display: grid;
    gap: 4px;
}

.vip-match-cell {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.vip-match-cell span {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 750;
    padding: 3px 7px;
    white-space: nowrap;
}

.vip-findings-panel {
    min-width: 0;
}

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

.vip-finding {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    min-width: 0;
    padding: 12px;
}

.vip-finding.active,
.vip-finding:hover {
    border-color: var(--accent);
}

.vip-finding-top,
.vip-finding-meta,
.vip-finding-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vip-finding-top {
    justify-content: space-between;
}

.vip-finding-top > span:last-child,
.vip-finding-meta span {
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

.vip-finding h3 {
    font-size: 0.9rem;
    margin: 10px 0 5px;
}

.vip-finding p {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.vip-finding-actions {
    margin-top: 10px;
}

.vip-finding-actions button,
.vip-finding-actions a {
    font-size: 0.72rem;
    min-height: 30px;
    padding: 5px 9px;
}

.vip-detail-panel {
    padding: 16px;
    position: sticky;
    top: 80px;
}

.vip-detail-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.vip-detail-head h2 {
    font-size: 1.08rem;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.vip-detail-metrics {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
}

.vip-detail-metrics div {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.vip-detail-metrics strong {
    display: block;
    font-size: 1rem;
}

.vip-detail-metrics span {
    color: var(--text-tertiary);
    display: block;
    font-size: 0.68rem;
    margin-top: 4px;
    text-transform: uppercase;
}

.vip-edit-form {
    display: grid;
    gap: 10px;
}

.vip-edit-form .vip-primary,
.vip-edit-form .vip-secondary {
    width: 100%;
}

.vip-detail-section {
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    padding-top: 14px;
}

.vip-detail-match {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 10px;
    text-align: left;
    width: 100%;
}

.vip-detail-match:hover {
    border-color: var(--accent);
}

.vip-empty {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px;
}

.vip-empty.slim {
    padding: 14px;
}

.vip-empty .vip-primary {
    margin-top: 12px;
}

.vip-muted {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 0;
}

.vip-toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    bottom: 22px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    font-size: 0.86rem;
    max-width: min(420px, calc(100vw - 32px));
    opacity: 0;
    padding: 12px 14px;
    position: fixed;
    right: 22px;
    transform: translateY(10px);
    transition: opacity 0.18s, transform 0.18s;
    z-index: 10000;
}

.vip-toast.success {
    border-color: rgba(56, 211, 159, 0.38);
}

.vip-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1180px) {
    .vip-ops-grid,
    .vip-workbench {
        grid-template-columns: 1fr;
    }

    .vip-detail-panel {
        position: static;
    }
}

@media (max-width: 920px) {
    .vip-hero {
        display: grid;
    }

    .vip-hero-actions {
        justify-content: flex-start;
    }

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

    .vip-toolbar,
    .vip-add-grid {
        grid-template-columns: 1fr;
    }

    .vip-add-grid label.wide {
        grid-column: auto;
    }

    .vip-table-head {
        display: none;
    }

    .vip-person-row {
        gap: 10px;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .vip-stats,
    .vip-health-grid,
    .vip-source-mix,
    .vip-detail-metrics {
        grid-template-columns: 1fr;
    }

    .vip-panel-head,
    .vip-action,
    .vip-detail-head {
        grid-template-columns: 1fr;
    }

    .vip-action {
        display: grid;
    }

    .vip-action button {
        width: 100%;
    }
}
