/* ============================================================
   Training Videos - Styles
   ============================================================ */

/* ---- Layout ---- */
.tv-layout-container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.tv-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
}

.tv-sidebar-greeting-banner {
    padding: 10px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tv-sidebar-header {
    padding: 12px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.tv-sidebar-header strong {
    flex: 1;
}

.tv-sidebar-greeting {
    width: 100%;
    font-size: 13px;
    color: #555;
}

.tv-sidebar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.tv-sidebar-controls strong {
    flex: 1;
}

.tv-btn-inline-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #999;
    padding: 0 2px;
}

.tv-btn-inline-edit:hover {
    color: #333;
}

.tv-nickname-cell {
    white-space: nowrap;
}

.tv-nickname-cell.has-nickname .tv-btn-inline-edit {
    visibility: hidden;
}

.tv-nickname-cell.has-nickname:hover .tv-btn-inline-edit {
    visibility: visible;
}

.tv-category-tree {
    padding: 5px 0;
    max-height: 75vh;
    overflow-y: auto;
}

.tv-main-content {
    flex: 1;
    min-width: 0;
}

/* ---- Tree items ---- */
.tv-tree-item {
    user-select: none;
}

.tv-tree-row {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.tv-tree-row:hover {
    background-color: #f5f5f5;
}

.tv-expand-toggle {
    width: 20px;
    text-align: center;
    cursor: pointer;
    font-size: 10px;
    color: #666;
    flex-shrink: 0;
}

.tv-no-toggle {
    width: 20px;
    flex-shrink: 0;
}

.tv-category-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.tv-video-link {
    color: #222;
    font-size: 13px;
    cursor: pointer;
}

.tv-video-link:hover {
    text-decoration: underline;
}

/* Indentation levels */
.tv-level-0 > .tv-tree-row { padding-left: 10px; }
.tv-level-1 > .tv-tree-row { padding-left: 28px; }
.tv-level-2 > .tv-tree-row { padding-left: 46px; }
.tv-level-3 > .tv-tree-row { padding-left: 64px; }
.tv-level-4 > .tv-tree-row { padding-left: 82px; }

/* Rating colors on tree rows */
.tv-rating-1 { background-color: #ffbbbb !important; }
.tv-rating-2 { background-color: #ffffbb !important; }
.tv-rating-3 { background-color: #d5fdd5 !important; }

.tv-rating-1:hover { background-color: #ff9999 !important; }
.tv-rating-2:hover { background-color: #ffff99 !important; }
.tv-rating-3:hover { background-color: #b5f5b5 !important; }

/* Selected video */
.tv-tree-row.tv-selected {
    outline: 2px solid #1a73e8;
    outline-offset: -2px;
}

/* ---- Video Player ---- */
.tv-video-player {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    min-height: 200px;
}

.tv-video-player iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
}

.tv-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    color: #999;
    font-size: 16px;
}

/* ---- Rating Buttons ---- */
.tv-rating-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.tv-conf-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    color: #333;
}

.tv-conf-red { background-color: #ffbbbb; }
.tv-conf-red:hover { background-color: #ff9999; }
.tv-conf-red.active { background-color: #ff6666; color: #fff; box-shadow: 0 4px 8px rgba(255, 102, 102, 0.4); border-bottom: 3px solid #cc3333; }

.tv-conf-yellow { background-color: #ffffbb; }
.tv-conf-yellow:hover { background-color: #ffff77; }
.tv-conf-yellow.active { background-color: #ffcc00; box-shadow: 0 4px 8px rgba(255, 204, 0, 0.4); border-bottom: 3px solid #cc9900; }

.tv-conf-green { background-color: #d5fdd5; }
.tv-conf-green:hover { background-color: #b5f5b5; }
.tv-conf-green.active { background-color: #66cc66; color: #fff; box-shadow: 0 4px 8px rgba(102, 204, 102, 0.4); border-bottom: 3px solid #339933; }

/* ---- Buttons ---- */
.tv-btn {
    display: inline-block;
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.tv-btn-primary { background-color: #1a73e8; color: #fff; }
.tv-btn-primary:hover { background-color: #1557b0; }

.tv-btn-secondary { background-color: #e0e0e0; color: #333; }
.tv-btn-secondary:hover { background-color: #ccc; }

.tv-btn-danger { background-color: #dc3545; color: #fff; }
.tv-btn-danger:hover { background-color: #c82333; }

.tv-btn-danger-outline { background: #fff; color: #dc3545; border: 1px solid #dc3545; }
.tv-btn-danger-outline:hover { background: #fdf0f0; color: #c82333; border-color: #c82333; }

.tv-btn-large { padding: 12px 30px; font-size: 16px; }

.tv-btn-small {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.4;
    transition: all 0.15s;
}

.tv-btn-small:hover { background: #f0f0f0; }

.tv-btn-add { color: #28a745; border-color: #28a745; }
.tv-btn-add:hover { background: #e8f5e9; }

.tv-btn-edit { color: #1a73e8; border-color: #1a73e8; }
.tv-btn-edit:hover { background: #e3f2fd; }

.tv-btn-delete { color: #dc3545; border-color: #dc3545; }
.tv-btn-delete:hover { background: #fce4ec; }

/* ---- Page Header ---- */
.tv-admin-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.tv-page-header {
    text-align: center;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tv-page-header h1 {
    margin: 0;
    color: rgb(36, 54, 70);
}

.tv-page-header p {
    margin: 5px 0 0;
    color: #666;
}

.tv-page-header-url {
    color: #888;
    text-decoration: none;
    font-size: 14px;
}

.tv-page-header-url:hover {
    color: #555;
    text-decoration: underline;
}

.tv-page-header-url:visited {
    color: #888;
}

/* ---- Viewer admin badge ---- */
.tv-admin-badge {
    background: #0b1a2b;
    color: #c8daea;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0.02em;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.tv-admin-badge:hover {
    background: #1a3350;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.tv-admin-badge:visited {
    color: #c8daea;
}

/* ---- Shared utility classes ---- */
.tv-mt-sm { margin-top: 5px; }

.tv-section-heading {
    margin: 0 0 10px;
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

.tv-empty-hint {
    color: #888;
    font-size: 13px;
    font-style: italic;
}

.tv-empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #888;
    font-size: 14px;
}

.tv-admin-wrapper,
.tv-layout-container,
.tv-libs-page {
    text-align: left;
}

.tv-empty-state p {
    margin: 4px 0;
}

/* ---- Inline status messages ---- */
.tv-inline-status {
    display: none;
    margin-left: 12px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    vertical-align: middle;
}

.tv-inline-success {
    color: #1b5e20;
    background: #d5fdd5;
}

.tv-inline-error {
    color: #c62828;
    background: #ffcdd2;
}

/* ---- Danger zone (delete library) ---- */
.tv-danger-zone {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tv-btn-text {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
}

.tv-btn-text-danger {
    color: #999;
}

.tv-btn-text-danger:hover {
    color: #dc3545;
}

/* ---- Admin Tabs ---- */
.tv-admin-tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tv-tab {
    padding: 10px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tv-tab:hover { color: #333; }
.tv-tab.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    font-weight: 600;
}

.tv-tab-content { display: none; }
.tv-tab-content.active { display: block; }

.tv-tab-content > * {
    margin-left: auto;
    margin-right: auto;
}

/* ---- Admin Videos Panel ---- */
.tv-admin-videos-panel {
    max-width: 800px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 18px;
}

.tv-admin-videos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.tv-admin-videos-header .tv-section-heading {
    margin: 0;
}

.tv-admin-videos-actions {
    display: flex;
    gap: 8px;
}

/* ---- Admin Tree ---- */
.tv-admin-tree-container {
    min-height: 200px;
}

.tv-admin-tree-item {
    user-select: none;
}

.tv-admin-tree-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 6px 12px 6px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    margin: 2px 0;
    transition: all 0.15s;
}

.tv-admin-tree-row:hover {
    background-color: #f5f5f5;
}

.tv-admin-category > .tv-admin-tree-row {
    background-color: #f0f8ff;
    border-color: #d0e8ff;
}

.tv-admin-video > .tv-admin-tree-row {
    background-color: #fff;
    border-color: #e0e0e0;
}

.tv-admin-item-icon {
    margin-right: 6px;
    font-size: 14px;
}

.tv-admin-item-name {
    flex: 1 1 120px;
    font-size: 13px;
    cursor: pointer;
}

.tv-admin-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    padding-left: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.tv-admin-tree-row:hover .tv-admin-item-actions {
    opacity: 1;
}

/* Admin indentation */
.tv-admin-tree-item.tv-level-0 > .tv-admin-tree-row { margin-left: 0; }
.tv-admin-tree-item.tv-level-1 > .tv-admin-tree-row { margin-left: 24px; }
.tv-admin-tree-item.tv-level-2 > .tv-admin-tree-row { margin-left: 48px; }
.tv-admin-tree-item.tv-level-3 > .tv-admin-tree-row { margin-left: 72px; }
.tv-admin-tree-item.tv-level-4 > .tv-admin-tree-row { margin-left: 96px; }

/* Drag and drop */
.tv-admin-tree-item[draggable="true"] {
    cursor: grab;
}

.tv-admin-tree-item.dragging {
    opacity: 0.4;
}

.tv-admin-tree-row.drag-over {
    border: 2px dashed #1a73e8 !important;
    background-color: #e3f2fd !important;
}

.tv-admin-subtree.drag-over-container {
    border: 2px dashed #28a745;
    border-radius: 4px;
    min-height: 30px;
    background-color: #e8f5e9;
}

/* ---- Forms ---- */
.tv-form-group {
    margin-bottom: 15px;
}

.tv-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.tv-form-group input[type="text"],
.tv-form-group input[type="email"],
.tv-form-group input[type="password"],
.tv-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.tv-form-group input:focus,
.tv-form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.tv-form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

.tv-form-actions {
    margin-top: 20px;
}

.tv-slug-row {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.tv-slug-prefix {
    background: #f0f0f0;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    color: #888 !important;
    white-space: nowrap;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.tv-slug-copy {
    padding: 0 16px;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 6px 6px 0;
    background: #1a73e8;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.tv-slug-copy:hover {
    background: #1557b0;
}

.tv-slug-row input {
    border-radius: 0 !important;
    flex: 1;
}

/* ---- Settings ---- */
.tv-settings-form {
    max-width: 600px;
}

.tv-access-toggle {
    display: inline-flex;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.tv-toggle-btn {
    padding: 8px 24px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    color: #666;
    transition: all 0.15s;
}

.tv-toggle-btn + .tv-toggle-btn {
    border-left: 1px solid #ccc;
}

.tv-toggle-btn.active {
    background: #1a73e8;
    color: #fff;
    font-weight: 600;
}

.tv-toggle-btn:hover:not(.active) {
    background: #f0f0f0;
}

/* ---- Access Panel ---- */
.tv-access-panel {
    max-width: 600px;
}

.tv-access-mode-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.tv-add-email-card {
    background: #f8f9fb;
    border: 1px solid #e4e8ed;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 20px;
}

.tv-add-email-row {
    display: flex;
    gap: 10px;
}

.tv-add-email-row input[type="email"] {
    flex: 2;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.tv-add-email-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.tv-whitelist-table {
    width: 100%;
    border-collapse: collapse;
}

.tv-whitelist-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    font-size: 13px;
}

.tv-whitelist-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.tv-whitelist-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.tv-status-pending { background: #fff3cd; color: #856404; }
.tv-status-active { background: #d5fdd5; color: #1b5e20; }

/* ---- Ratings Dashboard ---- */
.tv-ratings-intro {
    color: #555;
    font-size: 14px;
    margin: 0 0 12px;
    text-align: center;
}

.tv-ratings-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 24px;
    justify-content: center;
}

.tv-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.tv-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.tv-legend-green  { background: #d5fdd5; border: 1px solid #a3d9a5; }
.tv-legend-yellow { background: #ffffbb; border: 1px solid #e0d97a; }
.tv-legend-red    { background: #ffbbbb; border: 1px solid #e09a9a; }
.tv-legend-none   { background: #f0f0f0; border: 1px solid #ccc; }

.tv-ratings-matrix {
    overflow-x: auto;
    max-height: 70vh;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.tv-ratings-matrix table {
    border-collapse: collapse;
    font-size: 13px;
    width: 100%;
}

.tv-ratings-matrix-narrow table {
    width: auto;
}

.tv-ratings-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 12px;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    border-right: 1px solid #ddd;
    font-weight: 600;
    white-space: nowrap;
}

.tv-ratings-matrix thead th:last-child {
    border-right: none;
}

.tv-ratings-matrix td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #ddd;
    text-align: center;
    min-width: 30px;
}

.tv-ratings-matrix td:last-child {
    border-right: none;
}

.tv-matrix-video-col {
    text-align: left !important;
    white-space: nowrap;
    font-weight: 500;
}

.tv-matrix-red { background-color: #ffbbbb; }
.tv-matrix-yellow { background-color: #ffffbb; }
.tv-matrix-green { background-color: #d5fdd5; }
.tv-matrix-none { background-color: #fafafa; color: #ccc; }

.tv-matrix-summary td {
    font-weight: 600;
    background: #f5f5f5 !important;
    border-top: 2px solid #ddd;
    color: #333;
}

.tv-matrix-category {
    cursor: pointer;
}

.tv-matrix-category:hover {
    background: #f0f4f8;
}

.tv-matrix-category td {
    border-bottom: 1px solid #e0e0e0;
}

.tv-matrix-cat-cell {
    background: #eaeff4 !important;
}

.tv-matrix-category td.tv-matrix-video-col {
    background: #eaeff4;
}

.tv-matrix-toggle {
    font-size: 10px;
    color: #888;
    display: inline-block;
    width: 14px;
}

.tv-matrix-count {
    font-weight: normal;
    color: #999;
    font-size: 12px;
}

.tv-matrix-clickable {
    cursor: pointer;
}

.tv-matrix-clickable:hover {
    color: #1a73e8;
    text-decoration: underline;
}

.tv-matrix-video-row td.tv-matrix-video-col {
    font-weight: normal;
}

.tv-ratings-filter-bar {
    padding: 8px 14px;
    margin-bottom: 12px;
    background: #e3f2fd;
    border-radius: 6px;
    font-size: 13px;
    color: #1565c0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Libraries Page ---- */
.tv-libs-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px;
}

.tv-libs-section {
    margin-bottom: 36px;
}

.tv-libs-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tv-libs-section-title {
    margin: 0;
    font-size: 16px;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tv-libs-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tv-lib-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e4e8ed;
    border-bottom: none;
    transition: background 0.12s;
    text-decoration: none;
    color: inherit;
}

.tv-lib-row:first-child {
    border-radius: 10px 10px 0 0;
}

.tv-lib-row:last-child {
    border-bottom: 1px solid #e4e8ed;
    border-radius: 0 0 10px 10px;
}

.tv-lib-row:only-child {
    border-radius: 10px;
    border-bottom: 1px solid #e4e8ed;
}

.tv-lib-row:hover {
    background: #f8f9fb;
}

.tv-lib-row-main {
    flex: 1;
    min-width: 0;
}

.tv-lib-row-name {
    margin: 0;
    font-size: 16px;
    color: #222;
    font-weight: 600;
}

.tv-lib-row-desc {
    margin: 3px 0 0;
    font-size: 13px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-lib-row-url {
    font-size: 12px;
    color: #aaa;
}

.tv-lib-row-meta {
    flex-shrink: 0;
}

.tv-lib-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.tv-lib-row-arrow {
    font-size: 18px;
    color: #bbb;
    transition: transform 0.15s;
}

.tv-lib-row-invited:hover .tv-lib-row-arrow {
    transform: translateX(3px);
    color: #888;
}

.tv-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.tv-badge-public { background: #d5fdd5; color: #1b5e20; }
.tv-badge-private { background: #fff3cd; color: #856404; }
.tv-badge-invited { background: #e3f2fd; color: #1565c0; }

/* ---- Modal ---- */
.tv-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.tv-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.tv-modal-content h2 {
    margin: 0 0 20px;
}

/* ---- Password Form ---- */
.tv-password-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px;
}

.tv-password-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.tv-password-form h2 {
    margin: 0 0 10px;
    color: #333;
}

.tv-password-form input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    margin: 15px 0 10px;
    box-sizing: border-box;
}

.tv-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.tv-landing {
    --land-dark: #0b1a2b;
    --land-navy: #132d4a;
    --land-sky: #a1ecfe;
    --land-sky-dim: rgba(161, 236, 254, 0.12);
    --land-r: #ff6b6b;
    --land-y: #ffd43b;
    --land-g: #51cf66;
    margin: -16px 0 0;  /* pull up into the white wrapper gap */
    font-family: 'Outfit', 'Roboto', sans-serif;
    color: #dde6f0;
}

/* ---- Hero ---- */
.tv-hero {
    background: var(--land-dark);
    background-image:
        radial-gradient(ellipse 80% 60% at 70% 40%, rgba(161,236,254,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 80% at 20% 80%, rgba(81,207,102,0.04) 0%, transparent 60%);
    padding: 60px 28px 50px;
}

.tv-hero-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.tv-hero-text {
    text-align: center;
}

.tv-hero-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.1;
    margin: 0 0 18px;
    color: #fff;
    letter-spacing: -0.02em;
}

.tv-hero-sub {
    font-size: 17px;
    line-height: 1.6;
    color: #9ab4cc;
    margin: 0 auto 28px;
    max-width: 620px;
}

.tv-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.tv-hero-visual {
    flex-shrink: 0;
    width: 260px;
}

/* ---- Landing buttons ---- */
.tv-land-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.tv-land-btn-primary {
    background: var(--land-sky);
    color: var(--land-dark);
    border-color: var(--land-sky);
}

.tv-land-btn-primary:hover {
    background: #c4f3ff;
    border-color: #c4f3ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(161,236,254,0.3);
}

.tv-land-btn-ghost {
    background: transparent;
    color: var(--land-sky);
    border-color: rgba(161,236,254,0.35);
}

.tv-land-btn-ghost:hover {
    border-color: var(--land-sky);
    background: rgba(161,236,254,0.08);
}

/* ---- Mini mockup ---- */
.tv-mock {
    background: #162e48;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 2px 20px rgba(0,0,0,0.3),
        0 0 0 1px rgba(161,236,254,0.08);
    animation: mockFloat 6s ease-in-out infinite;
}

@keyframes mockFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.tv-mock-bar {
    background: var(--land-navy);
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b8dad;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.tv-mock-row {
    padding: 10px 14px;
    font-size: 13px;
    color: #8ea8c2;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}

.tv-mock-green  { background: rgba(81,207,102,0.10); color: #a6e5b4; }
.tv-mock-yellow { background: rgba(255,212,59,0.08); color: #e5d48a; }
.tv-mock-red    { background: rgba(255,107,107,0.10); color: #e5a0a0; }

.tv-mock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tv-mock-dot-g { background: var(--land-g); box-shadow: 0 0 6px rgba(81,207,102,0.5); }
.tv-mock-dot-y { background: var(--land-y); box-shadow: 0 0 6px rgba(255,212,59,0.5); }
.tv-mock-dot-r { background: var(--land-r); box-shadow: 0 0 6px rgba(255,107,107,0.5); }
.tv-mock-dot-none { background: #3a5068; }

/* ---- Steps section ---- */
.tv-steps-section {
    background: #fff;
    padding: 50px 28px;
}

.tv-steps-grid {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.tv-step-card {
    background: #f7f9fb;
    border: 1px solid #e4eaf0;
    border-radius: 14px;
    padding: 30px 26px 26px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tv-step-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(11,26,43,0.08);
}

/* Colored top-edge accent per card */
.tv-step-card-1 { border-top: 3px solid var(--land-sky); }
.tv-step-card-2 { border-top: 3px solid var(--land-g); }
.tv-step-card-3 { border-top: 3px solid var(--land-y); }

.tv-step-badge {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 36px;
    color: #dce4ec;
    line-height: 1;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.tv-step-card h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--land-dark);
    margin: 0 0 8px;
}

.tv-step-card p {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: #4a6178;
    margin: 0;
}

/* ---- Bottom CTA ---- */
.tv-cta-strip {
    background: var(--land-dark);
    padding: 50px 28px;
}

.tv-cta-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.tv-cta-inner h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 28px;
    color: #fff;
    margin: 0 0 8px;
}

.tv-cta-inner > p {
    color: #7a98b5;
    margin: 0 0 24px;
    font-size: 15px;
}

.tv-cta-inner .tv-hero-actions {
    justify-content: center;
}

/* ---- Entrance animations ---- */
.tv-hero-text    { animation: landFadeUp 0.6s ease-out both; }
.tv-hero-visual  { animation: landFadeUp 0.6s 0.15s ease-out both; }
.tv-step-card-1  { animation: landFadeUp 0.5s 0.2s ease-out both; }
.tv-step-card-2  { animation: landFadeUp 0.5s 0.3s ease-out both; }
.tv-step-card-3  { animation: landFadeUp 0.5s 0.4s ease-out both; }
.tv-cta-inner    { animation: landFadeUp 0.5s 0.5s ease-out both; }

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

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .tv-layout-container {
        flex-direction: column;
    }

    .tv-sidebar {
        width: 100%;
    }

    .tv-category-tree {
        max-height: 40vh;
    }

    .tv-rating-buttons {
        flex-direction: column;
    }

    .tv-conf-btn {
        width: 100%;
    }

    .tv-admin-tabs {
        flex-wrap: wrap;
    }

    .tv-add-email-row {
        flex-direction: column;
    }

    .tv-admin-item-actions {
        opacity: 1;
    }

    .tv-hero-visual {
        width: 220px;
    }

    .tv-steps-grid {
        grid-template-columns: 1fr !important;
    }

    .tv-land-btn {
        padding: 11px 22px;
        font-size: 14px;
    }
}
