/* Powered By — Reports page */
.avc-report-powered-by {
    text-align: right;
    font-size: 11px;
    color: #aaa;
    margin-top: 24px;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

.avc-report-powered-by a {
    color: #aaa;
    text-decoration: none;
}

.avc-report-powered-by a:hover {
    color: #888;
    text-decoration: underline;
}

/* =========================================================================
   License Stats Bar — shown at top of Conversations and Reports pages
   ========================================================================= */
.avc-license-stats-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.avc-license-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f6f7f7;
    border-radius: 6px;
    padding: 6px 14px;
}

.avc-license-stat .dashicons {
    color: #787c82;
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.avc-stat-label {
    font-size: 12px;
    color: #50575e;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.avc-stat-value {
    font-size: 14px;
    font-weight: 700;
    margin-left: 4px;
}

.avc-stat-ok    .avc-stat-value { color: #00a32a; }
.avc-stat-warn  .avc-stat-value { color: #dba617; }
.avc-stat-full  .avc-stat-value { color: #d63638; }

.avc-stat-upgrade {
    font-size: 12px;
    color: #d63638;
    margin-left: auto;
    white-space: nowrap;
}

.avc-stat-upgrade a {
    color: #d63638;
    font-weight: 600;
    text-decoration: underline;
}

/* Powered By Footer — student interface */
.avc-powered-by {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    padding: 10px 0 2px;
    margin-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.avc-powered-by a {
    color: #aaa;
    text-decoration: none;
}

.avc-powered-by a:hover {
    color: #888;
    text-decoration: underline;
}

/* Main Container */
.avc-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* --- FIX: Dark Mode Text --- */
/* Force dark text on main student container */
body .avc-container, 
body .avc-container h1, 
body .avc-container h2, 
body .avc-container h3, 
body .avc-container h4,
body .avc-container p {
    color: #2c3e50 !important;
}

/* Admin/Coach frontend dashboard */
.avc-frontend-dashboard {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

.avc-frontend-dashboard,
.avc-frontend-dashboard * {
    box-sizing: border-box;
}
.avc-page-title {
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
}

/* --- FIX: Dark Mode Text --- */
/* Force dark text on all coach dashboard elements */
body .avc-frontend-dashboard .avc-page-title,
body .avc-frontend-dashboard h2,
body .avc-frontend-dashboard h3,
body .avc-frontend-dashboard .avc-users-sidebar li a span,
body .avc-frontend-dashboard .avc-no-user-selected p,
body .avc-frontend-dashboard .avc-reply-area .avc-tab-btn {
     color: #2c3e50 !important;
}
/* Active tab needs to be readable */
body .avc-frontend-dashboard .avc-reply-area .avc-tab-btn.active {
    color: #007aff !important;
}

.avc-frontend-dashboard .avc-page-title {
    padding: 10px 20px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}
.avc-frontend-dashboard .avc-users-sidebar {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding-bottom: 10px;
}
.avc-frontend-dashboard .avc-users-sidebar h2 {
    border-color: #e0e0e0;
}
.avc-frontend-dashboard .avc-conversation-main {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden; /* To contain the inner elements */
}
.avc-frontend-dashboard .avc-no-user-selected {
    padding: 20px;
}
.avc-frontend-dashboard .avc-conversation-feed.admin-feed,
.avc-frontend-dashboard .avc-reply-area {
    border: none;
    background: none;
    margin-bottom: 0;
}
.avc-frontend-dashboard .avc-conversation-feed.admin-feed {
    background-color: #fff;
    max-height: 60vh;
    overflow-y: auto;
}
.avc-frontend-dashboard .avc-reply-area {
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

/* Recorder Wrapper */
.avc-recorder-wrapper {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.avc-video-container {
    position: relative;
    margin-bottom: 15px;
}

#avc-preview {
    width: 100%;
    border-radius: 8px;
    background-color: #000;
}

/* Recording Indicator */
#avc-recording-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 12px;
    height: 12px;
    background-color: #ff4136;
    border-radius: 50%;
    animation: avc-pulse 1.5s infinite;
}

@keyframes avc-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 65, 54, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 65, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 65, 54, 0); }
}

/* Timer */
#avc-timer {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
}

/* Controls & Buttons */
.avc-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.avc-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.avc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.avc-btn-primary {
    background-color: #007aff;
    color: white;
}
.avc-btn-primary:hover:not(:disabled) {
    background-color: #0056b3;
}

.avc-btn-secondary {
    background-color: #e5e5ea;
    color: #000;
}
/* FIX: Make secondary button text color highly specific to override theme styles */
body .avc-container .avc-btn.avc-btn-secondary {
    color: #000000 !important;
}
.avc-btn-secondary:hover:not(:disabled) {
    background-color: #d1d1d6;
}

/* Preview Area */
#avc-messages {
    margin-top: 15px;
}
.avc-preview-container video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}
.avc-preview-actions {
    display: flex;
    gap: 10px;
}

/* Notices */
.avc-notice {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

/* FIX: Ensure notice text is always readable with a highly specific selector */
body .avc-container .avc-notice,
body .avc-container .avc-notice p,
body .avc-frontend-dashboard .avc-notice p {
    color: #8a6d3b !important;
}

/* --- Message Bubble Styles --- */
.avc-conversation-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 10px 10px 0;
    max-height: 50vh;
    overflow-y: auto;
}
.avc-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 80%;
}
.avc-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.avc-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
.avc-bubble {
    padding: 10px 15px;
    border-radius: 18px;
}

.avc-bubble strong {
    display: block !important;
    text-align: left !important;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    margin-bottom: 5px;
}

body .avc-container .avc-bubble .avc-bubble-text,
body.wp-admin .avc-bubble .avc-bubble-text {
    display: block !important;
    text-align: left !important;
    white-space: normal;
    word-wrap: break-word;
}

.avc-message-attachment {
    margin-top: 8px;
}

.avc-message-attachment a {
    text-decoration: underline;
    font-weight: 600;
}

.avc-other .avc-message-attachment a {
    color: #007aff;
}

.avc-me .avc-message-attachment a {
    color: #ffffff;
}


.avc-video-thumbnail {
    position: relative;
    max-width: 250px;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden; /* Ensures video corners are rounded */
    background-color: #000; /* Fallback for video poster */
}

.avc-video-thumbnail video {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none; /* Prevents interaction with the thumbnail video */
}

.avc-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}
.avc-video-thumbnail:hover .avc-play-icon {
    background-color: rgba(0,0,0,0.7);
}
.avc-play-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 20px solid white;
    margin-left: 5px;
}
.avc-bubble small {
    font-size: 12px;
    opacity: 0.7;
    display: block;
    margin-top: 5px;
}
.avc-me {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.avc-me .avc-bubble {
    background-color: #007aff;
    color: white;
    border-bottom-right-radius: 4px;
}
.avc-me .avc-bubble small {
    text-align: right;
}
.avc-other {
    align-self: flex-start;
}
.avc-other .avc-bubble {
    background-color: #e5e5ea;
    color: black;
    border-bottom-left-radius: 4px;
}

/* --- Lightbox Styles --- */
.avc-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}
.avc-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}
#avc-lightbox-video {
    width: 100%;
    height: auto;
    max-height: 90vh;
    border-radius: 8px;
}
.avc-close-lightbox {
    position: absolute;
    top: -35px;
    right: -10px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
}

.avc-compose-section {
    margin-bottom: 14px;
}

.avc-compose-hidden {
    display: none;
}

.avc-admin-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

/* NEW: Text Input Area */
.avc-text-input-area {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}
.avc-text-input-area textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 10px;
    resize: vertical;
}

.avc-text-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.avc-file-input-hidden {
    display: none;
}

input[type="file"].avc-file-input-hidden,
#avc-text-attachment,
#avc-admin-text-attachment {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

.avc-attachment-trigger {
    width: 42px;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background-color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.avc-attachment-trigger:hover {
    border-color: #007aff;
    background-color: #f5f9ff;
}

.avc-attachment-trigger:focus-visible {
    outline: 2px solid #007aff;
    outline-offset: 2px;
}
/* Style for admin text area */
.avc-reply-area .avc-text-input-area {
    border: none;
    padding: 0;
}
.avc-reply-area .avc-text-input-area textarea {
    width: 100%;
    margin-bottom: 10px;
}
.avc-reply-area .avc-text-input-area button {
    align-self: flex-start;
}
.avc-text-input-area #avc-send-text,
.avc-text-input-area #avc-admin-send-text {
    align-self: flex-start;
    flex: 0 0 auto;
}

.avc-text-actions #avc-send-text,
.avc-text-actions #avc-admin-send-text {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    white-space: nowrap;
    margin-left: auto;
    visibility: visible !important;
    opacity: 1 !important;
}

.avc-shared-documents {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
}

.avc-shared-documents-toggle {
    width: 100%;
    display: block;
    text-align: left;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #e5e7eb;
    color: #1f2937;
    padding: 10px 12px;
    font-weight: 600;
    cursor: pointer;
}

.avc-shared-documents-panel {
    margin-top: 12px;
}

.avc-shared-documents-toggle[aria-expanded="true"] {
    background: #eef6ff;
    border-color: #90b8ff;
    color: #0f3d8f;
}

.avc-shared-documents-toggle:hover {
    background: #dbe1e8;
}

.avc-shared-documents-toggle:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.avc-shared-doc-group + .avc-shared-doc-group {
    margin-top: 16px;
}

.avc-shared-doc-group h4 {
    margin: 0 0 8px;
}

.avc-shared-doc-empty {
    margin: 0;
    color: #6b7280;
}

.avc-shared-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.avc-shared-doc-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.avc-shared-doc-link {
    text-decoration: none;
    color: inherit;
}

.avc-shared-doc-thumb {
    height: 92px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    overflow: hidden;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
}

.avc-shared-doc-type {
    letter-spacing: 0.3px;
}

.avc-shared-doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avc-doc-kind-google_doc { background: #e8f0fe; color: #1a73e8; }
.avc-doc-kind-google_sheet { background: #e6f4ea; color: #188038; }
.avc-doc-kind-pdf { background: #fce8e6; color: #d93025; }
.avc-doc-kind-doc { background: #e8f0fe; color: #185abc; }

.avc-shared-doc-label {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.3;
    word-break: break-word;
}

.avc-shared-doc-delete {
    margin-top: 8px;
    border: 1px solid #1f2937;
    background: #1f2937;
    color: #ffffff;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.avc-shared-doc-delete:hover {
    background: #374151;
}

.avc-shared-doc-delete:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.avc-container .avc-shared-doc-delete {
    border-color: #2563eb;
    background: #2563eb;
}

.avc-shared-documents-admin {
    margin-top: 14px;
}

.avc-container .avc-shared-documents {
    margin-top: 18px;
}


/* --- Admin Specific Styles --- */
.avc-conversations-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.avc-users-sidebar {
    flex: 0 0 350px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-left: 25px;
    margin-right: 15px;
}
.avc-users-sidebar h3 {
    margin: 20px 0 8px 0;
    padding: 8px 15px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(90deg, #007aff 0%, #0056cc 100%);
    color: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.avc-users-sidebar h2 {
    margin: 0;
    padding: 20px 15px 15px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e5e5e5;
    color: #2c3e50;
}
.avc-filter-form {
    padding: 15px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}
.avc-filter-form select, .avc-filter-form button {
    margin-right: 8px;
    margin-bottom: 8px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}
.avc-filter-form button {
    background: #007aff;
    color: white;
    border: none;
    cursor: pointer;
}
.avc-filter-form button:hover {
    background: #0056cc;
}
.avc-users-sidebar ul {
    margin: 0;
    padding: 10px;
    list-style: none;
}
.avc-users-sidebar li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 8px;
    color: #2c3e50;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
/* NEW: Style for coach assignment info in admin */
.avc-users-sidebar li a span {
    display: flex;
    flex-direction: column;
}
.avc-coach-assignment {
    font-size: 11px;
    color: #666;
    font-style: italic;
}
.avc-users-sidebar li a.active .avc-coach-assignment {
    color: #f0f0f0;
}


.avc-users-sidebar li a.active {
    background-color: #007aff;
    color: white;
    border-color: #0056cc;
    box-shadow: 0 2px 6px rgba(0,122,255,0.3);
}
.avc-users-sidebar li.red-box a {
    background-color: #fff5f5 !important;
    border: 2px solid #ff6b6b !important;
    color: #d63031 !important;
}
.avc-users-sidebar li.red-box a .avc-coach-assignment {
    color: #b91c1c !important;
}
.avc-users-sidebar .avc-student-role-status {
    display: inline-block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 600;
    color: #b42318;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.avc-users-sidebar li a:hover:not(.active) {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.new-message-indicator {
    background: #ff6600;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 8px;
    box-shadow: 0 1px 3px rgba(255,71,87,0.3);
}
.avc-frontend-dashboard .new-message-indicator {
    background: #ff6600;
    box-shadow: 0 1px 3px rgba(255,102,0,0.3);
}


.avc-conversation-main {
    flex-grow: 1;
    min-width: 0;
}
.avc-conversation-feed.admin-feed {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.avc-reply-area {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 4px;
}
.avc-reply-area h3 {
    margin-top: 0;
}
.avc-role-warning {
    border: 1px solid #ffd591;
    background: #fff7e6;
    color: #8a5d11;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0 0 15px;
    line-height: 1.45;
}
.avc-role-warning--danger {
    border-color: #ffb3b3;
    background: #fff1f0;
    color: #b42318;
}
.avc-role-warning--compose {
    border: 2px solid #ff6b6b;
    background: #fff5f5;
    color: #d63031;
    box-shadow: 0 2px 6px rgba(214, 48, 49, 0.1);
}
.avc-frontend-dashboard .avc-reply-area .avc-role-warning--compose {
    border: 2px solid #ff6b6b !important;
    background: #fff5f5 !important;
    color: #b42318 !important;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    box-shadow: 0 3px 10px rgba(180, 35, 24, 0.12);
}
.avc-frontend-dashboard .avc-reply-area .avc-role-warning--compose strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #8f1f13;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.avc-warning-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #d63031;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}
.avc-role-warning-lead {
    display: block;
    margin-top: 7px;
    font-weight: 600;
    color: #8f1f13;
}
.avc-role-warning--muted {
    border-color: #e5e7eb;
    background: #f9fafb;
    color: #4b5563;
}
.avc-role-warning-note {
    display: block;
    margin-top: 6px;
    font-weight: 600;
}

@media (max-width: 1100px), (max-device-width: 900px) {
    .avc-conversations-wrap {
        width: auto !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: max(10px, env(safe-area-inset-left)) !important;
        padding-right: max(10px, env(safe-area-inset-right)) !important;
    }

    .avc-conversations-wrap.avc-frontend-dashboard {
        width: auto !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: max(10px, env(safe-area-inset-left)) !important;
        padding-right: max(10px, env(safe-area-inset-right)) !important;
    }

    .avc-conversations-wrap .avc-conversations-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .avc-conversations-wrap .avc-users-sidebar {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .avc-conversations-wrap .avc-conversation-main {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .avc-conversations-wrap.avc-mobile-nav-enabled .avc-mobile-view-switch {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin: 0 0 12px;
        padding: 10px;
        border: 2px solid #007aff;
        border-radius: 12px;
        background: #eef5ff;
        box-shadow: 0 6px 14px rgba(0, 80, 180, 0.12);
    }

    .avc-mobile-view-switch .avc-mobile-view-label {
        width: 100%;
        margin: 0 0 2px;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #0f3d8f;
    }

    .avc-mobile-view-switch .avc-mobile-view-btn {
        appearance: none;
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        border: 1px solid #8fb6f3;
        background: #ffffff;
        color: #0f3d8f;
        border-radius: 10px;
        padding: 10px 12px;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
        cursor: pointer;
        text-align: center;
    }

    .avc-mobile-view-switch .avc-mobile-view-btn[aria-pressed="true"] {
        background: #007aff;
        border-color: #005ed1;
        color: #ffffff;
        box-shadow: 0 2px 6px rgba(0, 94, 209, 0.35);
    }

    .avc-mobile-view-switch .avc-mobile-view-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .avc-conversations-wrap.avc-mobile-nav-enabled.avc-mobile-view-students .avc-users-sidebar {
        display: block !important;
    }

    .avc-conversations-wrap.avc-mobile-nav-enabled.avc-mobile-view-students .avc-conversation-main {
        display: none !important;
    }

    .avc-conversations-wrap.avc-mobile-nav-enabled.avc-mobile-view-conversation .avc-users-sidebar {
        display: none !important;
    }

    .avc-conversations-wrap.avc-mobile-nav-enabled.avc-mobile-view-conversation .avc-conversation-main {
        display: block !important;
    }

    .avc-frontend-dashboard .avc-page-title {
        margin-bottom: 12px;
        padding: 10px 14px;
    }

    .avc-frontend-dashboard .avc-users-sidebar h2 {
        padding: 14px 12px 12px;
        font-size: 18px;
    }

    .avc-frontend-dashboard .avc-users-sidebar ul {
        padding: 8px;
    }

    .avc-frontend-dashboard .avc-conversation-feed.admin-feed,
    .avc-frontend-dashboard .avc-reply-area {
        width: 100% !important;
        max-width: 100% !important;
    }

    .avc-frontend-dashboard .avc-conversation-feed.admin-feed {
        max-height: 50vh;
        padding: 12px;
    }

    .avc-frontend-dashboard .avc-reply-area {
        padding: 14px;
    }

    .avc-frontend-dashboard .avc-text-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 700px), (max-device-width: 700px) {
    .avc-conversations-wrap.avc-mobile-nav-enabled .avc-mobile-view-switch {
        margin-bottom: 10px;
    }

    .avc-frontend-dashboard .avc-users-sidebar li a {
        padding: 10px 12px;
    }

    .avc-text-actions {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 8px;
        align-items: center;
    }

    .avc-text-actions #avc-send-text,
    .avc-text-actions #avc-admin-send-text {
        grid-column: 1 / -1;
        width: 100%;
        margin-left: 0;
    }

    .avc-frontend-dashboard .avc-message,
    .avc-frontend-dashboard .avc-video-thumbnail {
        max-width: 100% !important;
    }
}
/* Admin reply recorder */
#avc-admin-preview {
    width: 100%;
    max-width: 350px;
    background: #000;
    border-radius: 4px;
    margin-bottom: 10px;
}
/* Admin delete button */
.avc-delete-message {
    background: #f1f1f1;
    border: 1px solid #ccc;
    color: #d9534f;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 5px;
    display: inline-block;
}
.avc-delete-message:hover {
    background: #d9534f;
    color: white;
    border-color: #d43f3a;
}


/* --- NEW: Coach Self-Assign Button --- */
.avc-assign-form {
    margin: 10px 0;
}
.avc-assign-button {
    background-color: #007aff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.avc-assign-button:hover {
    background-color: #0056b3;
}

/* --- NEW: Self-Assign Notices --- */
.avc-assign-notice {
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    font-weight: 500;
}
/* --- FIX: Dark Mode Text --- */
body .avc-assign-notice.avc-assign-success {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d !important;
}
body .avc-assign-notice.avc-assign-error {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442 !important;
}
body .avc-assign-notice.avc-assign-current {
    background-color: #e5e5ea;
    border: 1px solid #d1d1d6;
    color: #333333 !important;
}

/* --- Reports --- */
.avc-reports-wrap {
    max-width: 1400px;
}

.avc-reports-wrap h1 {
    margin-bottom: 8px;
}

.avc-reports-wrap > p {
    margin-top: 0;
    color: #50575e;
    font-size: 14px;
}

.avc-reports-wrap h2 {
    margin: 24px 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.avc-reports-wrap .avc-report-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 14px 0 18px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.avc-reports-wrap .avc-report-export-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 14px 0 12px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.avc-reports-wrap .avc-report-filter-form input[type="date"] {
    min-width: 165px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    padding: 5px 8px;
    background: #fff;
}

.avc-reports-wrap .avc-report-filter-form select {
    min-width: 180px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    padding: 5px 8px;
    background: #fff;
}

.avc-reports-wrap .avc-report-export-form select,
.avc-reports-wrap .avc-report-export-form input[type="month"] {
    min-width: 180px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    padding: 5px 8px;
    background: #fff;
}

.avc-reports-wrap .avc-report-summary {
    background: #fff;
    border: 1px solid #dcdcde;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.avc-reports-wrap .avc-report-summary p {
    margin: 6px 0;
}

.avc-reports-wrap .avc-report-table {
    margin-bottom: 22px;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.avc-reports-wrap .avc-report-table thead th {
    background: #f6f7f7;
    color: #1d2327;
    font-weight: 600;
    border-bottom: 1px solid #dcdcde;
}

.avc-reports-wrap .avc-report-table tbody tr:hover {
    background: #f9fbff;
}

.avc-reports-wrap .avc-report-table td,
.avc-reports-wrap .avc-report-table th {
    padding: 10px 12px;
}

.avc-reports-wrap .avc-report-breakdown-table {
    table-layout: fixed;
    width: 100%;
}

.avc-reports-wrap .avc-report-breakdown-table th,
.avc-reports-wrap .avc-report-breakdown-table td {
    vertical-align: top;
}

.avc-reports-wrap .avc-report-breakdown-table .avc-col-num {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.avc-reports-wrap .avc-report-breakdown-table .avc-col-currency {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.avc-reports-wrap .avc-report-breakdown-table .avc-col-payout {
    font-weight: 600;
}

.avc-reports-wrap .avc-rate-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.avc-reports-wrap .avc-badge-default {
    background: #eef2ff;
    color: #3730a3;
}

.avc-reports-wrap .avc-badge-override {
    background: #ffedd5;
    color: #9a3412;
}

.avc-reports-wrap .avc-report-breakdown-table .avc-col-reason {
    width: 18%;
    white-space: normal;
    word-break: break-word;
}

.avc-reports-wrap .avc-report-breakdown-table .avc-reason-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.avc-reports-wrap .avc-report-breakdown-table .avc-empty {
    color: #8c8f94;
}

.avc-reports-wrap .avc-report-breakdown-table .avc-col-period {
    width: 14%;
    white-space: normal;
    word-break: break-word;
}

.avc-reports-wrap .avc-report-breakdown-table .avc-period-start,
.avc-reports-wrap .avc-report-breakdown-table .avc-period-end {
    display: block;
}

.avc-reports-wrap .avc-report-breakdown-table .avc-period-sep {
    display: inline-block;
    color: #6b7280;
    margin: 2px 0;
}

.avc-reports-wrap .avc-report-charts-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}

.avc-reports-wrap .avc-chart-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.avc-reports-wrap .avc-chart-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
}

.avc-reports-wrap .avc-chart-subtitle {
    font-size: 12px;
    color: #646970;
    margin: 4px 0 10px;
}

.avc-reports-wrap .avc-chart-empty {
    margin: 0;
    color: #646970;
    font-size: 13px;
}

.avc-reports-wrap .avc-volume-chart-shell {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 6px;
    align-items: end;
}

.avc-reports-wrap .avc-volume-y-axis {
    height: 156px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 11px;
    color: #646970;
    text-align: right;
    padding-right: 4px;
}

.avc-reports-wrap .avc-volume-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    min-height: 180px;
    overflow-x: hidden;
    padding-bottom: 4px;
    justify-content: space-between;
}

.avc-reports-wrap .avc-volume-day {
    min-width: 0;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.avc-reports-wrap .avc-volume-bars {
    height: 150px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
}

.avc-reports-wrap .avc-volume-bar {
    width: min(14px, 40%);
    min-height: 2px;
    border-radius: 4px 4px 0 0;
}

.avc-reports-wrap .avc-volume-bar.student {
    background: #4f46e5;
}

.avc-reports-wrap .avc-volume-bar.coach {
    background: #0ea5e9;
}

.avc-reports-wrap .avc-volume-label {
    font-size: 10px;
    color: #646970;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avc-reports-wrap .avc-coach-bar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avc-reports-wrap .avc-coach-bar-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.avc-reports-wrap .avc-coach-bar-head span {
    font-size: 12px;
    color: #646970;
}

.avc-reports-wrap .avc-coach-bar-track {
    height: 9px;
    background: #eef2ff;
    border-radius: 999px;
    overflow: hidden;
}

.avc-reports-wrap .avc-coach-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5 0%, #0ea5e9 100%);
    border-radius: 999px;
}

.avc-reports-wrap .avc-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 12px 0 20px;
}

.avc-reports-wrap .avc-metric-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.avc-reports-wrap .avc-metric-card strong {
    font-size: 12px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.avc-reports-wrap .avc-metric-card span {
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.1;
}

@media (max-width: 900px) {
    .avc-reports-wrap .avc-report-filter-form {
        align-items: flex-start;
    }

    .avc-reports-wrap .avc-report-charts-grid {
        grid-template-columns: 1fr;
    }

    .avc-reports-wrap .avc-metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* Media Picker Field Styling */
.avc-media-picker-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avc-media-picker-field .avc-media-picker-btn,
.avc-media-picker-field .avc-media-remove-btn {
    width: fit-content;
    padding: 5px 10px;
    font-size: 12px;
}

.avc-media-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avc-media-preview img {
    max-width: 200px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* --- Settings Tabs --- */
.avc-settings-wrap .nav-tab-wrapper {
    margin-bottom: 16px;
}

.avc-settings-wrap .avc-settings-panel {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 18px;
    max-width: 980px;
}

.avc-settings-wrap .avc-settings-panel h2 {
    margin-top: 0;
}

.avc-settings-wrap .avc-settings-panel h3 {
    margin: 20px 0 8px;
}

.avc-settings-wrap .avc-settings-panel p,
.avc-settings-wrap .avc-settings-panel li {
    line-height: 1.5;
}

.avc-settings-wrap .avc-about-table {
    margin-top: 14px;
    max-width: 760px;
}

.avc-settings-wrap .avc-about-table th {
    width: 220px;
}
