/* Styles partagés pour /videos/ : login, player, admin */

.videos-page {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 4rem;
    background: linear-gradient(180deg, var(--light-gray) 0%, var(--white) 100%);
}

.videos-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.videos-container.narrow {
    max-width: 500px;
}

.videos-container.wide {
    max-width: none;
}

.videos-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.videos-header h1 {
    font-size: 2.5rem;
    color: var(--black);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.videos-header p {
    color: var(--dark-gray);
    font-size: 1.1rem;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* --- Forms --- */

.field {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--black);
}

.field input,
.field select {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    background: var(--white);
    color: var(--black);
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--primary-yellow);
}

.btn-submit {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--black);
    color: var(--primary-yellow);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-inline {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    margin-right: 0.25rem;
}

.btn-inline.warn {
    background: #fef3c7;
    color: #92400e;
}

.btn-inline.danger {
    background: #fee2e2;
    color: #991b1b;
}

.btn-inline.primary {
    background: var(--primary-yellow);
    color: var(--black);
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* --- Video player --- */

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-meta {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(252, 211, 77, 0.1);
    border-radius: 10px;
    color: var(--dark-gray);
    font-size: 0.95rem;
}

/* --- Admin tables --- */

.section-block {
    margin-bottom: 3rem;
}

.section-block h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--black);
}

.data-table {
    width: 100%;
    background: var(--white);
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.data-table th,
.data-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
    font-size: 0.95rem;
}

.data-table th {
    background: #f8f8f8;
    font-weight: 700;
    color: var(--black);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.role-admin {
    background: var(--primary-yellow);
    color: var(--black);
}

.badge.role-user {
    background: #e5e7eb;
    color: #374151;
}

.badge.status-active {
    background: #d1fae5;
    color: #065f46;
}

.badge.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Tabs --- */

.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--light-gray);
    overflow-x: auto;
    overflow-y: hidden;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-gray);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.tab-button:hover {
    color: var(--black);
}

.tab-button.is-active {
    color: var(--black);
    border-bottom-color: var(--primary-yellow);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.tab-pane.is-visible {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Stat cards (tableau de bord admin) --- */

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--white);
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-yellow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.admin-stat-card.accent-blue   { border-left-color: #3b82f6; }
.admin-stat-card.accent-green  { border-left-color: #10b981; }
.admin-stat-card.accent-purple { border-left-color: #8b5cf6; }

.admin-stat-icon {
    font-size: 1.6rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(252, 211, 77, 0.18);
    border-radius: 12px;
    flex-shrink: 0;
}

.accent-blue   .admin-stat-icon { background: rgba(59, 130, 246, 0.15); }
.accent-green  .admin-stat-icon { background: rgba(16, 185, 129, 0.15); }
.accent-purple .admin-stat-icon { background: rgba(139, 92, 246, 0.15); }

.admin-stat-num {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--black);
    line-height: 1;
}

.admin-stat-label {
    color: var(--dark-gray);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* --- Dashboard 2-col layout --- */

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

.dashboard-card {
    background: var(--white);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.dashboard-card h3 {
    font-size: 1.05rem;
    color: var(--black);
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-card h3 a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark-yellow, #b58300);
    text-decoration: none;
}

.dashboard-card h3 a:hover { text-decoration: underline; }

/* --- Top videos list --- */

.top-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.top-list li:last-child { border-bottom: none; }

.top-rank {
    width: 26px;
    height: 26px;
    background: var(--primary-yellow);
    color: var(--black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.top-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-views { color: var(--dark-gray); font-size: 0.85rem; font-weight: 600; }

/* --- Compact recent activity --- */

.activity-compact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-compact li {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--light-gray);
    font-size: 0.88rem;
}

.activity-compact li:last-child { border-bottom: none; }

.activity-compact .a-line { display: flex; gap: 0.5rem; align-items: center; }
.activity-compact .a-event {
    background: rgba(252, 211, 77, 0.2);
    color: var(--black);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.activity-compact .a-time { color: #999; font-size: 0.75rem; margin-top: 0.15rem; }

/* --- Toolbar (search + actions au-dessus d'une table) --- */

.toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.toolbar input[type="search"] {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background: var(--white);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.toolbar input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.18);
}

.empty-search {
    padding: 1.5rem;
    text-align: center;
    color: var(--dark-gray);
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-style: italic;
}

/* --- Compact "Add" : bouton discret + form horizontal --- */

.add-section {
    margin-bottom: 1.5rem;
}

.add-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    background: transparent;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
    font-family: inherit;
}

.add-toggle:hover {
    border-color: var(--primary-yellow);
    color: var(--black);
    background: rgba(252, 211, 77, 0.06);
    transform: translateY(-1px);
}

.add-toggle .plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--primary-yellow);
    color: var(--black);
    border-radius: 50%;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;
}

.add-form-wrapper {
    animation: addExpand 0.2s ease-out;
}

@keyframes addExpand {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.compact-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
    align-items: end;
    padding: 1.1rem 1.25rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--primary-yellow);
}

.compact-form .field {
    margin: 0;
}

.compact-form .field label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dark-gray);
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.compact-form .field input,
.compact-form .field select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--light-gray);
    border-radius: 7px;
    background: var(--white);
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.compact-form .field input:focus,
.compact-form .field select:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.18);
}

.compact-form .field small {
    display: block;
    margin-top: 0.3rem;
    color: #9ca3af;
    font-size: 0.7rem;
}

.compact-form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.btn-add-submit {
    background: var(--black);
    color: var(--primary-yellow);
    padding: 0.55rem 1.25rem;
    font-weight: 700;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.88rem;
    height: 36px;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.btn-add-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-add-cancel {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.btn-add-cancel:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Toasts --- */

.toast-container {
    position: fixed;
    top: 100px;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    color: white;
    background: #1f2937;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    font-size: 0.95rem;
    max-width: 380px;
    animation: toastSlideIn 0.25s ease-out;
}

.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.toast-error   { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-info    { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.toast.is-fading { opacity: 0; transform: translateX(20px); transition: all 0.4s ease-in; }

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* --- Master-detail layout (users tab) --- */

.master-detail {
    display: grid;
    grid-template-columns: minmax(280px, 35%) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.master-pane {
    background: var(--white);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    max-height: 75vh;
    overflow-y: auto;
}

.master-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.master-row {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
    transition: background 0.12s, border-color 0.12s;
    margin-bottom: 0.15rem;
}

.master-row:hover {
    background: rgba(252, 211, 77, 0.08);
}

.master-row.is-selected {
    background: rgba(252, 211, 77, 0.18);
    border-left-color: var(--primary-yellow);
}

.master-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.master-row-email {
    font-weight: 600;
    color: var(--black);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.master-row-meta {
    color: var(--dark-gray);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.master-row-meta .dot { color: #ccc; }

/* --- Detail pane --- */

.detail-pane {
    background: var(--white);
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    min-height: 400px;
}

.detail-empty {
    color: var(--dark-gray);
    text-align: center;
    padding: 4rem 1rem;
    font-style: italic;
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.detail-identity h2 {
    font-size: 1.4rem;
    margin: 0 0 0.25rem;
    color: var(--black);
    word-break: break-all;
}

.detail-identity .name {
    color: var(--dark-gray);
    font-size: 0.95rem;
}

.detail-badges {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    margin: 1.25rem 0;
}

.detail-meta-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.detail-meta-label {
    color: var(--dark-gray);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.detail-meta-value {
    color: var(--black);
    font-size: 0.95rem;
    font-weight: 600;
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
    flex-wrap: wrap;
}

.detail-actions .btn-inline {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
}

.detail-section {
    margin-top: 2rem;
}

.detail-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--light-gray);
}

@media (max-width: 880px) {
    .master-detail {
        grid-template-columns: 1fr;
    }
    .master-pane {
        max-height: none;
    }
}

/* --- Manage access panel + access list (admin) --- */

.manage-panel {
    border: 2px solid var(--primary-yellow);
    border-radius: 12px;
    padding: 1.5rem;
    background: rgba(252, 211, 77, 0.06);
}

.manage-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
}

.manage-banner-email {
    color: var(--black);
    font-size: 1.1rem;
    margin-left: 0.25rem;
}

.manage-banner-name {
    color: var(--dark-gray);
    margin-left: 0.5rem;
    font-style: italic;
}

.access-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.access-item {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.access-item:hover {
    border-color: var(--primary-yellow);
}

.access-item.is-saving {
    opacity: 0.6;
}

.access-item label {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

.access-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 2px 0 0 0;
    cursor: pointer;
    flex-shrink: 0;
}

.access-meta {
    flex: 1;
    line-height: 1.4;
}

.access-meta strong {
    color: var(--black);
    font-size: 1rem;
}

.row-highlight {
    background: rgba(252, 211, 77, 0.12);
}

/* --- Pagination --- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 0.75rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--black);
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.pagination-btn:hover {
    background: var(--primary-yellow);
    border-color: var(--primary-yellow);
}

.pagination-btn[aria-disabled="true"] {
    color: #bbb;
    background: #f5f5f5;
    pointer-events: none;
    cursor: default;
}

.pagination-info {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* --- Master-detail layout (page Demo) --- */

.video-master-detail {
    display: grid;
    grid-template-columns: minmax(280px, 32%) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.video-master {
    background: var(--white);
    border-radius: 12px;
    padding: 0.85rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    max-height: 80vh;
    overflow-y: auto;
}

.video-master .gallery-title {
    font-size: 0.95rem;
    color: var(--dark-gray);
    margin: 0 0 0.85rem;
    padding: 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.video-master-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.video-thumb-row {
    display: flex;
    gap: 0.85rem;
    padding: 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
    transition: background 0.12s, border-color 0.12s;
    margin-bottom: 0.3rem;
}

.video-thumb-row:hover {
    background: rgba(252, 211, 77, 0.08);
}

.video-thumb-row.is-current {
    background: rgba(252, 211, 77, 0.18);
    border-left-color: var(--primary-yellow);
}

.thumb-mini {
    width: 140px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    background: #1a1a1a;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

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

.thumb-mini .placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.5rem;
}

.thumb-mini .now-playing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(252, 211, 77, 0.85);
    color: var(--black);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-info {
    flex: 1;
    min-width: 0;
}

.thumb-info h3 {
    margin: 0 0 0.2rem;
    font-size: 0.92rem;
    color: var(--black);
    line-height: 1.3;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thumb-info p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--dark-gray);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-detail {
    min-width: 0;  /* prevent grid overflow with iframe */
}

@media (max-width: 880px) {
    .video-master-detail {
        grid-template-columns: 1fr;
    }
    .video-master {
        max-height: none;
        order: 2;  /* player en haut, liste en bas sur mobile */
    }
}

/* --- Galerie de vignettes (page Demo, ancienne grille — gardée pour compat) --- */

.video-gallery {
    margin-top: 3rem;
}

.video-gallery .gallery-title {
    font-size: 1.5rem;
    color: var(--black);
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.thumb-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 3px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.thumb-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-yellow);
}

.thumb-card.is-current {
    border-color: var(--primary-yellow);
    box-shadow: 0 8px 28px rgba(252, 211, 77, 0.35);
}

.thumb-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #1a1a1a;
    overflow: hidden;
}

.thumb-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.5);
}

.thumb-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--primary-yellow);
    color: var(--black);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.thumb-meta {
    padding: 0.85rem 1rem 1rem;
}

.thumb-meta h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--black);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.thumb-meta p {
    font-size: 0.85rem;
    color: var(--dark-gray);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .videos-container {
        padding: 1rem;
    }
    .videos-header h1 {
        font-size: 1.75rem;
    }
    .data-table {
        font-size: 0.85rem;
    }
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.6rem;
    }
    .thumb-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
}

/* ============================================================== */
/* User pill — compte connecté en haut à droite de la section     */
/* ============================================================== */
.user-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem 0.55rem 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    /* Pousse l'élément vers la droite dans son conteneur block */
    margin: 0 0 1.25rem auto;
    width: fit-content;
    max-width: 100%;
}
.user-pill-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FACC15 0%, #EAB308 100%);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
    text-transform: uppercase;
}
.user-pill-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}
.user-pill-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.user-pill-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--dark-gray, #6b7280);
    margin-top: 0.1rem;
}
.user-pill-meta .badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
}
.user-pill-dot {
    color: #d1d5db;
}
.user-pill-domain {
    white-space: nowrap;
}
.user-pill-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    margin-left: 0.25rem;
    border-radius: 999px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background 120ms ease, color 120ms ease;
}
.user-pill-logout:hover {
    background: #fef3c7;
    color: #b45309;
}
.user-pill-logout-icon {
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 600px) {
    .user-pill {
        width: 100%;
        border-radius: 12px;
        gap: 0.6rem;
    }
    .user-pill-name {
        max-width: 140px;
    }
    .user-pill-logout-label {
        display: none;
    }
}

/* ============================================================== */
/* OTP — saisie du code à 6 chiffres                              */
/* ============================================================== */
.otp-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.6rem;
    margin: 0.5rem 0 0.25rem;
}
.otp-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Courier New', monospace;
    color: #111;
    background: #fff;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    padding: 0;
    box-sizing: border-box;
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
    -moz-appearance: textfield;
    appearance: textfield;
}
.otp-cell::-webkit-outer-spin-button,
.otp-cell::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.otp-cell:focus {
    outline: none;
    border-color: #EAB308;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.25);
    transform: translateY(-1px);
}
.otp-cell:disabled {
    background: #f3f4f6;
    color: #9ca3af;
}

.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
}
.btn-link:hover {
    color: #1e40af;
}

@media (max-width: 480px) {
    .otp-grid {
        gap: 0.4rem;
    }
    .otp-cell {
        font-size: 1.4rem;
        border-radius: 8px;
    }
}
