/* ============================================================================
   LoanBot – Debt Collection Voice Agent Portal
   Premium Dark Mode Design System
   ============================================================================ */

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Colors */
    --bg-primary: #0f1117;
    --bg-secondary: #161821;
    --bg-card: rgba(22, 24, 33, 0.8);
    --bg-card-hover: rgba(30, 33, 46, 0.9);
    --bg-glass: rgba(22, 24, 33, 0.6);

    --text-primary: #e4e6ef;
    --text-secondary: #8b8fa3;
    --text-muted: #5a5e72;
    --text-link: #7c8aff;
    --text-link-hover: #9da7ff;

    --accent-primary: #7c8aff;
    --accent-glow: rgba(124, 138, 255, 0.25);
    --accent-gradient: linear-gradient(135deg, #7c8aff 0%, #6366f1 100%);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* DPD Badge Colors */
    --dpd-upcoming: #10b981;
    --dpd-upcoming-bg: rgba(16, 185, 129, 0.15);
    --dpd-short: #f59e0b;
    --dpd-short-bg: rgba(245, 158, 11, 0.15);
    --dpd-long: #ef4444;
    --dpd-long-bg: rgba(239, 68, 68, 0.15);

    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    --color-secondary: #6b7280;

    /* Spacing */
    --sidebar-width: 240px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.4s ease;
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--text-link-hover);
}

code {
    background: rgba(124, 138, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent-primary);
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.brand-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-4px);
    }
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    padding: 1rem 0.75rem;
    flex: 1;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-links a:hover {
    background: rgba(124, 138, 255, 0.08);
    color: var(--text-primary);
}

.nav-links a.active {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.powered-by {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tech-stack {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 2px;
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    overflow: hidden;
}

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

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

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

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

.stat-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(124, 138, 255, 0.1);
}

.stat-warning .stat-icon {
    background: var(--dpd-short-bg);
}

.stat-info .stat-icon {
    background: rgba(59, 130, 246, 0.15);
}

.stat-pending .stat-icon {
    background: rgba(245, 158, 11, 0.15);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

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

/* --- Tables --- */
.table-responsive {
    overflow-x: auto;
}

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

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
}

.table-row-hover:hover {
    background: var(--bg-card-hover);
}

.mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.customer-link {
    font-weight: 600;
    color: var(--text-primary);
}

.customer-link:hover {
    color: var(--accent-primary);
}

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

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-upcoming {
    background: var(--dpd-upcoming-bg);
    color: var(--dpd-upcoming);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-short-overdue {
    background: var(--dpd-short-bg);
    color: var(--dpd-short);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-long-overdue {
    background: var(--dpd-long-bg);
    color: var(--dpd-long);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-secondary {
    background: rgba(107, 114, 128, 0.15);
    color: var(--color-secondary);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    background: transparent;
    color: var(--text-primary);
}

.btn:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    color: #fff;
}

.btn-glow {
    box-shadow: var(--shadow-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

#btn-end-call {
    width: 240px;
    justify-content: center;
    padding: 1rem 1.25rem;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffe4e6;
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.45) 0%, rgba(220, 38, 38, 0.35) 100%);
    border: 1px solid rgba(248, 113, 113, 0.45);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#btn-end-call:hover {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.62) 0%, rgba(239, 68, 68, 0.48) 100%);
    box-shadow: 0 12px 26px rgba(239, 68, 68, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(124, 138, 255, 0.08);
    color: var(--accent-primary);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    width: auto;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8fa3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.8em;
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

/* --- Lookup Result --- */
.lookup-result {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.lookup-found {
    color: var(--color-success);
}

.lookup-new {
    color: var(--color-info);
}

/* --- Quick Pick --- */
.quick-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quick-pick-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.6rem 0.8rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 0.82rem;
}

.quick-pick-btn:hover {
    background: rgba(124, 138, 255, 0.08);
    border-color: var(--accent-primary);
}

.quick-pick-btn.selected {
    background: rgba(124, 138, 255, 0.15);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
}

.qp-name {
    font-weight: 600;
    font-size: 0.82rem;
}

.qp-dpd {
    font-size: 0.7rem;
}

/* --- Dial Layout --- */
.dial-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.dial-form-card {
    position: sticky;
    top: 80px;
}

/* --- Conversation / Chat --- */
.conversation-card {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 1rem 1.5rem;
    overflow-y: auto;
    max-height: 55vh;
    min-height: 300px;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 250px;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chat-bubble {
    max-width: 85%;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-assistant {
    background: rgba(124, 138, 255, 0.1);
    border: 1px solid rgba(124, 138, 255, 0.2);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.chat-user {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-system {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    margin: 0 auto;
    text-align: center;
    font-size: 0.85rem;
}

.chat-role {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-time {
    font-weight: 400;
    font-size: 0.65rem;
}

.chat-text {
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input {
    flex: 1;
    padding: 0.6rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.chat-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-action-link {
    text-align: center;
    padding: 0.75rem;
}

/* Typing indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Call status indicator */
.call-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-success);
}

.call-status-badge.ended {
    color: var(--text-muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.call-status-badge.ended .pulse-dot {
    background: var(--text-muted);
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

/* --- Context Grid --- */
.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.context-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.context-value {
    font-size: 1rem;
    font-weight: 600;
}

/* --- Detail Pages --- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.detail-list {
    display: flex;
    flex-direction: column;
}

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

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

.detail-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.detail-value.highlight {
    color: var(--accent-primary);
}

.dpd-display {
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 0.5rem;
}

.dpd-display .badge {
    font-size: 1rem;
    padding: 6px 20px;
}

.summary-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* --- Timeline --- */
.timeline {
    padding: 1rem 1.5rem;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-marker {
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 138, 255, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

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

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

.timeline-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    line-height: 1.5;
}

/* --- Activity Feed --- */
.activity-feed {
    padding: 0.5rem 1rem;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.activity-item:hover {
    background: var(--bg-card-hover);
    border-radius: var(--radius-sm);
}

.activity-icon {
    font-size: 1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-content {
    flex: 1;
}

.activity-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2px;
}

.activity-duration {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* --- Transcript --- */
.transcript {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* --- Filter Group --- */
.filter-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .dial-layout {
        grid-template-columns: 1fr;
    }

    .dial-form-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }

    .brand-text,
    .brand-sub,
    .sidebar-footer,
    .nav-links a span:not(.nav-icon) {
        display: none;
    }

    .nav-links a {
        justify-content: center;
        padding: 0.75rem;
    }

    .main-content {
        margin-left: 60px;
    }

    .content-area {
        padding: 1rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

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

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}


/* --- Tabs --- */
.tabs-header {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent-primary);
    background: rgba(124, 138, 255, 0.1);
}

.tab-content {
    display: none;
    flex: 1;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}