/* DASHBOARD CONTAINER */
.cgpa-dashboard {
    font-family: 'Segoe UI', sans-serif;
    max-width: 1200px;
    margin: 30px auto;
    background: #f8fafc;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

/* HEADER */
.dash-header {
    background: white; padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center;
}
.dh-left { display: flex; align-items: center; gap: 15px; }
.dh-icon {
    width: 45px; height: 45px; background: #eff6ff; color: #3b82f6;
    border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.dash-header h2 { margin: 0; font-size: 22px; color: #1e293b; line-height: 1.2; }
.dash-header small { color: #64748b; font-size: 13px; font-weight: 600; display: block; margin-top: 2px; }
.badge-pro { background: #1e293b; color: white; padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: bold; }

/* GRID LAYOUT */
.dash-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    min-height: 450px;
}

/* LEFT COLUMN */
.col-controls { padding: 40px; border-right: 1px solid #e2e8f0; background: #fff; }

/* Menu Pills (Modified for Mobile) */
.nav-pills {
    display: flex; gap: 10px; background: #f1f5f9; padding: 6px;
    border-radius: 12px; margin-bottom: 30px; flex-wrap: wrap; /* Safety wrap */
}
.nav-btn {
    flex: 1; border: none; background: transparent; padding: 12px;
    border-radius: 8px; font-weight: 600; color: #64748b; cursor: pointer;
    transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;
    white-space: nowrap;
}
.nav-btn:hover { background: rgba(255,255,255,0.5); color: #333; }
.nav-btn.active { background: #fff; color: #3b82f6; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

/* Inputs */
.tab-panel { display: none; animation: slideUp 0.3s; }
.active-panel { display: block; }
@keyframes slideUp { from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);} }

.control-card { background: #fff; }
.lbl-main { display: block; font-size: 14px; font-weight: 700; color: #334155; margin-bottom: 10px; }
.inp-big {
    width: 100%; padding: 15px; font-size: 24px; border: 2px solid #e2e8f0;
    border-radius: 12px; font-weight: bold; color: #0f172a; outline: none; transition: 0.2s;
}
.inp-big:focus { border-color: #3b82f6; }

.setting-group { margin-top: 25px; padding-top: 20px; border-top: 1px dashed #e2e8f0; }
.flex-row { display: flex; gap: 10px; margin-top: 8px; }

select {
    flex: 1; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: 14px; background: #f8fafc; cursor: pointer; outline: none;
}
.inp-small {
    width: 100px; padding: 10px; border: 2px solid #3b82f6; border-radius: 8px;
    font-weight: bold; display: none; 
}

/* SGPA List */
.sgpa-wrapper { max-height: 350px; overflow-y: auto; }
.sgpa-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px; }
.sgpa-list input { padding: 10px; border: 1px solid #ddd; border-radius: 8px; width: 100%; font-size: 16px; }
.sgpa-actions { display: flex; gap: 15px; }
.btn-act { padding: 12px 20px; border-radius: 8px; border: 1px solid #ddd; background: #fff; cursor: pointer; font-weight: bold; font-size: 14px; }
.btn-primary { background: #3b82f6; color: white; border: none; flex: 1; }

/* RIGHT COLUMN */
.col-result {
    background: #f8fafc; padding: 40px;
    display: flex; align-items: center; justify-content: center;
}
.result-card {
    background: #fff; padding: 30px; border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-align: center;
    width: 100%; max-width: 350px;
}
.result-card h3 { margin: 0 0 20px; color: #64748b; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }

/* GAUGE */
.gauge-wrapper {
    position: relative; width: 220px; height: 110px; margin: 0 auto 20px; overflow: hidden;
}
.gauge-bg {
    width: 220px; height: 220px; background: #e2e8f0; border-radius: 50%; position: absolute; top: 0; left: 0;
}
.gauge-fill {
    position: absolute; top: 100%; left: 0; width: 220px; height: 220px;
    background: #3b82f6; border-radius: 50%;
    transform-origin: center top; transform: rotate(0deg);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.gauge-cover {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 180px; height: 90px; background: #fff;
    border-top-left-radius: 110px; border-top-right-radius: 110px;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
#res_big { font-size: 38px; font-weight: 800; color: #1e293b; line-height: 1; z-index: 10; margin-bottom: 5px; }
#res_lbl { font-size: 12px; color: #94a3b8; font-weight: 700; text-transform: uppercase; z-index: 10; margin-bottom: 15px; }

/* Details */
.res-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid #f1f5f9; padding-top: 20px; }
.rd-item { background: #f8fafc; padding: 8px; border-radius: 8px; }
.rd-item span { display: block; font-size: 11px; color: #94a3b8; font-weight: 700; margin-bottom: 3px; }
.rd-item strong { display: block; font-size: 14px; color: #334155; line-height: 1.4; }

/* --- MOBILE RESPONSIVE FIXES --- */
@media (max-width: 850px) {
    .cgpa-dashboard { margin: 15px; border-radius: 15px; }
    
    /* Header Stack */
    .dash-header { padding: 15px; flex-direction: row; }
    .badge-pro { display: none; } /* Hide 'Max Width' badge on mobile */

    /* Grid Stack */
    .dash-grid { grid-template-columns: 1fr; }
    .col-controls { border-right: none; border-bottom: 1px solid #e2e8f0; padding: 20px; }
    
    /* 2x2 Grid for Buttons (Fixes overflow issue) */
    .nav-pills { 
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 8px; 
        padding: 0; background: transparent; 
    }
    .nav-btn { 
        background: #fff; border: 1px solid #e2e8f0; 
        font-size: 13px; padding: 10px;
        justify-content: center;
    }
    .nav-btn.active { border-color: #3b82f6; background: #eff6ff; }

    /* Inputs */
    .inp-big { font-size: 20px; padding: 12px; }
    .setting-group { margin-top: 15px; padding-top: 15px; }
    
    /* SGPA Grid */
    .sgpa-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Result Section */
    .col-result { padding: 30px 20px; background: #f1f5f9; }
    .result-card { padding: 20px; box-shadow: none; border: 1px solid #e2e8f0; }
}