/* =============================================================================
   OSP — UI Extensions
   Avatar Initials  |  Context Switcher (Navbar)
   Full LTR + RTL support
   v1.0
============================================================================= */

/* =============================================================================
   Design Tokens
============================================================================= */
:root {
    --osp-green: #1b5e20;
    --osp-green-mid: var(--osp-green);
    --osp-green-light: #43a047;
    --osp-green-bg: #f8fafc;
    --osp-green-bg-2: #f1f5f9;
    --osp-green-bg-3: #e2e8f0;
    --osp-border: #e3e7ee;
    --osp-border-dark: rgba(255, 255, 255, 0.12);
    --osp-text: #1a1a1a;
    --osp-muted: #888;
    --osp-bg-hover: #f5f7fa;
    --osp-bg-input: #f5f7fa;
    --osp-white: #ffffff;
    --osp-panel-dark: #1e2130;
    --osp-radius-sm: 8px;
    --osp-radius-md: 14px;
    --osp-ease: 0.18s ease;

    /* Dashboard & Chart Palette - More sophisticated & varied */
    --dash-primary: #1b5e20; /* Deep Forest Green */
    --dash-secondary: #0f172a; /* Slate Dark */
    --dash-accent: #1e40af; /* Professional Azure Darker */
    --dash-warning: #ea580c; /* High Contrast Orange */
    --dash-danger: #be123c; /* Crimson Premium */
    --dash-info: #0891b2; /* Cyan/Teal Dark */
    --dash-success: #15803d; /* Standard Green Mid */

    /* Generic semantic status colors */
    --status-pending: #f59e0b;
    --status-active: #15803d;
    --status-closed: #64748b;
    --status-danger: #be123c;

    /* Chart Semantic Palette - RESTORED for JS compatibility */
    --chart-v-1: #f59e0b;
    --chart-v-2: #1b5e20;
    --chart-v-3: #6366f1;
    --chart-v-4: #64748b;

    --chart-c-1: #1b5e20;
    --chart-c-2: #3b82f6;
    --chart-c-3: #1e40af;
    --chart-c-4: #0f172a;

    --chart-o-1: #1b5e20;
    --chart-o-2: #0ea5e9;
    --chart-o-3: #f59e0b;
    --chart-o-4: #6366f1;

    --chart-b-1: #1b5e20;
    --chart-b-2: #15803d;
    --chart-b-3: #43a047;
    --chart-b-4: #81c784;

    /* Chart Surface Tokens */
    --dash-chart-accent: var(--dash-primary);
    --dash-chart-accent-dark: #1b5e20;
    --dash-chart-accent-soft: rgba(27, 94, 32, 0.08);
    --dash-chart-border: rgba(27, 94, 32, 0.12);
}

/* Dashboard Global Utilities */
.dash-v3-chart-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

/* =============================================================================
   1. Avatar Initials Fallback
   Used when a user has no profile photo
============================================================================= */
.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--osp-green),
        var(--osp-green-light)
    );
    color: var(--osp-white);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    user-select: none;
}

.avatar-initials--lg {
    font-size: 14px;
}

/* =============================================================================
   2. Context Switcher — Trigger Pill
============================================================================= */
.context-switcher-dropdown {
    position: relative;
}

/* Pill button */
.ctx-trigger {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    /* LTR: icon-left, labels, chevron-right */
    padding: 5px 12px 5px 8px;
    background: var(--osp-bg-input);
    border: 1.5px solid var(--osp-border);
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--osp-text);
    transition:
        background var(--osp-ease),
        border-color var(--osp-ease);
    white-space: nowrap;
    max-width: 300px;
    outline: none;
}

.ctx-trigger:disabled {
    cursor: default;
    pointer-events: none;
    opacity: 0.8;
}

[data-theme="dark"] .ctx-trigger:disabled,
.dark .ctx-trigger:disabled {
    opacity: 0.6;
}

@media (max-width: 560px) {
    .ctx-trigger:disabled {
        display: none !important;
    }
}

.ctx-trigger:hover {
    background: #eef1f7;
    border-color: #c5ccd8;
}

.ctx-trigger:focus-visible {
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.22);
    border-color: var(--osp-green);
}

/* RTL: flip inner padding so chevron is on the correct side */
[dir="rtl"] .ctx-trigger {
    padding: 5px 8px 5px 12px;
}

/* Dark mode */
[data-theme="dark"] .ctx-trigger,
.dark .ctx-trigger {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--osp-border-dark);
    color: #ddd;
}

/* Community icon circle */
.ctx-community-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--osp-green),
        var(--osp-green-light)
    );
    color: var(--osp-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Label stack */
.ctx-labels {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    overflow: hidden;
}

[dir="rtl"] .ctx-labels {
    align-items: flex-end;
}

.ctx-community-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    color: var(--osp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

[data-theme="dark"] .ctx-community-name,
.dark .ctx-community-name {
    color: #eee;
}

.ctx-role-badge {
    font-size: 12px;
    color: var(--osp-green);
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Chevron */
.ctx-chevron {
    font-size: 13px;
    color: #888;
    transition: transform 0.22s ease;
    flex-shrink: 0;
}

.ctx-chevron--open {
    transform: rotate(180deg);
}

/* =============================================================================
   3. Context Switcher — Dropdown Panel
============================================================================= */
.ctx-panel {
    position: fixed;
    top: calc(100% + 8px);

    /* LTR: panel opens to the right of the trigger */
    left: 14px;
    right: auto;

    z-index: 1060;
    width: min(460px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    background: var(--osp-white);
    border-radius: 16px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.08),
        0 2px 10px rgba(0, 0, 0, 0.04);

    /* Hidden state */
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.07);
}

/* RTL: panel opens to the left of the trigger */
[dir="rtl"] .ctx-panel {
    left: auto;
    right: 14px;
    /* Slide in from the right side */
    transform-origin: top right;
}

/* Open state */
.ctx-panel--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Dark mode */
[data-theme="dark"] .ctx-panel,
.dark .ctx-panel {
    background: var(--osp-panel-dark);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

/* --- Panel header --- */
.ctx-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 10px;
    border-bottom: none;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

[dir="rtl"] .ctx-panel-header {
    flex-direction: row-reverse;
}

[data-theme="dark"] .ctx-panel-header,
.dark .ctx-panel-header {
    border-bottom-color: rgba(255, 255, 255, 0.09);
    color: #eee;
}

/* Close × button */
.ctx-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    padding: 2px 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition:
        color var(--osp-ease),
        background var(--osp-ease);
}

/* =============================================================================
   4. General Notifications UI
============================================================================= */
.form-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, #f4faf7 0%, #edf7f2 100%);
    border: 1px solid #d6e8dc;
    border-radius: 12px;
    padding: 12px 14px;
}

.form-section-header__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #afd2bb;
    background: #dff2e7;
    color: #1f6f43;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.form-section-header__title {
    font-weight: 700;
    color: #163a2a;
}

.form-section-header__subtitle {
    font-size: 13px;
    color: #4f6f62;
}

.scope-radio-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.scope-option-label {
    margin: 0;
    cursor: pointer;
}

.scope-radio-input {
    display: none;
}

.scope-option-card {
    border: 1px solid #c8d8e7;
    border-radius: 14px;
    min-height: 86px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: #56728c;
    background: #f9fbfd;
    transition: all 0.15s ease-in-out;
}

.scope-option-card i {
    font-size: 24px;
}

.scope-radio-input:checked + .scope-option-card {
    border-color: #4cae72;
    box-shadow: inset 0 0 0 2px #bde6cd;
    background: #f1fbf5;
    color: #1f6f43;
}

.gn-delivery-block .form-section-header {
    margin-bottom: 0.6rem !important;
}

.gn-delivery-card {
    border: 1px solid #d8e4ef;
    border-radius: 14px;
    background:
        radial-gradient(
            circle at top right,
            rgba(56, 142, 60, 0.07),
            transparent 42%
        ),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow:
        0 10px 22px rgba(15, 39, 64, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
    padding: 6px 14px;
}

.gn-delivery-card--inline {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: nowrap;
}

.gn-delivery-option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    margin: 0;
    padding: 6px 0;
}

.gn-delivery-option + .gn-delivery-option {
    border-top: 1px solid #e7eef5;
}

.gn-delivery-card--inline .gn-delivery-option + .gn-delivery-option {
    border-top: 0;
    border-left: 1px solid #e7eef5;
    padding-left: 18px;
}

.gn-delivery-option .form-check-input {
    width: 2.65rem;
    height: 1.4rem;
    margin: 0;
    cursor: pointer;
    border-color: #b5c5d7;
    background-color: #c7d4e2;
    box-shadow: none;
}

.gn-delivery-option .form-check-input:checked {
    background-color: #2f8a4c;
    border-color: #2f8a4c;
}

.gn-delivery-option .form-check-input:focus {
    border-color: #2f8a4c;
    box-shadow: 0 0 0 0.2rem rgba(47, 138, 76, 0.18);
}

.gn-delivery-option .form-check-label {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #254058;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
}

.gn-delivery-option__icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid #d6e4ef;
    background: #f3f8fd;
    color: #496783;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.gn-submit-wrap {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5ecf3;
}

.gn-attachment-item {
    width: 100%;
    border: 1px solid #d9e3ef;
    border-radius: 10px;
    background: #fbfdff;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gn-attachment-handle {
    color: #9aa7b6;
    cursor: move;
    font-size: 16px;
}

.gn-attachment-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.gn-attachment-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gn-attachment-size {
    font-size: 11px;
    color: #6b7280;
}

.gn-attachment-remove {
    border: 0;
    background: transparent;
    color: #dc2626;
    font-size: 14px;
    line-height: 1;
}

/* Dark theme: General Notifications form blocks */
[data-theme="dark"] .form-section-header,
.dark .form-section-header {
    background: linear-gradient(180deg, #1f2633 0%, #171d28 100%);
    border-color: rgba(148, 163, 184, 0.28);
}

[data-theme="dark"] .form-section-header__icon,
.dark .form-section-header__icon {
    border-color: rgba(74, 222, 128, 0.38);
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

[data-theme="dark"] .form-section-header__title,
.dark .form-section-header__title {
    color: #e7edf6;
}

[data-theme="dark"] .form-section-header__subtitle,
.dark .form-section-header__subtitle {
    color: #9fb0c2;
}

[data-theme="dark"] .scope-option-card,
.dark .scope-option-card {
    border-color: rgba(148, 163, 184, 0.28);
    background: #151b26;
    color: #9fb0c2;
}

[data-theme="dark"] .scope-option-card i,
.dark .scope-option-card i {
    color: #94a9bf;
}

[data-theme="dark"] .scope-radio-input:checked + .scope-option-card,
.dark .scope-radio-input:checked + .scope-option-card {
    border-color: rgba(74, 222, 128, 0.65);
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.22);
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

[data-theme="dark"] .gn-delivery-card,
.dark .gn-delivery-card {
    border-color: rgba(148, 163, 184, 0.3);
    background:
        radial-gradient(
            circle at top right,
            rgba(34, 197, 94, 0.12),
            transparent 44%
        ),
        linear-gradient(180deg, #1c2431 0%, #141b27 100%);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .gn-delivery-option + .gn-delivery-option,
.dark .gn-delivery-option + .gn-delivery-option {
    border-top-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .gn-delivery-option .form-check-label,
.dark .gn-delivery-option .form-check-label {
    color: #dce6f2;
}

[data-theme="dark"] .gn-delivery-option__icon,
.dark .gn-delivery-option__icon {
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(148, 163, 184, 0.14);
    color: #aac0d5;
}

[data-theme="dark"] .gn-submit-wrap,
.dark .gn-submit-wrap {
    border-top-color: rgba(148, 163, 184, 0.24);
}

[data-theme="dark"] .gn-attachment-item,
.dark .gn-attachment-item {
    border-color: rgba(148, 163, 184, 0.28);
    background: #161d2a;
}

[data-theme="dark"] .gn-attachment-name,
.dark .gn-attachment-name {
    color: #e6edf6;
}

[data-theme="dark"] .gn-attachment-size,
.dark .gn-attachment-size {
    color: #93a7bd;
}

.gn-show-card {
    border: 1px solid #e3ebf3;
    border-radius: 14px;
    overflow: hidden;
}

.gn-show-header {
    background: linear-gradient(180deg, #fbfefd 0%, #f4f9f7 100%);
    border-bottom: 1px solid #e6eef5;
    padding-top: 18px;
    padding-bottom: 18px;
}

.gn-show-title {
    color: #0f2740;
    font-weight: 700;
}

.gn-show-scope-badge {
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 7px 12px;
}

.gn-show-body {
    padding-top: 1.1rem;
}

.gn-show-stat {
    border: 1px solid #dbe7f4;
    border-radius: 10px;
    background: #f8fbff;
    padding: 14px 14px 12px;
}

.gn-show-stat__label {
    display: block;
    margin-bottom: 6px;
    color: #6a7f95;
    font-size: 12px;
    font-weight: 600;
}

.gn-show-stat__value {
    color: #16324d;
    font-weight: 700;
    font-size: 16px;
}

.gn-show-box {
    border: 1px solid #dbe7f4;
    border-radius: 10px;
    background: #f9fbfd;
    padding: 14px;
}

.gn-show-attachments-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.gn-show-attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #dbe7f4;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.16s ease-in-out;
}

.gn-show-attachment-item:hover {
    border-color: #b7d0e8;
    box-shadow: 0 6px 20px rgba(19, 57, 96, 0.08);
    transform: translateY(-1px);
}

.gn-show-attachment-item__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.gn-show-attachment-item__meta {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.gn-show-attachment-item__name {
    color: #0f2740;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gn-show-attachment-item__size {
    color: #70879e;
    font-size: 12px;
}

.gn-show-attachment-item__action {
    color: #1f6f43;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.gn-show-empty-attachments {
    border: 1px dashed #c8d8e7;
    border-radius: 10px;
    padding: 16px 18px;
    color: #607589;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fbff;
    width: 100%;
    min-height: 72px;
}

.gn-show-empty-attachments__icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e9f2fb;
    color: #5b7389;
    font-size: 16px;
    flex: 0 0 auto;
}

.gn-show-empty-attachments__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gn-show-empty-attachments__title {
    font-size: 14px;
    font-weight: 600;
    color: #3f5870;
    line-height: 1.2;
}

.gn-show-empty-attachments__subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #7c93a8;
    line-height: 1.35;
}

#general-notifications-datatable .datatable-count-badge {
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 800;
    font-size: 12px;
    border: 1px solid transparent;
}

#general-notifications-datatable .datatable-count-badge.is-positive {
    background: rgba(99, 102, 241, 0.1);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.2);
}

#general-notifications-datatable .datatable-count-badge.is-zero {
    background: rgba(148, 163, 184, 0.14);
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.25);
}

.gn-attachment-preview-body {
    min-height: 55vh;
    background: #f5f8fb;
    padding: 10px;
}

.gn-attachment-preview-image {
    max-width: 100%;
    max-height: 75vh;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
}

.gn-attachment-preview-frame {
    width: 100%;
    min-height: 72vh;
    border: 0;
    border-radius: 6px;
    background: #fff;
}

.gn-attachment-preview-empty {
    min-height: 48vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

@media (max-width: 767.98px) {
    .scope-radio-group {
        grid-template-columns: 1fr;
    }

    .gn-delivery-card {
        padding-left: 10px;
        padding-right: 10px;
    }

    .gn-delivery-card--inline {
        flex-wrap: wrap;
        gap: 0;
    }

    .gn-delivery-card--inline .gn-delivery-option + .gn-delivery-option {
        border-left: 0;
        border-top: 1px solid #e7eef5;
        padding-left: 0;
    }

    .gn-delivery-option .form-check-label {
        font-size: 14px;
    }

    .gn-show-attachments-grid {
        grid-template-columns: 1fr;
    }
}

.ctx-close-btn:hover {
    color: #333;
    background: #f0f0f0;
}

[data-theme="dark"] .ctx-close-btn:hover,
.dark .ctx-close-btn:hover {
    color: #eee;
    background: rgba(255, 255, 255, 0.08);
}

/* =============================================================================
   4. Steps (Community → Role)
============================================================================= */
.ctx-step {
    padding: 8px 0 10px;
}

.ctx-step-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin: 10px 0 8px;
    padding: 0 24px;
}

[dir="rtl"] .ctx-step-label {
    text-align: right;
}

/* Back button (RTL: arrow flips automatically with icon transform) */
.ctx-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--osp-green);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 20px 10px;
    font-family: inherit;
    transition: opacity 0.15s;
}

.ctx-back-btn:hover {
    opacity: 0.7;
}

/* Flip back-arrow icon in RTL */
[dir="rtl"] .ctx-back-btn i {
    transform: scaleX(-1);
}

/* =============================================================================
   5. Item Lists (scrollable)
============================================================================= */
.ctx-community-list,
.ctx-role-list {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d0d7de transparent;
}

.ctx-community-list::-webkit-scrollbar,
.ctx-role-list::-webkit-scrollbar {
    width: 4px;
}

.ctx-community-list::-webkit-scrollbar-thumb,
.ctx-role-list::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border-radius: 4px;
}

/* =============================================================================
   6. Individual Item (community card / role card)
============================================================================= */
.ctx-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 24px;
    background: none;
    border: none;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;

    /* LTR: icon left, text centre, check/arrow right */
    text-align: start;

    transition: background 0.15s;
    font-family: inherit;
}

/* RTL: item layout naturally reverses due to flex + dir="rtl" on html */
[dir="rtl"] .ctx-item {
    flex-direction: row-reverse;
    text-align: end;
}

.ctx-item:hover:not(:disabled) {
    background: #f8fafc;
}

[data-theme="dark"] .ctx-item:hover:not(:disabled),
.dark .ctx-item:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
}

.ctx-item--active {
    background: #f0fdf4 !important;
    cursor: default;
}

[data-theme="dark"] .ctx-item--active,
.dark .ctx-item--active {
    background: rgba(46, 125, 50, 0.15) !important;
}

/* Item icon wrapper for notification badges */
.ctx-item-icon-wrap {
    position: relative;
    flex-shrink: 0;
}

.ctx-notif-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background-color: #ef4444; /* Premium Red */
    border: 2px solid var(--osp-white);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .ctx-notif-dot,
.dark .ctx-notif-dot {
    border-color: var(--osp-panel-dark);
}

/* Item icon box */
.ctx-item-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #eef8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--osp-green);
    font-size: 20px;
    transition: background var(--osp-ease);
}

.ctx-item--active .ctx-item-icon {
    background: var(--osp-green-bg-3);
}

/* Text body */
.ctx-item-body {
    flex: 1;
    min-width: 0;
    text-align: start;
}

[dir="rtl"] .ctx-item-body {
    text-align: end;
}

.ctx-item-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--osp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .ctx-item-name,
.dark .ctx-item-name {
    color: #eee;
}

.ctx-item-sub {
    display: block;
    font-size: 13px;
    color: var(--osp-muted);
    margin-top: 2px;
    unicode-bidi: plaintext;
}

[dir="rtl"] .ctx-item-sub {
    direction: rtl;
}

/* Check / arrow icons pushed to opposite edge */
/* LTR: push to the right */
.ctx-item-check,
.ctx-item-arrow {
    flex-shrink: 0;
    font-size: 14px;
    margin-inline-start: auto; /* logical: works for both LTR and RTL */
}

[dir="rtl"] .ctx-item-check,
[dir="rtl"] .ctx-item-arrow {
    margin-inline-start: 0;
    margin-inline-end: auto;
}

.ctx-item-check {
    color: var(--osp-green);
}

.ctx-item-arrow {
    color: #ccc;
    transition:
        transform var(--osp-ease),
        color var(--osp-ease);
}

/* RTL: flip the directional arrow (chevron-right → chevron-left visually) */
[dir="rtl"] .ctx-item-arrow {
    transform: scaleX(-1);
}

.ctx-item:hover .ctx-item-arrow {
    color: var(--osp-green);
}

/* =============================================================================
   7. Inner States (loading / error)
============================================================================= */
.ctx-inner-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0;
}

.ctx-inner-error {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: #c62828;
    font-size: 12.5px;
    background: #fff5f5;
    border-radius: var(--osp-radius-sm);
    margin: 4px 12px;
}

[dir="rtl"] .ctx-inner-error {
    flex-direction: row-reverse;
    text-align: right;
}

[data-theme="dark"] .ctx-inner-error,
.dark .ctx-inner-error {
    background: rgba(198, 40, 40, 0.12);
}

/* =============================================================================
   8. Spinner
============================================================================= */
.ctx-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(46, 125, 50, 0.2);
    border-top-color: var(--osp-green);
    border-radius: 50%;
    animation: ctxSpin 0.7s linear infinite;
    flex-shrink: 0;
}

.ctx-spinner--lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

@keyframes ctxSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================================================
   9. Submitting Overlay
============================================================================= */
.ctx-submitting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 36px 16px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

[data-theme="dark"] .ctx-submitting,
.dark .ctx-submitting {
    color: #aaa;
}

/* =============================================================================
   10. Click-outside Backdrop
============================================================================= */
.ctx-backdrop {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 1059;
    background: transparent;
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.ctx-backdrop--show {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
}

/* =============================================================================
   11. Responsive
============================================================================= */

/* Tablet: narrow pill on medium screens */
@media (max-width: 768px) {
    .ctx-community-name,
    .ctx-role-badge {
        max-width: 100px;
    }
}

/* Mobile: hide text labels, show only icon + chevron */
@media (max-width: 560px) {
    .ctx-labels {
        display: none;
    }

    .ctx-trigger {
        padding: 5px 8px;
        gap: 6px;
    }

    /* Panel: shift it so it doesn't overflow viewport edges */
    .ctx-panel {
        width: min(320px, calc(100vw - 12px));
        max-width: calc(100vw - 12px);
        left: auto;
        right: 0;
    }

    [dir="rtl"] .ctx-panel {
        left: auto;
        right: 0;
    }
}

/* =============================================================================
   12. RTL — Additional Overrides
   Everything below tightens up any remaining LTR-biased positioning
   that logical properties don't cover in older browsers.
============================================================================= */

/* Panel: ensure correct side on very small RTL screens */
@media (max-width: 560px) {
    [dir="rtl"] .ctx-panel {
        left: auto;
        right: 0;
    }
}

/* Trigger padding (already handled by logical rule above, but here for older Safaris) */
[dir="rtl"] .ctx-trigger {
    padding-left: 12px;
    padding-right: 8px;
}

/* Step back button padding */
[dir="rtl"] .ctx-back-btn {
    padding: 4px 16px 8px 16px;
    flex-direction: row-reverse;
}

/* Panel header flex direction (already row-reverse above) */
/* Panel header title text */
[dir="rtl"] .ctx-panel-header span {
    text-align: right;
}

/* =============================================================================
   13. Profile & Account Settings
============================================================================= */
.account-wrapper {
    background: #f4f3f7;
    border-radius: 12px;
    min-height: 700px;
}

.account-sidebar {
    border-right: 1px solid #ebebeb;
    padding: 40px 20px;
}
[dir="rtl"] .account-sidebar {
    border-right: none;
    border-left: 1px solid #ebebeb;
}

.account-nav .nav-link {
    color: #333;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 8px;
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
    margin-bottom: 5px;
    transition: all 0.2s ease;
}
[dir="rtl"] .account-nav .nav-link {
    text-align: right;
}

.account-nav .nav-link.active {
    color: var(--osp-green);
    background: var(--osp-green-bg);
}

.account-content {
    padding: 40px 50px;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #ebebeb;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
}
[dir="rtl"] .profile-avatar {
    margin-right: 0;
    margin-left: 20px;
}

.profile-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: #111;
}

.profile-role {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin-bottom: 25px;
}

/* Clean input styling */
.clean-input-group label {
    font-size: 13px;
    color: #888;
    margin-bottom: 7px;
    display: block;
    font-weight: 500;
    text-transform: capitalize;
}

.clean-input-group .form-control,
.clean-input-group .form-select {
    background: #fff;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    font-size: 15px;
    color: #333;
    font-weight: 400;
    border-radius: 6px;
    box-shadow: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.clean-input-group .form-control:focus,
.clean-input-group .form-select:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

.avatar-upload-label {
    color: #28a745;
    font-size: 13px;
    cursor: pointer;
    display: inline-block;
    margin-top: 5px;
    font-weight: 500;
}

/* =============================================================================
   14. Typography Scale Improvements
============================================================================= */
body {
    font-size: 14px;
}

/* Sidebar parent items */
.sidebar .sidebar-menu > ul > li > a span {
    font-size: 16px !important; /* Bump from 15px */
}

/* Sidebar child items */
.sidebar .sidebar-menu > ul > li.submenu ul li a {
    font-size: 14px !important; /* Bump from 13px */
}

/* Navbar top links */
.header .user-info .user-name {
    font-size: 16px !important;
}

.header .nav > li > a {
    font-size: 16px;
}

/* =============================================================================
   15. Roles Page Styles
============================================================================= */
.role-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.role-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.role-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin: 0;
}

.role-lock-icon {
    font-size: 16px;
    line-height: 1;
    opacity: 0.85;
}

.role-card-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

.role-card-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.role-btn {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.role-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.perm-module-row {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.perm-module-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.perm-module-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
}

.perm-cb-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.perm-cb-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    position: relative;
    background-color: #fff;
    margin-right: 8px;
    transition: all 0.2s ease;
}

html[dir="rtl"] .perm-cb-wrapper input[type="checkbox"] {
    margin-right: 0;
    margin-left: 8px;
}

.perm-cb-wrapper input[type="checkbox"]:checked {
    background-color: #10b981;
    border-color: #10b981;
}

.perm-cb-wrapper input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.perm-cb-wrapper label {
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.perm-pill {
    background-color: #fcfcfc;
    border-radius: 6px;
    padding: 10px 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #475569;
    font-weight: 500;
    min-width: 140px;
    position: relative;
    overflow: hidden;
    margin-right: 16px;
    margin-bottom: 16px;
}

html[dir="rtl"] .perm-pill {
    margin-right: 0;
    margin-left: 16px;
}

.perm-pill-icon {
    position: absolute;
    bottom: -10px;
    right: 5px;
    font-size: 40px;
    color: #e2e8f0;
    z-index: 1;
}

html[dir="rtl"] .perm-pill-icon {
    right: auto;
    left: 5px;
}

.perm-pill span {
    position: relative;
    z-index: 2;
}

.custom-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 24px;
}

/* =============================================================================
   16. Custom Pagination
============================================================================= */
.osp-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
}

.osp-pagination__summary {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    text-align: left;
}

.osp-pagination__list {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.osp-pagination__item .page-link {
    min-width: 38px;
    height: 38px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    padding: 0 12px;
    transition: all 0.2s ease;
}

.osp-pagination__item .page-link:hover {
    border-color: #16a34a;
    color: #16a34a;
}

.osp-pagination__item.active .page-link {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.osp-pagination__item.disabled .page-link {
    background: #f8fafc;
    color: #94a3b8;
    border-color: #e2e8f0;
    pointer-events: none;
}

html[dir="rtl"] .osp-pagination {
    flex-direction: row-reverse;
}

html[dir="rtl"] .osp-pagination__summary {
    text-align: right;
}

@media (max-width: 768px) {
    .osp-pagination {
        justify-content: center;
    }

    .osp-pagination__summary {
        width: 100%;
        text-align: center;
    }

    .osp-pagination__list {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* =============================================================================
   17. Header Language Button
============================================================================= */
.header .header-user .user-menu .btn-menubar.lang-menubar-btn {
    border-radius: 12px;
    padding: 0;
}

.header .header-user .user-menu .btn-menubar.lang-menubar-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* =============================================================================
   18. Building Types
============================================================================= */
.osp-building-type-form .form-label {
    font-weight: 600;
    color: #334155;
}

.osp-building-type-form .form-control,
.osp-building-type-form .form-select {
    border-radius: 8px;
    border-color: #dbe2ea;
    min-height: 44px;
}

.osp-info-box {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.osp-info-label {
    font-size: 12px;
    color: #64748b;
}

.osp-datatable-card {
    border-radius: 12px;
    border-color: #e5e7eb;
}

.osp-datatable {
    border-collapse: separate;
    border-spacing: 0;
}

.osp-datatable thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding-top: 12px;
    padding-bottom: 12px;
}

.osp-datatable tbody td {
    border-top: 1px solid #eef2f7;
    color: #334155;
    vertical-align: middle;
}

.osp-datatable tbody tr:hover {
    background: #f8fafc;
}

.osp-dt-wrapper .dataTables_info {
    font-size: 13px;
    color: #64748b;
}

.osp-dt-wrapper .dataTables_paginate .paginate_button {
    margin: 0 2px !important;
}

.osp-dt-wrapper .dataTables_paginate .paginate_button .page-link {
    border-radius: 8px;
    border: 1px solid #dbe2ea;
    color: #475569;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.osp-dt-wrapper .dataTables_paginate .paginate_button.active .page-link {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
    width: 36px;
    height: 36px;
}

.osp-dt-wrapper
    .dataTables_paginate
    .paginate_button:not(.active)
    .page-link:hover {
    border-color: #22c55e;
    color: #22c55e;
    background: #fff;
}

.osp-dt-wrapper .dataTables_empty {
    padding: 24px !important;
    color: #64748b;
    font-weight: 500;
}

.header .header-user .user-menu .lang-dropdown .lang-dropdown-menu {
    min-width: 260px;
    border-radius: 14px;
    padding: 8px;
    margin-top: 4px;
    margin-right: -4px;
    border: 1px solid #d9e5ef;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow:
        0 16px 34px rgba(15, 23, 42, 0.12),
        0 2px 6px rgba(15, 23, 42, 0.06);
}

html[dir="rtl"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-menu {
    margin-right: 0;
    margin-left: -4px;
}

.header .header-user .user-menu .lang-dropdown .lang-menubar-btn--premium {
    height: 44px !important;
    min-width: 174px;
    border-radius: 12px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    padding: 0 12px 0 10px !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #12324f;
    box-shadow: none;
}

.header .header-user .user-menu .lang-dropdown .lang-menubar-btn--compact {
    min-width: 98px;
    height: 40px !important;
    padding: 0 10px !important;
    gap: 7px;
    border-radius: 11px !important;
}

.header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium::after {
    display: none;
}

.header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium:hover {
    border-color: #d6e2ee !important;
    background: #f4f8fc !important;
    color: #0e2e4a;
}

.header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium:focus-visible {
    box-shadow:
        0 0 0 0.2rem rgba(46, 125, 50, 0.14),
        0 6px 16px rgba(15, 39, 64, 0.09);
}

.header .header-user .user-menu .lang-dropdown .lang-trigger__icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: #315979;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.header .header-user .user-menu .lang-dropdown .lang-trigger__meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.05;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
}

html[dir="rtl"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-trigger__meta {
    align-items: flex-end;
}

.header .header-user .user-menu .lang-dropdown .lang-trigger__code {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #1a405f;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 999px;
    min-width: 34px;
    height: 22px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex: 0 0 auto;
}

.header .header-user .user-menu .lang-dropdown .lang-trigger__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c8196;
}

.header .header-user .user-menu .lang-dropdown .lang-trigger__current {
    font-size: 13px;
    font-weight: 700;
    color: #142e46;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--compact
    .lang-trigger__label,
.header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--compact
    .lang-trigger__current,
.header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--compact
    .lang-trigger__meta {
    display: none;
}

.header .header-user .user-menu .lang-dropdown .lang-trigger__chevron {
    font-size: 13px;
    color: #57748e;
    transition: transform 0.18s ease;
    flex: 0 0 auto;
}

.header .header-user .user-menu .lang-dropdown.show .lang-trigger__chevron {
    transform: rotate(180deg);
}

.badge.badge-soft-danger {
    background: rgba(231, 13, 13, 0.1) !important;
    color: #e70d0d !important;
}

.header .header-user .user-menu .lang-dropdown .lang-dropdown-item {
    border-radius: 10px;
    padding: 10px 12px;
    color: #0f2740;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid transparent;
    margin-bottom: 5px;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        border-color 0.18s ease;
}

.header .header-user .user-menu .lang-dropdown .lang-dropdown-item__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.header .header-user .user-menu .lang-dropdown .lang-dropdown-item__name {
    font-size: 13.5px;
    font-weight: 700;
    color: inherit;
}

.header .header-user .user-menu .lang-dropdown .lang-dropdown-item__code {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #5e7b97;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid #dbe8f3;
    background: #f2f8fd;
}

.header .header-user .user-menu .lang-dropdown .lang-dropdown-item__check {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #0f7a3f;
    background: #ebf9f0;
    border: 1px solid #c5edd4;
    flex: 0 0 auto;
}

.header .header-user .user-menu .lang-dropdown .lang-dropdown-item:hover,
.header .header-user .user-menu .lang-dropdown .lang-dropdown-item:focus {
    background: #eef7ff;
    border-color: #cfe0ef;
    color: #0f2740;
    transform: translateX(2px);
}

html[dir="rtl"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:hover,
html[dir="rtl"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:focus {
    transform: translateX(-2px);
}

.header .header-user .user-menu .lang-dropdown .lang-dropdown-item.active {
    background: #ecf9f0;
    color: #0f6d39;
    border-color: #b9e5ca;
}

.header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active:hover {
    background: #e4f6ea;
    color: #0f6d39;
}

.header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active
    .lang-dropdown-item__code {
    color: #0f6d39;
    border-color: #b9e5ca;
    background: #e8f8ed;
}

.header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active
    .lang-dropdown-item__name {
    color: #0f6d39;
}

html[dir="rtl"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium {
    padding: 0 10px 0 12px !important;
}

html[dir="rtl"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:hover,
html[dir="rtl"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:focus {
    transform: translateX(-2px);
}

/* Dark theme: header language switcher */
[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium {
    color: #d9e4ef;
    border-color: transparent !important;
    background: transparent !important;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium:hover,
[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium:focus,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium:hover,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-menubar-btn--premium:focus {
    border-color: rgba(148, 163, 184, 0.35) !important;
    background: rgba(148, 163, 184, 0.12) !important;
    color: #f1f5f9;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-trigger__icon,
.dark .header .header-user .user-menu .lang-dropdown .lang-trigger__icon {
    color: #9ec5e8;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-trigger__code,
.dark .header .header-user .user-menu .lang-dropdown .lang-trigger__code {
    color: #cde1f3;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-trigger__chevron,
.dark .header .header-user .user-menu .lang-dropdown .lang-trigger__chevron {
    color: #9db2c6;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-menu,
.dark .header .header-user .user-menu .lang-dropdown .lang-dropdown-menu {
    border-color: rgba(148, 163, 184, 0.26);
    background: linear-gradient(180deg, #1e2533 0%, #151b27 100%);
    box-shadow:
        0 20px 42px rgba(0, 0, 0, 0.48),
        0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item,
.dark .header .header-user .user-menu .lang-dropdown .lang-dropdown-item {
    color: #dce7f2;
    border-color: transparent;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item__name,
.dark .header .header-user .user-menu .lang-dropdown .lang-dropdown-item__name {
    color: #dce7f2;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item__code,
.dark .header .header-user .user-menu .lang-dropdown .lang-dropdown-item__code {
    color: #9db2c6;
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:hover,
[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:focus,
.dark .header .header-user .user-menu .lang-dropdown .lang-dropdown-item:hover,
.dark .header .header-user .user-menu .lang-dropdown .lang-dropdown-item:focus {
    background: rgba(71, 85, 105, 0.34);
    border-color: rgba(148, 163, 184, 0.36);
    color: #f8fafc;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:hover
    .lang-dropdown-item__name,
[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:focus
    .lang-dropdown-item__name,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:hover
    .lang-dropdown-item__name,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item:focus
    .lang-dropdown-item__name {
    color: #f8fafc;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(74, 222, 128, 0.45);
    color: #86efac;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active:hover,
[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active:focus,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active:hover,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active:focus {
    background: rgba(34, 197, 94, 0.24);
    border-color: rgba(74, 222, 128, 0.58);
    color: #86efac;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active
    .lang-dropdown-item__name,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active
    .lang-dropdown-item__name {
    color: #86efac;
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active
    .lang-dropdown-item__code,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item.active
    .lang-dropdown-item__code {
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(34, 197, 94, 0.18);
}

[data-theme="dark"]
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item__check,
.dark
    .header
    .header-user
    .user-menu
    .lang-dropdown
    .lang-dropdown-item__check {
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(34, 197, 94, 0.2);
}

/* =============================================================================
   18. Sidebar Active States
============================================================================= */
#sidebar-menu .sidebar-nav-link {
    border-radius: 10px;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

#sidebar-menu .sidebar-nav-link i,
#sidebar-menu .sidebar-nav-link span {
    transition: color 0.18s ease;
}

#sidebar-menu .sidebar-nav-link:hover {
    background: #f4f8f5;
}

#sidebar-menu .sidebar-nav-link.active {
    background: linear-gradient(
        90deg,
        rgba(22, 163, 74, 0.16),
        rgba(22, 163, 74, 0.07)
    );
    box-shadow: inset 3px 0 0 #16a34a;
}

html[dir="rtl"] #sidebar-menu .sidebar-nav-link.active {
    box-shadow: inset -3px 0 0 #16a34a;
}

#sidebar-menu .sidebar-nav-link.active i,
#sidebar-menu .sidebar-nav-link.active span {
    color: var(--osp-green);
    font-weight: 600;
}

#sidebar-menu .submenu > a.active,
#sidebar-menu .submenu > a.subdrop {
    background: var(--osp-green);
    border-radius: 10px;
}

#sidebar-menu .submenu > a .menu-arrow {
    transition: transform 0.2s ease;
}

#sidebar-menu .submenu > a.subdrop .menu-arrow {
    transform: rotate(90deg);
}

html[dir="rtl"] #sidebar-menu .submenu > a.subdrop .menu-arrow {
    transform: rotate(-90deg);
}

/* =============================================================================
   19. Dashboard Hero + KPI Cards
============================================================================= */
.osp-unified-overview {
    --osp-surface: #ffffff;
    --osp-shadow: 0 10px 24px rgba(14, 18, 33, 0.08);
    --osp-border: rgba(17, 24, 39, 0.08);
}

.osp-surface {
    border: 1px solid var(--osp-border);
    box-shadow: var(--osp-shadow) !important;
}

.osp-dashboard-hero {
    background:
        radial-gradient(
            circle at 84% 20%,
            rgba(255, 255, 255, 0.26) 0,
            rgba(255, 255, 255, 0.03) 32%
        ),
        linear-gradient(120deg, #0f6e3f 0%, #1f8b4d 45%, #36a85e 100%);
    position: relative;
    isolation: isolate;
}

.osp-dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(7, 41, 26, 0.35), transparent 52%);
    pointer-events: none;
    z-index: -1;
}

.osp-community-avatar {
    width: 76px;
    height: 76px;
    object-fit: cover;
}

.osp-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.16);
    color: #e5f9ec;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.osp-hero-main {
    min-width: 0;
}

.osp-community-summary {
    max-width: 680px;
}

.osp-btn-hero {
    border-radius: 999px;
    padding-inline: 1rem;
    white-space: nowrap;
}

.osp-hero-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.osp-meta-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
}

.osp-meta-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
}

.osp-hero-insights {
    display: block;
    width: 100%;
    max-width: 560px;
}

.osp-hero-panel {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    padding: 0.75rem;
    backdrop-filter: blur(2px);
}

.osp-hero-panel-title {
    color: #f0fdf4;
    font-size: 0.86rem;
    font-weight: 700;
}

.osp-hero-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.75rem;
}

.osp-hero-span-2 {
    grid-column: span 2;
}

.osp-hero-label {
    color: rgba(240, 253, 244, 0.78);
    font-size: 0.73rem;
    line-height: 1.15;
}

.osp-hero-value {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.osp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
}

.osp-chip-light {
    background: #fff;
    color: #111827;
}

.osp-chip-soft {
    background: #f3f4f6;
    color: #111827;
}

.osp-chip-status.is-active {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.osp-chip-status.is-inactive {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.osp-chip-label {
    opacity: 0.75;
}

.osp-chip-value {
    font-weight: 700;
}

.osp-kpi-card {
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
    border: 1px solid rgba(17, 24, 39, 0.06);
}

.osp-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(16, 24, 40, 0.1) !important;
}

.osp-kpi-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f8b4d;
    background: rgba(31, 139, 77, 0.1);
}

.osp-kpi-value {
    line-height: 1.15;
    word-break: break-word;
}

@media (max-width: 1199.98px) {
    .osp-hero-meta {
        align-items: flex-start !important;
    }

    .osp-hero-insights {
        max-width: 100%;
    }
}

@media (min-width: 1200px) {
    .osp-hero-meta {
        align-items: flex-end;
    }

    .osp-meta-toolbar {
        justify-content: flex-end;
    }

    .osp-meta-chips {
        justify-content: flex-end;
    }

    .osp-hero-insights {
        justify-self: end;
    }
}

@media (max-width: 575.98px) {
    .osp-hero-profile-grid {
        grid-template-columns: 1fr;
    }

    .osp-hero-span-2 {
        grid-column: span 1;
    }
}

/* =============================================================================
   20. Dashboard V2 — Hero, KPI Grid, Panels, Lists, Charts
   Premium redesign using osp-v2-* namespace
============================================================================= */

/* ── Shared tokens ───────────────────────────────────────────────────────── */
.osp-v2-hero,
.osp-v2-panel,
.osp-v2-kpi-card {
    --v2-radius: 16px;
    --v2-shadow:
        0 4px 24px rgba(15, 23, 42, 0.07), 0 1px 4px rgba(15, 23, 42, 0.04);
    --v2-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --v2-border: rgba(17, 24, 39, 0.07);
    --v2-surface: #ffffff;
    --v2-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Hero Banner ─────────────────────────────────────────────────────────── */
.osp-v2-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--v2-radius);
    background:
        radial-gradient(
            ellipse at 80% 10%,
            rgba(255, 255, 255, 0.22) 0,
            transparent 38%
        ),
        linear-gradient(
            130deg,
            #0a5c32 0%,
            #1a7d45 40%,
            #2ea85f 80%,
            #3fc870 100%
        );
    box-shadow: var(--v2-shadow-lg);
    padding: 2.5rem 2.5rem 2rem;
}

/* Decorative blobs */
.osp-v2-blob {
    pointer-events: none;
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.18;
}
.osp-v2-blob--1 {
    width: 380px;
    height: 380px;
    background: #86efac;
    top: -120px;
    right: -80px;
}
.osp-v2-blob--2 {
    width: 240px;
    height: 240px;
    background: #34d399;
    bottom: -60px;
    left: 10%;
    opacity: 0.12;
}
.osp-v2-blob--3 {
    width: 160px;
    height: 160px;
    background: #facc15;
    top: 30px;
    left: 38%;
    opacity: 0.08;
}

/* Hero inner layout */
.osp-v2-hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    justify-content: space-between;
}

/* Left column */
.osp-v2-hero__left {
    flex: 1 1 300px;
    min-width: 0;
}

/* Eyebrow badge */
.osp-v2-eyebrow {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #d1fae5;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    margin-bottom: 0.75rem;
}

.osp-v2-hero__title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.22;
    margin-bottom: 0.45rem;
}

.osp-v2-hero__subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.72);
}

/* Community row */
.osp-v2-community-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.osp-v2-community-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.osp-v2-community-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}

.osp-v2-community-avatar-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    animation: ospPulseRing 2.4s ease-out infinite;
}

@keyframes ospPulseRing {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    80% {
        transform: scale(1.2);
        opacity: 0;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.osp-v2-community-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osp-v2-community-addr {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 2px;
}

/* Chips row */
.osp-v2-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.osp-v2-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    border: 1px solid transparent;
    line-height: 1;
    backdrop-filter: blur(6px);
}

.osp-v2-chip__label {
    opacity: 0.75;
}
.osp-v2-chip__val {
    font-weight: 700;
}

.osp-v2-chip--president {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
}
.osp-v2-chip--manager {
    background: rgba(255, 255, 255, 0.13);
    color: #e0fce8;
    border-color: rgba(255, 255, 255, 0.18);
}
.osp-v2-chip--active {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}
.osp-v2-chip--inactive {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Right column: profile card */
.osp-v2-hero__right {
    flex: 0 1 360px;
    min-width: 0;
    width: 100%;
    max-width: 360px;
}

.osp-v2-profile-card {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    padding: 1.15rem 1.4rem;
    backdrop-filter: blur(8px);
    min-width: 0;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.osp-v2-profile-card__header {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #d1fae5;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
}

.osp-v2-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 1rem;
}

.osp-v2-pf-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.osp-v2-pf-item--full {
    grid-column: span 2;
}

.osp-v2-pf-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(240, 253, 244, 0.65);
}

.osp-v2-pf-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    word-break: break-word;
}
.osp-v2-pf-green {
    color: #86efac !important;
}
.osp-v2-pf-red {
    color: #fca5a5 !important;
}

/* CTA button */
.osp-v2-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.5rem 1.1rem;
    text-decoration: none;
    transition:
        background 0.2s var(--v2-ease),
        transform 0.2s var(--v2-ease);
    backdrop-filter: blur(4px);
    align-self: flex-start;
}
.osp-v2-cta-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    color: #fff;
    transform: translateY(-1px);
}

/* Dark / high-contrast variant of the profile card used on the hero */
.osp-v2-profile-card--dark {
    background: rgba(0, 0, 0, 0.38);
    border-color: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.osp-v2-profile-card--dark .osp-v2-profile-card__header {
    color: #a7f3d0;
}

.osp-v2-profile-card--dark .osp-v2-pf-label {
    color: rgba(255, 255, 255, 0.55);
}

.osp-v2-profile-card--dark .osp-v2-pf-val {
    color: #ffffff;
}

.osp-v2-profile-card--dark .osp-v2-pf-green {
    color: #6ee7b7 !important;
}
.osp-v2-profile-card--dark .osp-v2-pf-red {
    color: #fca5a5 !important;
}

/* Solid CTA button (white bg, green text) — inside dark card */
.osp-v2-cta-btn--solid {
    background: rgba(255, 255, 255, 0.95);
    color: #065f46;
    border-color: transparent;
    font-weight: 700;
}
.osp-v2-cta-btn--solid:hover {
    background: #ffffff;
    color: #064e3b;
    transform: translateY(-1px);
}

/* ── KPI Grid ────────────────────────────────────────────────────────────── */
.osp-v2-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

@media (max-width: 1399.98px) {
    .osp-v2-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 767.98px) {
    .osp-v2-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 479.98px) {
    .osp-v2-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* KPI Card */
.osp-v2-kpi-card {
    position: relative;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    box-shadow: var(--v2-shadow);
    padding: 1.25rem 1rem 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    cursor: default;
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 0.45s var(--v2-ease),
        transform 0.45s var(--v2-ease),
        box-shadow 0.25s ease;
}
.osp-v2-kpi-card--visible {
    opacity: 1;
    transform: translateY(0);
}
.osp-v2-kpi-card:hover {
    box-shadow: var(--v2-shadow-lg);
    transform: translateY(-3px);
}

.osp-v2-kpi-card__icon-wrap {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    background: var(--card-gradient, linear-gradient(135deg, #059669, #10b981));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.osp-v2-kpi-card__body {
    flex: 1;
}

.osp-v2-kpi-card__label {
    font-size: 0.76rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.15rem;
}

.osp-v2-kpi-card__value {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.15;
    margin: 0;
    word-break: break-word;
}

/* Colored accent bar at the bottom */
.osp-v2-kpi-card__bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-gradient, linear-gradient(90deg, #059669, #10b981));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--v2-ease);
}
.osp-v2-kpi-card:hover .osp-v2-kpi-card__bar {
    transform: scaleX(1);
}

/* Sparkline wrapper inside KPI card */
.osp-v2-spark-wrap {
    position: absolute;
    bottom: 12px;
    right: 12px;
    opacity: 0.35;
}

/* ── Panels ──────────────────────────────────────────────────────────────── */
.osp-v2-panel {
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    box-shadow: var(--v2-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.osp-v2-panel__head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.055);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.osp-v2-panel__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: rgba(22, 163, 74, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    font-size: 1rem;
    flex-shrink: 0;
}

.osp-v2-panel__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.osp-v2-panel__body {
    padding: 1.25rem 1.35rem;
    flex: 1;
}

/* ── Dropdown button inside panel head ───────────────────────────────────── */
.osp-v2-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    transition:
        border-color 0.18s,
        color 0.18s;
}
.osp-v2-dropdown-toggle:hover {
    border-color: #16a34a;
    color: #16a34a;
}

.osp-v2-dropdown-menu {
    border-radius: 12px !important;
    padding: 6px !important;
    min-width: 160px;
}
.osp-v2-dropdown-item {
    border-radius: 8px;
    font-size: 0.83rem;
    font-weight: 500;
    padding: 0.45rem 0.75rem !important;
    transition:
        background 0.15s,
        color 0.15s;
}
.osp-v2-dropdown-item:hover {
    background: #f0fdf4 !important;
    color: #166534 !important;
}

/* View all link */
.osp-v2-view-all {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #16a34a;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.18s;
}
.osp-v2-view-all:hover {
    opacity: 0.72;
    color: #15803d;
}

/* ── Community Snapshot grid ─────────────────────────────────────────────── */
.osp-v2-snap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.osp-v2-snap-item {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: box-shadow 0.2s;
}
.osp-v2-snap-item:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
}

.osp-v2-snap-val {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}
.osp-v2-snap-val--amber {
    color: #d97706;
}
.osp-v2-snap-val--sky {
    color: #0284c7;
}
.osp-v2-snap-val--violet {
    color: #7c3aed;
}

.osp-v2-snap-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.3rem;
}

/* Divider */
.osp-v2-divider {
    height: 1px;
    background: rgba(15, 23, 42, 0.06);
    margin: 1rem 0;
}

/* Meta row (created/updated) */
.osp-v2-meta-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.osp-v2-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: #94a3b8;
    font-size: 1.1rem;
    min-width: 0;
}

.osp-v2-meta-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.osp-v2-meta-val {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    margin-top: 1px;
}

/* ── Operations Health Progress bars ─────────────────────────────────────── */
.osp-v2-health-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.osp-v2-health-label {
    font-size: 0.83rem;
    font-weight: 600;
    color: #334155;
}

.osp-v2-health-pct {
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.osp-v2-progress-track {
    height: 7px;
    background: #fcfcfc;
    border-radius: 999px;
    overflow: hidden;
}

.osp-v2-progress-fill {
    height: 100%;
    border-radius: 999px;
    width: 0%;
}

/* ── Donut legend ────────────────────────────────────────────────────────── */
.osp-v2-legend {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.osp-v2-legend-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.osp-v2-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.osp-v2-legend-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: #475569;
}
.osp-v2-legend-pct {
    font-size: 0.82rem;
    font-weight: 700;
}

/* ── Recent Data Lists ───────────────────────────────────────────────────── */
.osp-v2-list {
    display: flex;
    flex-direction: column;
}

.osp-v2-list-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.35rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.055);
    transition: background 0.15s;
}
.osp-v2-list-item:last-child {
    border-bottom: none;
}
.osp-v2-list-item:hover {
    background: #f8fafc;
}

.osp-v2-list-avatar {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.osp-v2-list-avatar--maintenance {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}
.osp-v2-list-avatar--unit {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.osp-v2-list-body {
    flex: 1;
    min-width: 0;
}

.osp-v2-list-title {
    font-size: 0.87rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osp-v2-list-meta {
    font-size: 0.74rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
}

.osp-v2-list-date {
    font-size: 0.76rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Status badges */
.osp-v2-status-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
    flex-shrink: 0;
}
.osp-v2-status-badge--success {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.osp-v2-status-badge--warning {
    background: rgba(245, 158, 11, 0.13);
    color: #d97706;
}
.osp-v2-status-badge--danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
.osp-v2-status-badge--primary {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}
.osp-v2-status-badge--info {
    background: rgba(6, 182, 212, 0.12);
    color: #0891b2;
}
.osp-v2-status-badge--secondary {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}
.osp-v2-status-badge--processing {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

/* Empty state */
.osp-v2-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    color: #cbd5e1;
}
.osp-v2-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.osp-v2-empty p {
    font-size: 0.84rem;
    font-weight: 500;
    margin: 0;
}

/* Chart empty state */
.osp-v2-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    font-weight: 500;
    color: #94a3b8;
    font-size: 0.88rem;
}

/* ── Dark Mode ───────────────────────────────────────────────────────────── */
[data-theme="dark"] .osp-v2-hero,
.dark .osp-v2-hero {
    background:
        radial-gradient(
            ellipse at 80% 10%,
            rgba(255, 255, 255, 0.1) 0,
            transparent 38%
        ),
        linear-gradient(
            130deg,
            #062e1a 0%,
            #0a5c32 40%,
            #127a42 80%,
            #1a9950 100%
        );
}

[data-theme="dark"] .osp-v2-panel,
[data-theme="dark"] .osp-v2-kpi-card,
.dark .osp-v2-panel,
.dark .osp-v2-kpi-card {
    --v2-surface: #131720;
    --v2-border: rgba(255, 255, 255, 0.07);
    background: #131720;
    border-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .osp-v2-panel__head,
.dark .osp-v2-panel__head {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .osp-v2-panel__title,
[data-theme="dark"] .osp-v2-kpi-card__value,
[data-theme="dark"] .osp-v2-snap-val,
[data-theme="dark"] .osp-v2-health-label,
[data-theme="dark"] .osp-v2-list-title,
[data-theme="dark"] .osp-v2-meta-val,
.dark .osp-v2-panel__title,
.dark .osp-v2-kpi-card__value {
    color: #f1f5f9;
}

[data-theme="dark"] .osp-v2-snap-item,
.dark .osp-v2-snap-item {
    background: #1a2035;
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .osp-v2-divider,
.dark .osp-v2-divider {
    background: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .osp-v2-list-item:hover,
.dark .osp-v2-list-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .osp-v2-list-item,
.dark .osp-v2-list-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .osp-v2-progress-track,
.dark .osp-v2-progress-track {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .osp-v2-panel__icon,
.dark .osp-v2-panel__icon {
    background: rgba(22, 163, 74, 0.15);
}

[data-theme="dark"] .osp-v2-dropdown-toggle,
.dark .osp-v2-dropdown-toggle {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

[data-theme="dark"] .osp-v2-legend-name,
[data-theme="dark"] .osp-v2-list-date,
[data-theme="dark"] .osp-v2-list-meta,
.dark .osp-v2-legend-name {
    color: #94a3b8;
}

/* ── RTL ─────────────────────────────────────────────────────────────────── */
[dir="rtl"] .osp-v2-hero__inner {
    flex-direction: row;
}
[dir="rtl"] .osp-v2-community-row {
    flex-direction: row;
}
[dir="rtl"] .osp-v2-chips-row {
    flex-direction: row;
}
[dir="rtl"] .osp-v2-panel__head {
    flex-direction: row;
}
[dir="rtl"] .osp-v2-view-all {
    flex-direction: row;
}
[dir="rtl"] .osp-v2-list-item {
    flex-direction: row;
}
[dir="rtl"] .osp-v2-meta-row {
    flex-direction: row;
}
[dir="rtl"] .osp-v2-hero__left,
[dir="rtl"] .osp-v2-hero__subtitle,
[dir="rtl"] .osp-v2-community-name,
[dir="rtl"] .osp-v2-community-addr,
[dir="rtl"] .osp-v2-chip,
[dir="rtl"] .osp-v2-profile-card,
[dir="rtl"] .osp-v2-pf-item,
[dir="rtl"] .osp-v2-health-label {
    text-align: right;
}
[dir="rtl"] .osp-v2-list-body,
[dir="rtl"] .osp-v2-meta-item,
[dir="rtl"] .osp-v2-panel__title,
[dir="rtl"] .osp-v2-legend-name {
    text-align: right;
}
[dir="rtl"] .osp-v2-kpi-card__bar {
    transform-origin: right;
}
[dir="rtl"] .osp-v2-snap-grid {
    direction: rtl;
}
.osp-v2-hero__title,
.osp-v2-community-name,
.osp-v2-community-addr,
.osp-v2-chip__val,
.osp-v2-pf-val {
    unicode-bidi: plaintext;
}
.osp-v2-inline-datetime {
    unicode-bidi: isolate;
    display: inline-block;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
    .osp-v2-hero__inner {
        flex-direction: column;
    }
    .osp-v2-hero__right {
        max-width: 100%;
    }
    .osp-v2-profile-card {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }
    .osp-v2-profile-grid {
        gap: 0.5rem 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .osp-v2-hero {
        padding: 1.5rem 1.25rem 1.25rem;
    }
    .osp-v2-hero__title {
        font-size: 1.35rem;
    }
    .osp-v2-snap-grid {
        grid-template-columns: 1fr 1fr;
    }
    .osp-v2-profile-grid {
        grid-template-columns: 1fr;
    }
    .osp-v2-pf-item--full {
        grid-column: span 1;
    }
    .osp-v2-meta-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    .osp-v2-list-item {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }
    .osp-v2-status-badge,
    .osp-v2-list-date {
        margin-inline-start: auto;
    }
    [dir="rtl"] .osp-v2-status-badge,
    [dir="rtl"] .osp-v2-list-date {
        margin-inline-start: 0;
        margin-inline-end: auto;
    }
}

@media (max-width: 1199.98px) {
    [dir="rtl"] .osp-v2-hero__inner {
        flex-direction: column;
    }
}

@media (max-width: 479.98px) {
    .osp-v2-snap-grid {
        grid-template-columns: 1fr;
    }
    .osp-v2-chips-row {
        flex-wrap: wrap;
    }
}

/* =============================================================================
   Provider Maintenance Table + Update Status Modal
============================================================================= */
#provider-maintenance-datatable {
    width: 100% !important;
    table-layout: fixed;
}

#provider-maintenance-datatable td,
#provider-maintenance-datatable th {
    white-space: nowrap;
}

#provider-maintenance-datatable th:nth-child(7),
#provider-maintenance-datatable td:nth-child(7) {
    white-space: normal;
}

#provider-maintenance-datatable td.osp-dt-actions-cell {
    min-width: 0;
}

#view-provider-maintenance .provider-maintenance-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin: 0 !important;
}

#view-provider-maintenance .provider-maintenance-filter {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    flex: 0 0 220px;
}

#provider-maintenance-datatable .maintenance-action-wrap {
    display: flex;
    justify-content: flex-start;
}

#provider-maintenance-datatable .maintenance-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 110px;
    height: 30px;
    padding: 0 0.625rem;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
}

#provider-maintenance-datatable .maintenance-action-btn--update {
    color: #198754;
    border: 1px solid rgba(25, 135, 84, 0.45);
    background: rgba(25, 135, 84, 0.06);
}

#provider-maintenance-datatable .maintenance-action-btn--update:hover {
    color: #fff;
    background: #198754;
    border-color: #198754;
}

#provider-maintenance-datatable .maintenance-action-btn--blocked {
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.35);
    background: rgba(108, 117, 125, 0.08);
    cursor: not-allowed;
}

@media (max-width: 992px) {
    #view-provider-maintenance .page-breadcrumb {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        border-bottom: 0 !important;
    }

    #view-provider-maintenance .page-breadcrumb .breadcrumb {
        margin-bottom: 0 !important;
    }

    #view-provider-maintenance .page-breadcrumb .bc-main .my-auto {
        margin-bottom: 0 !important;
    }

    #view-provider-maintenance .page-breadcrumb .right-content {
        display: flex !important;
        width: 100% !important;
        margin-top: 0 !important;
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
        justify-content: stretch !important;
        align-items: stretch !important;
    }

    #view-provider-maintenance .page-breadcrumb .right-content > * {
        display: block !important;
        flex: 1 1 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    #view-provider-maintenance .provider-maintenance-filters {
        display: flex !important;
        flex-wrap: wrap;
        margin-bottom: 0 !important;
        gap: 0.35rem !important;
    }

    #view-provider-maintenance .provider-maintenance-filter {
        display: block !important;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }

    #view-provider-maintenance .custom-card.osp-datatable-card {
        margin-top: 0 !important;
    }
}

.swal2-popup.osp-update-status-modal {
    width: min(460px, calc(100vw - 32px));
    padding: 1.25rem 1.25rem 1rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

.osp-update-status-modal__title {
    margin-bottom: 0.9rem;
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.swal2-popup.osp-update-status-modal
    .swal2-select.osp-update-status-modal__select {
    width: 100%;
    height: 44px;
    margin: 0;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #fff;
    font-size: 15px;
    color: #0f172a;
}

.swal2-popup.osp-update-status-modal
    .swal2-select.osp-update-status-modal__select:focus {
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.16);
}

.swal2-popup.osp-update-status-modal
    .swal2-actions.osp-update-status-modal__actions {
    width: 100%;
    gap: 0.55rem;
    justify-content: center;
    margin: 1rem 0 0;
}

.swal2-popup.osp-update-status-modal .osp-swal-btn {
    min-width: 104px;
    height: 38px;
    border-radius: 10px;
    padding: 0 0.95rem;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid transparent;
    transition: all 0.16s ease-in-out;
}

.swal2-popup.osp-update-status-modal .osp-swal-btn--primary {
    color: #fff;
    background: #198754;
    border-color: #198754;
}

.swal2-popup.osp-update-status-modal .osp-swal-btn--primary:hover {
    background: #157347;
    border-color: #157347;
}

.swal2-popup.osp-update-status-modal .osp-swal-btn--ghost {
    color: #475569;
    background: #fff;
    border-color: #cbd5e1;
}

.swal2-popup.osp-update-status-modal .osp-swal-btn--ghost:hover {
    color: #1e293b;
    background: #f8fafc;
    border-color: #94a3b8;
}

/* ─── UTILITY ────────────────────────────────────────────────────────────── */
.bg-primary-transparent {
    background-color: rgba(46, 125, 50, 0.1) !important;
}
.bg-success-transparent {
    background-color: rgba(22, 163, 74, 0.1) !important;
}
.bg-warning-transparent {
    background-color: rgba(234, 88, 12, 0.1) !important;
}
.bg-info-transparent {
    background-color: rgba(8, 145, 178, 0.1) !important;
}
.bg-danger-transparent {
    background-color: rgba(220, 38, 38, 0.1) !important;
}
.bg-secondary-transparent {
    background-color: rgba(108, 117, 125, 0.1) !important;
}

/* =============================================================================
   SHARED INDEX / DATATABLE PREMIUM STYLES (Migrated from Votings)
============================================================================= */
/* ─── INDEX PAGE FILTERS ───────────────────────────────────────────────────── */
.vt-page-shell .filters-wrap {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    align-items: end;
}

.vt-page-shell .datatable-filter {
    border-radius: 10px;
    border-color: var(--vt-border);
    padding: 8px 16px;
}

/* Votings index premium shell */
.vt-page-shell .page-breadcrumb {
    background:
        radial-gradient(
            1200px 260px at 15% -40%,
            rgba(var(--vt-primary-rgb), 0.12),
            transparent 60%
        ),
        radial-gradient(
            900px 220px at 90% -60%,
            rgba(var(--vt-info-rgb), 0.08),
            transparent 55%
        ),
        linear-gradient(180deg, #fdfefe 0%, #f6faf8 100%);
    border: 1px solid rgba(var(--vt-primary-rgb), 0.12);
    border-radius: 18px;
    padding: 18px 20px 16px;
    margin-bottom: 16px !important;
    box-shadow: var(--vt-shadow-sm);
}

.vt-page-shell .page-breadcrumb h2 {
    font-size: clamp(1.5rem, 2vw, 2rem);
    letter-spacing: -0.02em;
    color: #1f2a44 !important;
}

.vt-page-shell .page-breadcrumb .breadcrumb {
    margin-top: 4px;
}

.vt-page-shell .page-breadcrumb .breadcrumb-item,
.vt-page-shell .page-breadcrumb .breadcrumb-item a {
    color: #4f5d75;
    font-weight: 500;
}

.vt-page-shell .page-breadcrumb .breadcrumb-item.active {
    color: #1f2a44;
    font-weight: 700;
}

.vt-page-shell .filters-wrap .datatable-filter {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d7e1e8;
    background: #ffffff;
    font-weight: 600;
    color: #334155;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transition: var(--vt-transition);
    padding-inline: 12px;
}

.vt-page-shell .filters-wrap .datatable-filter:focus {
    border-color: rgba(var(--vt-primary-rgb), 0.45);
    box-shadow: 0 0 0 4px rgba(var(--vt-primary-rgb), 0.14);
}

.vt-page-shell .vt-filter-field {
    min-width: 0;
}

.vt-page-shell .vt-filter-label {
    display: block;
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #4b5d73;
}

.vt-page-shell .vt-filter-field--status {
    grid-column: span 2;
}

.vt-page-shell .vt-filter-field--scope {
    grid-column: span 2;
}

.vt-page-shell .vt-filter-field--start-range {
    grid-column: span 3;
}

.vt-page-shell .vt-filter-field--end-range {
    grid-column: span 3;
}

.vt-page-shell .vt-filter-field--action {
    grid-column: span 2;
}

.vt-page-shell .vt-range-input-group .input-group-text {
    min-height: 44px;
    border: 1px solid #d7e1e8;
    border-right: 0;
    color: #5f738a;
    background: #f7fbff;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.vt-page-shell .vt-range-input-group .form-control {
    min-height: 44px;
    border: 1px solid #d7e1e8;
    border-left: 0;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    padding-inline: 12px;
    background: #ffffff;
    font-weight: 600;
    color: #334155;
}

.vt-page-shell .vt-range-input-group .form-control::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.vt-page-shell .vt-range-input-group:focus-within .input-group-text,
.vt-page-shell .vt-range-input-group:focus-within .form-control {
    border-color: rgba(var(--vt-primary-rgb), 0.45);
}

.vt-page-shell .vt-range-input-group:focus-within {
    border-radius: 10px;
    box-shadow: 0 0 0 4px rgba(var(--vt-primary-rgb), 0.14);
}

.vt-page-shell .filters-wrap .btn.btn-primary {
    min-height: 44px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding-inline: 16px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    box-shadow: 0 10px 20px rgba(var(--vt-primary-rgb), 0.2);
}

.vt-page-shell .vt-filter-field--action .btn {
    width: 100%;
}

.vt-page-shell .filters-wrap .btn.btn-primary:hover {
    box-shadow: 0 12px 24px rgba(var(--vt-primary-rgb), 0.25);
}

.vt-page-shell .osp-datatable-card {
    border: 1px solid #dce4ea !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
    padding: 14px !important;
}

.vt-page-shell .dataTables_wrapper .dataTables_filter input {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #d7e1e8;
    background: #f8fbfd;
    padding-inline: 14px 14px;
}

.vt-page-shell .dataTables_wrapper .dataTables_length select {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid #d7e1e8;
    background: #f8fbfd;
}

.vt-page-shell .osp-datatable {
    border-collapse: separate;
    border-spacing: 0;
}

.vt-page-shell .osp-datatable thead th {
    background: linear-gradient(180deg, #f2f6fa 0%, #eaf0f6 100%);
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
    font-weight: 800;
    border-bottom: 1px solid #d7e1e8 !important;
    padding-top: 14px;
    padding-bottom: 14px;
}

.vt-page-shell .osp-datatable thead th:first-child {
    border-top-left-radius: 10px;
}

.vt-page-shell .osp-datatable thead th:last-child {
    border-top-right-radius: 10px;
}

.vt-page-shell .osp-datatable tbody tr {
    transition: var(--vt-transition);
}

.vt-page-shell .osp-datatable tbody td {
    border-bottom: 1px solid #e6edf2 !important;
    padding-top: 13px;
    padding-bottom: 13px;
    vertical-align: middle;
}

.vt-page-shell .osp-datatable tbody tr:hover {
    background: linear-gradient(
        180deg,
        rgba(var(--vt-primary-rgb), 0.04) 0%,
        rgba(var(--vt-info-rgb), 0.03) 100%
    );
}

.vt-page-shell .osp-datatable .datatable-view-link {
    font-weight: 500;
    color: #196f3d !important;
    text-decoration: none;
}

.vt-page-shell .osp-datatable .datatable-view-link:hover {
    color: #0f5132 !important;
    text-decoration: underline;
}

.vt-page-shell .osp-datatable .datatable-count-badge {
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: #4338ca;
    font-weight: 800;
    font-size: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.vt-page-shell .osp-datatable td:last-child {
    text-align: center;
}

.vt-page-shell .osp-datatable .voting-actions-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vt-page-shell .osp-datatable .voting-actions-toggle {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #d9e2ea;
    color: #334155;
    font-size: 16px;
}

.vt-page-shell .osp-datatable .voting-actions-toggle::after {
    display: none;
}

.vt-page-shell .osp-datatable .voting-actions-toggle:hover,
.vt-page-shell .osp-datatable .voting-actions-toggle:focus {
    border-color: rgba(var(--vt-primary-rgb), 0.35);
    color: var(--vt-primary);
    box-shadow: 0 0 0 4px rgba(var(--vt-primary-rgb), 0.12);
}

.vt-page-shell .osp-datatable .voting-actions-menu {
    min-width: 210px;
    border-radius: 14px;
    border: 1px solid #d5e0e8;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
    padding: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    backdrop-filter: blur(8px);
}

.vt-page-shell .osp-datatable .voting-actions-menu .dropdown-item {
    width: 100%;
    height: auto;
    min-height: 0;
    border-radius: 10px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-weight: 700;
    font-size: 14px;
    color: #24324a;
    padding: 10px 12px;
    margin: 0 0 4px 0;
    display: flex !important;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1.2;
}

.vt-page-shell .osp-datatable .voting-actions-menu .dropdown-item:last-child {
    margin-bottom: 0;
}

.vt-page-shell .osp-datatable .voting-actions-menu .dropdown-item i {
    font-size: 16px;
    opacity: 0.85;
}

.vt-page-shell .osp-datatable .voting-actions-menu .dropdown-item:hover,
.vt-page-shell .osp-datatable .voting-actions-menu .dropdown-item:focus {
    background: linear-gradient(
        180deg,
        rgba(var(--vt-primary-rgb), 0.12) 0%,
        rgba(var(--vt-primary-rgb), 0.08) 100%
    ) !important;
    color: #1f2a44;
}

.vt-page-shell
    .osp-datatable
    .voting-actions-menu
    .dropdown-item.text-danger:hover,
.vt-page-shell
    .osp-datatable
    .voting-actions-menu
    .dropdown-item.text-danger:focus {
    background: rgba(var(--vt-danger-rgb), 0.1);
    color: var(--vt-danger) !important;
}

@media (max-width: 767.98px) {
    .vt-form-section::after {
        display: none;
    }

    #votings-create .option-row,
    #votings-edit .option-row {
        grid-template-columns: auto auto 1fr auto;
        gap: 10px;
    }

    #votings-create .option-row .flex-grow-1,
    #votings-edit .option-row .flex-grow-1 {
        grid-column: 1 / -1;
    }
}

/* =============================================================================
   4. Unified Dashboard
============================================================================= */
.dash-v3-shell {
    --dash-bg: linear-gradient(180deg, #f7fbf7 0%, #eef7ef 100%);
    --dash-surface: rgba(255, 255, 255, 0.94);
    --dash-border: rgba(46, 125, 50, 0.14);
    --dash-text: #17311d;
    --dash-muted: #5f7365;
    --dash-shadow: 0 20px 45px rgba(28, 66, 34, 0.08);
    display: grid;
    gap: 1.5rem;
    min-width: 0;
}

.dash-v3-alert {
    background: linear-gradient(
        135deg,
        rgba(46, 125, 50, 0.12),
        rgba(165, 214, 167, 0.12)
    );
    border: 1px solid rgba(46, 125, 50, 0.2);
    border-radius: 20px;
    color: var(--dash-text);
}

.dash-v3-alert strong {
    color: var(--osp-green);
}

.dash-v3-hero-card,
.dash-v3-panel {
    box-shadow: var(--dash-shadow);
}

.dash-v3-role-pill {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.8rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7fcf7 100%);
    border: 1px solid rgba(46, 125, 50, 0.14);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(28, 66, 34, 0.08);
    min-width: 180px;
    text-align: start;
}

.dash-v3-role-pill__eyebrow,
.dash-v3-section-title,
.dash-v3-kicker {
    display: inline-block;
    color: var(--osp-green-bg);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dash-v3-role-pill strong {
    color: var(--osp-green);
}

.dash-v3-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 28px;
    background:
        radial-gradient(
            circle at top left,
            rgba(255, 255, 255, 0.16),
            transparent 26%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(129, 199, 132, 0.22),
            transparent 30%
        ),
        linear-gradient(135deg, #16361a 0%, var(--osp-green) 54%, #66bb6a 100%);
    color: #fff;
    box-shadow: var(--dash-shadow);
}

.dash-v3-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.dash-v3-hero__content {
    min-width: 0;
}

.dash-v3-hero__title {
    margin: 0.7rem 0 0.8rem;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.02;
    color: #fff;
    word-break: break-word;
}

.dash-v3-hero__text {
    max-width: 62ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.7;
}

.dash-v3-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.4rem;
}

.dash-v3-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.92rem;
    max-width: 100%;
    white-space: normal;
    text-align: start;
}

.dash-v3-identity,
.dash-v3-panel,
.dash-v3-stat-card {
    background: var(--dash-surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--dash-border);
    box-shadow: var(--dash-shadow);
}

.dash-v3-identity {
    border-radius: 24px;
    padding: 1.25rem;
    color: var(--dash-text);
    display: grid;
    gap: 1rem;
    align-self: stretch;
    min-width: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.96),
        rgba(245, 251, 245, 0.96)
    );
}

.dash-v3-community {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.dash-v3-community__avatar {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1b5e20, var(--osp-green));
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
}

.dash-v3-community__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dash-v3-community__name {
    color: var(--dash-text);
    font-size: 1.15rem;
    font-weight: 800;
    word-break: break-word;
}

.dash-v3-community__address,
.dash-v3-muted,
.dash-v3-scope__hint,
.dash-v3-stat-card__meta,
.dash-v3-list__body span,
.dash-v3-health-item__meta {
    color: var(--dash-muted);
}

.dash-v3-scope__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 0.9rem 0 0.85rem;
}

.dash-v3-scope__item {
    padding: 0.9rem 0.95rem;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f6fbf6 100%);
    border: 1px solid rgba(46, 125, 50, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dash-v3-scope__item span,
.dash-v3-stat-card__label,
.dash-v3-list__date {
    color: var(--dash-muted);
    font-size: 0.85rem;
}

.dash-v3-scope__item strong,
.dash-v3-panel__title,
.dash-v3-list__body strong {
    color: var(--dash-text);
}

.dash-v3-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
    min-width: 0;
}

.dash-v3-stat-card {
    position: relative;
    overflow: hidden;
    padding: 1.15rem;
    border-radius: 22px;
    display: flex;
    gap: 0.95rem;
    min-height: 132px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.98),
        rgba(245, 251, 245, 0.96)
    );
}

.dash-v3-stat-card.card {
    margin-bottom: 0;
}

.dash-v3-stat-card::after {
    content: "";
    position: absolute;
    inset-inline-end: -28px;
    inset-block-start: -28px;
    width: 100px;
    height: 100px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
}

.dash-v3-stat-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.dash-v3-stat-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.dash-v3-stat-card__value {
    font-size: 1.55rem;
    line-height: 1.05;
    color: var(--dash-text);
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-v3-stat-card__trend {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.dash-v3-stat-card__trend--up {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.dash-v3-stat-card__trend--down {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.dash-v3-stat-card__trend i {
    font-size: 0.6rem;
}

.dash-v3-stat-card--blue .dash-v3-stat-card__icon {
    background: linear-gradient(135deg, #01579b, #0288d1);
}
.dash-v3-stat-card--green .dash-v3-stat-card__icon {
    background: linear-gradient(135deg, #1b5e20, var(--osp-green));
}
.dash-v3-stat-card--amber .dash-v3-stat-card__icon {
    background: linear-gradient(135deg, #ff6f00, #ffa000);
}
.dash-v3-stat-card--rose .dash-v3-stat-card__icon {
    background: linear-gradient(135deg, #c2185b, #e91e63);
}
.dash-v3-stat-card--violet .dash-v3-stat-card__icon {
    background: linear-gradient(135deg, #4527a0, #673ab7);
}
.dash-v3-stat-card--slate .dash-v3-stat-card__icon {
    background: linear-gradient(135deg, #455a64, #78909c);
}
.dash-v3-stat-card--orange .dash-v3-stat-card__icon {
    background: linear-gradient(135deg, #e65100, #ff9800);
}
.dash-v3-stat-card--indigo .dash-v3-stat-card__icon {
    background: linear-gradient(135deg, #1a237e, #3f51b5);
}

.dash-v3-panel {
    border-radius: 24px;
    height: 100%;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--osp-border);
}

.dash-v3-panel__head {
    padding: 1.2rem 1.2rem 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    position: relative;
}

.dash-v3-panel__head::after {
    content: "";
    position: absolute;
    inset-inline-start: 1.2rem;
    inset-block-end: -0.35rem;
    width: 72px;
    height: 4px;
    border-radius: 999px;
    background: var(--dash-secondary);
    opacity: 0.2;
}

.dash-v3-panel__title {
    margin: 0.2rem 0 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dash-secondary) !important;
}

.dash-v3-chart-card__stats {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.dash-v3-chart-card__stat {
    border: 1px dashed var(--osp-border);
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.dash-v3-chart-card__stat span {
    display: block;
    color: #5f7365;
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

.dash-v3-chart-card__stat strong {
    color: var(--dash-chart-accent-dark);
    font-size: 1.1rem;
}

.dash-v3-chart-card__list {
    display: grid;
    gap: 0.75rem;
}

.dash-v3-chart-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    margin: 0 -0.65rem;
    border-bottom: 1px dashed var(--osp-border);
    text-decoration: none !important;
    color: inherit;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
    border-radius: 8px;
}
.dash-v3-chart-card__row--clickable:hover {
    background: rgba(148, 163, 184, 0.06);
    transform: translateX(3px);
}
[dir="rtl"] .dash-v3-chart-card__row--clickable:hover {
    transform: translateX(-3px);
}

.dash-v3-chart-card__label {
    color: #17311d;
    font-weight: 600;
    font-size: 0.88rem;
}

.dash-v3-chart-card__meta {
    color: #5f7365;
    font-size: 0.76rem;
    margin-top: 0.15rem;
}

.dash-v3-chart-card__value {
    color: var(--dash-chart-accent-dark);
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
}

.dash-v3-chart-card__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(
        135deg,
        rgba(148, 163, 184, 0.08),
        rgba(148, 163, 184, 0.04)
    );
    border: 1px solid var(--osp-border);
}

.dash-v3-chart-card__summary span {
    display: block;
    color: var(--dash-primary);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.dash-v3-chart-card__summary strong {
    color: var(--dash-chart-accent-dark);
    font-size: 1rem;
    display: block;
    margin-top: 0.2rem;
}

.dash-v3-chart-card__summary i {
    color: var(--dash-accent) !important;
}

.dash-v3-panel__body {
    padding: 1.2rem;
    min-width: 0;
}

.dash-v3-chart {
    min-height: 320px;
}

.dash-v3-chart--sm {
    min-height: 260px;
}

.dash-v3-legend {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.dash-v3-legend__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    width: 100%;
}

.dash-v3-legend__swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.dash-v3-legend__value {
    margin-inline-start: auto;
    color: var(--dash-muted);
    font-weight: 700;
}

.dash-v3-health-list {
    display: grid;
    gap: 1rem;
}

.dash-v3-health-item {
    padding: 1rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.dash-v3-health-item.border-dashed {
    border-style: dashed !important;
}

.dash-v3-health-item__top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.35rem;
    color: var(--dash-text);
    font-weight: 700;
}

.dash-v3-health-item__bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.dash-v3-health-item__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.dash-v3-actions {
    display: grid;
    gap: 0.75rem;
}

.dash-v3-action {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(46, 125, 50, 0.12);
    background: linear-gradient(180deg, #ffffff 0%, #f6fbf6 100%);
    color: var(--dash-text);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    min-width: 0;
}

.dash-v3-action.list-group-item {
    border-width: 1px !important;
    border-style: solid !important;
    border-color: rgba(46, 125, 50, 0.12) !important;
}

.dash-v3-action:hover {
    transform: translateY(-2px);
    border-color: rgba(46, 125, 50, 0.32);
    box-shadow: 0 12px 28px rgba(46, 125, 50, 0.12);
    color: var(--dash-text);
}

.dash-v3-action__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #fcfcfc;
    color: #475569;
    font-size: 1.15rem;
}

.dash-v3-action__label {
    flex: 1 1 auto;
    font-weight: 700;
    min-width: 0;
}

.dash-v3-list {
    display: grid;
}

.dash-v3-list__item {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    padding: 1.1rem 1.2rem;
    border-top: 1px solid rgba(46, 125, 50, 0.1);
    min-width: 0;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.2s ease;
}

.dash-v3-list__item--clickable:hover {
    background: rgba(46, 125, 50, 0.03) !important;
}

.dash-v3-list__item.list-group-item {
    background: transparent;
}

.dash-v3-list__icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.15rem;
}

.dash-v3-list__icon--primary {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    color: var(--osp-green);
}

.dash-v3-list__icon--secondary {
    background: linear-gradient(135deg, #edf7ed, #e8f5e9);
    color: #33691e;
}

.dash-v3-list__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.dash-v3-list__body strong,
.dash-v3-list__body span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-v3-list__badge {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: #fcfcfc;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Premium Status Badges */
.dash-v3-badge-premium {
    padding: 0.45rem 0.85rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
/* Premium Status Badges - Comprehensive System */
.dash-v3-badge-premium {
    padding: 0.45rem 0.85rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* 1. Neutral / Blue (Initial/Incoming) */
.dash-v3-badge-premium--new,
.dash-v3-badge-premium--open {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* 2. Amber / Orange (Action Required / Intermediate) */
.dash-v3-badge-premium--pending,
.dash-v3-badge-premium--suspended,
.dash-v3-badge-premium--re_open,
.dash-v3-badge-premium--reopen {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

/* 3. Green / Success (Positive / Ongoing) */
.dash-v3-badge-premium--active,
.dash-v3-badge-premium--in_progress,
.dash-v3-badge-premium--processing,
.dash-v3-badge-premium--resolved,
.dash-v3-badge-premium--completed {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

/* 4. Slate / Gray (Terminal / Archived) */
.dash-v3-badge-premium--closed,
.dash-v3-badge-premium--fixed {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #e2e8f0;
}

/* 5. Rose / Red (Negative / Stopped) */
.dash-v3-badge-premium--cancelled,
.dash-v3-badge-premium--rejected,
.dash-v3-badge-premium--expired {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Status dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot--active {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}
.status-dot--inactive {
    background: #94a3b8;
}

.dash-v3-empty {
    padding: 2.5rem 1.2rem;
    text-align: center;
    color: var(--dash-muted);
    background: #f8fafc;
    border: 1px dashed var(--osp-border);
    border-radius: 18px;
    margin-top: 25px;
}

[dir="rtl"] .dash-v3-role-pill,
[dir="rtl"] .dash-v3-badge,
[dir="rtl"] .dash-v3-community,
[dir="rtl"] .dash-v3-scope__item,
[dir="rtl"] .dash-v3-stat-card,
[dir="rtl"] .dash-v3-panel__head,
[dir="rtl"] .dash-v3-health-item__top,
[dir="rtl"] .dash-v3-action,
[dir="rtl"] .dash-v3-list__item,
[dir="rtl"] .dash-v3-legend__item {
    direction: rtl;
}

[dir="rtl"] .dash-v3-community {
    text-align: right;
}

[dir="rtl"] .dash-v3-panel__head,
[dir="rtl"] .dash-v3-health-item__top {
    text-align: right;
}

[dir="rtl"] .dash-v3-action {
    flex-direction: row-reverse;
}

[dir="rtl"] .dash-v3-list__item {
    flex-direction: row-reverse;
}

[dir="rtl"] .dash-v3-list__body {
    text-align: right;
}

[dir="rtl"] .dash-v3-list__badge,
[dir="rtl"] .dash-v3-list__date {
    text-align: center;
}

@media (max-width: 1399.98px) {
    .dash-v3-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dash-v3-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .dash-v3-hero {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .dash-v3-panel__head {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .dash-v3-card-grid {
        grid-template-columns: 1fr;
    }

    [dir="rtl"] .dash-v3-panel__head {
        align-items: flex-end;
    }
}

@media (max-width: 767.98px) {
    .page-breadcrumb {
        gap: 0.75rem;
    }

    .dash-v3-role-pill {
        min-width: 0;
        width: 100%;
    }

    .dash-v3-hero {
        padding: 1.15rem;
        border-radius: 22px;
    }

    .dash-v3-alert {
        border-radius: 16px;
    }

    .dash-v3-hero__title {
        font-size: clamp(1.7rem, 7vw, 2.4rem);
    }

    .dash-v3-hero__meta {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dash-v3-badge {
        width: 100%;
        justify-content: flex-start;
    }

    .dash-v3-identity,
    .dash-v3-panel,
    .dash-v3-stat-card {
        border-radius: 20px;
    }

    .dash-v3-community {
        align-items: flex-start;
    }

    .dash-v3-community__avatar {
        width: 60px;
        height: 60px;
        border-radius: 18px;
    }

    .dash-v3-scope__grid,
    .dash-v3-stats-grid,
    .dash-v3-card-grid {
        grid-template-columns: 1fr;
    }

    .dash-v3-panel__head,
    .dash-v3-panel__body {
        padding-inline: 1rem;
    }

    .dash-v3-chart {
        min-height: 260px;
    }

    .dash-v3-chart--sm {
        min-height: 220px;
    }

    .dash-v3-health-item,
    .dash-v3-action {
        padding: 0.9rem;
    }

    .dash-v3-list__item {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 0.9rem 1rem;
    }

    .dash-v3-list__date,
    .dash-v3-list__badge {
        margin-inline-start: 61px;
        white-space: normal;
        max-width: calc(100% - 61px);
        overflow-wrap: anywhere;
    }

    [dir="rtl"] .dash-v3-badge {
        justify-content: flex-end;
    }

    [dir="rtl"] .dash-v3-list__date,
    [dir="rtl"] .dash-v3-list__badge {
        margin-inline-start: 0;
        margin-inline-end: 61px;
    }
}

@media (max-width: 575.98px) {
    .dash-v3-shell {
        gap: 1rem;
    }

    .dash-v3-role-pill {
        padding: 0.7rem 0.85rem;
    }

    .dash-v3-hero__text {
        font-size: 0.96rem;
    }

    .dash-v3-community {
        gap: 0.75rem;
    }

    .dash-v3-community__name {
        font-size: 1rem;
    }

    .dash-v3-stat-card {
        min-height: 118px;
        padding: 1rem;
    }

    .dash-v3-stat-card__icon {
        width: 46px;
        height: 46px;
        border-radius: 15px;
        font-size: 1.15rem;
    }

    .dash-v3-stat-card__value {
        font-size: 1.35rem;
    }

    .dash-v3-panel__title {
        font-size: 1rem;
    }

    .dash-v3-action {
        gap: 0.75rem;
    }

    .dash-v3-action__icon,
    .dash-v3-list__icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
        font-size: 1rem;
    }

    .dash-v3-list__date,
    .dash-v3-list__badge {
        margin-inline-start: 55px;
        max-width: calc(100% - 55px);
    }

    [dir="rtl"] .dash-v3-list__date,
    [dir="rtl"] .dash-v3-list__badge {
        margin-inline-start: 0;
        margin-inline-end: 55px;
    }
}

/* =============================================================================
   NEW: Trendy Extensions & Ticket Dashboard
   ============================================================================= */

.dash-v3-stat-card__trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-top: 6px;
    line-height: 1;
}

.dash-v3-stat-card__trend--up {
    background: rgba(34, 197, 94, 0.14);
    color: #16a34a;
}

.dash-v3-stat-card__trend--down {
    background: rgba(220, 38, 38, 0.14);
    color: #dc2626;
}

.dash-v3-stat-card__trend i {
    font-size: 0.7rem;
}

.dash-v3-panel--tickets {
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    border-color: rgba(2, 119, 189, 0.12);
}

.dash-v3-chart--radial {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-integrated-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 767.98px) {
    .dash-integrated-grid {
        grid-template-columns: 1fr;
    }
}

.bg-light-transparent {
    background: rgba(148, 163, 184, 0.08) !important;
}

/* Password/Secret Toggles */
.ps-password-group {
    position: relative;
}
.ps-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    z-index: 10;
    transition: all 0.2s ease;
    border-radius: 4px;
}
.ps-password-toggle:hover {
    color: #475569;
    background: #fcfcfc;
}
.ps-password-toggle i {
    font-size: 1.1rem;
}
.ps-form-control[type="password"],
.ps-form-control[type="text"] {
    padding-right: 42px;
}
.form-control[type="password"],
.form-control[type="text"] {
    padding-right: 42px;
}

/* Global fix for Select2 overlapping Bootstrap dropdowns (like Notifications) */
.select2-container:not(.select2-container--open) {
    z-index: 1 !important;
}

/* Ensure the open container stays above its siblings but below navbars */
.select2-container.select2-container--open {
    z-index: 1020 !important;
}
/* =============================================================================
   OSP — Premium User Dropdown
   Aesthetics: Rich Glassmorphism, Smooth Gradients, Premium Micro-animations
============================================================================= */

:root {
    --ud-bg: rgba(255, 255, 255, 0.94);
    --ud-border: rgba(226, 232, 240, 0.8);
    --ud-shadow:
        0 20px 48px -12px rgba(0, 0, 0, 0.12),
        0 10px 15px -5px rgba(0, 0, 0, 0.04);
    --ud-accent: #10b981; /* Premium Emerald */
    --ud-danger: #ef4444;
    --ud-text-main: #0f172a;
    --ud-text-muted: #64748b;
    --ud-radius: 18px;
    --ud-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --ud-bg: rgba(15, 23, 42, 0.94);
    --ud-border: rgba(51, 65, 85, 0.8);
    --ud-text-main: #f8fafc;
    --ud-text-muted: #94a3b8;
}

/* Header Trigger Area */
.profile-dropdown .dropdown-toggle {
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 12px;
    background: transparent;
    transition: var(--ud-transition);
    border: 1px solid transparent;
}

.profile-dropdown .dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .profile-dropdown .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.header-avatar-wrap {
    width: 38px;
    height: 38px;
    position: relative;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.header-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    display: block;
}

[data-theme="dark"] .header-avatar-wrap img {
    border-color: #1e293b;
}

.header-user-meta .user-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ud-text-main);
    line-height: 1.2;
}

.header-user-meta .user-role {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ud-text-muted);
}

/* Premium Dropdown Menu */
.premium-user-dropdown {
    width: 290px;
    padding: 0;
    background: var(--ud-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ud-border) !important;
    border-radius: var(--ud-radius) !important;
    box-shadow: var(--ud-shadow) !important;
    overflow: hidden;
    margin-top: 10px !important;
}

/* Dropdown Header */
.dropdown-header-premium {
    padding: 20px;
    background: linear-gradient(
        135deg,
        rgba(16, 185, 129, 0.08) 0%,
        transparent 100%
    );
    border-bottom: 1px solid var(--ud-border);
}

.avatar-premium-meta {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.avatar-premium-meta img {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
}

[data-theme="dark"] .avatar-premium-meta img {
    border-color: #334155;
}

.status-indicator {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 3px solid var(--ud-bg);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dropdown Body */
.dropdown-body-premium {
    padding: 12px 8px;
}

.menu-section-title {
    padding: 8px 14px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ud-text-muted);
    opacity: 0.7;
}

.dropdown-item-premium {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin: 2px 4px;
    border-radius: 12px;
    color: var(--ud-text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--ud-transition);
}

.dropdown-item-premium:hover {
    background: rgba(16, 185, 129, 0.08);
    color: var(--ud-accent);
}

.dropdown-item-premium .icon-wrap {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-inline-end: 12px;
    font-size: 1.15rem;
    transition: var(--ud-transition);
    flex-shrink: 0;
}

.bg-primary-soft {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}
.bg-warning-soft {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.bg-info-soft {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
}

.dropdown-item-premium:hover .icon-wrap {
    transform: scale(1.1);
}

/* Dropdown Footer */
.dropdown-footer-premium {
    padding: 14px 16px;
    background: rgba(241, 245, 249, 0.4);
    border-top: 1px solid var(--ud-border);
}

[data-theme="dark"] .dropdown-footer-premium {
    background: rgba(30, 41, 59, 0.4);
}

.logout-btn-premium {
    width: 100%;
    padding: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    color: var(--ud-danger);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ud-transition);
}

.logout-btn-premium:hover {
    background: var(--ud-danger);
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
    border-color: var(--ud-danger);
}

.logout-btn-premium i {
    font-size: 1.1rem;
}

/* Anim - simple fadeInUp */
@keyframes udFadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-user-dropdown.show {
    animation: udFadeInUp 0.3s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* RTL Adjustments */
[dir="rtl"] .dropdown-header-premium {
    background: linear-gradient(
        -135deg,
        rgba(16, 185, 129, 0.08) 0%,
        transparent 100%
    );
}
