:root {
    /* Otika light admin + Vidfy accents */
    --fa-blue: #6777EF;
    --fa-blue-dark: #5163e0;
    --fa-red: #fc544b;
    --fa-green: #2ed8b6;
    --fa-orange: #ffa426;
    --fa-bg: #f3f5fa;
    --fa-panel: #ffffff;
    --fa-ink: #1e2438;
    --fa-muted: #7b8794;
    --fa-border: #e6e9f4;
    --fa-shadow: 0 8px 28px rgba(30, 36, 56, 0.06);
    --fa-shadow-lg: 0 18px 48px rgba(30, 36, 56, 0.1);
    --fa-lavender: rgba(103, 119, 239, 0.08);
    --fa-radius: 14px;
    --fa-radius-sm: 10px;
    --fa-ease: cubic-bezier(0.22, 1, 0.36, 1);

    --vidfy-mint: #2ed8b6;
    --vidfy-cyan: #3abaf4;
    --vidfy-violet: #6777EF;
    --vidfy-gradient: linear-gradient(135deg, #2ed8b6 0%, #6777EF 55%, #5b6ef5 100%);
    --vidfy-mesh:
        radial-gradient(1200px 600px at 8% -10%, rgba(46, 216, 182, 0.18), transparent 55%),
        radial-gradient(900px 500px at 92% 0%, rgba(103, 119, 239, 0.16), transparent 50%),
        radial-gradient(700px 420px at 70% 100%, rgba(58, 186, 244, 0.1), transparent 55%),
        linear-gradient(180deg, #f7f8fc 0%, #f1f3f9 100%);

    --sidebar-width: 268px;
    --vidfy-select-chevron: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c7a89' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");

    --el-ink: var(--fa-ink);
    --el-muted: var(--fa-muted);
    --el-border: var(--fa-border);
    --el-soft: #f8f9fc;
    --el-radius: var(--fa-radius-sm);
    --el-shadow: var(--fa-shadow);

    --bs-primary: #6777EF;
    --bs-primary-rgb: 103, 119, 239;
    --bs-body-font-family: "Plus Jakarta Sans", "Nunito", system-ui, sans-serif;
    --bs-body-color: #1e2438;
    --bs-border-radius: 10px;
    --bs-link-color: #6777EF;
    --bs-link-hover-color: #5163e0;
    --font-display: "Sora", "Plus Jakarta Sans", system-ui, sans-serif;
    --font-body: "Plus Jakarta Sans", "Nunito", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    min-height: 100vh;
    color: var(--fa-ink);
    background: var(--vidfy-mesh);
    background-attachment: fixed;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, .brand-title, .stat-value, .kpi-value, .dash-title, .el-page-title, .glass-heading {
    font-family: var(--font-display);
    letter-spacing: -0.03em;
    font-weight: 700;
    color: var(--fa-ink);
}

.text-gradient {
    background: var(--vidfy-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.text-muted,
.text-muted-glass { color: var(--fa-muted) !important; }

/* ——— Shell / sidebar ——— */
.app-shell {
    min-height: 100vh;
    display: block;
    overflow-x: clip;
    width: 100%;
}
.app-sidebar { display: none; }
.app-main {
    width: 100%;
    min-height: 100vh;
    min-width: 0;
    max-width: 100%;
    background: transparent;
    overflow-x: clip;
}

@media (min-width: 992px) {
    .app-shell {
        display: grid;
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    }
    .app-sidebar {
        display: flex;
        flex-direction: column;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
        max-width: var(--sidebar-width);
        height: 100vh;
        position: sticky;
        top: 0;
        overflow-y: auto;
        overflow-x: hidden;
        background:
            linear-gradient(180deg, rgba(255,255,255,0.97) 0%, #fff 40%),
            radial-gradient(420px 220px at 0% 0%, rgba(46, 216, 182, 0.12), transparent 70%);
        border-right: 1px solid rgba(230, 233, 244, 0.9);
        z-index: 30;
        box-shadow: 8px 0 32px rgba(30, 36, 56, 0.04);
        backdrop-filter: blur(10px);
    }
    .app-sidebar .sidebar-inner { width: 100%; min-height: 100%; }
    .app-main { width: auto; min-width: 0; max-width: 100%; }
}

.app-offcanvas {
    background: #fff;
    color: var(--fa-ink);
    width: min(var(--sidebar-width), 100vw) !important;
    max-width: min(var(--sidebar-width), 100vw) !important;
    border-right: 1px solid var(--fa-border);
}
.app-offcanvas .offcanvas-body { overflow-x: hidden; }
.app-offcanvas .btn-close { filter: none; }

.sidebar-inner {
    width: 100%;
    box-sizing: border-box;
    padding: 0 !important;
}

.sidebar-brand {
    background: transparent;
    margin: 0;
    padding: 1.35rem 1rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 0;
    border-bottom: 1px solid rgba(230, 233, 244, 0.85);
}
.sidebar-brand .brand-lockup {
    justify-content: center;
    width: 100%;
}
.sidebar-brand .brand-mark-jazz {
    width: auto;
    max-width: 156px;
    max-height: 72px;
}
.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.brand-mark {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
}
.sidebar-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6777EF, #a55eea);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    flex: 0 0 auto;
    box-shadow: 0 4px 12px rgba(103, 119, 239, 0.35);
}

.brand-wordmark {
    color: #34395e !important;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
    line-height: 1;
    text-transform: lowercase;
}
.brand-wordmark-dark {
    color: #34395e !important;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.04em;
    line-height: 1;
    white-space: nowrap;
}

.app-offcanvas .offcanvas-header {
    background: #fff;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--fa-border);
    justify-content: center;
    position: relative;
}
.app-offcanvas .offcanvas-header .brand-lockup {
    justify-content: center;
    width: 100%;
}
.app-offcanvas .offcanvas-header .brand-mark-jazz {
    max-width: 156px;
    max-height: 72px;
}
.app-offcanvas .offcanvas-header .btn-close {
    filter: none;
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}
.app-offcanvas .offcanvas-header .brand-wordmark {
    color: #34395e !important;
}

.sidebar-profile {
    display: none;
}

.sidebar-nav-wrap {
    padding: 0.35rem 0.65rem 0.75rem;
}

.brand {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}
.brand-logo {
    width: auto;
    max-width: 150px;
    max-height: 36px;
    height: auto;
    object-fit: contain;
    display: block;
}
.brand-sub, .nav-section-label {
    color: #adb5bb;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}
.nav-section-label { margin: 0.85rem 0.85rem 0.35rem; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-radius: 10px;
    color: #5f6b7a !important;
    padding: 0.58rem 0.85rem;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 0;
    transition: background 0.2s var(--fa-ease), color 0.2s var(--fa-ease), transform 0.2s var(--fa-ease), box-shadow 0.2s var(--fa-ease);
}
.sidebar-link-label {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-count-badge {
    flex: 0 0 auto;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--fa-orange, #ffa426);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1.15rem;
    text-align: center;
    margin-left: auto;
}
.sidebar-link i {
    color: #8a94a3;
    flex: 0 0 1.1rem;
    width: 1.1rem;
    text-align: center;
    transition: color 0.2s var(--fa-ease);
}
.sidebar-link:hover {
    background: var(--fa-lavender);
    color: var(--fa-blue) !important;
    transform: translateX(2px);
}
.sidebar-link:hover i { color: var(--fa-blue); }
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(103, 119, 239, 0.14), rgba(46, 216, 182, 0.08));
    color: var(--fa-blue) !important;
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--fa-blue);
}
.sidebar-link.active i { color: var(--fa-blue); }

.sidebar-link.sidebar-sublink {
    padding-left: 2.35rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.sidebar-link.sidebar-sublink i {
    font-size: 0.95rem;
}

.feature-group {
    padding: 0.15rem 0 0.35rem;
}
.feature-group-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
}
.feature-group-toggle {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #8a94a3;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.feature-group-toggle:hover {
    background: var(--fa-lavender, #eef0ff);
    color: var(--fa-blue, #6777EF);
}
.feature-group-toggle i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}
.feature-group.is-open .feature-group-toggle i {
    transform: rotate(180deg);
}
.feature-group-children {
    display: none;
    padding: 0.2rem 0 0 1.65rem;
}
.feature-group.is-open .feature-group-children {
    display: block;
}

/* ——— Topbar ——— */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.78);
    border-bottom: 1px solid rgba(230, 233, 244, 0.85);
    box-shadow: 0 8px 24px rgba(30, 36, 56, 0.04);
    min-height: 66px;
    backdrop-filter: blur(14px) saturate(1.2);
}
.topbar-credits {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.topbar-credits::-webkit-scrollbar {
    display: none;
}
.topbar-credits-link {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
.topbar-credits-link:hover .topbar-credit {
    border-color: color-mix(in srgb, var(--fa-blue) 35%, #e6e9f4);
}
.topbar-credit {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    min-width: 0;
    max-width: 10.5rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e6e9f4;
    color: #4b5563;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
}
.topbar-credit i {
    flex-shrink: 0;
    font-size: .82rem;
    color: var(--fa-blue);
}
.topbar-credit-label {
    overflow: hidden;
    text-overflow: ellipsis;
    color: #6c757d;
    font-weight: 500;
}
.topbar-credit-count {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.topbar-credit.is-low {
    background: #fff8e8;
    border-color: #f3deab;
    color: #8a5b12;
}
.topbar-credit.is-low i {
    color: #c4881a;
}
.topbar-credit.is-empty {
    background: #fff1f2;
    border-color: #f4c7cb;
    color: #b42332;
}
.topbar-credit.is-empty i {
    color: #d64550;
}
.hamburger-btn,
.topbar-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}
.hamburger-btn:hover,
.topbar-icon-btn:hover {
    color: var(--fa-blue);
    background: var(--fa-lavender);
}
.topbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #3abaf4;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    line-height: 1;
    padding: 0 4px;
}
.topbar-badge.is-warn { background: var(--fa-notification, var(--fa-green)); }
.notif-menu {
    width: min(360px, 92vw);
    max-height: 70vh;
    overflow: hidden;
}
.notif-menu-head {
    border-bottom: 1px solid #eef1f5;
    background: #fff;
}
.notif-menu-list {
    max-height: 55vh;
    overflow: auto;
}
.notif-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
}
.notif-item:hover { background: #f8f9fb; }
.notif-item.is-unread { background: rgba(var(--fa-notification-rgb, 46, 216, 182), 0.12); }
.notif-item-title { font-weight: 700; font-size: 0.88rem; color: #1e2635; }
.notif-item-body { font-size: 0.78rem; color: #6c757d; margin-top: 0.15rem; }
.notif-item-time { font-size: 0.7rem; color: #9aa0a6; margin-top: 0.25rem; }
.studio-process {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}
.lipsync-process-busy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6777EF;
    font-size: 0.8125rem;
    font-weight: 600;
}
.package-usage {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #98a6ad;
    line-height: 1.35;
}
.package-usage--studio {
    font-size: 0.875rem;
    color: #505458;
}
.package-usage--studio .package-usage-note {
    color: #6c757d;
}
.package-usage-icon {
    font-size: 0.75rem;
    opacity: 0.85;
}
.package-usage--studio .package-usage-icon {
    color: #98a6ad;
}
.package-usage-note {
    color: #a8b0bc;
}
.package-usage.is-low {
    color: #b7791f;
}
.package-usage.is-low .package-usage-note {
    color: #c69749;
}
.package-usage.is-empty {
    color: #d64550;
}
.package-usage.is-empty .package-usage-note {
    color: #e0787f;
}
.studio-limit {
    font-size: 0.875rem;
    font-weight: 400;
    color: #505458;
    line-height: 1.35;
}
.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--fa-blue), #2ed8b6);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 16px rgba(103, 119, 239, 0.28);
}
.topbar-logo {
    height: 34px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

.live-badge {
    font-weight: 600;
    background: rgba(99, 237, 122, 0.15) !important;
    color: #28a745 !important;
    border: 1px solid rgba(99, 237, 122, 0.35) !important;
}
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fa-green);
    margin-right: 6px;
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 237, 122, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(99, 237, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 237, 122, 0); }
}

.app-content {
    padding-top: 1.5rem;
    width: 100%;
    max-width: none;
    /* Opacity-only: transform creates a containing block and breaks Bootstrap modal backdrops */
    animation: pageEnter 0.35s var(--fa-ease) both;
}

@keyframes pageEnter {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ——— Buttons ——— */
.btn-primary,
.btn-dark {
    background: linear-gradient(135deg, var(--fa-blue) 0%, var(--fa-blue-dark) 100%) !important;
    border: 0 !important;
    color: #fff !important;
    border-radius: 10px;
    font-weight: 650;
    letter-spacing: -0.01em;
    box-shadow: 0 8px 20px rgba(103, 119, 239, 0.28);
    transition: transform 0.2s var(--fa-ease), box-shadow 0.2s var(--fa-ease), filter 0.2s var(--fa-ease);
}
.btn-primary:hover,
.btn-dark:hover {
    background: linear-gradient(135deg, var(--fa-blue-dark) 0%, #4556d6 100%) !important;
    color: #fff !important;
    filter: none;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(103, 119, 239, 0.34);
}
.btn-primary:active,
.btn-dark:active {
    transform: translateY(0);
}

.btn-glass,
.btn-outline-secondary,
.btn-light {
    border-radius: 10px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(230, 233, 244, 0.95) !important;
    color: #5f6b7a !important;
    box-shadow: 0 2px 8px rgba(30, 36, 56, 0.03);
    transition: border-color 0.2s var(--fa-ease), color 0.2s var(--fa-ease), background 0.2s var(--fa-ease), transform 0.2s var(--fa-ease);
}
.btn-glass:hover,
.btn-outline-secondary:hover,
.btn-light:hover {
    border-color: rgba(103, 119, 239, 0.45) !important;
    color: var(--fa-blue) !important;
    background: rgba(103, 119, 239, 0.06) !important;
    transform: translateY(-1px);
}

.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    flex-wrap: nowrap;
    vertical-align: middle;
    line-height: 1;
    white-space: nowrap;
}
.table-actions form {
    display: inline-flex !important;
    align-items: center;
    margin: 0;
    line-height: 1;
}
.table-actions .btn {
    margin: 0 !important;
    vertical-align: middle;
}

/* ——— Cards / panels ——— */
.glass-card,
.card-soft,
.card {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(230, 233, 244, 0.95) !important;
    border-radius: var(--fa-radius) !important;
    box-shadow: var(--fa-shadow);
    color: var(--fa-ink);
    backdrop-filter: blur(8px);
    transition: box-shadow 0.25s var(--fa-ease), border-color 0.25s var(--fa-ease);
}
.glass-card:hover,
.card-soft:hover {
    box-shadow: var(--fa-shadow-lg);
    border-color: rgba(103, 119, 239, 0.16) !important;
}

.glass-card form > .btn:last-child,
.glass-card .form-actions {
    margin-top: 1.25rem;
}

.glass-heading {
    font-size: 1.08rem;
    color: var(--fa-ink);
    font-weight: 700;
}

.glass-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 650;
    background: linear-gradient(135deg, rgba(103, 119, 239, 0.12), rgba(46, 216, 182, 0.1));
    color: var(--fa-blue);
    border: 1px solid rgba(103, 119, 239, 0.12);
}

/* ——— Dashboard Otika KPIs ——— */
.dash-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}
.dash-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fa-blue);
    font-weight: 750;
    margin-bottom: 0.35rem;
    font-family: var(--font-display);
}
.dash-title {
    font-size: clamp(1.6rem, 2.6vw, 2rem);
    color: var(--fa-ink);
}

.kpi-card {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 1.3rem 1.25rem;
    position: relative;
    overflow: hidden;
    color: var(--fa-ink) !important;
    background: rgba(255,255,255,0.94) !important;
    border: 1px solid rgba(230, 233, 244, 0.95) !important;
    box-shadow: var(--fa-shadow) !important;
}
.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--fa-blue), var(--fa-chart-success, var(--fa-green)));
    opacity: 0.85;
}
.kpi-card::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(103, 119, 239, 0.08), transparent 70%);
    pointer-events: none;
}
.kpi-card .kpi-label {
    color: var(--fa-muted) !important;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.kpi-card .kpi-meta { color: var(--fa-muted) !important; font-size: 0.78rem; }
.kpi-card .kpi-unit { color: inherit !important; font-size: 0.85em; }
.kpi-card .kpi-value {
    color: var(--fa-ink) !important;
    font-size: 1.75rem;
    line-height: 1.15;
    font-weight: 800;
}
.kpi-card .kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 0.35rem;
}
.kpi-card .kpi-delta.is-up { color: var(--fa-chart-success, var(--fa-green)); }
.kpi-card .kpi-delta.is-down { color: var(--fa-chart-danger, var(--fa-red, var(--fa-orange))); }
.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    flex: 0 0 auto;
    margin-left: auto;
    order: 2;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}
.kpi-body { flex: 1; min-width: 0; order: 1; }
.kpi-mint .kpi-icon { background: rgba(252, 84, 75, 0.12); color: #fc544b; }
.kpi-cyan .kpi-icon { background: rgba(103, 119, 239, 0.12); color: #6777EF; }
.kpi-violet .kpi-icon { background: rgba(58, 186, 244, 0.12); color: #3abaf4; }
.kpi-rate .kpi-icon { background: rgba(var(--fa-chart-success-rgb, 46, 216, 182), 0.18); color: var(--fa-chart-success, var(--fa-green)); }
.kpi-mint, .kpi-cyan, .kpi-violet, .kpi-rate {
    background: #fff !important;
}
.kpi-label { font-size: 0.85rem; font-weight: 600; }
.kpi-value { font-size: 1.75rem; line-height: 1.1; }
.kpi-unit { font-size: 1rem; margin-left: 2px; }
.kpi-meta { font-size: 0.78rem; margin-top: 0.15rem; }
.text-success-soft { color: var(--fa-chart-success, var(--fa-green)) !important; }

.chart-wrap { position: relative; width: 100%; }
.chart-wrap-lg { height: 280px; }
.chart-wrap-md { height: 260px; }
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    font-size: 0.8rem;
    color: var(--fa-muted);
}
.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
}
.legend-mint { background: var(--fa-chart-primary, var(--fa-blue)); }
.legend-violet { background: var(--fa-chart-success, var(--fa-green)); }
.legend-rose { background: var(--fa-chart-danger, var(--fa-red)); }
.legend-muted { background: var(--fa-chart-muted, var(--fa-muted)); }

.donut-wrap {
    position: relative;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.donut-wrap canvas { max-height: 220px; }
.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.donut-big { font-size: 2rem; font-weight: 800; color: var(--fa-ink); line-height: 1; }
.donut-sub { font-size: 0.78rem; color: var(--fa-muted); }
.donut-keys {
    display: grid;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--fa-muted);
}
.donut-keys strong { color: var(--fa-ink); float: right; }
.donut-keys .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
}
.donut-keys .mint { background: var(--fa-chart-success, var(--fa-green)); }
.donut-keys .primary { background: var(--fa-chart-primary, var(--fa-blue)); }
.donut-keys .rose { background: var(--fa-chart-danger, var(--fa-red)); }
.donut-keys .violet { background: var(--fa-chart-muted, var(--fa-muted)); }

.quick-stack { display: grid; gap: 0.5rem; }
.quick-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    text-decoration: none;
    color: #445065;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(230, 233, 244, 0.95);
    font-weight: 600;
    font-size: 0.92rem;
    box-shadow: 0 2px 8px rgba(30, 36, 56, 0.03);
}
.quick-link i { color: var(--fa-blue); }
.quick-link:hover {
    border-color: rgba(103, 119, 239, 0.28);
    background: rgba(103, 119, 239, 0.06);
    color: var(--fa-blue);
}

.alert-glass {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 500;
    margin-bottom: 0.55rem;
    border: 1px solid transparent;
}
.alert-ok { background: rgba(46,216,182,.12); color: #1aa383; border-color: rgba(46,216,182,.2); }
.alert-info { background: rgba(103,119,239,.1); color: var(--fa-blue); border-color: rgba(103,119,239,.2); }
.alert-warn { background: rgba(255,182,77,.15); color: #c98720; border-color: rgba(255,182,77,.25); }
.alert-err { background: rgba(255,83,112,.1); color: var(--fa-red); border-color: rgba(255,83,112,.2); }

.activity-list { display: grid; gap: 0.2rem; }
.activity-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.35rem;
    border-bottom: 1px solid #f0f0f0;
    min-width: 0;
}
.activity-row:last-child { border-bottom: 0; }
.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    background: var(--fa-blue);
    flex: 0 0 auto;
}
.activity-title {
    font-weight: 700;
    color: var(--fa-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-meta {
    font-size: 0.78rem;
    color: var(--fa-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-row > .min-w-0,
.activity-row > .flex-grow-1 {
    min-width: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    white-space: nowrap;
    line-height: 1.35;
    border: 1px solid transparent;
}
.status-completed,
.status-approved { background: rgba(46, 216, 182, 0.16); color: #0f8f6f; border-color: rgba(46, 216, 182, 0.35); }
.status-pending,
.status-processing { background: rgba(255, 182, 77, 0.18); color: #b8740f; border-color: rgba(255, 182, 77, 0.4); }
.status-ready { background: rgba(103, 119, 239, 0.14); color: #4553c7; border-color: rgba(103, 119, 239, 0.35); }
.status-progress { background: rgba(58, 186, 244, 0.16); color: #0b7eaf; border-color: rgba(58, 186, 244, 0.4); }
.status-draft { background: rgba(152, 166, 173, 0.18); color: #5b6b73; border-color: rgba(152, 166, 173, 0.35); }
.status-blocked { background: rgba(108, 117, 125, 0.14); color: #495057; border-color: rgba(108, 117, 125, 0.3); }
.status-rejected,
.status-failed { background: rgba(252, 84, 75, 0.14); color: #c62828; border-color: rgba(252, 84, 75, 0.35); }
.status-cancelled { background: rgba(152, 166, 173, 0.2); color: #6c757d; border-color: rgba(152, 166, 173, 0.35); }
.status-default { background: rgba(52, 57, 94, 0.08); color: #34395e; border-color: rgba(52, 57, 94, 0.12); }

/* ——— Forms / tables ——— */
.form-control,
.form-select {
    border-radius: 10px;
    border-color: #d9dee8;
    background-color: #fff;
    color: var(--fa-ink);
    min-height: 42px;
    transition: border-color 0.2s var(--fa-ease), box-shadow 0.2s var(--fa-ease);
}
.form-control::placeholder,
.form-select::placeholder,
textarea.form-control::placeholder,
input.form-control::placeholder {
    color: #b8beca;
    opacity: 1;
}
.form-control::-webkit-input-placeholder {
    color: #b8beca;
    opacity: 1;
}
.form-control::-moz-placeholder {
    color: #b8beca;
    opacity: 1;
}
.form-control:focus,
.form-select:focus {
    border-color: rgba(103, 119, 239, 0.55);
    box-shadow: 0 0 0 4px rgba(103, 119, 239, 0.12);
    background-color: #fff;
    color: var(--fa-ink);
}
select.form-select {
    appearance: none;
    background-image: var(--vidfy-select-chevron);
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 14px 14px;
    padding-right: 2.5rem;
}
select.form-select:focus {
    background-image: var(--vidfy-select-chevron);
}
select.form-select[multiple],
select.form-select[size]:not([size="1"]) {
    background-image: none;
    padding-right: 0.75rem;
}
button.form-select {
    background-image: none;
}

/* Custom dropdown triggers (TTS audio picker, etc.) — match form-select, not native GTK/OS buttons */
.audio-picker { position: relative; }
.audio-picker-trigger {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 42px;
    border: 1px solid #d9dee8;
    background: #fff;
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    text-align: left;
    font: inherit;
    font-weight: 600;
    color: var(--fa-ink, #374151);
    line-height: 1.4;
    cursor: pointer;
    box-shadow: none;
}
.audio-picker-trigger:hover,
.audio-picker.is-open .audio-picker-trigger {
    border-color: #c5ccd8;
}
.audio-picker-trigger:focus,
.audio-picker-trigger:focus-visible {
    outline: none;
    border-color: rgba(103, 119, 239, 0.55);
    box-shadow: 0 0 0 4px rgba(103, 119, 239, 0.12);
}
.audio-picker-label { min-width: 0; }
.audio-picker-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 80;
    background: #fff;
    border: 1px solid #d9dee8;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(30, 36, 56, 0.12);
    max-height: min(420px, 55vh);
    overflow: auto;
    padding: 0.35rem;
}
.audio-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 0.55rem 0.6rem;
    text-align: left;
    cursor: pointer;
    color: var(--fa-ink, #374151);
    font: inherit;
}
.audio-picker-item:hover,
.audio-picker-item.is-active { background: #f3f4f6; }
.audio-picker-item-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.audio-picker-play {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
    color: #6b7280 !important;
    box-shadow: none !important;
}
.audio-picker-play:hover,
.audio-picker-play.is-playing {
    border-color: #9ca3af !important;
    color: #111827 !important;
    background: #f9fafb !important;
}

.form-label { color: #445065; font-weight: 650; }
.form-text { color: var(--fa-muted) !important; }

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--fa-ink);
    --bs-table-border-color: #eef1f6;
    --bs-table-hover-bg: rgba(103, 119, 239, 0.04);
    --bs-table-hover-color: var(--fa-ink);
}
.table thead th {
    color: #7a8698;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom-width: 1px !important;
}

.badge.text-bg-light,
.badge.text-bg-secondary {
    background: #f0f2f5 !important;
    color: #505458 !important;
    border: 0;
}
.badge.text-bg-success { background: rgba(46,216,182,.18) !important; color: #1aa383 !important; }
.badge.text-bg-danger { background: rgba(255,83,112,.15) !important; color: var(--fa-red) !important; }

.alert { border-radius: 12px; border-width: 1px; }
.alert-success { background: rgba(46,216,182,.12); color: #1aa383; border-color: rgba(46,216,182,.25); }
.alert-danger { background: rgba(255,83,112,.1); color: var(--fa-red); border-color: rgba(255,83,112,.25); }
.alert-warning { background: rgba(255,182,77,.15); color: #c98720; border-color: rgba(255,182,77,.3); }
.alert-info { background: rgba(103,119,239,.1); color: var(--fa-blue); border-color: rgba(103,119,239,.25); }

.pagination .page-link {
    color: var(--fa-blue);
    background: #fff;
    border-radius: 8px !important;
    margin: 0 0.15rem;
    border: 1px solid var(--fa-border);
}
.pagination .page-item.active .page-link {
    background: var(--fa-blue);
    border-color: var(--fa-blue);
    color: #fff;
}

.modal-content {
    background: #fff;
    border: 0;
    border-radius: 16px !important;
    box-shadow: 0 24px 64px rgba(30, 36, 56, 0.18);
    color: var(--fa-ink);
}
.modal-header, .modal-footer { border-color: #eef1f6; }
.btn-close { filter: none; }

/* Keep centered modals fully inside the viewport (header + body + footer). */
.modal-dialog-centered {
    min-height: calc(100% - 1.5rem);
}
.modal-dialog-centered .modal-content {
    max-height: calc(100dvh - 1.5rem);
}
@supports not (height: 100dvh) {
    .modal-dialog-centered .modal-content {
        max-height: calc(100vh - 1.5rem);
    }
}

.el-page-title {
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    margin: 0;
    color: var(--fa-ink);
}

.el-tabs {
    display: flex;
    gap: 1.25rem;
    border-bottom: 1px solid var(--fa-border);
    margin-bottom: 1.25rem;
}
.el-tabs a {
    color: var(--fa-muted);
    text-decoration: none;
    padding: 0.75rem 0;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.el-tabs a.active {
    color: var(--fa-blue);
    border-bottom: 3px solid var(--fa-blue);
}

.el-search {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(230, 233, 244, 0.95);
    border-radius: 14px;
    padding: 0.5rem 0.9rem 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(30, 36, 56, 0.04);
    max-width: 520px;
}
.el-search i { color: #6777EF; opacity: 0.7; order: 2; }
.el-search input {
    border: 0;
    outline: none;
    box-shadow: none !important;
    flex: 1;
    background: transparent;
    color: var(--fa-ink);
    order: 1;
}
.el-search input::placeholder { color: #a6a9c4; }

.filter-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.2rem;
}
.filter-pill {
    border: 1px solid rgba(230, 233, 244, 0.95);
    background: rgba(255,255,255,0.88);
    color: #505458;
    border-radius: 999px;
    padding: 0.42rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 650;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(30, 36, 56, 0.03);
    flex: 0 0 auto;
    white-space: nowrap;
}
.filter-pill:hover { border-color: var(--fa-blue); color: var(--fa-blue); }
.filter-pill.active {
    background: var(--fa-blue);
    color: #fff;
    border-color: var(--fa-blue);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.75rem 0 0.9rem;
}
.section-head h2 { font-size: 1.15rem; margin: 0; color: var(--fa-ink); }

.voice-mini {
    background: #fff;
    border: 0;
    border-radius: 10px;
    padding: 0.9rem;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-shadow: var(--fa-shadow);
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
}
.voice-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}
.voice-mini-body {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}
.voice-mini-copy {
    flex: 1 1 auto;
    min-width: 0;
}
.voice-mini-name {
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.voice-mini-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.35;
}
.voice-mini-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    margin-top: 0.75rem;
}
.voice-mini-actions .btn,
.voice-mini-actions .play-btn {
    flex: 0 0 auto;
}
.voice-mini--row {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
}
.voice-mini--row .voice-mini-body {
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}
.voice-mini--row .voice-mini-actions {
    margin-top: 0;
}

.voice-avatar,
.footer-player-avatar,
.lang-chip {
    background: var(--fa-blue);
    color: #fff;
}

.play-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--fa-border);
    background: #fff;
    color: var(--fa-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.play-btn:hover,
.play-btn.is-playing,
.preview-play.is-playing {
    background: var(--fa-blue);
    color: #fff;
    border-color: var(--fa-blue);
}

.handpick-card { display: none; }

.avatar-tile { display: none; }

.spotlight-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid #f0f0f0;
    min-width: 0;
}
.spotlight-row:last-child { border-bottom: 0; }
.spotlight-row .spotlight-copy {
    flex: 1 1 auto;
    min-width: 0;
}
.spotlight-row .spotlight-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spotlight-row .spotlight-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spotlight-row .badge,
.spotlight-row .play-btn,
.spotlight-row .btn {
    flex: 0 0 auto;
}
@media (max-width: 767.98px) {
    .spotlight-row {
        flex-wrap: wrap;
    }
    .spotlight-row .spotlight-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 0.4rem;
        margin-top: 0.35rem;
    }
}

.lang-card {
    border-radius: 8px;
    border: 0;
    background: #fff;
    padding: 1rem;
    height: 100%;
    box-shadow: var(--fa-shadow);
}
.lang-chip {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.studio-shell {
    background: #fff;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    min-height: 70vh;
    box-shadow: var(--fa-shadow);
}
.studio-shell.lipsync-studio {
    overflow: visible;
}
.lipsync-studio .studio-main,
.lipsync-studio .studio-side,
.lipsync-studio .studio-editor,
.lipsync-studio .setting-block {
    overflow: visible;
}
.lipsync-studio .audio-picker.is-open {
    z-index: 90;
}
.studio-main {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    min-height: 70vh;
}
.studio-editor {
    padding: 1.25rem 1.35rem 5.5rem;
    border-right: 1px solid #f0f0f0;
    position: relative;
}
.studio-side {
    padding: 1.25rem;
    background: #fafbfd;
}
.studio-textarea {
    width: 100%;
    min-height: 420px;
    border: 0;
    resize: vertical;
    outline: none;
    font-size: 1.15rem;
    line-height: 1.6;
    background: transparent;
    color: var(--fa-ink);
}
.studio-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.setting-block {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 0.9rem;
    margin-bottom: 0.85rem;
    box-shadow: none;
}
.voice-picker-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}
.voice-picker-item:hover,
.voice-picker-item.active {
    background: var(--fa-lavender);
    border-color: rgba(70, 128, 255, 0.2);
}
.voice-picker-list { max-height: 280px; overflow: auto; }

@media (max-width: 991px) {
    .studio-main { grid-template-columns: 1fr; }
    .studio-editor { border-right: 0; border-bottom: 1px solid #f0f0f0; }
}

body.has-footer-player { padding-bottom: 92px; }

.footer-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: #fff;
    border-top: 3px solid var(--fa-blue);
    box-shadow: 0 -8px 24px rgba(62, 57, 107, 0.1);
    transform: translateY(110%);
    transition: transform .22s ease;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (min-width: 992px) {
    .footer-player { left: var(--sidebar-width); }
}
.footer-player.is-open { transform: translateY(0); }
.footer-player-x {
    position: absolute;
    top: 0.35rem;
    right: 0.45rem;
    z-index: 2;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}
.footer-player-x:hover {
    background: #f3f4f6;
    color: #111827;
}
.footer-player-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.75rem 2.25rem 0.75rem 1.25rem;
    width: 100%;
}
.footer-player-meta { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.footer-player-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex: 0 0 auto;
}
.footer-player-title {
    font-weight: 700;
    color: var(--fa-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.footer-player-sub {
    font-size: 0.8rem;
    color: var(--fa-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.footer-player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.footer-play-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: var(--fa-blue);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(70, 128, 255, 0.35);
}
.footer-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: min(420px, 100%);
}
.footer-seek {
    flex: 1;
    height: 22px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
    outline: none;
}
.footer-seek:focus-visible .footer-seek-thumb {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--fa-blue) 28%, transparent);
}
.footer-seek-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 999px;
    pointer-events: none;
}
.footer-seek-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: 999px;
    background: var(--fa-blue);
}
.footer-seek-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: var(--fa-blue);
    transform: translateY(-50%);
    box-shadow: 0 0 0 3px rgba(70, 128, 255, 0.16);
    pointer-events: none;
}
.footer-progress {
    flex: 1;
    height: 22px;
    margin: 0;
    appearance: none;
    background: transparent;
    cursor: pointer;
}
.footer-progress::-webkit-slider-runnable-track {
    height: 4px;
    background: #e9ecef;
    border-radius: 999px;
}
.footer-progress::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--fa-blue);
    cursor: pointer;
}
.footer-progress::-moz-range-track {
    height: 4px;
    background: #e9ecef;
    border-radius: 999px;
    border: 0;
}
.footer-progress::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    background: var(--fa-blue);
    cursor: pointer;
}
.footer-time { font-size: 0.72rem; color: var(--fa-muted); min-width: 34px; }
.footer-player-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}
.footer-player-download {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex: 0 0 auto;
}
.footer-player-download:hover {
    background: #f8fafc;
    color: var(--fa-blue, #3b82f6);
    border-color: rgba(59, 130, 246, 0.35);
}
.footer-player-download i {
    font-size: 1rem;
    line-height: 1;
}
@media (max-width: 991.98px) {
    .footer-player-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "meta actions"
            "controls controls";
        gap: 0.55rem 0.75rem;
        padding: 0.65rem 0.9rem;
    }
    .footer-player-meta { grid-area: meta; }
    .footer-player-controls { grid-area: controls; }
    .footer-player-actions { grid-area: actions; justify-content: flex-end; }
    body.has-footer-player { padding-bottom: 128px; }
}

@media (max-width: 767.98px) {
    .footer-player-inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "meta"
            "controls"
            "actions";
        gap: 0.5rem;
        padding: 0.6rem 0.85rem;
    }
    .footer-player-actions { justify-content: stretch; }
    .footer-player-actions .btn { flex: 1; }
    body.has-footer-player { padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px)); }
}

#ajax-loading,
.ajax-loading {
    display: none !important;
}

button[aria-busy="true"],
a[aria-busy="true"],
input[aria-busy="true"] {
    pointer-events: none;
}

.project-card {
    background: #fff;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--fa-shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(62, 57, 107, 0.12);
}
.project-card .fw-bold.text-dark { color: var(--fa-ink) !important; }
.project-thumb {
    height: 180px;
    background: linear-gradient(135deg, #6777EF, #2ed8b6), #111;
    background-size: cover;
    background-position: center;
}
.project-thumb-sm {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #eef1f5;
    border: 1px solid #e5e9f0;
    overflow: hidden;
    flex-shrink: 0;
}
.project-thumb-sm img,
.project-thumb-sm video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #111;
}
#createProjectModal {
    z-index: 1060;
}
#createProjectModal .modal-content {
    box-shadow: 0 24px 64px rgba(30, 36, 56, 0.28);
}

.drop-zone {
    border: 2px dashed #d0d7e2;
    border-radius: 8px;
    padding: 2.5rem 1.25rem;
    background: #fafbfd;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--fa-ink);
}

.lipsync-studio {
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.lipsync-studio .studio-main {
    min-height: 0;
    flex: 1 1 auto;
}
.lipsync-studio .studio-editor {
    padding-bottom: 1.25rem;
}
.lipsync-studio .drop-zone {
    min-height: 220px;
}
.lipsync-studio .studio-footer {
    position: static;
    flex-wrap: nowrap;
    border-top: 1px solid #f0f0f0;
    margin: 0;
}
.lipsync-studio .studio-footer .studio-process {
    min-width: 0;
}
.lipsync-studio .studio-footer .package-usage {
    min-width: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lipsync-studio .studio-footer .btn {
    flex-shrink: 0;
    white-space: nowrap;
}
.lipsync-job-actions .btn,
.lipsync-job-actions .dropdown > .btn {
    white-space: nowrap;
}
.lipsync-studio .studio-side { background: #fafbfd; color: var(--fa-ink); }
.lipsync-studio .setting-block {
    background: #fff;
    border-color: #f0f0f0;
}
.lipsync-studio .form-label,
.lipsync-studio .fw-semibold,
.lipsync-studio .form-text { color: #505458 !important; }

.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-label { color: var(--fa-muted); font-size: 0.85rem; }
.stat-card .stat-value {
    font-size: 1.85rem;
    margin-top: 0.25rem;
    color: var(--fa-ink);
}

pre.result-json {
    background: #f8fafc;
    border: 1px solid var(--fa-border);
    border-radius: 6px;
    padding: 1rem;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--fa-ink);
}

.avatar-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.avatar-pick {
    display: block;
    cursor: pointer;
    border: 2px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color .15s ease, transform .15s ease;
}
.avatar-pick:hover { border-color: #a8c1ff; transform: translateY(-2px); }
.avatar-pick:has(input:checked) {
    border-color: var(--fa-blue);
    box-shadow: 0 0 0 2px rgba(103,119,239,0.2);
}
.avatar-pick video,
.avatar-pick img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    background: #111;
}
.avatar-pick span {
    display: block;
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
    color: #505458;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Shared drag-drop + record uploader */
.vidfy-upload-zone {
    border: 1.5px dashed #d5dbe3;
    border-radius: 12px;
    background: #fafbfd;
    padding: 1.15rem 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.vidfy-upload-zone.is-drag,
.vidfy-upload.has-file .vidfy-upload-zone {
    border-color: var(--fa-blue);
    background: #eef3ff;
}
.vidfy-upload-zone.is-drag {
    box-shadow: 0 0 0 3px rgba(103,119,239,.12);
}
.vidfy-upload-label {
    font-weight: 600;
    color: #1e1e2d;
}
.vidfy-upload-meta {
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}
.vidfy-upload-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
}
.vidfy-upload [data-upload-clear][hidden] {
    display: none !important;
}
.vidfy-upload [data-upload-record].is-recording {
    color: #ff5370;
    border-color: #ff5370;
    background: #fff1f3;
}
.vidfy-upload.is-recording .vidfy-upload-zone {
    border-color: #ff5370;
    background: #fff7f8;
}
.vidfy-upload.is-recording .vidfy-upload-label {
    color: #ff5370;
}
/* Stom select (custom voice picker trigger) */
.stom-select { width: 100%; }
.stom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
    border: 1px solid #e3e8ef;
    background: #fff;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    transition: border-color .15s ease, box-shadow .15s ease;
    cursor: pointer;
}
.stom-select-trigger:hover { border-color: #c9d8ff; }
.stom-select-trigger:focus {
    outline: none;
    border-color: var(--fa-blue);
    box-shadow: 0 0 0 3px rgba(103,119,239,.15);
}
.stom-select-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--fa-blue); color: #fff;
    display: grid; place-items: center;
    font-size: 0.8rem; font-weight: 700; flex: 0 0 auto;
}
.stom-select-text { min-width: 0; flex: 1; }
.stom-select-name {
    display: block; font-weight: 600; color: #1e2635;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 0.9rem;
}
.stom-select-hint {
    display: block; font-size: 0.72rem; color: #9aa0a6;
}
.stom-select-caret { color: #9aa0a6; flex: 0 0 auto; }

/* Compact variant inside dialogue chips */
.dlg-speaker-chip .stom-select { width: auto; min-width: 150px; }
.dlg-speaker-chip .stom-select-trigger {
    border: 0; background: transparent; padding: 0.15rem 0.25rem; border-radius: 999px; gap: 0.4rem;
}
.dlg-speaker-chip .stom-select-avatar { width: 22px; height: 22px; font-size: 0.65rem; }
.dlg-speaker-chip .stom-select-hint { display: none; }
.dlg-speaker-chip .stom-select-name { font-size: 0.82rem; max-width: 140px; }

/* Voice picker modal */
.voice-picker {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    min-height: min(72vh, 640px);
}
.voice-picker-head {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1rem 0.5rem;
}
.voice-picker-back {
    width: 36px; height: 36px; padding: 0;
    display: grid; place-items: center;
}
.voice-picker-title {
    font-size: 1.15rem; font-weight: 700; margin: 0; color: #1e2635;
}
.voice-picker-tabs {
    border-bottom: 1px solid #eef1f5;
}
.voice-picker-tabs .nav-link {
    border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    color: #888c95; font-weight: 600; padding: 0.75rem 0.9rem;
}
.voice-picker-tabs .nav-link.active {
    color: #1e2635; border-bottom-color: #1e2635; background: transparent;
}
.voice-picker-tools { padding: 0.85rem 1rem 0.5rem; }
.voice-picker-search {
    display: flex; align-items: center; gap: 0.55rem;
    background: #f3f4f6; border-radius: 10px; padding: 0.55rem 0.8rem;
}
.voice-picker-search i { color: #9aa0a6; }
.voice-picker-search input {
    border: 0; background: transparent; outline: none; width: 100%;
    font-size: 0.95rem; color: #1e2635;
}
.voice-picker-filters {
    display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem;
}
.voice-filter-chip {
    border: 1px solid #e3e8ef; background: #fff; color: #505458;
    border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.78rem; font-weight: 600;
}
.voice-filter-chip.active {
    background: #1e2635; border-color: #1e2635; color: #fff;
}
.voice-picker-list {
    max-height: 52vh; overflow: auto; padding: 0.25rem 0.5rem 1rem;
}
.voice-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.75rem; border-radius: 12px; cursor: pointer;
}
.voice-row:hover, .voice-row.is-active { background: #f3f4f6; }
.voice-row-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    color: #fff; font-weight: 700; display: grid; place-items: center; flex: 0 0 auto;
}
.voice-row-body { min-width: 0; flex: 1; }
.voice-row-name { font-weight: 700; color: #1e2635; }
.voice-row-desc {
    font-size: 0.8rem; color: #6c757d;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.voice-row-meta { font-size: 0.72rem; color: #9aa0a6; text-transform: capitalize; margin-top: 0.1rem; }
.voice-row-play {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid #e3e8ef;
    background: #fff; color: #1e2635; display: grid; place-items: center; flex: 0 0 auto;
}
.voice-row-play:hover { border-color: var(--fa-blue); color: var(--fa-blue); }
.voice-row-play.is-disabled { opacity: 0.35; }

/* Jazz brand lockup (replaces ElevenLabs in UI) */
.brand-mark-jazz {
    width: auto;
    max-width: 96px;
    height: auto;
    max-height: 28px;
    object-fit: contain;
    background: transparent;
}
.brand-wordmark {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    color: #e31837;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}
.jazz-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    vertical-align: middle;
    line-height: 1.2;
}
.jazz-brand-logo {
    width: auto;
    max-width: 88px;
    height: auto;
    object-fit: contain;
    flex: 0 0 auto;
}
.jazz-brand-label {
    font-weight: 700;
    color: #e31837;
    letter-spacing: -0.02em;
}
.jazz-brand-prefix,
.jazz-brand-suffix {
    color: inherit;
}
.btn .jazz-brand-lockup .jazz-brand-label { font-size: 0.92em; }
.glass-heading .jazz-brand-logo { max-width: 96px; }
.dash-kicker .jazz-brand-logo { max-width: 110px; }

/* ——— Global UI polish (atmosphere + motion) ——— */
.vidfy-empty-state .vidfy-empty-icon {
    width: 56px;
    height: 56px;
    margin-inline: auto;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(103, 119, 239, 0.1);
    color: var(--fa-blue);
    font-size: 1.45rem;
}

.skip-to-content:focus {
    position: fixed !important;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2000;
    width: auto !important;
    height: auto !important;
    padding: 0.55rem 0.9rem;
    clip: auto !important;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--fa-shadow-lg);
    color: var(--fa-ink);
    font-weight: 700;
}

.btn:focus-visible,
.sidebar-link:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.vidfy-check-dropdown-toggle:focus-visible,
.quick-link:focus-visible {
    outline: 2px solid var(--fa-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.18);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--fa-red);
    animation: fieldShake 0.35s var(--fa-ease);
}

@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.glass-card {
    transition: transform 0.25s var(--fa-ease), box-shadow 0.25s var(--fa-ease);
}
.glass-card:hover {
    box-shadow: var(--fa-shadow-lg);
}

.quick-link {
    transition: transform 0.2s var(--fa-ease), background 0.2s var(--fa-ease), color 0.2s var(--fa-ease);
}
.quick-link:hover {
    transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
    .app-content,
    .glass-card,
    .card-soft,
    .btn-primary,
    .btn-dark,
    .btn-glass,
    .sidebar-link,
    .quick-link,
    .form-control.is-invalid {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

.hamburger-btn,
.topbar-icon-btn {
    border-radius: 10px;
    transition: background 0.2s var(--fa-ease), color 0.2s var(--fa-ease), transform 0.2s var(--fa-ease);
}
.hamburger-btn:hover,
.topbar-icon-btn:hover {
    transform: translateY(-1px);
}

.dropdown-menu {
    border-radius: 14px !important;
    border: 1px solid rgba(230, 233, 244, 0.95) !important;
    box-shadow: var(--fa-shadow-lg) !important;
    padding: 0.4rem;
    overflow: hidden;
}
.app-topbar .dropdown-menu {
    min-width: 20rem;
    max-width: min(24rem, calc(100vw - 1.25rem));
    padding: 0.55rem;
    overflow: visible;
}
.app-topbar .dropdown-header {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 0.15rem;
    font-weight: 650;
    color: var(--fa-ink, #1e2635);
}
.app-topbar .dropdown-item-text {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
    padding-top: 0;
    padding-bottom: 0.4rem;
    line-height: 1.35;
}
.app-topbar .dropdown-item {
    padding: 0.55rem 0.8rem;
}
.app-topbar .dropdown-divider {
    margin: 0.35rem 0.35rem;
}
.dropdown-item {
    border-radius: 8px;
    font-weight: 550;
    padding: 0.5rem 0.75rem;
}
.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(103, 119, 239, 0.08);
    color: var(--fa-blue);
}

.toast {
    border-radius: 12px !important;
    box-shadow: var(--fa-shadow-lg);
}
#toast-host .toast.text-bg-success {
    background-color: var(--fa-notification, var(--fa-green)) !important;
    color: #fff !important;
}
#toast-host .toast.text-bg-danger {
    background-color: var(--fa-red) !important;
    color: #fff !important;
}
#toast-host .toast.text-bg-warning {
    background-color: var(--fa-orange) !important;
    color: var(--fa-ink) !important;
}

.footer-player {
    backdrop-filter: blur(16px) saturate(1.15);
}
.footer-player-inner {
    border-radius: 18px 18px 0 0;
    border: 1px solid rgba(230, 233, 244, 0.95);
    box-shadow: 0 -12px 40px rgba(30, 36, 56, 0.1);
}

.table-light,
thead.table-light th {
    background: linear-gradient(180deg, #f8f9fd, #f3f5fb) !important;
}

.glass-card.has-datatable:hover,
.glass-card.p-0:hover {
    transform: none;
}

.h4, .h5, .h6 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

.nav-section-label {
    opacity: 0.85;
}

.filter-pill {
    transition: background 0.2s var(--fa-ease), color 0.2s var(--fa-ease), transform 0.2s var(--fa-ease);
}
.filter-pill:hover {
    transform: translateY(-1px);
}

.quick-link {
    transition: transform 0.2s var(--fa-ease), box-shadow 0.2s var(--fa-ease), border-color 0.2s var(--fa-ease);
}
.quick-link:hover {
    transform: translateY(-2px);
}

.status-badge,
[class*="status-"] {
    border-radius: 999px !important;
}

.project-card,
.voice-card {
    transition: transform 0.25s var(--fa-ease), box-shadow 0.25s var(--fa-ease);
}
.project-card:hover,
.voice-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--fa-shadow-lg);
}

/* Soft page header rhythm for list/admin screens */
.app-content > .mb-3:first-child .h4,
.app-content > .d-flex:first-child .h4 {
    letter-spacing: -0.03em;
}

.app-offcanvas {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), #fff),
        radial-gradient(380px 200px at 0% 0%, rgba(46, 216, 182, 0.1), transparent 70%);
}

/* Checkbox dropdown (brands / campaign assignees) */
.vidfy-check-dropdown {
    position: relative;
}
.vidfy-check-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    min-height: calc(1.5em + 0.75rem + 2px);
}
.vidfy-check-dropdown-toggle::after {
    content: "";
    margin-left: auto;
    width: 14px;
    height: 14px;
    border: 0;
    background-image: var(--vidfy-select-chevron);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    opacity: 0.85;
    flex-shrink: 0;
    transition: transform 0.15s var(--fa-ease);
}
.vidfy-check-dropdown.is-open .vidfy-check-dropdown-toggle::after {
    transform: rotate(180deg);
    margin-top: 0;
}
.vidfy-check-dropdown-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 0.5rem;
}
.vidfy-check-dropdown-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(230, 233, 244, 0.95);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(30, 36, 56, 0.12);
    padding: 0.4rem;
}
.vidfy-check-dropdown-group {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8b95a8;
    padding: 0.45rem 0.55rem 0.2rem;
}
.vidfy-check-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    cursor: pointer;
    margin: 0;
    font-size: 0.92rem;
}
.vidfy-check-dropdown-item:hover {
    background: rgba(103, 119, 239, 0.08);
}
.vidfy-check-dropdown-item.is-indent {
    padding-left: 1.35rem;
}
.vidfy-check-dropdown-item .form-check-input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.brand-tree-name.is-child {
    padding-left: 1rem;
    font-weight: 500;
}
.brand-tree-name .brand-tree-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #8b95a8;
}

/* Brand tree inside dropdown */
.vidfy-brand-tree-dropdown .vidfy-brand-tree-menu {
    padding: 0.55rem;
}
.vidfy-brand-tree-dropdown .vidfy-brand-tree-search {
    margin-bottom: 0.5rem;
}
.vidfy-brand-tree-dropdown .vidfy-brand-tree-list {
    max-height: 260px;
    overflow: auto;
}
.vidfy-brand-tree {
    border: 1px solid #d9dee8;
    border-radius: 10px;
    background: #fff;
    padding: 0.65rem;
}
.vidfy-brand-tree-dropdown.vidfy-brand-tree,
.vidfy-brand-tree-dropdown {
    border: 0;
    padding: 0;
    background: transparent;
}
.vidfy-brand-tree-search {
    margin-bottom: 0.55rem;
}
.vidfy-brand-tree-search::placeholder {
    color: #b8beca !important;
    opacity: 1;
}
.vidfy-brand-tree-list {
    max-height: 280px;
    overflow: auto;
    padding-right: 0.15rem;
}
.vidfy-brand-tree-node {
    margin-bottom: 0.15rem;
}
.vidfy-brand-tree-node.is-filtered-out,
.vidfy-brand-tree-row.is-filtered-out {
    display: none !important;
}
.vidfy-brand-tree-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.4rem;
    border-radius: 8px;
    margin: 0;
    cursor: pointer;
}
.vidfy-brand-tree-row:hover,
.vidfy-brand-tree-check:hover {
    background: rgba(103, 119, 239, 0.08);
}
.vidfy-brand-tree-row.is-child {
    padding-left: 1.85rem;
    position: relative;
}
.vidfy-brand-tree-children {
    margin-left: 0.85rem;
    padding-left: 0.55rem;
    border-left: 1px solid #e6e9f4;
}
.vidfy-brand-tree-node:not(.is-open) > .vidfy-brand-tree-children {
    display: none !important;
}
.vidfy-brand-tree-toggle {
    width: 22px;
    height: 22px;
    border: 1px solid #d9dee8;
    border-radius: 4px;
    background: #f8f9fc;
    color: #5f6b7a;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    cursor: pointer;
    position: relative;
    z-index: 2;
}
.vidfy-brand-tree-toggle:hover {
    border-color: #6777EF;
    color: #6777EF;
}
.vidfy-brand-tree-spacer,
.vidfy-brand-tree-branch {
    width: 22px;
    flex: 0 0 auto;
}
.vidfy-brand-tree-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    padding: 0.1rem 0;
}
.vidfy-brand-tree-label {
    font-weight: 600;
    color: #1e2438;
    font-size: 0.92rem;
}
.vidfy-brand-tree-row.is-child .vidfy-brand-tree-label {
    font-weight: 500;
}
.vidfy-brand-tree-row .form-check-input {
    margin: 0;
    flex-shrink: 0;
}
.vidfy-brand-tree-row:has(.brand-assign-check:checked),
.vidfy-brand-tree-row:has(.vidfy-brand-tree-check .brand-assign-check:checked) {
    background: rgba(103, 119, 239, 0.12);
}

/* ——— Responsive system ——— */
.chart-legend {
    flex-wrap: wrap;
}
.lipsync-jobs-list .lipsync-job-row {
    align-items: center;
}
.app-content {
    max-width: 100%;
    min-width: 0;
}
#toast-host.toast-container {
    z-index: 10900 !important;
    top: max(4.25rem, calc(env(safe-area-inset-top, 0px) + 3.75rem));
    padding-top: 0.75rem;
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    pointer-events: none;
}
#toast-host.toast-container .toast {
    pointer-events: auto;
}
.dropdown-menu .dropdown-item-text {
    max-width: min(280px, 80vw);
    overflow-wrap: anywhere;
    word-break: break-word;
}
.app-topbar .dropdown-menu .dropdown-item-text {
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vidfy-check-dropdown-menu {
    z-index: 1085;
}
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .studio-footer {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }
    .studio-footer .btn,
    .studio-footer .btn-primary {
        width: 100%;
    }
    .lipsync-studio .studio-footer {
        flex-wrap: wrap;
        flex-direction: column;
        align-items: stretch;
    }
    .lipsync-studio .studio-footer .package-usage {
        white-space: normal;
        flex-wrap: wrap;
        overflow: visible;
        text-overflow: unset;
    }
    .studio-editor {
        padding-bottom: 1.25rem;
    }
    .studio-textarea {
        min-height: 280px;
        font-size: 1.05rem;
    }
    .drop-zone {
        min-height: 220px;
    }
    .lipsync-jobs-list .lipsync-job-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .lipsync-jobs-list .lipsync-job-actions {
        justify-content: flex-end;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    body {
        background-attachment: scroll;
    }
    .app-content {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }
    .kpi-card {
        gap: 0.55rem;
        padding: 1rem 0.9rem;
    }
    .kpi-icon {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
    .kpi-card .kpi-value {
        font-size: 1.35rem;
    }
    .kpi-card .kpi-delta,
    .kpi-card .kpi-meta {
        white-space: normal;
        line-height: 1.35;
        font-size: 0.72rem;
    }
    .dash-title {
        font-size: 1.45rem;
    }
    .glass-card {
        border-radius: 14px;
    }
    .avatar-grid,
    .library-avatar-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }
    .dlg-speaker-chip .stom-select {
        min-width: 0;
        width: 100%;
    }
    .dlg-speaker-chip .stom-select-name {
        max-width: none;
    }
    .glass-heading .jazz-brand-logo {
        max-width: 72px;
    }
    .sidebar-brand .brand-mark-jazz,
    .app-offcanvas .offcanvas-header .brand-mark-jazz {
        max-width: 132px;
        max-height: 64px;
    }
    .overlay-size-fields > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .vidfy-check-dropdown-item {
        font-size: 0.875rem;
    }
    .modal-footer {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .modal-footer .btn {
        flex: 1 1 auto;
    }
    table.vidfy-dt.dataTable thead th {
        white-space: normal;
    }
    .dt-actions,
    td.text-nowrap:not(:has(.table-actions)) {
        white-space: normal !important;
    }
    .dt-actions .btn,
    td.text-end:not(:has(.table-actions)) .btn {
        margin-bottom: 0.25rem;
    }
    td .table-actions,
    .table-actions .btn {
        white-space: nowrap !important;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 575.98px) {
    .kpi-card {
        flex-direction: column-reverse;
        align-items: flex-start;
    }
    .kpi-icon {
        align-self: flex-end;
    }
    .login-card,
    .auth-card {
        padding: 1.35rem 1.1rem !important;
    }
    .btn {
        white-space: normal;
    }
    .topbar-icon-btn {
        width: 38px;
        height: 38px;
    }
    h1.h4, .h4 {
        font-size: 1.2rem;
    }
    .dash-hero > .d-flex {
        width: 100%;
        flex-direction: column;
    }
    .dash-hero > .d-flex .btn,
    .dash-hero > .d-flex form {
        width: 100%;
        flex: none;
    }
    .dash-hero > .d-flex form .btn {
        width: 100%;
    }
    .app-topbar {
        padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
        gap: 0.5rem !important;
    }
    .topbar-credit-label {
        display: none;
    }
    .topbar-credit {
        max-width: 6.5rem;
        padding: .24rem .45rem;
    }
    .img-fluid, video, iframe {
        max-width: 100%;
        height: auto;
    }
    .modal-dialog {
        margin: 0.75rem;
        max-width: calc(100% - 1.5rem);
    }
    .audio-picker-trigger {
        max-width: 100%;
    }
    #user-role-filters {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }
    #user-role-filters .btn {
        flex: 0 0 auto;
    }
    .filter-pills {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.45rem;
        padding-bottom: 0.25rem;
    }
    .filter-pill {
        flex: 0 0 auto;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .kpi-card .kpi-delta,
    .kpi-card .kpi-meta {
        white-space: normal;
    }
}

@media (hover: none) and (pointer: coarse) {
    .glass-card:hover,
    .project-card:hover,
    .voice-card:hover {
        transform: none;
    }
    .sidebar-link {
        min-height: 44px;
    }
    .btn:not(.btn-sm):not(.btn-close):not(.topbar-icon-btn):not(.hamburger-btn):not(.footer-play-btn) {
        min-height: 42px;
    }
    .btn-sm {
        min-height: 36px;
    }
    .vidfy-check-dropdown-item {
        min-height: 44px;
        align-items: center;
    }
}

/* Narrow screens: stack page headers, wrap DT chrome, keep tables scrollable */
@media (max-width: 767.98px) {
    .lipsync-page > .d-flex:first-child,
    .el-page-head,
    .dash-hero {
        align-items: stretch !important;
    }
    .lipsync-page > .d-flex:first-child .d-flex,
    .lipsync-page > .d-flex:first-child form,
    .lipsync-page > .d-flex:first-child .btn {
        width: 100%;
    }
    div.dt-container .dt-layout-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    div.dt-container .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .form-actions,
    .modal-footer {
        flex-wrap: wrap;
    }
    .app-content,
    #main-content {
        min-width: 0;
        max-width: 100%;
    }
    img, video, canvas, svg {
        max-width: 100%;
    }
}

/* SweetAlert2 — match app buttons */
.vidfy-swal-popup {
    border-radius: 14px !important;
    font-family: inherit;
}
.vidfy-swal-popup .swal2-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--fa-ink, #1e2635);
}
.vidfy-swal-popup .swal2-html-container {
    font-size: 0.95rem;
    color: var(--fa-muted, #6b7280);
}
.vidfy-swal-popup .swal2-actions {
    gap: 0.5rem;
}
.vidfy-swal-popup .btn {
    margin: 0;
    min-width: 5.5rem;
}

