:root {
    --brand-red: #9b1c1f;
    --brand-blue: #21409a;
    --brand-bg: #f4f6f9;
    --brand-text: #1f2937;
    --app-header-bg: #111827;
    --app-header-bg-2: #0f172a;
    --app-header-border: rgba(255, 255, 255, 0.08);
    --app-header-text: #f9fafb;
    --app-header-muted: rgba(255, 255, 255, 0.72);
    --app-header-search-bg: rgba(255, 255, 255, 0.10);
    --app-header-search-border: rgba(255, 255, 255, 0.14);
    --app-header-search-placeholder: rgba(255, 255, 255, 0.60);
}

html {
    font-size: 16px;
}

body {
    background: var(--brand-bg);
    color: var(--brand-text);
    padding-top: 0;
}

.brand-badge {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-red), #c63b3f);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(155, 28, 31, .2);
}

.brand-title {
    color: var(--brand-red);
    font-weight: 700;
}

.btn-brand {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
}

    .btn-brand:hover,
    .btn-brand:focus {
        background: #1a3177;
        border-color: #1a3177;
        color: #fff;
    }

.page-header h1 {
    font-weight: 700;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.stat-label {
    color: #64748b;
    font-size: .95rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-blue);
}

.backoffice-subnav .btn {
    border-radius: 999px;
}

    .backoffice-subnav .btn.btn-brand {
        box-shadow: 0 0.2rem 0.6rem rgba(13, 56, 140, 0.18);
    }

.backoffice-title-link {
    color: inherit;
    text-decoration: none;
}

    .backoffice-title-link:hover {
        text-decoration: underline;
    }

.transcript-card textarea,
.transcript-textarea {
    resize: vertical;
}

.backoffice-card {
    border-radius: 1rem;
}

    .backoffice-card .badge {
        font-weight: 500;
    }



.videos-table td,
.videos-table th {
    vertical-align: middle;
}

.video-edit-thumb-wrap {
    background: #111;
    border-radius: 0.5rem;
    overflow: hidden;
    padding: 0.25rem;
}

.video-edit-thumb {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    display: block;
}

.transcript-textarea {
    width: 100%;
    min-height: 260px;
    max-height: 400px;
    resize: vertical;
    font-size: 0.9rem;
    line-height: 1.4;
}

.canais-list .list-group-item {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}

    .canais-list .list-group-item:first-child {
        border-top: 0;
    }

    .canais-list .list-group-item.active {
        border-color: transparent;
    }

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.pagination .page-link {
    color: inherit;
}

/* ==========================================
   HEADER GLOBAL ESCURO
   ========================================== */

.app-header {
    background: linear-gradient(135deg, var(--app-header-bg), var(--app-header-bg-2));
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.20);
    z-index: 1030;
}

.app-navbar {
    min-height: 78px;
}

.app-brand {
    text-decoration: none;
    min-width: 0;
}

    .app-brand:hover {
        text-decoration: none;
    }

.app-brand-mark {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-brand-logo {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.28));
}

.app-brand-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.app-brand-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #F9FAFB;
    white-space: nowrap;
}

.app-brand-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #E5E7EB;
    margin-top: 3px;
    letter-spacing: 0.03em;
}

.app-navbar .nav-link {
    color: var(--app-header-muted);
    font-weight: 500;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    position: relative;
    transition: color 0.18s ease, background-color 0.18s ease;
}

    .app-navbar .nav-link:hover {
        color: var(--app-header-text);
        background-color: rgba(255, 255, 255, 0.06);
    }

    .app-navbar .nav-link.active {
        color: var(--app-header-text);
        background-color: rgba(255, 255, 255, 0.06);
    }

        .app-navbar .nav-link.active::after {
            content: "";
            position: absolute;
            left: 12px;
            right: 12px;
            bottom: 6px;
            height: 2px;
            border-radius: 999px;
            background: #b91c1c;
        }

.app-header-search {
    width: 100%;
    max-width: 420px;
}

    .app-header-search .input-group-text,
    .app-header-search .form-control {
        background: var(--app-header-search-bg);
        border-color: var(--app-header-search-border);
        color: var(--app-header-text);
    }

    .app-header-search .input-group-text {
        border-right: 0;
        color: var(--app-header-muted);
    }

    .app-header-search .form-control {
        border-left: 0;
        box-shadow: none;
    }

        .app-header-search .form-control::placeholder {
            color: var(--app-header-search-placeholder);
        }

        .app-header-search .form-control:focus {
            box-shadow: none;
            border-color: rgba(255, 255, 255, 0.22);
            background: rgba(255, 255, 255, 0.13);
        }

.app-logout-btn {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.55rem 0.9rem;
    white-space: nowrap;
}

    .app-logout-btn:hover,
    .app-logout-btn:focus {
        color: #fff;
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.24);
    }

.app-navbar-toggler {
    border-color: rgba(255, 255, 255, 0.18);
}

    .app-navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(185, 28, 28, 0.18);
    }

    .app-navbar-toggler .navbar-toggler-icon {
        filter: invert(1) brightness(1.8);
    }

.app-main {
    padding-top: 1.5rem;
}

/* ==========================================
   LOGIN DISCRETO / INSTITUCIONAL
   ========================================== */

.login-page {
    min-height: 100vh;
    margin: 0;
    background: #f1f5f9;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card.login-card-minimal {
    width: 100%;
    max-width: 380px;
    padding: 32px 30px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.login-logo {
    width: 72px;
    height: auto;
    display: inline-block;
    object-fit: contain;
}

.login-brand-text {
    font-family: 'Cinzel', serif;
    font-size: 0.92rem;
    line-height: 1.35;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #4b5563;
}

.login-card-minimal .form-control {
    min-height: 52px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    box-shadow: none;
}

    .login-card-minimal .form-control:focus {
        border-color: #94a3b8;
        box-shadow: 0 0 0 0.2rem rgba(148, 163, 184, 0.15);
    }

    .login-card-minimal .form-control::placeholder {
        color: #9ca3af;
    }

.login-card-minimal .btn-brand {
    min-height: 52px;
    border-radius: 10px;
}

.login-card-minimal .form-check {
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-card-minimal .form-check-input {
    cursor: pointer;
}

.login-card-minimal .form-check-label {
    cursor: pointer;
    font-size: 0.85rem;
    color: #6b7280;
}

/* ==========================================
   FRONTOFFICE COMUM
   ========================================== */

.fo-video-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.fo-video-card {
    position: relative;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    overflow: hidden;
    border-radius: 12px;
    height: 100%;
}

    .fo-video-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 5px;
        height: 100%;
        background-color: transparent;
        border-top-left-radius: 12px;
        border-bottom-left-radius: 12px;
        z-index: 2;
        pointer-events: none;
    }

    .fo-video-card.pr::before {
        background-color: #B91C1C;
    }

    .fo-video-card.outros::before {
        background-color: #64748B;
    }

    .fo-video-card:hover {
        background-color: #fff8e1;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
        border-color: #ffe082;
    }

.fo-video-thumb-wrapper {
    position: relative;
    overflow: hidden;
}

    .fo-video-thumb-wrapper > img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 1 !important;
        filter: none !important;
        background: transparent !important;
    }

.fo-video-duration-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    max-width: max-content;
    white-space: nowrap;
    padding: 2px 6px;
    line-height: 1;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.75);
    border-radius: 4px;
    box-sizing: border-box;
    pointer-events: none;
}

.fo-video-live-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    max-width: max-content;
    white-space: nowrap;
    padding: 3px 7px;
    line-height: 1;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    background-color: #dc2626;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    pointer-events: none;
}

.fo-video-play-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.fo-video-card:hover .fo-video-play-overlay {
    display: flex;
}

.fo-video-play-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.fo-video-thumb-wrapper:hover .fo-video-play-icon {
    transform: scale(1.08);
    background: rgba(0, 0, 0, 0.75);
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

.fo-video-play-icon::before {
    content: "";
    display: block;
    margin-left: 4px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #ffffff;
}

.fo-video-card .card-title {
    color: inherit;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.4rem;
}

.fo-video-card .text-muted {
    color: #6c757d !important;
}

.fo-video-save-btn {
    border: 1px solid #d7dbe2;
    background: #fff;
    color: #495057;
    border-radius: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    flex: 0 0 auto;
}

    .fo-video-save-btn:hover {
        background: #f8f9fa;
        border-color: #c8ced6;
        color: #212529;
    }

    .fo-video-save-btn.active {
        color: #c58b00;
        border-color: #e7d08a;
        background: #fffdf5;
    }

    .fo-video-save-btn i {
        font-size: 0.95rem;
    }

.fo-search-card .form-label {
    font-weight: 700;
    font-size: 0.95rem;
}

.fo-empty-guardados {
    padding: 3rem 1rem;
    text-align: center;
    color: #6c757d;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
}

/* ==========================================
   DETALHE DO VÍDEO
   ========================================== */

.fo-detail-card {
    border-radius: 12px;
}

.fo-detail-title {
    line-height: 1.2;
}

.fo-detail-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.fo-detail-meta {
    color: #6c757d;
    font-size: 1.05rem;
    line-height: 1.45;
}

.fo-detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.fo-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid #d7dbe2;
    background: #fff;
    color: #495057;
    border-radius: 0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    .fo-action-btn:hover {
        background: #f8f9fa;
        border-color: #c8ced6;
        color: #212529;
        text-decoration: none;
    }

    .fo-action-btn.active {
        color: #c58b00;
        border-color: #e7d08a;
        background: #fffdf5;
    }

    .fo-action-btn i {
        font-size: 0.95rem;
    }

.fo-transcricao-card {
    border-radius: 12px;
}

    .fo-transcricao-card .card-body {
        display: flex;
        flex-direction: column;
    }

.fo-transcricao-box {
    height: calc(100vh - 290px);
    min-height: 420px;
    max-height: 720px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.55;
    background: #f8f9fb;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
}

.fo-transcricao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

    .fo-transcricao-header h2 {
        margin-bottom: 0;
    }

@media (min-width: 1400px) {
    .transcript-textarea {
        min-height: 620px;
    }
}



/* ==========================================
   MENU DO UTILIZADOR
   ========================================== */

.app-user-dropdown {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.7rem 0.35rem 0.35rem;
    transition: all 0.2s ease;
    min-height: 42px;
}

    .app-user-dropdown:hover,
    .app-user-dropdown:focus,
    .app-user-dropdown.show {
        background: rgba(255,255,255,0.14);
        border-color: rgba(255,255,255,0.28);
        color: #fff;
    }

    .app-user-dropdown::after {
        display: none;
    }

.app-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    flex: 0 0 32px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.app-user-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: #f9fafb;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-user-menu {
    border-radius: 0.75rem;
    padding: 0.4rem;
    min-width: 220px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

    .app-user-menu .dropdown-item {
        border-radius: 0.5rem;
        font-size: 0.92rem;
        padding: 0.55rem 0.75rem;
    }

        .app-user-menu .dropdown-item:hover {
            background: #f1f5f9;
        }




@media (max-width: 1199.98px) {
    .app-brand-title {
        font-size: 1.05rem;
        white-space: normal;
    }

    .app-header-search {
        max-width: none;
    }

    .app-navbar .navbar-collapse {
        margin-top: 0.9rem;
        padding-top: 0.9rem;
        border-top: 1px solid var(--app-header-border);
    }

    .app-navbar .nav-link {
        padding-left: 0;
        padding-right: 0;
        border-radius: 0;
    }

        .app-navbar .nav-link.active::after {
            left: 0;
            right: auto;
            width: 42px;
        }
}


.video-list-card {
    border-radius: 12px;
    position: relative;
}

    .video-list-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 5px;
        height: 100%;
        border-radius: 12px 0 0 12px;
    }

    .video-list-card.pr::before {
        background: #B91C1C;
    }

    .video-list-card.outros::before {
        background: #64748B;
    }

.video-list-thumb {
    width: 160px;
    min-width: 160px;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
}

    .video-list-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.segment-row {
    padding: 6px 0;
    border-top: 1px solid #eee;
}

.segment-text {
    font-size: 0.9rem;
    color: #333;
}



/* ==========================================
   FRONTOFFICE - MODO CONDENSADO
   ========================================== */

.fo-view-mode-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
}

.fo-view-mode-label {
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.fo-view-mode-select {
    min-width: 180px;
    max-width: 220px;
    font-weight: 600;
    border-radius: 0.65rem;
}

.fo-condensed-list {
    display: none;
}

.fo-page-root[data-view-mode="normal"] .fo-normal-grid {
    display: flex;
}

.fo-page-root[data-view-mode="normal"] .fo-condensed-list {
    display: none;
}

.fo-page-root[data-view-mode="condensed"] .fo-normal-grid {
    display: none;
}

.fo-page-root[data-view-mode="condensed"] .fo-condensed-list {
    display: block;
}

.fo-condensed-table-wrap {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 0.35rem 1rem rgba(20, 32, 50, 0.05);
    border: 1px solid #e8edf3;
}

.fo-condensed-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .fo-condensed-table thead th {
        background: #fff;
        border-bottom: 1px solid #dbe3ef;
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        font-weight: 700;
        color: #0f172a;
        text-align: left;
        white-space: nowrap;
    }

    .fo-condensed-table tbody td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e9eef5;
        vertical-align: top;
        background: #fff;
    }

    .fo-condensed-table tbody tr:last-child td {
        border-bottom: 0;
    }

.fo-condensed-row {
    cursor: pointer;
    transition: background-color 0.18s ease;
    position: relative;
}

    .fo-condensed-row:hover td {
        background: #f8fafc;
    }

.fo-condensed-thumb-cell {
    width: 150px;
    position: relative;
}

.fo-condensed-thumb-link {
    display: inline-block;
    text-decoration: none;
}

.fo-condensed-thumb-wrap {
    position: relative;
    width: 120px;
    height: 68px;
    border-radius: 0.6rem;
    overflow: hidden;
    background: #e9ecef;
}

.fo-condensed-row.pr .fo-condensed-thumb-wrap {
    box-shadow: inset 4px 0 0 #b91c1c;
}

.fo-condensed-row.outros .fo-condensed-thumb-wrap {
    box-shadow: inset 4px 0 0 #64748b;
}

.fo-condensed-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fo-condensed-duration-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.25rem 0.35rem;
    border-radius: 0.35rem;
}

.fo-condensed-live-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0.22rem 0.35rem;
    line-height: 1;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    background-color: #dc2626;
    border-radius: 0.3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.fo-condensed-title-cell {
    min-width: 0;
    width: 100%;
}

.fo-condensed-title-line {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.15rem;
    color: #111827;
}

.fo-condensed-meta-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.05rem;
}

.fo-condensed-meta-block {
    flex: 1;
    min-width: 0;
}

.fo-condensed-file-line {
    color: #475569;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .fo-condensed-file-line strong {
        font-weight: 700;
    }

.fo-condensed-extra {
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.1rem;
}

.fo-condensed-save-side {
    flex-shrink: 0;
    width: 42px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.1rem;
}

    .fo-condensed-save-side .fo-video-save-btn {
        margin: 0;
    }

.fo-condensed-date-main {
    color: #111827;
    margin-bottom: 0.2rem;
}

.fo-condensed-time-soft {
    color: #64748b;
}

.fo-condensed-empty-thumb {
    width: 120px;
    height: 68px;
    border-radius: 0.6rem;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    text-align: center;
    padding: 0.4rem;
}

@media (max-width: 1199.98px) {
    .fo-view-mode-wrap {
        min-width: 0;
        justify-content: flex-end;
        margin-top: 0;
    }

    .fo-condensed-title-cell {
        min-width: 0;
    }

    .fo-condensed-table thead th,
    .fo-condensed-table tbody td {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .fo-condensed-file-line {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-word;
    }

    .fo-condensed-meta-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 0.75rem;
        margin-top: 0.2rem;
    }

    .fo-condensed-meta-block {
        min-width: 0;
    }

    .fo-condensed-extra {
        flex-wrap: wrap;
    }

    .fo-condensed-save-side {
        width: auto;
        min-width: 42px;
        justify-content: flex-end;
    }

    .fo-condensed-date-main,
    .fo-condensed-time-soft {
        white-space: nowrap;
    }

    .fo-condensed-table th:nth-child(3),
    .fo-condensed-table td:nth-child(3) {
        width: 120px;
        white-space: nowrap;
    }

    .fo-condensed-table th:nth-child(4),
    .fo-condensed-table td:nth-child(4) {
        width: 130px;
    }

    .fo-condensed-table th:nth-child(5),
    .fo-condensed-table td:nth-child(5) {
        width: 150px;
    }
}




@media (max-width: 767.98px) {

    .fo-view-mode-wrap {
        min-width: 0;
        justify-content: flex-end;
        margin-top: 0;
    }

    .fo-condensed-table thead {
        display: none;
    }

    .fo-condensed-table,
    .fo-condensed-table tbody,
    .fo-condensed-table tr,
    .fo-condensed-table td {
        display: block;
        width: 100%;
    }

    .fo-condensed-table-wrap {
        border: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .fo-condensed-row {
        display: block;
        background: #fff;
        border: 1px solid #e8edf3;
        border-radius: 1rem;
        margin-bottom: 0.9rem;
        padding: 0.8rem 0.85rem;
        position: relative;
        overflow: hidden;
    }

        .fo-condensed-row:last-child {
            margin-bottom: 0;
        }

        .fo-condensed-row.pr::before,
        .fo-condensed-row.outros::before {
            content: "";
            position: absolute;
            left: 0;
            top: 10px;
            bottom: 10px;
            width: 4px;
            border-radius: 4px;
        }

        .fo-condensed-row.pr::before {
            background: #b91c1c;
        }

        .fo-condensed-row.outros::before {
            background: #64748b;
        }

    .fo-condensed-table tbody td {
        border: 0 !important;
        padding: 0.18rem 0;
        background: transparent;
    }

    /* THUMB */
    .fo-condensed-thumb-cell {
        float: left;
        width: 140px !important;
        margin: 0 0.85rem 0.35rem 0;
        padding: 0 !important;
    }

    .fo-condensed-thumb-wrap,
    .fo-condensed-empty-thumb {
        width: 140px;
        height: 79px;
        aspect-ratio: unset;
    }

    /* BLOCO DIREITO */
    .fo-condensed-title-cell {
        display: block !important;
        width: auto !important;
        margin-left: 150px;
        min-height: 79px;
        padding: 0 38px 0 0 !important;
        overflow: visible;
    }

    .fo-condensed-title-line {
        margin: 0 0 0.2rem 0;
        font-size: 0.98rem;
        line-height: 1.28;
        font-weight: 700;
        color: #111827;
    }

    .fo-condensed-meta-row {
        display: block;
        margin-top: 0.05rem;
    }

    .fo-condensed-meta-block {
        min-width: 0;
    }

    .fo-condensed-extra {
        display: block;
        font-size: 0.92rem;
        color: #6b7280;
        margin-top: 0;
    }

    /* BOTÃO GUARDAR */
    .fo-condensed-save-side {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        margin: 0;
        padding: 0;
    }

        .fo-condensed-save-side .fo-video-save-btn {
            margin: 0;
            width: 30px;
            height: 30px;
        }

    /* DATA/HORA por baixo do thumbnail */
    .fo-condensed-table td:nth-child(3) {
        clear: both;
        float: left;
        width: 140px !important;
        margin: 0.25rem 0.85rem 0 0;
        padding: 0 !important;
        font-size: 0.88rem;
        line-height: 1.25;
    }

    .fo-condensed-date-main {
        display: inline;
        margin-right: 0.2rem;
        color: #6b7280;
        font-weight: 600;
    }

    .fo-condensed-time-soft {
        display: inline;
        color: #64748b;
    }

    /* CANAL + PROGRAMA em largura total por baixo */
    .fo-condensed-table td:nth-child(4),
    .fo-condensed-table td:nth-child(5) {
        display: inline-block !important;
        width: auto !important;
        padding: 0 !important;
        font-size: 0.92rem;
        line-height: 1.25;
        color: #475569;
        vertical-align: top;
    }

    .fo-condensed-table td:nth-child(4) {
        clear: both;
        margin-top: 0.15rem;
        margin-right: 0.35rem;
    }

        .fo-condensed-table td:nth-child(4)::after {
            content: " · ";
            color: #94a3af;
            margin-left: 0.35rem;
        }

    .fo-condensed-table td:nth-child(5) {
        margin-top: 0.15rem;
    }
}



@media (max-width: 991.98px) {
    .fo-detail-meta-row {
        flex-direction: column;
        align-items: stretch;
    }

    .fo-detail-actions {
        justify-content: flex-start;
    }

    .fo-transcricao-box {
        height: auto;
        min-height: 320px;
        max-height: 320px;
    }

    .app-user-name {
        max-width: 90px;
    }
}

/* ==========================================
   CORREÇÕES MOBILE / LAYOUT GLOBAL
   Header consistente, sem overflow horizontal
   ========================================== */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

html {
    min-height: 100%;
}

body.app-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

.app-header {
    width: 100%;
}

.app-header-container,
.app-main-container,
.app-footer-container {
    max-width: 100%;
}

.app-navbar {
    min-height: 72px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.app-main {
    flex: 1 0 auto;
    padding-top: 0.85rem;
}

.app-main-container {
    overflow-x: hidden;
}

.app-footer {
    flex-shrink: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.86rem;
}

.app-footer-inner {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    flex-wrap: wrap;
}

.fo-page-root,
.fo-normal-grid,
.fo-video-card,
.fo-video-card-link,
.fo-search-card,
.card,
.row {
    max-width: 100%;
}

.form-control,
.form-select,
.input-group,
.btn,
.pagination {
    max-width: 100%;
}

.fo-video-thumb-wrapper,
.fo-video-thumb-wrapper > img {
    max-width: 100%;
}

.pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
}

    .pagination .page-link {
        min-width: 2.4rem;
        text-align: center;
        border-radius: 0.35rem;
    }

@media (max-width: 1199.98px) {
    .app-header-container {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .app-navbar-toggler {
        flex: 0 0 auto;
        width: 50px;
        height: 50px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.35rem;
        margin: 0;
        border-radius: 0.7rem;
    }

    .app-brand {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 62px);
        margin-right: 0;
        gap: 0.65rem !important;
    }

    .app-brand-mark {
        width: 54px;
        height: 54px;
    }

    .app-brand-text-wrap {
        min-width: 0;
        max-width: 100%;
    }

    .app-brand-title,
    .app-brand-subtitle {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .app-navbar .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .app-header-container,
    .app-main-container,
    .app-footer-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .app-navbar {
        min-height: 66px;
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }

    .app-brand-mark {
        display: none;
    }

    .app-brand {
        max-width: calc(100% - 62px);
        align-items: center !important;
    }

    .app-brand-title {
        font-size: 0.86rem;
        line-height: 1.08;
        letter-spacing: 0.045em;
        white-space: normal;
    }

    .app-brand-subtitle {
        font-size: 0.78rem;
        line-height: 1.15;
        letter-spacing: 0.015em;
        margin-top: 2px;
    }

    .app-navbar-toggler {
        width: 46px;
        height: 46px;
        border-radius: 0.65rem;
    }

    .app-navbar .navbar-collapse {
        margin-top: 0.65rem;
        padding-top: 0.65rem;
    }

    .app-header-search .form-control {
        min-width: 0;
    }

    .app-main {
        padding-top: 0.45rem;
    }

    .app-main-container {
        padding-top: 0.75rem !important;
        padding-bottom: 1rem !important;
    }

    .fo-page-root > .d-flex:first-child {
        margin-bottom: 1rem !important;
    }

    .fo-view-mode-wrap {
        width: 100%;
        justify-content: flex-start;
        gap: 0.55rem;
        margin-top: 0.65rem;
    }

    .fo-view-mode-select {
        min-width: 0;
        max-width: 100%;
        width: min(220px, 100%);
    }

    .fo-normal-grid {
        --bs-gutter-x: 0;
        --bs-gutter-y: 1rem;
        margin-left: 0;
        margin-right: 0;
    }

        .fo-normal-grid > [class*="col-"] {
            padding-left: 0;
            padding-right: 0;
        }

    .fo-video-card .card-body {
        padding-left: 0.95rem;
        padding-right: 0.95rem;
    }

    .fo-video-card .card-title {
        min-height: 0;
        font-size: 1.05rem;
    }

    .fo-video-card .small.text-muted.d-flex {
        gap: 0.5rem;
        align-items: flex-start !important;
    }

    .pagination {
        justify-content: center;
        overflow-x: visible;
    }

        .pagination .page-link {
            min-width: 2.25rem;
            padding: 0.45rem 0.65rem;
        }

    .app-footer-inner {
        min-height: 58px;
        flex-direction: column;
        gap: 0.15rem;
        padding: 0.65rem 0;
    }

    .app-footer-separator {
        display: none;
    }
}

/* ==========================================
   HOTFIX MOBILE 2026-04-25
   Header consistente + prevenção de overflow lateral
   ========================================== */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

body {
    position: relative;
}

.app-header,
.app-navbar,
.app-header-container,
.app-main,
.app-main-container,
.app-footer,
.app-footer-container,
.fo-page-root,
.backoffice-card,
.videos-search-card,
.table-responsive {
    max-width: 100% !important;
}

.app-header,
.app-navbar,
.app-header-container {
    overflow-x: hidden !important;
}

.row {
    max-width: 100%;
}

img,
video,
table,
.card,
.fo-video-card,
.video-list-card,
.form-control,
.form-select,
.input-group,
.btn,
.pagination {
    max-width: 100%;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fo-pagination-nav {
    max-width: 100%;
    overflow-x: hidden;
}

.fo-pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

    .fo-pagination .page-link {
        min-width: 2.35rem;
        text-align: center;
        border-radius: 0.35rem;
    }

@media (max-width: 991.98px) {
    .app-header-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: 100%;
        max-width: 100vw !important;
        display: flex;
        align-items: center;
        gap: 0.65rem;
        flex-wrap: wrap;
    }

    .app-navbar {
        min-height: 0 !important;
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }

    .app-navbar-toggler {
        order: 1;
        width: 46px;
        height: 46px;
        flex: 0 0 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
        padding: 0.35rem !important;
        border-radius: 0.65rem;
    }

    .app-brand {
        order: 2;
        flex: 1 1 0;
        min-width: 0 !important;
        max-width: calc(100% - 56px) !important;
        margin: 0 !important;
        gap: 0 !important;
    }

    .app-brand-mark,
    .app-brand-logo {
        display: none !important;
    }

    .app-brand-text-wrap {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .app-brand-title {
        display: block;
        max-width: 100%;
        font-size: clamp(0.82rem, 3.6vw, 1.02rem) !important;
        line-height: 1.08 !important;
        letter-spacing: 0.035em !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .app-brand-subtitle {
        display: block;
        max-width: 100%;
        font-size: clamp(0.78rem, 3.3vw, 0.96rem) !important;
        line-height: 1.12 !important;
        margin-top: 2px !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .app-navbar .navbar-collapse {
        order: 3;
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
        margin-top: 0.55rem !important;
        padding-top: 0.55rem !important;
        overflow-x: hidden;
    }

    .app-header-search {
        max-width: 100% !important;
    }

    .app-main {
        padding-top: 0.35rem !important;
    }

    .app-main-container,
    main > .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-top: 0.7rem !important;
        max-width: 100vw !important;
        overflow-x: hidden;
    }
}

@media (max-width: 767.98px) {
    .fo-page-root > .d-flex:first-child {
        margin-bottom: 0.9rem !important;
    }

    .fo-view-mode-wrap {
        width: 100% !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
        margin-top: 0.55rem !important;
    }

    .fo-view-mode-select {
        width: min(220px, 100%) !important;
        min-width: 0 !important;
    }

    .fo-normal-grid {
        --bs-gutter-x: 0;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

        .fo-normal-grid > [class*="col-"] {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }

    .fo-video-card .card-body {
        padding-left: 0.95rem;
        padding-right: 0.95rem;
    }

    .fo-video-card .small.text-muted.d-flex {
        gap: 0.5rem;
        align-items: flex-start !important;
    }

    .fo-pagination .page-link {
        min-width: 2.15rem;
        padding: 0.42rem 0.58rem;
    }
}

/* ==========================================
   MOBILE - compactar cards da homepage / pesquisa / guardados
   Reduz espaço entre canal/programa e data/hora/duração.
   Deve ficar no fim do ficheiro para ganhar aos estilos anteriores.
   ========================================== */
/* MOBILE - alinhar data/hora + duração + botão na mesma linha */
@media (max-width: 767.98px) {

    .fo-video-card .card-body.pt-0 .small.text-muted.d-flex {
        display: flex !important;
        justify-content: space-between;
        align-items: center !important;
        gap: 0.5rem;
        flex-wrap: nowrap !important;
    }

        .fo-video-card .card-body.pt-0 .small.text-muted.d-flex > div {
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }

        .fo-video-card .card-body.pt-0 .small.text-muted.d-flex .fo-video-save-btn {
            margin-left: 0.4rem;
        }

    /* evita quebra da duração */
    .fo-video-card .card-body.pt-0 .small.text-muted {
        white-space: nowrap;
    }

    /* canal/programa */
    .fo-video-card .card-body.d-flex.flex-column .text-muted.mb-2 {
        margin-bottom: 0 !important;
    }

    /* bloco de baixo (data/hora) */
    .fo-video-card > .card-body.pt-0 {
        padding-top: 0 !important;
        margin-top: -1.25rem !important; /* 👈 ESTE É O SEGREDO */
    }
}

/* ==========================================
   FIX FINAL MOBILE HEADER / MENU PERFIL
   2026-04-26
   Repõe símbolo PR no mobile, header fixo e menu de perfil.
   Mantém as linhas do menu mobile clicáveis em toda a largura.
   ========================================== */

.app-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 10000 !important;
    overflow: visible !important;
}

    .app-navbar,
    .app-header-container,
    .app-navbar .navbar-collapse,
    .app-navbar .navbar-nav,
    .app-navbar .d-flex,
    .app-header .dropdown {
        overflow: visible !important;
    }

.app-main {
    padding-top: 88px !important;
}

.app-header .dropdown {
    position: relative !important;
}

.app-header .dropdown-menu,
.app-header .dropdown-menu.app-user-menu,
.app-user-menu,
.dropdown-menu.app-user-menu {
    z-index: 10050 !important;
}

@media (min-width: 992px) {
    .app-header .dropdown-menu.app-user-menu,
    .app-header .dropdown-menu.app-user-menu[data-bs-popper],
    .app-user-menu,
    .app-user-menu[data-bs-popper] {
        position: absolute !important;
        top: calc(100% + 0.55rem) !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
        margin-top: 0 !important;
        min-width: 220px !important;
        max-width: min(320px, calc(100vw - 24px)) !important;
    }
}

@media (max-width: 991.98px) {
    .app-main {
        padding-top: 84px !important;
    }

    .app-header-container {
        display: flex !important;
        align-items: center !important;
        gap: 0.55rem !important;
        flex-wrap: wrap !important;
        overflow: visible !important;
    }

    .app-navbar-toggler {
        order: 1 !important;
        width: 44px !important;
        height: 44px !important;
        flex: 0 0 44px !important;
        margin: 0 !important;
        padding: 0.32rem !important;
        border-radius: 0.65rem !important;
    }

    .app-brand {
        order: 2 !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: calc(100% - 54px) !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        margin: 0 !important;
    }

    .app-brand-mark {
        display: inline-flex !important;
        width: 34px !important;
        height: 34px !important;
        flex: 0 0 34px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .app-brand-logo {
        display: block !important;
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
        object-fit: contain !important;
    }

    .app-brand-text-wrap {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding-top: 3px !important;
        overflow: visible !important;
    }

    .app-brand-title {
        font-size: clamp(0.78rem, 3.35vw, 0.98rem) !important;
        line-height: 1.20 !important;
        letter-spacing: 0.032em !important;
        white-space: normal !important;
        overflow: visible !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }

    .app-brand-subtitle {
        font-size: clamp(0.72rem, 3.05vw, 0.9rem) !important;
        line-height: 1.10 !important;
        margin-top: 2px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .app-navbar .navbar-collapse {
        order: 3 !important;
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 0.45rem !important;
        padding-top: 0.5rem !important;
        border-top: 1px solid rgba(255,255,255,0.08) !important;
        overflow: visible !important;
    }

    .app-navbar .navbar-nav {
        width: 100% !important;
        gap: 0.25rem !important;
    }

    .app-navbar .nav-item {
        width: 100% !important;
    }

    .app-navbar .nav-link {
        display: flex !important;
        width: 100% !important;
        padding: 0.55rem 0.65rem !important;
        border-radius: 0.55rem !important;
        align-items: center !important;
    }

        .app-navbar .nav-link.active::after {
            left: 0.65rem !important;
            right: auto !important;
            bottom: 0.2rem !important;
            width: 42px !important;
        }

    .app-header-search {
        width: 100% !important;
        max-width: 100% !important;
    }

    .app-user-dropdown {
        width: auto !important;
        max-width: 100% !important;
        min-height: 40px !important;
        padding: 0.25rem 0.55rem 0.25rem 0.25rem !important;
    }

    .app-user-avatar {
        width: 30px !important;
        height: 30px !important;
        flex-basis: 30px !important;
    }

    .app-header .dropdown {
        width: fit-content !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .app-header .dropdown-menu.app-user-menu,
    .app-header .dropdown-menu.app-user-menu[data-bs-popper],
    .app-user-menu,
    .app-user-menu[data-bs-popper] {
        position: static !important;
        float: none !important;
        transform: none !important;
        width: min(260px, 100%) !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin-top: 0.45rem !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18) !important;
    }

    .app-main-container,
    main > .container-fluid {
        padding-top: 0.45rem !important;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding-top: 64px !important;
    }

    .app-brand-mark {
        width: 30px !important;
        height: 30px !important;
        flex-basis: 30px !important;
    }

    .app-brand-logo {
        width: 30px !important;
        height: 30px !important;
        max-width: 30px !important;
        max-height: 30px !important;
    }

    .app-brand-title {
        font-size: 0.76rem !important;
        line-height: 1.20 !important;
        letter-spacing: 0.02em !important;
    }

    .app-brand-subtitle {
        font-size: 0.70rem !important;
    }
}



/* ==========================================
   DETALHE VÍDEO - MOBILE / AJUSTE FINAL
   Corrige laterais e simplifica botões
   ========================================== */

.fo-detail-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.fo-detail-layout {
    max-width: 100%;
}

    .fo-detail-layout > [class*="col-"] {
        min-width: 0;
    }

.fo-detail-card video {
    display: block;
    width: 100%;
    max-width: 100%;
}

.fo-transcricao-box {
    max-width: 100%;
    overflow-x: hidden;
    word-break: normal;
    overflow-wrap: anywhere;
}

/* Botões de ação em modo ícone */
.fo-detail-page .fo-action-btn,
.fo-transcricao-card .fo-action-btn {
    min-width: 42px;
    height: 40px;
    justify-content: center;
}

@media (max-width: 991.98px) {

    .fo-detail-page {
        width: 100%;
        max-width: 100vw;
        padding: 0;
        margin: 0;
    }

    .fo-detail-layout {
        --bs-gutter-x: 0;
        --bs-gutter-y: 1.25rem;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
        max-width: 100%;
    }

        .fo-detail-layout > [class*="col-"] {
            padding-left: 0 !important;
            padding-right: 0 !important;
            width: 100%;
            max-width: 100%;
        }

    .fo-detail-card,
    .fo-transcricao-card {
        width: 100%;
        max-width: 100%;
        border-radius: 12px;
    }

        .fo-detail-card .card-body,
        .fo-transcricao-card .card-body {
            padding: 1rem;
        }

    .fo-detail-title {
        font-size: 1.35rem;
        line-height: 1.22;
        margin-top: 1.25rem !important;
        margin-bottom: 0.85rem !important;
    }

    .fo-detail-meta-row {
        gap: 0.9rem;
    }

    .fo-detail-meta {
        font-size: 0.95rem;
        line-height: 1.45;
    }

    .fo-detail-actions {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .fo-detail-page .fo-action-btn,
    .fo-transcricao-card .fo-action-btn {
        width: 42px;
        height: 40px;
        padding: 0;
        border-radius: 0.35rem;
        gap: 0;
    }

        .fo-detail-page .fo-action-btn span,
        .fo-transcricao-card .fo-action-btn span {
            display: none !important;
        }

        .fo-detail-page .fo-action-btn i,
        .fo-transcricao-card .fo-action-btn i {
            font-size: 1rem;
            margin: 0;
        }

    .fo-transcricao-header {
        flex-wrap: nowrap;
        align-items: center;
    }

        .fo-transcricao-header h2 {
            font-size: 1.15rem;
            line-height: 1.2;
        }

    .fo-transcricao-box {
        min-height: 320px;
        max-height: 360px;
        height: 360px;
        font-size: 0.93rem;
        line-height: 1.55;
    }
}

@media (max-width: 480px) {

    .fo-detail-card .card-body,
    .fo-transcricao-card .card-body {
        padding: 0.9rem;
    }

    .fo-detail-title {
        font-size: 1.28rem;
    }

    .fo-detail-meta {
        font-size: 0.92rem;
    }

    .fo-detail-page .fo-action-btn,
    .fo-transcricao-card .fo-action-btn {
        width: 40px;
        height: 38px;
    }
}


/* Detalhe vídeo - canal/programa numa linha e data/hora/duração noutra */
.fo-detail-meta-main {
    line-height: 1.35;
}

.fo-detail-meta-secondary {
    margin-top: 0.2rem;
    color: #6c757d;
    line-height: 1.35;
}

@media (max-width: 767.98px) {
    .fo-detail-meta-main {
        font-size: 0.98rem;
    }

    .fo-detail-meta-secondary {
        font-size: 0.92rem;
        margin-top: 0.25rem;
    }
}



/* ==========================================
   Espaço superior dos títulos das páginas
   ========================================== */

.app-main-container,
main > .container-fluid {
    padding-top: 1.2rem !important;
}

@media (max-width: 991.98px) {
    .app-main-container,
    main > .container-fluid {
        padding-top: 1rem !important;
    }
}

@media (max-width: 480px) {
    .app-main-container,
    main > .container-fluid {
        padding-top: 0.9rem !important;
    }
}


/* ==========================================
   ADMIN / UTILIZADORES - MOBILE
   Converte tabela em cards no telemóvel
   ========================================== */

.users-admin-table {
    width: 100%;
}

    .users-admin-table th,
    .users-admin-table td {
        vertical-align: middle;
    }

.users-admin-email {
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {

    .users-admin-table {
        border-collapse: separate;
        border-spacing: 0;
    }

        .users-admin-table thead {
            display: none;
        }

        .users-admin-table,
        .users-admin-table tbody,
        .users-admin-table tr,
        .users-admin-table td {
            display: block;
            width: 100%;
        }

            .users-admin-table tbody tr {
                background: #ffffff;
                border: 1px solid #e5e7eb;
                border-radius: 0.95rem;
                box-shadow: 0 0.25rem 0.8rem rgba(15, 23, 42, 0.04);
                padding: 0.85rem 0.9rem;
                margin-bottom: 0.9rem;
            }

                .users-admin-table tbody tr:last-child {
                    margin-bottom: 0;
                }

            .users-admin-table tbody td {
                border: 0 !important;
                padding: 0.25rem 0 !important;
                display: grid;
                grid-template-columns: 88px minmax(0, 1fr);
                gap: 0.75rem;
                align-items: start;
                font-size: 0.95rem;
                line-height: 1.35;
            }

                .users-admin-table tbody td::before {
                    content: attr(data-label);
                    color: #64748b;
                    font-size: 0.78rem;
                    font-weight: 700;
                    text-transform: uppercase;
                    letter-spacing: 0.04em;
                    padding-top: 0.08rem;
                }

    .users-admin-username {
        font-weight: 700;
        color: #111827;
        font-size: 1rem !important;
    }

    .users-admin-name,
    .users-admin-email {
        color: #1f2937;
    }

    .users-admin-email {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .users-admin-roles .badge,
    .users-admin-active .badge {
        width: fit-content;
        max-width: 100%;
    }

    .users-admin-actions {
        margin-top: 0.45rem;
        padding-top: 0.75rem !important;
        border-top: 1px solid #eef2f7 !important;
        display: block !important;
        text-align: left !important;
    }

        .users-admin-actions::before {
            display: none !important;
        }

        .users-admin-actions > div {
            display: flex !important;
            justify-content: flex-start !important;
            flex-wrap: nowrap !important;
            gap: 0.55rem !important;
        }

        .users-admin-actions .btn-action-icon {
            width: 42px;
            height: 40px;
            border-radius: 0.55rem;
        }

            .users-admin-actions .btn-action-icon i {
                font-size: 1rem;
            }

    .card .table-responsive:has(.users-admin-table) {
        overflow-x: visible !important;
    }
}

@media (max-width: 480px) {

    .users-admin-table tbody tr {
        padding: 0.8rem;
        border-radius: 0.85rem;
    }

    .users-admin-table tbody td {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 0.6rem;
        font-size: 0.92rem;
    }

        .users-admin-table tbody td::before {
            font-size: 0.74rem;
        }
}

/* ==========================================
   LOGS - largura máxima em desktop
   ========================================== */

.logs-page {
    max-width: 1500px;
    margin: 0 auto;
}


/* ==========================================
   LOGS / AUDITORIA - tabela e antes/depois
   ========================================== */

.logs-audit-table {
    width: 100%;
    table-layout: fixed;
}

    .logs-audit-table th,
    .logs-audit-table td {
        vertical-align: top;
    }

        .logs-audit-table th:nth-child(1),
        .logs-audit-table td:nth-child(1) {
            width: 115px;
        }

        .logs-audit-table th:nth-child(2),
        .logs-audit-table td:nth-child(2) {
            width: 125px;
        }

        .logs-audit-table th:nth-child(3),
        .logs-audit-table td:nth-child(3) {
            width: 280px;
        }

        .logs-audit-table th:nth-child(4),
        .logs-audit-table td:nth-child(4) {
            width: 120px;
        }

        .logs-audit-table th:nth-child(5),
        .logs-audit-table td:nth-child(5) {
            width: 90px;
        }

        .logs-audit-table th:nth-child(6),
        .logs-audit-table td:nth-child(6) {
            width: auto;
        }

    .logs-audit-table td {
        overflow-wrap: anywhere;
    }

.audit-details {
    max-width: 100%;
}

    .audit-details summary {
        cursor: pointer;
        color: #64748b;
        font-size: 0.88rem;
        user-select: none;
    }

        .audit-details summary:hover {
            color: #1f3a8a;
        }

.audit-json-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    max-width: 100%;
}

.audit-json-block {
    max-width: 100%;
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    background: #f8fafc;
    overflow: hidden;
}

.audit-json-title {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    background: #eef2f7;
    border-bottom: 1px solid #e5e7eb;
}

.audit-json-block pre {
    margin: 0;
    padding: 0.65rem;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 0.78rem;
    line-height: 1.45;
    background: transparent;
}

/* Em ecrãs médios/pequenos, a tabela pode rolar horizontalmente sem esmagar colunas */
@media (max-width: 1199.98px) {
    .logs-audit-table {
        min-width: 1050px;
    }

    .table-responsive:has(.logs-audit-table) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}


/* ==========================================
   PÁGINAS DE CORTESIA / ERRO
   ========================================== */

.courtesy-page {
    min-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
}

.courtesy-card {
    width: 100%;
    max-width: 620px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1.4rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
    padding: 2.4rem 2.2rem;
    text-align: center;
}

.courtesy-symbol {
    margin-bottom: 1rem;
}

    .courtesy-symbol img {
        width: 58px;
        height: auto;
        opacity: 0.92;
    }

.courtesy-error-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: .3rem .75rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.courtesy-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1.1rem auto;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.courtesy-icon-info {
    background: #eaf2ff;
    color: #0d6efd;
}

.courtesy-icon-warning {
    background: #fff8e6;
    color: #9a6a00;
}

.courtesy-icon-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.courtesy-card h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .75rem;
}

.courtesy-message {
    max-width: 500px;
    margin: 0 auto 1.4rem auto;
    color: #475569;
    font-size: 1rem;
    line-height: 1.55;
}

.courtesy-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.courtesy-reference {
    margin-top: .5rem;
    margin-bottom: 1rem;
    color: #64748b;
    font-size: .82rem;
}

    .courtesy-reference code {
        color: #334155;
    }

.courtesy-help {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    color: #64748b;
    font-size: .88rem;
}

@media (max-width: 575.98px) {
    .courtesy-page {
        padding: 1.4rem .75rem;
        align-items: flex-start;
    }

    .courtesy-card {
        padding: 1.6rem 1.2rem;
        border-radius: 1rem;
    }

        .courtesy-card h1 {
            font-size: 1.25rem;
        }

    .courtesy-actions {
        flex-direction: column;
    }

        .courtesy-actions .btn {
            width: 100%;
        }
}
/* Homepage: filtro simples Vídeos PR / Outros */
.fo-index-controls {
    justify-content: flex-end;
}

.fo-video-type-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fo-type-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.45rem 0.9rem;
    border: 1px solid #d8dee9;
    border-radius: 0;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.fo-type-filter-btn:hover,
.fo-type-filter-btn:focus {
    border-color: #d49a00;
    color: #1f2937;
    background: #fff8e6;
    text-decoration: none;
    box-shadow: 0 0 0 0.15rem rgba(211, 151, 0, 0.14);
}

.fo-type-filter-btn.is-active {
    border-color: #d49a00;
    background: #fff3cd;
    color: #8a5a00;
    font-weight: 600;
}


@media (max-width: 575.98px) {
    .fo-index-controls {
        width: 100%;
        align-items: stretch !important;
    }

    .fo-video-type-filter {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 0.4rem;
    }

    .fo-type-filter-btn {
        width: 100%;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
        font-size: 0.86rem;
    }

    .fo-index-controls .fo-view-mode-wrap {
        width: 100%;
        justify-content: space-between;
    }
}

/* Correção: badge DIRETO sempre no canto superior direito da thumbnail,
   sem interferir com a duração no canto superior esquerdo. */
.fo-video-thumb-wrapper .fo-video-live-badge {
    left: auto !important;
    right: 8px !important;
    inset-inline-start: auto !important;
    inset-inline-end: 8px !important;
    top: 8px !important;
    z-index: 7;
}

.fo-condensed-thumb-wrap .fo-condensed-live-badge {
    left: auto !important;
    right: 6px !important;
    inset-inline-start: auto !important;
    inset-inline-end: 6px !important;
    top: 6px !important;
    z-index: 7;
}

@media (max-width: 575.98px) {
    .fo-video-thumb-wrapper .fo-video-live-badge {
        right: 6px !important;
        inset-inline-end: 6px !important;
        top: 6px !important;
        font-size: 0.62rem;
        padding: 3px 6px;
    }
}

/* Badge DIRETO no detalhe do vídeo, junto ao programa. */
.fo-detail-live-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.45rem;
    padding: 0.18rem 0.45rem;
    border-radius: 0.2rem;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    vertical-align: middle;
}

@media (max-width: 575.98px) {
    .fo-detail-live-badge {
        margin-left: 0.35rem;
        padding: 0.16rem 0.4rem;
        font-size: 0.66rem;
    }
}

/* Local / contexto separado do título, inline com sublinhado institucional. */
.fo-video-title-with-local {
    line-height: 1.25;
}

.fo-local-contexto-prefix {
    display: inline;
    color: inherit;
    font-size: inherit;
    font-weight: 700;
    text-decoration-line: underline;
    text-decoration-color: #B91C1C;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}


/* Compatibilidade para usos pontuais antigos desta classe, como modal de sucesso do upload. */
.fo-local-contexto-badge {
    display: inline;
    color: inherit;
    font-size: inherit;
    font-weight: 700;
    text-decoration-line: underline;
    text-decoration-color: #B91C1C;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.fo-local-contexto-prefix-detail {
    font-size: inherit;
}

.fo-local-contexto-separator {
    color: inherit;
    font-weight: 600;
}

.fo-condensed-title-line .fo-local-contexto-prefix,
.fo-search-title .fo-local-contexto-prefix {
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

@media (max-width: 575.98px) {
    .fo-local-contexto-prefix {
        text-decoration-thickness: 2px;
        text-underline-offset: 2px;
    }
}

