/* Patient My Hub — multi-case, multi-lawyer */
.hub-screen {
    padding: 0.5rem 0.25rem 3.5rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* Extra room inside shell main content */
.app-shell .dashboard-main-content.shell-content:has(.hub-screen) {
    padding: 28px 28px 40px;
}

@media (max-width: 767px) {
    .app-shell .dashboard-main-content.shell-content:has(.hub-screen) {
        padding: 20px 16px 32px;
    }
}

/* Header */
.hub-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.hub-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #f1f5f9);
    margin: 0 0 0.35rem;
}

.hub-subtitle {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text-secondary, #94a3b8);
    max-width: 36rem;
}

.hub-header-action {
    flex-shrink: 0;
}

/* Case rail */
.hub-cases-section {
    margin-bottom: 2rem;
    padding: 1.35rem 1.5rem 1.5rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-cases-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
}

.hub-cases-label {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #6b7280);
}

.hub-cases-count {
    font-size: 0.8rem;
    color: var(--gold-primary, #F5C86A);
    font-weight: 600;
}

.hub-cases-rail {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.25rem 0.15rem 0.5rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.hub-cases-rail::-webkit-scrollbar {
    height: 6px;
}

.hub-cases-rail::-webkit-scrollbar-thumb {
    background: rgba(245, 200, 106, 0.35);
    border-radius: 3px;
}

.hub-case-chip {
    flex: 0 0 auto;
    min-width: 148px;
    max-width: 220px;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hub-case-chip:hover {
    border-color: rgba(245, 200, 106, 0.35);
    background: rgba(245, 200, 106, 0.06);
}

.hub-case-chip.is-active {
    border-color: var(--gold-primary, #F5C86A);
    background: rgba(245, 200, 106, 0.12);
    box-shadow: 0 0 0 1px rgba(245, 200, 106, 0.25);
}

.hub-case-chip-id {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
}

.hub-case-chip-status {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hub-case-chip-status.status-active {
    color: #4ade80;
}

.hub-case-chip-status.status-assigned {
    color: var(--gold-primary, #F5C86A);
}

.hub-case-chip-score {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}

/* Context bar */
.hub-context-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-context-label {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin-right: 0.35rem;
}

.hub-context-case {
    color: var(--text-primary, #f1f5f9);
    font-size: 1rem;
}

.hub-context-status {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    font-weight: 600;
}

.hub-context-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.hub-stat-pill {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #94a3b8);
}

.hub-banner {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.hub-banner--warn {
    background: rgba(245, 200, 106, 0.08);
    border: 1px solid rgba(245, 200, 106, 0.25);
    color: var(--text-secondary, #94a3b8);
}

.hub-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--gold-primary, #F5C86A);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

/* Tabs */
.hub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2.25rem;
    padding: 0.5rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted, #6b7280);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
    min-width: 0;
}

.hub-tab-btn.active {
    color: #1a1a1a;
    background: var(--gold-primary, #F5C86A);
}

.hub-tab-btn:hover:not(.active) {
    color: var(--text-primary, #f1f5f9);
    background: rgba(255, 255, 255, 0.05);
}

.hub-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: inherit;
}

.hub-tab-btn.active .hub-tab-badge {
    background: rgba(0, 0, 0, 0.2);
}

/* Loading */
.hub-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary, #94a3b8);
}

.hub-loading-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 1rem;
    border: 3px solid rgba(245, 200, 106, 0.2);
    border-top-color: var(--gold-primary, #F5C86A);
    border-radius: 50%;
    animation: hubSpin 0.8s linear infinite;
}

@keyframes hubSpin {
    to { transform: rotate(360deg); }
}

.hub-error {
    text-align: center;
    padding: 2rem;
    color: #f87171;
}

.hub-panel {
    min-height: 200px;
    padding-top: 0.25rem;
}

.hub-panel-head {
    margin-bottom: 1.5rem;
}

.hub-panel-head--spaced {
    margin-top: 2.75rem;
    padding-top: 0.5rem;
}

.hub-panel-title {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
}

.hub-panel-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
}

/* Lawyer cards (videos) */
.hub-lawyer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.35rem;
}

.hub-lawyer-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.15rem;
}

.hub-lawyer-card {
    padding: 1.5rem 1.5rem 1.35rem;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hub-lawyer-card-top {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.hub-lawyer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(245, 200, 106, 0.12);
    border: 1px solid rgba(245, 200, 106, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.hub-lawyer-avatar.has-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hub-lawyer-initial {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold-primary, #F5C86A);
}

.hub-lawyer-meta {
    flex: 1;
    min-width: 0;
}

.hub-lawyer-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    line-height: 1.3;
}

.hub-lawyer-firm {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.35;
}

.hub-status-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.hub-status-badge--pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.hub-status-badge--ready {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.hub-lawyer-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
}

.hub-hint-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    animation: hubPulse 1.2s ease-in-out infinite;
}

@keyframes hubPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.hub-lawyer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: auto;
    padding-top: 0.35rem;
}

.hub-btn-block {
    flex: 1 1 100%;
}

/* Document cards */
.hub-doc-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-doc-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(245, 200, 106, 0.15);
    color: var(--gold-primary, #F5C86A);
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hub-doc-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.hub-doc-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #f1f5f9);
}

.hub-doc-card-sub {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}

.hub-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.hub-upload-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.hub-upload-icon {
    color: var(--text-muted, #6b7280);
    flex-shrink: 0;
}

.hub-upload-info {
    flex: 1;
    min-width: 0;
}

.hub-upload-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-upload-type {
    font-size: 0.72rem;
    color: var(--text-muted, #6b7280);
}

.hub-doc-pending {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
}

/* Messages */
.hub-msg-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hub-msg-row {
    display: flex;
    gap: 1rem;
    width: 100%;
    text-align: left;
    padding: 1.15rem 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    align-items: center;
}

.hub-msg-row:hover {
    border-color: rgba(245, 200, 106, 0.35);
    background: rgba(245, 200, 106, 0.06);
}

.hub-msg-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(245, 200, 106, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.hub-msg-avatar.has-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hub-msg-body {
    flex: 1;
    min-width: 0;
}

.hub-msg-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
}

.hub-msg-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #f1f5f9);
}

.hub-msg-time {
    font-size: 0.72rem;
    color: var(--text-muted, #6b7280);
    flex-shrink: 0;
}

.hub-msg-firm {
    margin: 0.1rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}

.hub-msg-preview {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hub-msg-preview--muted {
    font-style: italic;
}

.hub-msg-chevron {
    font-size: 1.5rem;
    color: var(--text-muted, #6b7280);
    flex-shrink: 0;
    line-height: 1;
}

/* Buttons */
.hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
}

.hub-btn:active {
    transform: scale(0.98);
}

.hub-btn-primary {
    background: var(--gold-primary, #F5C86A);
    color: #1a1a1a;
}

.hub-btn-secondary {
    background: transparent;
    color: var(--gold-primary, #F5C86A);
    border: 1px solid rgba(245, 200, 106, 0.45);
}

.hub-btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary, #f1f5f9);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hub-btn:hover {
    opacity: 0.92;
}

/* Empty */
.hub-empty {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 0.5rem;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.hub-empty--compact {
    padding: 1.25rem;
}

.hub-empty-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
}

.hub-empty-text {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary, #94a3b8);
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

/* Modals */
.hub-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.hub-modal {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    background: var(--bg-card, #1e293b);
    border-radius: 14px;
    padding: 1.25rem;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hub-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-primary, #f1f5f9);
    font-size: 1.35rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
}

.hub-modal-title {
    margin: 0 2.5rem 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary, #f1f5f9);
}

.hub-modal-video {
    width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    background: #000;
}

.hub-modal-doc-img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

.hub-modal-doc-frame {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: 8px;
}

/* Light theme */
[data-theme="light"] .hub-cases-section,
[data-theme="light"] .hub-lawyer-card,
[data-theme="light"] .hub-doc-card,
[data-theme="light"] .hub-upload-card,
[data-theme="light"] .hub-msg-row {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .hub-case-chip {
    background: #fff;
}

[data-theme="light"] .hub-case-chip.is-active {
    background: rgba(245, 200, 106, 0.2);
}

[data-theme="light"] .hub-tabs {
    background: rgba(0, 0, 0, 0.04);
}

@media (min-width: 1024px) {
    .app-shell .dashboard-main-content.shell-content:has(.hub-screen) {
        padding: 32px 40px 52px;
    }

    .hub-screen {
        padding: 0.75rem 0.5rem 4rem;
    }
}

@media (max-width: 640px) {
    .hub-lawyer-grid,
    .hub-lawyer-grid--compact,
    .hub-upload-grid {
        grid-template-columns: 1fr;
    }

    .hub-context-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .hub-tab-btn {
        font-size: 0.8rem;
        padding: 0.65rem 0.5rem;
    }

    .hub-case-chip {
        min-width: 120px;
    }

    .hub-header {
        margin-bottom: 1.5rem;
    }

    .hub-cases-section {
        margin-bottom: 1.5rem;
    }

    .hub-tabs {
        margin-bottom: 1.75rem;
    }
}
