:root {
    --sp-primary: #2563eb;
    --sp-primary-dark: #1d4ed8;
}

/* =============================================
   Base
   ============================================= */
.sp-wrap {
    max-width: 920px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
    box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }

/* =============================================
   Auth Box
   ============================================= */
#sp-auth-wrap {
    max-width: 500px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 28px rgba(0,0,0,.10);
    padding: 36px;
}
.sp-logo-wrap { text-align: center; margin-bottom: 12px; }
.sp-logo-wrap img { max-height: 70px; }
.sp-school-name { text-align: center; font-size: 20px; font-weight: 700; color: var(--sp-primary); margin-bottom: 8px; }
.sp-welcome-msg { text-align: center; font-size: 14px; color: #6b7280; margin-bottom: 20px; }

.sp-auth-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
}
.sp-tab-btn {
    background: none; border: none;
    padding: 10px 24px; cursor: pointer;
    font-size: 15px; font-weight: 500; color: #6b7280;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: color .2s, border-color .2s;
}
.sp-tab-btn.active, .sp-tab-btn:hover { color: var(--sp-primary); border-bottom-color: var(--sp-primary); }
.sp-tab-panel { display: none; }
.sp-tab-panel.active { display: block; }

.sp-form label {
    display: block; margin: 14px 0 4px;
    font-size: 13px; font-weight: 600; color: #374151;
}
.sp-form input, .sp-form select {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #d1d5db; border-radius: 8px;
    font-size: 14px; transition: border .2s;
}
.sp-form input:focus, .sp-form select:focus {
    outline: none; border-color: var(--sp-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* =============================================
   Buttons
   ============================================= */
.sp-btn {
    display: inline-block; margin-top: 18px;
    padding: 11px 28px; background: var(--sp-primary);
    color: #fff; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    width: 100%; transition: background .2s; text-align: center;
    text-decoration: none;
}
.sp-btn:hover { background: var(--sp-primary-dark); }
.sp-btn:disabled { opacity: .6; cursor: not-allowed; }
.sp-btn-sm { padding: 7px 16px; font-size: 13px; margin-top: 0; width: auto; }
.sp-btn-outline {
    background: transparent; border: 2px solid rgba(255,255,255,.8);
    color: #fff; width: auto; padding: 8px 20px; font-size: 13px; margin-top: 0;
}
.sp-btn-outline:hover { background: rgba(255,255,255,.15); }
.sp-btn-outline-dark { border-color: var(--sp-primary); color: var(--sp-primary); background: transparent; }

/* =============================================
   Messages
   ============================================= */
.sp-msg { margin: 10px 0; padding: 10px 14px; border-radius: 8px; font-size: 14px; display: none; }
.sp-msg.success { background: #d1fae5; color: #065f46; }
.sp-msg.error   { background: #fee2e2; color: #991b1b; }
.sp-alert       { padding: 12px 18px; border-radius: 8px; font-size: 14px; margin: 16px 0; }
.sp-alert-error { background: #fee2e2; color: #991b1b; }
.req { color: #ef4444; }

/* =============================================
   Dashboard Shell
   ============================================= */
.sp-dashboard { background: #fff; border-radius: 14px; box-shadow: 0 4px 24px rgba(0,0,0,.08); overflow: hidden; }

.sp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 28px;
    background: linear-gradient(135deg, var(--sp-primary-dark), var(--sp-primary));
    color: #fff;
}
.sp-header-info { display: flex; align-items: center; gap: 16px; }
.sp-avatar {
    width: 54px; height: 54px; background: rgba(255,255,255,.25);
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 22px; font-weight: 700;
    color: #fff; flex-shrink: 0;
}
.sp-avatar-img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.4); flex-shrink:0; }
.sp-header-logo { max-height: 28px; margin-bottom: 4px; display: block; }
.sp-header h2 { margin: 0; font-size: 19px; color: #fff; }
.sp-header p  { margin: 3px 0 0; font-size: 13px; color: rgba(255,255,255,.75); }

.sp-dash-tabs {
    display: flex; background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 16px; overflow-x: auto; gap: 2px;
}
.sp-dash-tabs .sp-tab-btn { white-space: nowrap; padding: 13px 16px; font-size: 14px; }

.sp-badge {
    display: inline-block; background: var(--sp-primary);
    color: #fff; border-radius: 10px;
    padding: 1px 7px; font-size: 11px; margin-left: 4px;
}

.sp-tab-panel { padding: 24px 28px; }
.sp-tab-panel h3 { margin: 0 0 18px; font-size: 17px; color: var(--sp-primary); }
.sp-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sp-panel-header h3 { margin: 0; }

/* =============================================
   Profile
   ============================================= */
.sp-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sp-profile-item {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 14px 16px;
}
.sp-profile-item span { display: block; font-size: 11px; color: #6b7280; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .5px; }
.sp-profile-item strong { font-size: 15px; color: #1a1a2e; }
.sp-gpa-pill { background: #eff6ff !important; border-color: #bfdbfe !important; }
.sp-gpa-value { color: var(--sp-primary) !important; font-size: 18px !important; }

/* =============================================
   Results
   ============================================= */
.sp-results-group { margin-bottom: 24px; }
.sp-results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sp-results-header h4 { margin: 0; font-size: 14px; color: var(--sp-primary); padding: 7px 12px; background: #eff6ff; border-left: 4px solid var(--sp-primary); border-radius: 4px; }
.sp-period-gpa { font-size: 13px; font-weight: 600; color: var(--sp-primary); background: #eff6ff; padding: 4px 12px; border-radius: 20px; }

/* =============================================
   Tables
   ============================================= */
.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sp-table th { background: #f1f5f9; padding: 9px 14px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.sp-table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; color: #374151; }
.sp-table tr:last-child td { border-bottom: none; }
.sp-table tr:hover td { background: #f8fafc; }

.sp-grade { display: inline-block; padding: 2px 10px; border-radius: 20px; font-weight: 700; font-size: 13px; }
.sp-grade-a { background:#d1fae5; color:#065f46; }
.sp-grade-b { background:#dbeafe; color:#1e40af; }
.sp-grade-c { background:#fef3c7; color:#92400e; }
.sp-grade-d { background:#ffedd5; color:#9a3412; }
.sp-grade-e,.sp-grade-f { background:#fee2e2; color:#991b1b; }
.sp-grade-p { background:#e0e7ff; color:#3730a3; }

/* =============================================
   Report Card
   ============================================= */
.sp-report-card {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 28px; max-width: 760px; margin: 0 auto;
}
.sp-report-header { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid var(--sp-primary); padding-bottom: 16px; margin-bottom: 20px; }
.sp-report-logo { max-height: 60px; }
.sp-report-header h2 { margin: 0; font-size: 20px; color: var(--sp-primary); }
.sp-report-subtitle { margin: 4px 0 0; font-size: 13px; color: #6b7280; }
.sp-report-student-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin-bottom: 20px; font-size: 14px; background: #f8fafc; padding: 14px; border-radius: 8px; }
.sp-report-semester { margin-bottom: 24px; }
.sp-report-sem-title { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 15px; color: #1e3a8a; padding: 8px 12px; background: #eff6ff; border-left: 4px solid var(--sp-primary); border-radius: 4px; margin-bottom: 10px; }
.sp-report-gpa-pill { background: var(--sp-primary); color: #fff; padding: 3px 12px; border-radius: 20px; font-size: 13px; }
.sp-report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sp-report-table th { background: #f1f5f9; padding: 8px 10px; text-align: left; font-weight: 600; color: #475569; font-size: 11px; text-transform: uppercase; }
.sp-report-table td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; }
.sp-report-total td { background: #f8fafc; font-size: 14px; padding: 10px; }
.sp-report-cumulative {
    margin-top: 20px; padding: 16px 20px; background: var(--sp-primary);
    color: #fff; border-radius: 10px; display: flex; align-items: center; gap: 12px; font-size: 15px;
}
.sp-report-cumulative strong { font-size: 22px; }
.sp-report-cumulative {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
}
.sp-gpa-classification { opacity: .85; font-size: 14px; margin-left: auto; }
.sp-report-footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid #e2e8f0; text-align: center; font-size: 12px; color: #9ca3af; }

@media print {
    /* hide the entire page (theme header, nav, sidebar, footer, etc.) */
    body * { visibility: hidden !important; }
    /* reveal only the report card and its contents */
    #sp-tab-report, #sp-tab-report * { visibility: visible !important; }
    /* pull the report out of normal flow so it's the only thing on the page */
    #sp-tab-report {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* hide plugin-internal chrome still nested inside .sp-wrap */
    .sp-header, .sp-dash-tabs, .sp-btn, #sp-logout-btn { display: none !important; }
    .sp-dashboard { box-shadow: none !important; border-radius: 0 !important; }
    .sp-wrap { margin: 0 !important; max-width: 100% !important; }
}

/* =============================================
   Fees
   ============================================= */
.sp-status { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.sp-status-paid    { background:#d1fae5; color:#065f46; }
.sp-status-unpaid  { background:#fee2e2; color:#991b1b; }
.sp-status-partial { background:#fef3c7; color:#92400e; }
.sp-fee-note { margin-top: 14px; padding: 12px 16px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; font-size: 13px; color: #92400e; }

/* =============================================
   Documents
   ============================================= */
.sp-doc-group { margin-bottom: 24px; }
.sp-doc-group-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #374151; display: flex; align-items: center; gap: 8px; }
.sp-doc-count { background: #e0e7ff; color: #3730a3; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.sp-doc-list { display: flex; flex-direction: column; gap: 10px; }
.sp-doc-card {
    display: flex; align-items: center; gap: 14px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 14px 16px;
    transition: box-shadow .2s;
}
.sp-doc-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.sp-doc-icon { font-size: 28px; flex-shrink: 0; }
.sp-doc-info { flex: 1; min-width: 0; }
.sp-doc-title { font-size: 15px; font-weight: 600; color: #1a1a2e; }
.sp-doc-meta { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.sp-doc-download {
    flex-shrink: 0; background: var(--sp-primary); color: #fff;
    padding: 7px 16px; border-radius: 7px; font-size: 13px;
    font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: background .2s;
}
.sp-doc-download:hover { background: var(--sp-primary-dark); color: #fff; }

/* =============================================
   Notices
   ============================================= */
.sp-notices-list { display: flex; flex-direction: column; gap: 14px; }
.sp-notice-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px 18px; }
.sp-notice-title { font-size: 15px; font-weight: 700; color: #1e3a8a; margin-bottom: 3px; }
.sp-notice-date  { font-size: 12px; color: #9ca3af; margin-bottom: 8px; }
.sp-notice-body  { font-size: 14px; color: #374151; line-height: 1.6; }

/* =============================================
   Footer
   ============================================= */
.sp-footer { text-align: center; font-size: 12px; color: #9ca3af; margin-top: 20px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.sp-dash-footer { text-align: center; font-size: 12px; color: #9ca3af; padding: 14px 28px; border-top: 1px solid #f1f5f9; }

/* =============================================
   Empty state
   ============================================= */
.sp-empty { text-align: center; padding: 36px 20px; color: #9ca3af; font-size: 15px; }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 600px) {
    #sp-auth-wrap { padding: 24px 18px; }
    .sp-profile-grid { grid-template-columns: 1fr; }
    .sp-header { flex-direction: column; gap: 14px; align-items: flex-start; }
    .sp-report-student-info { grid-template-columns: 1fr; }
    .sp-report-card { padding: 16px; }
    .sp-tab-panel { padding: 16px; }
    .sp-doc-card { flex-wrap: wrap; }
    .sp-table { font-size: 12px; }
    .sp-table th, .sp-table td { padding: 7px 8px; }
	.sp-report-cumulative { flex-wrap: wrap; }
}

/* =============================================
   Social Login
   ============================================= */
.sp-social-divider {
    text-align: center; margin: 18px 0 4px;
    position: relative; color: #9ca3af; font-size: 13px;
}
.sp-social-divider::before {
    content: ''; position: absolute; top: 50%; left: 0; right: 0;
    height: 1px; background: #e5e7eb;
}
.sp-social-divider span { background: #fff; padding: 0 10px; position: relative; }
.sp-btn-google {
    background: #fff; color: #374151;
    border: 1.5px solid #d1d5db;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-weight: 600; font-size: 14px; margin-top: 10px;
    transition: box-shadow .2s, border-color .2s; text-decoration: none;
}
.sp-btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); border-color: #9ca3af; color: #111; background: #fff; }
.sp-google-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* =============================================
   Remember Me
   ============================================= */
.sp-remember-row { margin-top: 12px; }
.sp-remember-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7280; cursor: pointer; font-weight: 400; }
.sp-remember-label input { width: auto; margin: 0; }

/* =============================================
   Fees Total Row
   ============================================= */
.sp-fees-total-row td { background: #f1f5f9; border-top: 2px solid #e2e8f0; font-size: 14px; padding: 11px 14px; }
.sp-balance-due   { color: #991b1b; }
.sp-balance-clear { color: #065f46; }
.sp-tab-btn,
.sp-tab-btn.active,
.sp-tab-btn:hover,
.sp-tab-btn:focus {
    background: transparent !important;
    background-color: transparent !important;
}
