:root {
    --viv-blue: #1D6FB8;
    --viv-blue-dark: #155d9c;
    --viv-cyan: #00A8E1;
    --viv-blue-light: #7DB7E6;
    --viv-blue-soft: #E6F0FA;
    --viv-text: #1f2937;
    --viv-text-strong: #101828;
    --viv-muted: #667085;
    --viv-bg: #F2F4F7;
    --viv-surface: #ffffff;
    --viv-border: #E2E8F0;
    --viv-border-strong: #D6E4F2;
    --viv-green: #17B26A;
    --viv-orange: #F79009;
    --viv-red: #F04438;
    --viv-shadow: 0 18px 45px rgba(15, 35, 75, .06);
    --viv-shadow-strong: 0 24px 80px rgba(29, 111, 184, .12);
}

html.wp-toolbar:has(body.viventis-app-page) {
    padding-top: 0 !important;
}

body.wp-admin.viventis-app-page {
    background: var(--viv-bg) !important;
    color: var(--viv-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.wp-admin.viventis-app-page #adminmenumain,
body.wp-admin.viventis-app-page #wpadminbar,
body.wp-admin.viventis-app-page #wpfooter,
body.wp-admin.viventis-app-page .notice,
body.wp-admin.viventis-app-page .updated,
body.wp-admin.viventis-app-page .error,
body.wp-admin.viventis-app-page .is-dismissible {
    display: none !important;
}

body.wp-admin.viventis-app-page #wpcontent,
body.wp-admin.viventis-app-page #wpbody-content {
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-bottom: 0 !important;
}

body.wp-admin.viventis-app-page #wpbody {
    padding-top: 0 !important;
}

body.wp-admin.viventis-app-page a:focus,
body.wp-admin.viventis-app-page input:focus {
    box-shadow: none;
    outline: none;
}

.viventis-admin-wrap {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    background: var(--viv-bg);
}

.viventis-app-shell {
    display: grid;
    grid-template-columns: 278px minmax(0, 1fr);
    min-height: 100vh;
    background: var(--viv-bg);
}

.viventis-app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--viv-surface);
    border-right: 1px solid var(--viv-border);
    display: flex;
    flex-direction: column;
    padding: 22px 18px;
    box-sizing: border-box;
}

.viventis-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--viv-text-strong);
    margin-bottom: 22px;
}

.viventis-logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--viv-blue), var(--viv-cyan));
    color: #fff;
    font-weight: 900;
    font-size: 21px;
    box-shadow: 0 12px 28px rgba(29, 111, 184, .22);
}

.viventis-logo-text {
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -.05em;
    color: var(--viv-text-strong);
}

.viventis-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--viv-border-strong);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 35, 75, .04);
    margin-bottom: 20px;
}

.viventis-user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--viv-blue-soft);
    color: var(--viv-blue);
    font-weight: 900;
}

.viventis-user-card strong,
.viventis-user-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 170px;
}

.viventis-user-card strong {
    color: var(--viv-text-strong);
    font-size: 14px;
}

.viventis-user-card small {
    color: var(--viv-muted);
    font-size: 12px;
    margin-top: 2px;
}

.viventis-app-nav {
    display: grid;
    gap: 4px;
}

.viventis-nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    color: #3b4856;
    text-decoration: none;
    font-weight: 750;
    font-size: 14px;
    border: 1px solid transparent;
    transition: .16s ease;
}

.viventis-nav-item .dashicons {
    color: #7a8796;
    font-size: 19px;
    width: 19px;
    height: 19px;
}

.viventis-nav-item:hover {
    background: #F8FBFE;
    color: var(--viv-blue);
}

.viventis-nav-item:hover .dashicons,
.viventis-nav-item.is-active .dashicons {
    color: var(--viv-blue);
}

.viventis-nav-item.is-active {
    background: var(--viv-blue-soft);
    color: var(--viv-blue);
    border-color: var(--viv-border-strong);
    box-shadow: inset 3px 0 0 var(--viv-blue);
}

.viventis-sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--viv-border);
}

.viventis-sidebar-footer strong,
.viventis-sidebar-footer small {
    display: block;
}

.viventis-sidebar-footer strong {
    color: var(--viv-text-strong);
    font-size: 14px;
}

.viventis-sidebar-footer small {
    margin-top: 3px;
    color: var(--viv-muted);
    font-size: 12px;
}

.viventis-footer-progress {
    height: 4px;
    background: #EEF4FA;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}

.viventis-footer-progress span {
    display: block;
    width: 38%;
    height: 100%;
    background: linear-gradient(90deg, var(--viv-blue), var(--viv-cyan));
}

.viventis-app-main {
    min-width: 0;
    background: var(--viv-bg);
}

.viventis-topbar {
    height: 64px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--viv-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.viventis-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--viv-muted);
    font-size: 13px;
    font-weight: 650;
}

.viventis-breadcrumb span:after {
    content: "›";
    margin-left: 10px;
    color: #a7b0bc;
}

.viventis-breadcrumb strong {
    color: var(--viv-text-strong);
}

.viventis-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.viventis-searchbox {
    width: 290px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--viv-border);
    border-radius: 10px;
    background: #fff;
    padding: 0 11px;
    color: #98A2B3;
}

.viventis-searchbox input {
    width: 100%;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    color: var(--viv-muted);
    min-height: 0 !important;
    opacity: 1;
}

.viventis-icon-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--viv-border);
    border-radius: 10px;
    background: #fff;
    color: var(--viv-muted);
    text-decoration: none;
}

.viventis-icon-button:hover {
    color: var(--viv-blue);
    border-color: var(--viv-blue-light);
}

.viventis-page-head,
.viventis-metrics-grid,
.viventis-main-grid,
.viventis-panel {
    margin-left: 24px;
    margin-right: 24px;
}

.viventis-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    padding: 26px 0 18px;
}

.viventis-page-head h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.2;
    letter-spacing: -.03em;
    color: var(--viv-text-strong);
    font-weight: 850;
}

.viventis-page-head p {
    margin: 7px 0 0;
    color: var(--viv-muted);
    font-size: 14px;
}

.viventis-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.viventis-primary-button,
.viventis-secondary-button,
.viventis-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
}

.viventis-primary-button {
    background: var(--viv-blue);
    color: #fff !important;
    box-shadow: 0 12px 26px rgba(29,111,184,.22);
}

.viventis-primary-button:hover {
    background: var(--viv-blue-dark);
}

.viventis-secondary-button,
.viventis-link-button {
    background: #fff;
    color: var(--viv-blue) !important;
    border: 1px solid var(--viv-border-strong);
}

.viventis-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.viventis-metric-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-height: 112px;
    background: #fff;
    border: 1px solid var(--viv-border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--viv-shadow);
    box-sizing: border-box;
    overflow: hidden;
}

.viventis-metric-card:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 3px;
    background: var(--viv-blue);
}

.viventis-metric-card.accent-cyan:before { background: var(--viv-cyan); }
.viventis-metric-card.accent-green:before { background: var(--viv-green); }
.viventis-metric-card.accent-orange:before { background: var(--viv-orange); }

.viventis-metric-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--viv-blue-soft);
    color: var(--viv-blue);
}

.viventis-metric-card.accent-cyan .viventis-metric-icon { background: rgba(0,168,225,.12); color: var(--viv-cyan); }
.viventis-metric-card.accent-green .viventis-metric-icon { background: rgba(23,178,106,.12); color: var(--viv-green); }
.viventis-metric-card.accent-orange .viventis-metric-icon { background: rgba(247,144,9,.12); color: var(--viv-orange); }

.viventis-metric-card span,
.viventis-metric-card strong,
.viventis-metric-card small {
    display: block;
}

.viventis-metric-card span {
    color: var(--viv-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.viventis-metric-card strong {
    margin: 7px 0 5px;
    color: var(--viv-text-strong);
    font-size: 25px;
    line-height: 1;
    letter-spacing: -.03em;
}

.viventis-metric-card small {
    color: var(--viv-muted);
    font-size: 12px;
}

.viventis-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, .75fr);
    gap: 16px;
    margin-bottom: 18px;
}

.viventis-panel {
    background: #fff;
    border: 1px solid var(--viv-border);
    border-radius: 14px;
    box-shadow: var(--viv-shadow);
    padding: 18px;
    box-sizing: border-box;
    margin-bottom: 18px;
}

.viventis-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.viventis-panel-heading span {
    display: block;
    color: var(--viv-blue);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 5px;
}

.viventis-panel-heading h2 {
    margin: 0;
    color: var(--viv-text-strong);
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.viventis-tag,
.viventis-pill {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--viv-blue-soft);
    color: var(--viv-blue) !important;
    padding: 6px 10px;
    font-size: 11px !important;
    font-weight: 850;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.viventis-stage-tabs {
    display: flex;
    gap: 26px;
    border-bottom: 1px solid var(--viv-border);
    margin-bottom: 16px;
}

.viventis-stage-tabs span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    color: var(--viv-muted);
    font-weight: 800;
    font-size: 13px;
    border-bottom: 2px solid transparent;
}

.viventis-stage-tabs span.is-active {
    color: var(--viv-blue);
    border-bottom-color: var(--viv-blue);
}

.viventis-stage-list {
    display: grid;
    gap: 10px;
}

.viventis-stage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px;
    border: 1px solid var(--viv-border);
    border-radius: 12px;
    background: #fff;
}

.viventis-stage-row > div {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
}

.viventis-stage-row span {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--viv-blue-soft);
    color: var(--viv-blue);
    font-weight: 900;
    grid-row: span 2;
}

.viventis-stage-row strong,
.viventis-stage-row small {
    display: block;
}

.viventis-stage-row strong {
    color: var(--viv-text-strong);
    font-size: 14px;
}

.viventis-stage-row small {
    color: var(--viv-muted);
    margin-top: 3px;
}

.viventis-stage-row b {
    color: var(--viv-text-strong);
    font-size: 19px;
}

.viventis-source-list {
    display: grid;
    gap: 10px;
}

.viventis-source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    border-bottom: 1px solid var(--viv-border);
}

.viventis-source-item:last-child {
    border-bottom: 0;
}

.viventis-source-item span {
    color: var(--viv-muted);
    font-weight: 800;
}

.viventis-source-item strong {
    color: var(--viv-blue);
    font-size: 18px;
}

.viventis-empty-box {
    min-height: 130px;
    border: 1px dashed var(--viv-border-strong);
    border-radius: 12px;
    background: #F8FBFE;
    color: var(--viv-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.viventis-table-card {
    overflow-x: auto;
    border: 1px solid var(--viv-border);
    border-radius: 12px;
}

.viventis-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    background: #fff;
}

.viventis-table th,
.viventis-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--viv-border);
    vertical-align: middle;
}

.viventis-table th {
    background: #F7FAFC;
    color: #475467;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.viventis-table td {
    color: #344054;
    font-size: 13px;
    font-weight: 650;
}

.viventis-table tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 1280px) {
    .viventis-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .viventis-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .viventis-app-shell {
        grid-template-columns: 1fr;
    }

    .viventis-app-sidebar {
        position: relative;
        height: auto;
    }

    .viventis-app-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .viventis-page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .viventis-searchbox {
        display: none;
    }
}

@media (max-width: 640px) {
    .viventis-metrics-grid,
    .viventis-app-nav {
        grid-template-columns: 1fr;
    }
}
