/* =====================================================
   STUDENT DASHBOARD - aicode.ptit.edu.vn Neobrutal Edition
   ===================================================== */

:root {
    --aicode-bg: #fdfbf7;
    --aicode-border: #181810;
    --aicode-active-red: #a81c1c;
    --aicode-active-red-hover: #991b1b;
    --aicode-text-main: #181810;
    --aicode-text-muted: #64748b;
    --aicode-sidebar-width: 260px;
    --aicode-font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body.aicode-dashboard-body {
    margin: 0;
    padding: 0;
    font-family: var(--aicode-font);
    background-color: var(--aicode-bg);
    background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
    background-size: 18px 18px;
    color: var(--aicode-text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ===== APP LAYOUT ===== */
.aicode-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* ===== SIDEBAR ===== */
.aicode-sidebar {
    width: var(--aicode-sidebar-width);
    background: #ffffff;
    border-right: 2.5px solid var(--aicode-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    min-height: 100vh;
}

/* Notebook Spiral Spine Decoration on Right Edge */
.notebook-spine {
    position: absolute;
    top: 0;
    right: -13px;
    width: 24px;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    z-index: 20;
    padding: 30px 0;
    box-sizing: border-box;
}

.spine-ring {
    width: 22px;
    height: 14px;
    background: #ffffff;
    border: 2px solid var(--aicode-border);
    border-radius: 6px;
    box-shadow: 1px 1px 0px rgba(0,0,0,0.25);
}

.spine-collapse-btn {
    pointer-events: auto;
    width: 26px;
    height: 26px;
    background: #ffffff;
    border: 2px solid var(--aicode-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 1.5px 1.5px 0px var(--aicode-border);
    transition: transform 0.15s;
    margin-bottom: 20px;
}

.spine-collapse-btn:hover {
    transform: scale(1.1);
}

/* Brand Logo Box */
.aicode-brand-container {
    padding: 16px 14px 14px;
}

.aicode-brand-card {
    background: #ffffff;
    border: 2px solid var(--aicode-border);
    box-shadow: 2.5px 2.5px 0px var(--aicode-border);
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.aicode-brand-card:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3.5px 3.5px 0px var(--aicode-border);
}

.aicode-brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 50%;
    border: 1.5px solid var(--aicode-border);
    padding: 2px;
    background: #fff;
    flex-shrink: 0;
}

.aicode-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-ptit {
    font-size: 15px;
    font-weight: 900;
    color: #181810;
    letter-spacing: -0.2px;
}

.brand-ai {
    font-size: 15px;
    font-weight: 900;
    color: #a81c1c;
}

.brand-code {
    font-size: 15px;
    font-weight: 900;
    color: #a81c1c;
    letter-spacing: -0.2px;
}

/* Nav Menu Items */
.aicode-nav {
    padding: 6px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.aicode-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--aicode-text-main);
    font-size: 13.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid transparent;
    user-select: none;
}

.aicode-nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.aicode-nav-item:hover:not(.active) {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.aicode-nav-item.active {
    background-color: var(--aicode-active-red);
    color: #ffffff;
    border: 2px solid var(--aicode-border);
    box-shadow: 2px 2px 0px var(--aicode-border);
}

.aicode-nav-item.active .nav-icon svg {
    stroke: #ffffff;
    fill: none;
}

/* Profile Box Footer */
.aicode-profile-footer {
    padding: 12px 14px 18px;
    border-top: 2px solid var(--aicode-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.profile-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.profile-avatar-box {
    width: 36px;
    height: 36px;
    background: #e2b4b4;
    border: 2px solid var(--aicode-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 15px;
    color: var(--aicode-border);
    flex-shrink: 0;
}

.profile-text-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    overflow: hidden;
}

.profile-name {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--aicode-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-student-code {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--aicode-text-muted);
}

.profile-selector-icon {
    color: var(--aicode-text-muted);
    cursor: pointer;
}

/* ===== MAIN WORKSPACE ===== */
.aicode-main {
    flex: 1;
    padding: 36px 48px;
    overflow-y: auto;
}

.aicode-header {
    margin-bottom: 24px;
}

.workspace-title {
    font-size: 36px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin: 0 0 8px 0;
    color: var(--aicode-text-main);
}

.workspace-subtitle {
    font-size: 15px;
    color: var(--aicode-text-muted);
    margin: 0 0 20px 0;
    font-weight: 500;
}

.workspace-divider {
    height: 2px;
    background-color: var(--aicode-border);
    width: 100%;
    margin-bottom: 28px;
}

/* Content Panels */
.aicode-tab-panel {
    display: none;
}

.aicode-tab-panel.active {
    display: block;
}

/* ===== METRICS / STATS CARDS (Neobrutal) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: #ffffff;
    border: 2px solid var(--aicode-border);
    box-shadow: 3.5px 3.5px 0px var(--aicode-border);
    border-radius: 8px;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
}

.stat-box-lbl {
    font-size: 12.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--aicode-text-muted);
    margin-bottom: 6px;
}

.stat-box-val {
    font-size: 28px;
    font-weight: 900;
    color: var(--aicode-text-main);
    line-height: 1.1;
}

/* ===== BRUTAL CARD & TABLE ===== */
.brutal-card {
    background: #ffffff;
    border: 2.5px solid var(--aicode-border);
    box-shadow: 4px 4px 0px var(--aicode-border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 28px;
}

.brutal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.brutal-card-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--aicode-text-main);
    margin: 0;
}

.brutal-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.brutal-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.brutal-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--aicode-text-main);
    border-bottom: 2px solid var(--aicode-border);
    text-transform: uppercase;
    white-space: nowrap;
}

.brutal-table td {
    padding: 14px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--aicode-text-main);
}

.brutal-table tr:last-child td {
    border-bottom: none;
}

/* ===== CHARTS GRID ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Badge styles */
.badge-brutal {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1.5px solid var(--aicode-border);
    box-shadow: 1.5px 1.5px 0px var(--aicode-border);
    text-transform: uppercase;
}

.badge-brutal-primary {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-brutal-success {
    background: #ecfdf5;
    color: #047857;
}

.badge-brutal-warning {
    background: #fffbeb;
    color: #b45309;
}
