/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-elevated: #22222e;
    --border-color: #2a2a3a;
    --border-accent: #3a3a4a;
    
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    --accent-primary: #00d4aa;
    --accent-secondary: #00b894;
    --accent-glow: rgba(0, 212, 170, 0.3);
    
    --win-color: #00d4aa;
    --win-bg: rgba(0, 212, 170, 0.1);
    --loss-color: #ff6b6b;
    --loss-bg: rgba(255, 107, 107, 0.1);
    
    --warning-color: #ffd93d;
    --info-color: #6c5ce7;
    
    --sidebar-width: 260px;
    --header-height: 60px;
    
    --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

#app {
    height: 100%;
}

/* ===== Screens ===== */
.screen {
    display: none;
    height: 100%;
}

.screen.active {
    display: flex;
}

/* ===== Login Screen ===== */
#login-screen {
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 170, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    font-size: 28px;
    font-weight: 700;
    color: var(--bg-primary);
    margin-bottom: 20px;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: 0 4px 20px var(--accent-glow);
    object-fit: contain;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.error-text {
    color: var(--loss-color);
    font-size: 0.875rem;
    margin-top: 12px;
    text-align: center;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--loss-color);
    color: white;
}

.btn-danger:hover {
    background: #ff5252;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ===== Dashboard Layout ===== */
#dashboard-screen {
    display: none;
}

#dashboard-screen.active {
    display: flex;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-small {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--bg-primary);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.user-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-primary);
}

.nav-item.admin-only {
    display: none;
}

body.is-admin .nav-item.admin-only {
    display: flex;
}

#logout-btn {
    margin-top: auto;
    width: 100%;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    overflow-y: auto;
    min-height: 100vh;
    background: 
        radial-gradient(ellipse at 90% 10%, rgba(0, 212, 170, 0.03) 0%, transparent 40%),
        var(--bg-primary);
}

.content-section {
    display: none;
    max-width: 1400px;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

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

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

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.stat-card.win .stat-value {
    color: var(--win-color);
}

.stat-card.loss .stat-value {
    color: var(--loss-color);
}

.stat-card.pnl .stat-value.positive {
    color: var(--win-color);
}

.stat-card.pnl .stat-value.negative {
    color: var(--loss-color);
}

/* ===== Calendar & News Row ===== */
.calendar-news-row {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.calendar-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    flex: 1;
    min-width: 0;
}

.news-widget-container {
    width: 400px;
    min-width: 350px;
    max-width: 450px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.news-widget-container .tradingview-widget-container {
    height: 100%;
    min-height: 450px;
}

.news-widget-container .tradingview-widget-copyright {
    padding: 8px;
    font-size: 11px;
    opacity: 0.7;
}

/* Responsive: stack on smaller screens */
@media (max-width: 1200px) {
    .calendar-news-row {
        flex-direction: column;
    }
    
    .news-widget-container {
        width: 100%;
        max-width: none;
        min-height: 400px;
    }
}

/* ===== PreMarket Prep Layout ===== */
.premarket-layout {
    display: flex;
    gap: 24px;
}

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

.premarket-news-widget {
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 700px;
    position: sticky;
    top: 24px;
}

.premarket-news-widget .tradingview-widget-container {
    height: 680px;
    min-height: 680px;
}

.premarket-news-widget .tradingview-widget-copyright {
    padding: 8px;
    font-size: 11px;
    opacity: 0.7;
}

@media (max-width: 1200px) {
    .premarket-layout {
        flex-direction: column;
    }
    
    .premarket-news-widget {
        width: 100%;
        max-width: none;
        position: static;
    }
    
    .premarket-news-widget .tradingview-widget-container {
        height: 450px;
    }
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    position: relative;
    cursor: default;
    transition: all 0.2s ease;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.today {
    border: 2px solid var(--accent-primary);
}

.calendar-day.has-trades {
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-align: center;
}

.calendar-day.has-trades:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

button.calendar-day {
    width: 100%;
    height: 100%;
}

.calendar-day.selected {
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.3);
    transform: scale(1.05);
}

.calendar-day.positive {
    background: var(--win-bg);
    color: var(--win-color);
}

.calendar-day.negative {
    background: var(--loss-bg);
    color: var(--loss-color);
}

.calendar-day .day-number {
    font-weight: 500;
}

.calendar-day .day-pnl {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    margin-top: 2px;
}

.calendar-day .day-count {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.calendar-day.positive .day-count,
.calendar-day.negative .day-count {
    color: inherit;
    opacity: 0.8;
}

/* Trades Header */
.trades-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.trades-header .hint {
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--text-muted);
}

.trades-header .btn {
    margin-left: auto;
}

/* ===== Tables ===== */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    overflow-x: auto;
}

.table-container h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 500;
}

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

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: var(--bg-elevated);
}

.data-table .buy {
    color: var(--win-color);
}

.data-table .sell {
    color: var(--loss-color);
}

.pnl-positive {
    color: var(--win-color);
    font-weight: 500;
}

.pnl-negative {
    color: var(--loss-color);
    font-weight: 500;
}

/* ===== Score Display ===== */
.score-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.score-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}

.score-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent-primary);
}

/* ===== Form Container ===== */
.form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    margin-bottom: 32px;
}

.form-container.hidden {
    display: none;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ===== Image Upload ===== */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.05);
}

.image-upload-area p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.image-upload-area .preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.image-upload-area .preview-image.hidden {
    display: none;
}

.image-upload-area.has-image {
    border-style: solid;
    padding: 16px;
}

.image-upload-area.has-image p {
    display: none;
}

/* ===== Entries List ===== */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.entry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all 0.2s ease;
}

.entry-card:hover {
    border-color: var(--border-accent);
}

.entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.entry-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.entry-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.entry-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.entry-badge.win {
    background: var(--win-bg);
    color: var(--win-color);
}

.entry-badge.loss {
    background: var(--loss-bg);
    color: var(--loss-color);
}

.entry-badge.long {
    background: var(--win-bg);
    color: var(--win-color);
}

.entry-badge.short {
    background: var(--loss-bg);
    color: var(--loss-color);
}

.entry-actions {
    display: flex;
    gap: 8px;
}

.entry-content {
    display: grid;
    gap: 16px;
}

.entry-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entry-field-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.entry-field-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.entry-image {
    margin-top: 16px;
}

.entry-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* ===== Discussion / Comments ===== */
.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.discussion-thread {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.discussion-header {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.comment {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 8px;
    border-left: 3px solid var(--border-color);
}

.comment.admin-comment {
    border-left-color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.05);
}

.comment.student-comment {
    border-left-color: var(--info-color);
    background: rgba(108, 92, 231, 0.05);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.comment-author {
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.comment-date {
    color: var(--text-muted);
}

.comment-content {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    line-height: 1.5;
}

/* ===== Q&A Section ===== */
.qa-card {
    border-left: 4px solid var(--border-color);
}

.qa-card.answered {
    border-left-color: var(--win-color);
}

.qa-card.pending {
    border-left-color: var(--warning-color);
}

.pending-badge {
    background: rgba(255, 217, 61, 0.2);
    color: var(--warning-color);
}

.student-badge {
    background: rgba(108, 92, 231, 0.2);
    color: var(--info-color);
}

.qa-question {
    margin-bottom: 16px;
}

.question-text {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.qa-thread {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
}

.qa-thread.hidden {
    display: none;
}

.qa-answers {
    margin-bottom: 16px;
}

.qa-answer {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 8px;
    border-left: 3px solid var(--border-color);
}

.qa-answer.admin-answer {
    border-left-color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.05);
}

.qa-answer.student-answer {
    border-left-color: var(--info-color);
    background: rgba(108, 92, 231, 0.05);
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.answer-author {
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.answer-date {
    color: var(--text-muted);
}

.answer-content {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    line-height: 1.5;
}

.qa-reply-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.qa-reply-form textarea {
    flex: 1;
    padding: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    resize: none;
    min-height: 60px;
}

.qa-reply-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.qa-reply-form button {
    align-self: flex-end;
}

/* ===== Strategy Section ===== */
.strategy-notice {
    background: rgba(255, 217, 61, 0.1);
    border: 1px solid rgba(255, 217, 61, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 24px;
    color: var(--warning-color);
    font-size: 0.9rem;
}

.strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.strategy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color 0.2s ease;
}

.strategy-card:hover {
    border-color: var(--accent-primary);
}

.strategy-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.strategy-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.strategy-actions {
    display: flex;
    gap: 8px;
}

.strategy-field {
    margin-bottom: 12px;
}

.strategy-field .field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.strategy-field .field-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.strategy-card .strategy-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.strategy-display {
    margin-bottom: 32px;
}

.strategy-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.strategy-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.strategy-section:last-of-type {
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
}

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

.strategy-section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.version-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.strategy-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.strategy-meta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Strategy History */
.strategy-history {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.strategy-history h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.history-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.history-entry.current {
    border-color: var(--accent-primary);
}

.history-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.history-version {
    font-weight: 600;
    color: var(--text-primary);
}

.history-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.current-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-preview {
    font-size: 0.85rem;
    color: var(--accent-primary);
    cursor: pointer;
    padding: 8px 0;
}

.history-preview:hover {
    text-decoration: underline;
}

.history-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.history-detail.hidden {
    display: none;
}

.history-field {
    margin-bottom: 12px;
}

.history-field strong {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.history-field div {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    line-height: 1.5;
}

/* ===== Ideas Lab Section ===== */
.ideas-intro {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.idea-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all 0.2s ease;
}

.idea-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.idea-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.idea-status {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.idea-status.brainstorm {
    background: rgba(156, 136, 255, 0.15);
    color: #9c88ff;
}

.idea-status.testing {
    background: rgba(0, 168, 255, 0.15);
    color: #00a8ff;
}

.idea-status.promising {
    background: rgba(255, 196, 0, 0.15);
    color: #ffc400;
}

.idea-status.refining {
    background: rgba(255, 127, 80, 0.15);
    color: #ff7f50;
}

.idea-status.ready {
    background: rgba(0, 230, 118, 0.15);
    color: var(--accent-primary);
}

.idea-status.abandoned {
    background: rgba(255, 71, 87, 0.15);
    color: var(--danger-color);
}

.idea-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.idea-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.idea-thumbnail {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.idea-thumbnail:hover {
    opacity: 0.8;
}

.idea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.idea-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.idea-actions {
    display: flex;
    gap: 8px;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-danger-ghost {
    background: transparent;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    opacity: 0.7;
    transition: all 0.2s;
}

.btn-danger-ghost:hover {
    opacity: 1;
    background: rgba(255, 71, 87, 0.1);
}

/* Image upload for ideas */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.image-upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 230, 118, 0.05);
}

.image-preview {
    position: relative;
    margin-top: 12px;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
}

.image-preview .remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* Idea Modal */
.idea-modal {
    max-width: 700px;
}

.idea-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.idea-full-description {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

.idea-full-image {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    cursor: pointer;
}

.idea-discussion {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.idea-discussion h4 {
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--text-primary);
}

.idea-comments {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.idea-comment {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
}

.idea-comment.coach-comment {
    background: rgba(0, 230, 118, 0.08);
    border-left: 3px solid var(--accent-primary);
}

.no-comments {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.idea-comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idea-comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
}

.idea-comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Image viewer modal */
.image-viewer {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.image-viewer img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ===== Fullscreen Page (Trade Review) ===== */
.fullscreen-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.fullscreen-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fullscreen-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 0;
    overflow: hidden;
    min-height: 0;
}

.fullscreen-content .trade-left-column {
    grid-row: 1 / -1;
    padding: 32px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.fullscreen-content .trade-right-column {
    grid-row: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fullscreen-footer {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

/* Trade Review Columns */
.trade-review-modal .modal-header,
.trade-review-modal .modal-body {
    /* Override old styles */
}

.trade-review-modal .modal-body {
    flex: 1;
    overflow: hidden;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    padding: 0;
    background: var(--bg-primary);
    min-height: 0;
}

.trade-review-modal .trade-left-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    overflow-y: auto;
}

.trade-review-modal .trade-right-column {
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.trade-summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.trade-summary-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.trade-stat {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.trade-stat.pnl-stat {
    grid-column: span 2;
    align-items: center;
    padding: 20px;
    background: rgba(0, 230, 118, 0.05);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.buy, .stat-value.long {
    color: var(--accent-primary);
}

.stat-value.sell, .stat-value.short {
    color: var(--danger-color);
}

.trade-stat.pnl-stat .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.trade-stat.pnl-stat .stat-value.pnl-negative {
    color: var(--danger-color);
}

.trade-date {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

/* Ratings Section */
.review-ratings-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.rating-row:last-child {
    border-bottom: none;
}

.rating-row label {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.star-rating {
    display: flex;
    gap: 4px;
}

.star-rating .star {
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
}

.star-rating .star:hover {
    transform: scale(1.2);
}

.star-rating .star.active {
    color: #ffc107;
}

.rating-row .form-select {
    width: 160px;
    padding: 8px 12px;
    font-size: 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

/* Tags Section */
.review-tags-section {
    display: flex;
    flex-direction: column;
}

.review-tags-section > label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.tags-input-container {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
}

.current-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 28px;
}

.current-tags .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.current-tags .tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
}

.current-tags .tag button:hover {
    opacity: 1;
}

#tag-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 4px 0;
}

#tag-input:focus {
    outline: none;
}

#tag-input::placeholder {
    color: var(--text-muted);
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    z-index: 10;
    max-height: 150px;
    overflow-y: auto;
}

.tag-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.tag-suggestion:hover {
    background: var(--bg-secondary);
}

.existing-tags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.existing-tags small {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 4px;
}

.quick-tag {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.quick-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.quick-tag.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.review-images-area {
    display: flex;
    flex-direction: column;
}

.review-images-area label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.review-images-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-image-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.review-image-item img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
    border-radius: var(--radius-sm);
}

.review-image-item img:hover {
    opacity: 0.85;
}

.review-image-item .remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.review-image-item:hover .remove-image {
    opacity: 1;
}

.trade-review-modal .image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--bg-primary);
}

.trade-review-modal .image-upload-area:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.review-notes-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.review-notes-section label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.review-notes-section textarea {
    flex: 1;
    width: 100%;
    padding: 20px;
    font-size: 1rem;
    line-height: 1.8;
    resize: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    min-height: 0;
}

.review-notes-section textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.review-notes-section textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Readonly styles for admin view */
.review-notes-section.readonly {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.review-notes-section .notes-display {
    flex: 1;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1rem;
    overflow-y: auto;
    white-space: pre-wrap;
}

.review-meta-info {
    margin-top: 12px;
    color: var(--text-muted);
}

.star-rating.readonly {
    pointer-events: none;
}

.rating-value {
    font-size: 1rem;
    color: var(--text-primary);
    padding: 8px 0;
}

.current-tags.readonly {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.current-tags.readonly .tag {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.no-review-notice {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-review-notice .empty-state {
    text-align: center;
    color: var(--text-muted);
}

.no-review-notice .empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-review-notice p {
    font-size: 1.1rem;
}

.trade-review-modal .form-actions {
    padding: 16px 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
}

/* Responsive for smaller screens */
@media (max-width: 900px) {
    .trade-review-modal .modal-body {
        grid-template-columns: 1fr;
    }
    
    .trade-review-modal .trade-left-column {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* Trade row styles */
tr.has-review {
    background: rgba(0, 230, 118, 0.05);
}

tr.has-review:hover {
    background: rgba(0, 230, 118, 0.1);
}

.pnl-positive {
    color: var(--accent-primary) !important;
    font-weight: 600;
}

.pnl-negative {
    color: var(--danger-color) !important;
    font-weight: 600;
}

.btn-success {
    background: rgba(0, 230, 118, 0.2);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-success:hover {
    background: rgba(0, 230, 118, 0.3);
}

/* Hint text */
.hint-text {
    font-size: 0.75rem;
    font-weight: normal;
    color: var(--text-muted);
    margin-left: 8px;
}

/* Student review content (admin view) */
.student-review-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.student-review-content label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.review-text {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    line-height: 1.8;
    white-space: pre-wrap;
    color: var(--text-primary);
    flex: 1;
    min-height: 300px;
    overflow-y: auto;
}

.review-meta {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.no-review-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.no-review-notice p {
    font-size: 1.1rem;
}

/* ===== Trade Discussion Section ===== */
.trade-discussion-section {
    margin-top: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.trade-discussion-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.trade-comments-container {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding-right: 8px;
}

.trade-comment {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.trade-comment:last-child {
    margin-bottom: 0;
}

.trade-comment.coach-comment {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--accent-primary);
}

.trade-comment.student-comment {
    background: var(--bg-tertiary);
}

.trade-comment .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.trade-comment .comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.trade-comment .comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.trade-comment .comment-content {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
}

.trade-comment .badge.coach-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
}

.trade-comment-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.trade-comment-form textarea {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: none;
}

.trade-comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.trade-comment-form button {
    flex-shrink: 0;
}

.no-comments {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

/* ===== Admin Section ===== */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.student-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.student-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.student-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.student-username {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.student-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.student-stat {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.student-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent-primary);
}

.student-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.student-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ===== Student Detail View ===== */
.student-detail {
    animation: fadeIn 0.3s ease;
}

.student-detail.hidden {
    display: none;
}

#back-to-students {
    margin-bottom: 20px;
}

#viewing-student-name {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.student-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.tab-content {
    display: none;
}

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

/* ===== Modal ===== */
.modal, .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal.hidden {
    display: none;
}

/* Standard modal content (smaller modals) */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

/* Generic modal box (for dynamically created modals) */
.modal-overlay .modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
}

.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-overlay .modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-overlay .modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-overlay .modal-close:hover {
    color: var(--text-primary);
}

.modal-overlay .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h3 {
    margin-bottom: 20px;
}

.existing-comments {
    margin-bottom: 20px;
    max-height: 350px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
}

/* ===== Statistics Page ===== */
.stats-overview {
    margin-bottom: 32px;
}

.stats-overview h3,
.stats-section-block h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stats-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.stats-grid.large {
    grid-template-columns: repeat(4, 1fr);
}

.stats-section-block {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.stats-table-container {
    overflow-x: auto;
}

.stats-table-container .data-table {
    width: 100%;
}

.stats-table-container .data-table th {
    background: var(--bg-secondary);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.stats-table-container .data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

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

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
    font-style: italic;
}

.tag-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.positive {
    color: var(--accent-primary) !important;
}

.negative {
    color: var(--danger-color) !important;
}

@media (max-width: 900px) {
    .stats-grid.large {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Hidden ===== */
.hidden {
    display: none !important;
}

/* ===== Inline Edit ===== */
.inline-edit {
    width: 80px;
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto;
        flex-direction: row;
        padding: 10px;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 100;
    }

    .sidebar-header {
        display: none;
    }

    .nav-menu {
        display: flex;
        width: 100%;
        overflow-x: auto;
    }

    .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 10px;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    #logout-btn {
        display: none;
    }

    .main-content {
        margin-left: 0;
        margin-bottom: 80px;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Chat Section ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-size: 1.1rem;
}

.chat-message {
    display: flex;
    max-width: 80%;
}

.chat-message.from-student {
    align-self: flex-end;
}

.chat-message.from-coach {
    align-self: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    max-width: 100%;
}

.from-student .message-bubble {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-bottom-right-radius: 4px;
}

.from-coach .message-bubble {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-content {
    line-height: 1.5;
    word-wrap: break-word;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.75rem;
    opacity: 0.8;
}

.message-author {
    font-weight: 600;
}

.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    align-items: flex-end;
}

.chat-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input-area textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-input-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-actions .btn-icon {
    cursor: pointer;
    padding: 8px 12px;
}

/* Chat Image Preview */
.chat-image-preview {
    position: relative;
    display: inline-block;
    max-width: 200px;
}

.chat-image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.remove-chat-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-chat-image:hover {
    background: #dc2626;
}

/* Message Image */
.message-image {
    margin-bottom: 8px;
}

.message-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.2s;
}

.message-image img:hover {
    opacity: 0.9;
}

/* Admin Chat View */
.admin-chat-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chat-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-sidebar h3 {
    padding: 16px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1rem;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: var(--bg-tertiary);
}

.conversation-item.active {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--accent-primary);
}

.conversation-item.has-unread {
    background: rgba(16, 185, 129, 0.05);
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conversation-name {
    font-weight: 600;
    color: var(--text-primary);
}

.unread-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.conversation-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.chat-main {
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

#admin-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Chat Badge (notification) */
.chat-badge {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.nav-item {
    position: relative;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

