/* Student Portal — brand red theme */
:root {
    --sp-primary: #d9242a;
    --sp-primary-dark: #b01c22;
    --sp-bg: #f3f3f3;
    --sp-sidebar: #1f1f1f;
    --sp-text: #0f172a;
    --sp-muted: #64748b;
    --sp-border: #e2e8f0;
    --sp-card: #ffffff;
    --sp-header-height: 74px;
}

.sp-body {
    margin: 0;
    font-family: Inter, sans-serif;
    background: var(--sp-bg);
    color: var(--sp-text);
    width: 100%;
    max-width: 100%;
}

html {
    width: 100%;
    max-width: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Custom scrollbar (global) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: #d5dbe6;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}
:hover::-webkit-scrollbar-thumb {
    background-color: #b4bccb;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #d9242a;
    border-width: 1px;
}
::-webkit-scrollbar-thumb:active {
    background-color: #b81d22;
    border-width: 1px;
}
::-webkit-scrollbar-button {
    display: none;
}
@supports (-moz-appearance: none) {
    * {
        scrollbar-width: thin;
        scrollbar-color: #c3cad8 transparent;
    }
    .sp-nav {
        scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    }
}
.sp-wrapper { display: flex; min-height: 100vh; max-width: 100%; width: 100%; overflow-x: clip; }
.sp-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 140; }
.sp-overlay.active { display: block; }

.sp-sidebar {
    width: 260px; background: var(--sp-sidebar); color: #e2e8f0; display: flex; flex-direction: column;
    flex-shrink: 0; position: sticky; top: 0; align-self: flex-start; height: 100vh; z-index: 160;
}
.sp-brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sp-brand-text { flex: 1; min-width: 0; }
.sp-brand-icon { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #d9242a, #b01c22); display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; flex-shrink: 0; }
.sp-brand-icon.has-logo { background: #fff; border: 1px solid #e2e8f0; }
.sp-brand-icon img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.sp-brand h2 { margin: 0; font-size: 0.95rem; color: #fff; line-height: 1.2; word-break: break-word; }
.sp-brand span { font-size: 0.72rem; color: #f0a3a6; }
.sp-sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background .15s, border-color .15s;
}
.sp-sidebar-close:hover {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.3);
}

.sp-user-card { display: flex; gap: 12px; align-items: center; padding: 16px 18px; margin: 12px; background: rgba(255,255,255,.06); border-radius: 14px; }
.sp-user-card img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.sp-user-card strong { display: block; color: #fff; font-size: 0.9rem; }
.sp-user-card small { color: #f0a3a6; font-size: 0.78rem; }

.sp-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.sp-nav::-webkit-scrollbar { width: 6px; }
.sp-nav::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,.22); }
.sp-nav:hover::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,.34); }
.sp-nav::-webkit-scrollbar-thumb:hover,
.sp-nav::-webkit-scrollbar-thumb:active { background-color: rgba(255,255,255,.6); }
.sp-nav-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .06em; color: #f0a3a6; padding: 12px 10px 6px; margin: 0; }
.sp-nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
    color: #efefef; text-decoration: none; font-size: 0.88rem; font-weight: 500; margin-bottom: 2px;
}
.sp-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sp-nav a.active { background: linear-gradient(135deg, #d9242a, #b01c22); color: #fff; }
.sp-nav a i { width: 18px; text-align: center; }

.sp-sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sp-logout { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #fca5a5; text-decoration: none; border-radius: 10px; font-size: 0.88rem; }
.sp-logout:hover { background: rgba(239,68,68,.15); }

.sp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ===== Topbar (matches teacher portal) ===== */
.sp-topbar {
    height: var(--sp-header-height);
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--sp-border);
    position: sticky; top: 0; z-index: 120;
    box-shadow: 0 1px 8px rgba(143, 22, 27, 0.04);
}
.sp-header-left { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.sp-header-breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; }
.sp-breadcrumb-root { color: var(--sp-muted); font-weight: 500; }
.sp-header-breadcrumb > i { font-size: 0.55rem; color: #cbd5e1; }
.sp-breadcrumb-current { color: var(--sp-text); font-weight: 600; }

.sp-header-center { flex: 1; display: flex; justify-content: center; max-width: 560px; }
.sp-search-bar {
    display: flex; align-items: center; background: var(--sp-card);
    border-radius: 14px; border: 1.5px solid var(--sp-border);
    padding: 0 18px; width: 100%; height: 48px; transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(143, 22, 27, 0.06); position: relative;
}
.sp-search-bar:focus-within { border-color: var(--sp-primary); box-shadow: 0 0 0 4px rgba(217, 36, 42, 0.12), 0 4px 16px rgba(143, 22, 27, 0.1); }
.sp-search-bar > i { color: #94a3b8; margin-right: 12px; font-size: 1rem; flex-shrink: 0; }
.sp-search-bar:focus-within > i { color: var(--sp-primary); }
.sp-search-bar input { border: none; outline: none; background: transparent; width: 100%; font-family: inherit; color: var(--sp-text); font-size: 0.95rem; font-weight: 500; }
.sp-search-bar input::placeholder { color: #94a3b8; font-weight: 400; }
.sp-search-shortcut { display: inline-flex; align-items: center; padding: 4px 9px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 7px; font-size: 0.72rem; font-family: inherit; color: #64748b; font-weight: 600; flex-shrink: 0; margin-left: 8px; }
.sp-search-dropdown { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border: 1px solid var(--sp-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12); max-height: 320px; overflow-y: auto; z-index: 200; }
.sp-search-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid #f1f5f9; }
.sp-search-item:hover { background: #fff5f5; }
.sp-search-item i { width: 36px; height: 36px; border-radius: 10px; background: #fde8e9; color: var(--sp-primary); display: flex; align-items: center; justify-content: center; }
.sp-search-item strong { display: block; font-size: 0.9rem; }
.sp-search-item span { font-size: 0.78rem; color: var(--sp-muted); }
.sp-search-empty { padding: 16px; text-align: center; color: var(--sp-muted); font-size: 0.88rem; }

.sp-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sp-header-icon-btn { width: 42px; height: 42px; border-radius: 12px; background-color: #f8fafc; border: 1px solid var(--sp-border); display: flex; align-items: center; justify-content: center; color: var(--sp-text); font-size: 1.05rem; transition: all 0.2s ease; position: relative; text-decoration: none; }
.sp-header-icon-btn:hover { background-color: #f1f5f9; border-color: #cbd5e1; color: var(--sp-primary); }

.sp-header-user { position: relative; margin-left: 6px; z-index: 200; }
.sp-header-user-trigger { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-card); cursor: pointer; transition: all 0.2s ease; font-family: inherit; }
.sp-header-user-trigger:hover, .sp-header-user.open .sp-header-user-trigger { border-color: #cbd5e1; background: #f8fafc; box-shadow: 0 2px 8px rgba(143, 22, 27, 0.06); }
.sp-header-user-trigger img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
.sp-header-user-info { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.sp-header-user-name { font-size: 0.875rem; font-weight: 600; color: var(--sp-text); line-height: 1.2; }
.sp-header-user-role { font-size: 0.72rem; color: var(--sp-muted); margin-top: 1px; }
.sp-header-user-chevron { font-size: 0.65rem; color: var(--sp-muted); transition: transform 0.2s ease; margin-left: 4px; }
.sp-header-user.open .sp-header-user-chevron { transform: rotate(180deg); }
.sp-header-user-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: 240px; background: var(--sp-card); border: 1px solid var(--sp-border); border-radius: 14px; box-shadow: 0 12px 40px rgba(143, 22, 27, 0.12); display: none; z-index: 300; overflow: hidden; }
.sp-header-user.open .sp-header-user-dropdown { display: block; }
.sp-dropdown-header { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--sp-border); background: #f8fafc; }
.sp-dropdown-header img { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; }
.sp-dropdown-header strong { display: block; font-size: 0.9rem; color: var(--sp-text); }
.sp-dropdown-header span { font-size: 0.75rem; color: var(--sp-muted); }
.sp-dropdown-menu { padding: 8px; list-style: none; margin: 0; }
.sp-dropdown-menu li a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 0.875rem; color: #64748b; transition: all 0.2s ease; text-decoration: none; }
.sp-dropdown-menu li a i { width: 18px; font-size: 0.85rem; color: var(--sp-muted); }
.sp-dropdown-menu li a:hover { background: #f1f5f9; color: var(--sp-text); }
.sp-dropdown-menu li a:hover i { color: var(--sp-primary); }
.sp-dropdown-footer { padding: 8px; border-top: 1px solid var(--sp-border); }
.sp-dropdown-footer a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 0.875rem; color: #ef4444; font-weight: 500; transition: background 0.2s ease; text-decoration: none; }
.sp-dropdown-footer a:hover { background: #fef2f2; }

.sp-menu-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--sp-border); border-radius: 10px; background: #fff; cursor: pointer; font-size: 1rem; color: var(--sp-text); align-items: center; justify-content: center; transition: all 0.2s ease; }
.sp-menu-toggle:hover { background: #f1f5f9; border-color: #cbd5e1; }

.sp-content { flex: 1; padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; min-width: 0; }

/* ===== Footer (matches teacher portal) ===== */
.sp-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 20px 30px; background-color: var(--sp-card); border-top: 1px solid var(--sp-border); margin-top: auto; min-width: 0; width: 100%; }
.sp-footer-left { min-width: 0; flex: 1 1 auto; }
.sp-footer p { color: var(--sp-muted); font-size: 0.9rem; margin: 0; line-height: 1.45; word-break: break-word; }
.sp-footer strong { color: var(--sp-text); }
.sp-footer-right { display: flex; flex-wrap: wrap; gap: 20px; min-width: 0; }
.sp-footer-right a { color: var(--sp-muted); font-size: 0.9rem; transition: color 0.3s ease; text-decoration: none; }
.sp-footer-right a:hover { color: var(--sp-primary); }

/* Mobile app-style bottom tab bar — desktop hidden */
.sp-bottom-nav {
    display: none;
}

.sp-welcome,
.sp-stat-grid,
.sp-quick-card,
.sp-grid-2,
.sp-card { min-width: 0; max-width: 100%; }

/* Stat cards */
.sp-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 16px; margin-bottom: 20px; }
.sp-stat { background: var(--sp-card); border: 1px solid var(--sp-border); border-radius: 18px; padding: 18px; display: flex; gap: 14px; align-items: center; position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; }
.sp-stat::after { content: ''; position: absolute; top: -30px; right: -30px; width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: .05; pointer-events: none; z-index: 0; }
.sp-stat:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15,23,42,.08); border-color: transparent; }
.sp-stat-icon { width: 50px; height: 50px; border-radius: 14px; background: #fde8e9; color: var(--sp-primary); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; position: relative; z-index: 1; }
.sp-stat-body { min-width: 0; flex: 1; position: relative; z-index: 1; }
.sp-stat span { display: block; font-size: 0.7rem; color: var(--sp-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.sp-stat strong { font-size: 1.5rem; font-weight: 800; line-height: 1.2; color: var(--sp-text); word-break: break-word; overflow-wrap: anywhere; }
.sp-stat small { display: block; font-size: 0.74rem; color: var(--sp-muted); font-weight: 500; margin-top: 2px; word-break: break-word; }
.sp-stat.tone-green { color: #059669; } .sp-stat.tone-green .sp-stat-icon { background: #ecfdf5; color: #059669; }
.sp-stat.tone-red { color: #dc2626; } .sp-stat.tone-red .sp-stat-icon { background: #fef2f2; color: #dc2626; }
.sp-stat.tone-blue { color: #2563eb; } .sp-stat.tone-blue .sp-stat-icon { background: #eff6ff; color: #2563eb; }
.sp-stat.tone-amber { color: #d97706; } .sp-stat.tone-amber .sp-stat-icon { background: #fffbeb; color: #d97706; }
.sp-stat.tone-purple { color: #d9242a; } .sp-stat.tone-purple .sp-stat-icon { background: #fde8e9; color: #d9242a; }

/* Welcome hero */
.sp-welcome { position: relative; overflow: hidden; border-radius: 20px; padding: 26px 28px; margin-bottom: 20px; background: linear-gradient(135deg, #8e161b 0%, #b01c22 55%, #d9242a 100%); color: #fff; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; max-width: 100%; }
.sp-welcome::before { content: ''; position: absolute; top: -70px; right: -50px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none; }
.sp-welcome::after { content: ''; position: absolute; bottom: -90px; right: 90px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.05); pointer-events: none; }
.sp-welcome-avatar { width: 66px; height: 66px; border-radius: 18px; object-fit: cover; border: 2px solid rgba(255,255,255,.35); position: relative; z-index: 1; flex-shrink: 0; }
.sp-welcome-body { position: relative; z-index: 1; flex: 1; min-width: 0; }
.sp-welcome-body h2 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; word-break: break-word; }
.sp-welcome-body p { margin: 0 0 12px; opacity: .85; font-size: 0.92rem; }
.sp-welcome-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-welcome-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); font-size: 0.78rem; font-weight: 600; max-width: 100%; word-break: break-word; }
.sp-welcome-date { position: relative; z-index: 1; text-align: center; padding: 12px 20px; border-radius: 16px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); flex-shrink: 0; }
.sp-welcome-date strong { display: block; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.sp-welcome-date span { font-size: 0.76rem; opacity: .85; }

/* Layout grid */
.sp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sp-grid-2.wide-first { grid-template-columns: 1.4fr 1fr; }

/* Cards */
.sp-card { background: var(--sp-card); border: 1px solid var(--sp-border); border-radius: 18px; padding: 22px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(217,36,42,.04); }
.sp-card h3 { margin: 0 0 16px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.sp-card h3 i { color: var(--sp-primary); }
.sp-card-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -22px -22px 18px;
    padding: 14px 22px;
    border-bottom: 1px solid #f3e4e4;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(180deg, #fffafa 0%, #ffffff 100%);
}
.sp-card-head::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #d9242a, #b01c22);
}
.sp-card-head h3 {
    margin: 0;
    min-width: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--sp-text);
    letter-spacing: -0.01em;
    gap: 10px;
}
.sp-card-head h3 i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff5f5;
    border: 1px solid #f5c2c4;
    color: var(--sp-primary);
    font-size: 0.85rem;
}
.sp-card-head > span:not(.sp-badge),
.sp-card-head .spb-muted {
    padding: 4px 11px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--sp-border);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--sp-muted);
    white-space: nowrap;
}
.sp-card-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sp-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #f5c2c4;
    background: #fff;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.sp-card-link i { font-size: 0.72rem; transition: transform .15s; }
.sp-card-link:hover {
    background: var(--sp-primary);
    border-color: var(--sp-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(217, 36, 42, 0.2);
}
.sp-card-link:hover .fa-arrow-right { transform: translateX(2px); }
span.sp-card-link,
.sp-card-link[style*="cursor:default"] { border-color: var(--sp-border); color: var(--sp-muted); }
span.sp-card-link:hover { background: #fff; color: var(--sp-muted); border-color: var(--sp-border); box-shadow: none; }

/* List */
.sp-list { display: flex; flex-direction: column; }
.sp-list-item { padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.sp-list-item:last-child { border-bottom: none; }
.sp-list-row { display: flex; gap: 13px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid #f1f5f9; }
.sp-list-row:last-child { border-bottom: none; }
.sp-list-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; flex-shrink: 0; background: #fde8e9; color: var(--sp-primary); }
.sp-list-ico.tone-blue { background: #eff6ff; color: #2563eb; }
.sp-list-ico.tone-amber { background: #fffbeb; color: #d97706; }
.sp-list-ico.tone-green { background: #ecfdf5; color: #059669; }
.sp-list-main { flex: 1; min-width: 0; }
.sp-list-main strong { display: block; font-size: 0.92rem; color: var(--sp-text); }
.sp-list-main p { margin: 3px 0 0; font-size: 0.85rem; color: var(--sp-muted); line-height: 1.5; }
.sp-list-main small { display: block; margin-top: 5px; font-size: 0.74rem; color: #94a3b8; }

/* Badges */
.sp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: .01em; }
.sp-badge.present { background: #ecfdf5; color: #059669; }
.sp-badge.absent { background: #fef2f2; color: #dc2626; }
.sp-badge.late { background: #fffbeb; color: #d97706; }
.sp-badge.half { background: #eff6ff; color: #2563eb; }
.sp-badge.urgent { background: #fef2f2; color: #dc2626; }
.sp-badge.important { background: #fffbeb; color: #d97706; }
.sp-badge.normal { background: #f1f5f9; color: #475569; }
.sp-badge.paid { background: #ecfdf5; color: #059669; }
.sp-badge.due { background: #fef2f2; color: #dc2626; }
.sp-badge.method { background: #fde8e9; color: #d9242a; }

/* Monthly fee schedule (legacy list — kept for compatibility) */
.sp-month-schedule { display: flex; flex-direction: column; gap: 8px; }
.sp-month-row {
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    border-bottom: none;
}
.sp-month-row.is-paid {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.sp-month-row.is-partial {
    background: #fffbeb;
    border-color: #fde68a;
}
.sp-month-row.is-pending {
    background: #fff;
    border-color: #e2e8f0;
}
.sp-month-row.is-current {
    box-shadow: inset 0 0 0 1px #fdba74;
}
.sp-month-row.is-paid.is-current {
    box-shadow: inset 0 0 0 1px #34d399;
}
.sp-month-current { color: #ea580c !important; font-weight: 700; }
.sp-month-row.is-paid .sp-month-current { color: #059669 !important; }
.sp-month-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.sp-month-side > strong { font-size: 0.95rem; color: var(--sp-text); white-space: nowrap; }
.sp-month-row.is-paid .sp-month-side > strong { color: #047857; }

/* Table */
.sp-table-wrap { overflow-x: auto; border: 1px solid var(--sp-border); border-radius: 14px; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.sp-table thead th { background: #f8fafc; padding: 12px 14px; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 700; border-bottom: 1px solid var(--sp-border); }
.sp-table tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; color: var(--sp-text); }
.sp-table tbody tr:last-child td { border-bottom: none; }
.sp-table tbody tr:hover { background: #faf9ff; }
.sp-table .ta-c { text-align: center; }
.sp-table .ta-r { text-align: right; }

/* Empty state */
.sp-empty { text-align: center; padding: 36px 20px; color: #94a3b8; }
.sp-empty-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; background: #fff5f5; color: var(--sp-primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.sp-empty strong { display: block; color: #475569; font-size: 0.95rem; margin-bottom: 4px; }
.sp-empty p { margin: 0; font-size: 0.85rem; }

/* Attendance ring */
.sp-ring-card { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.sp-ring { --pct: 0; width: 150px; height: 150px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--sp-primary) calc(var(--pct) * 1%), #fde8e9 0); display: flex; align-items: center; justify-content: center; position: relative; }
.sp-ring::before { content: ''; position: absolute; inset: 14px; background: #fff; border-radius: 50%; }
.sp-ring-inner { position: relative; z-index: 1; text-align: center; }
.sp-ring-inner strong { display: block; font-size: 1.8rem; font-weight: 800; color: var(--sp-text); line-height: 1; }
.sp-ring-inner span { font-size: 0.72rem; color: var(--sp-muted); font-weight: 600; text-transform: uppercase; }
.sp-ring-legend { flex: 1; min-width: 200px; display: grid; gap: 12px; }
.sp-ring-leg { display: flex; align-items: center; gap: 12px; }
.sp-ring-dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.sp-ring-leg .lbl { flex: 1; font-size: 0.88rem; color: #475569; }
.sp-ring-leg .val { font-weight: 800; font-size: 1rem; color: var(--sp-text); }

/* Quick access (Dashboard) */
.sp-quick-card { margin-bottom: 20px; }
.sp-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.sp-quick { display: flex; flex-direction: column; gap: 3px; padding: 16px; border-radius: 15px; border: 1px solid var(--sp-border); background: var(--sp-card); text-decoration: none; color: var(--sp-text); transition: transform .16s, box-shadow .16s, border-color .16s; min-width: 0; }
.sp-quick:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(15,23,42,.09); border-color: transparent; }
.sp-quick-ic { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 8px; background: #fde8e9; color: #d9242a; }
.sp-quick.tone-blue .sp-quick-ic { background: #eff6ff; color: #2563eb; }
.sp-quick.tone-green .sp-quick-ic { background: #ecfdf5; color: #059669; }
.sp-quick.tone-amber .sp-quick-ic { background: #fffbeb; color: #d97706; }
.sp-quick.tone-purple .sp-quick-ic { background: #fde8e9; color: #d9242a; }
.sp-quick strong { font-size: 0.92rem; font-weight: 700; word-break: break-word; }
.sp-quick small { font-size: 0.75rem; color: var(--sp-muted); word-break: break-word; }

/* Table footer + grade chips (Exam Results) */
.sp-table tfoot td { padding: 13px 14px; font-weight: 800; background: #fffafa; color: #8e161b; border-top: 2px solid #fde8e9; }
.sp-grade-chip { display: inline-block; min-width: 34px; padding: 3px 9px; border-radius: 7px; background: #ecfdf5; color: #059669; font-weight: 700; font-size: 0.8rem; }
.sp-grade-chip.is-fail { background: #fef2f2; color: #dc2626; }

/* Exam selector tabs */
.sp-exam-tabs { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 20px; }
.sp-exam-tab { flex: 0 0 auto; display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-radius: 14px; background: var(--sp-card); border: 1px solid var(--sp-border); text-decoration: none; color: var(--sp-text); transition: all .16s; min-width: 190px; }
.sp-exam-tab i { width: 38px; height: 38px; border-radius: 11px; background: #fde8e9; color: var(--sp-primary); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.sp-exam-tab span { display: flex; flex-direction: column; min-width: 0; }
.sp-exam-tab strong { font-size: 0.92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-exam-tab small { font-size: 0.72rem; color: var(--sp-muted); }
.sp-exam-tab:hover { border-color: var(--sp-primary); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(217,36,42,.1); }
.sp-exam-tab.active { border-color: transparent; background: linear-gradient(135deg, #d9242a, #b01c22); color: #fff; box-shadow: 0 12px 26px rgba(217,36,42,.3); }
.sp-exam-tab.active i { background: rgba(255,255,255,.2); color: #fff; }
.sp-exam-tab.active small { color: rgba(255,255,255,.8); }

/* Timetable */
.sp-tt-today { margin-bottom: 20px; }
.sp-tt-today-empty { margin: 0; color: var(--sp-muted); font-size: 0.9rem; display: flex; align-items: center; gap: 9px; }
.sp-tt-today-empty i { color: #d97706; }
.sp-tt-today-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sp-tt-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--sp-border); border-radius: 13px; background: #faf9ff; }
.sp-tt-chip-p { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, #d9242a, #b01c22); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.82rem; flex-shrink: 0; }
.sp-tt-chip-body { min-width: 0; }
.sp-tt-chip-body strong { display: block; font-size: 0.92rem; color: var(--sp-text); }
.sp-tt-chip-body small { display: block; font-size: 0.76rem; color: var(--sp-muted); margin-top: 2px; }
.sp-tt-grid td, .sp-tt-grid th { vertical-align: middle; }
.sp-tt-grid th.is-today, .sp-tt-grid td.is-today { background: #fff5f5; }
.sp-tt-grid thead th.is-today { color: var(--sp-primary); }
.sp-tt-pn { font-weight: 800; color: var(--sp-primary); white-space: nowrap; }
.sp-tt-cell { display: flex; flex-direction: column; align-items: center; gap: 1px; position: relative; }
.sp-tt-cell strong { font-size: 0.84rem; color: var(--sp-text); }
.sp-tt-cell small { font-size: 0.72rem; color: var(--sp-muted); }
.sp-tt-room { font-size: 0.66rem; font-weight: 700; color: var(--sp-primary); background: #fde8e9; padding: 1px 7px; border-radius: 6px; margin-top: 3px; }
.sp-tt-free { color: #cbd5e1; font-weight: 700; }

/* Certificates */
.sp-cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.sp-cert-card { background: var(--sp-card); border: 1px solid var(--sp-border); border-radius: 18px; padding: 20px; position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; border-top: 3px solid var(--sp-primary); }
.sp-cert-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(15,23,42,.1); }
.sp-cert-card.tone-amber { border-top-color: #d97706; }
.sp-cert-card.tone-purple { border-top-color: #d9242a; }
.sp-cert-card.tone-green { border-top-color: #059669; }
.sp-cert-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.sp-cert-ic { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.sp-cert-card.tone-amber .sp-cert-ic { background: #fffbeb; color: #d97706; }
.sp-cert-card.tone-purple .sp-cert-ic { background: #fff5f5; color: #d9242a; }
.sp-cert-card.tone-green .sp-cert-ic { background: #ecfdf5; color: #059669; }
.sp-cert-badge { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #059669; background: #ecfdf5; padding: 4px 10px; border-radius: 999px; }
.sp-cert-title { margin: 0 0 2px; font-size: 1.05rem; }
.sp-cert-sub { margin: 0 0 14px; font-size: 0.8rem; color: var(--sp-muted); }
.sp-cert-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: #475569; margin-bottom: 12px; }
.sp-cert-meta span { display: inline-flex; align-items: center; gap: 6px; }
.sp-cert-meta i { color: var(--sp-primary); }
.sp-cert-purpose { margin: 0 0 14px; font-size: 0.8rem; color: #475569; background: #f8fafc; border-radius: 10px; padding: 9px 12px; display: flex; gap: 8px; }
.sp-cert-purpose i { color: var(--sp-primary); margin-top: 2px; }
.sp-cert-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 12px; background: linear-gradient(135deg, #d9242a, #b01c22); color: #fff; font-size: 0.86rem; font-weight: 700; text-decoration: none; transition: filter .15s, transform .15s; }
.sp-cert-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* Documents */
.sp-doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.sp-doc-card { display: flex; align-items: center; gap: 14px; background: var(--sp-card); border: 1px solid var(--sp-border); border-radius: 16px; padding: 15px; transition: border-color .15s, box-shadow .15s; }
.sp-doc-card:hover { border-color: var(--sp-primary); box-shadow: 0 12px 26px rgba(15,23,42,.08); }
.sp-doc-ic { width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; background: #f1f5f9; color: #475569; }
.sp-doc-ic.tone-pdf { background: #fef2f2; color: #dc2626; }
.sp-doc-ic.tone-img { background: #eff6ff; color: #2563eb; }
.sp-doc-ic.tone-doc { background: #eef2ff; color: #4338ca; }
.sp-doc-ic.tone-xls { background: #ecfdf5; color: #059669; }
.sp-doc-body { flex: 1; min-width: 0; }
.sp-doc-type { display: inline-block; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-primary); background: #fde8e9; padding: 2px 9px; border-radius: 999px; margin-bottom: 5px; }
.sp-doc-name { display: block; font-size: 0.9rem; color: var(--sp-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-doc-meta { display: block; font-size: 0.74rem; color: var(--sp-muted); margin-top: 3px; }
.sp-doc-actions { display: flex; gap: 7px; flex-shrink: 0; }
.sp-doc-btn { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; text-decoration: none; transition: all .15s; }
.sp-doc-btn.view { background: #f1f5f9; color: #475569; }
.sp-doc-btn.view:hover { background: #e2e8f0; }
.sp-doc-btn.dl { background: #fde8e9; color: var(--sp-primary); }
.sp-doc-btn.dl:hover { background: var(--sp-primary); color: #fff; }

/* Fee progress */
.sp-fee-progress { margin-top: 4px; }
.sp-fee-progress-head { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 8px; }
.sp-fee-progress-head span { color: var(--sp-muted); font-weight: 600; }
.sp-fee-progress-head strong { color: var(--sp-text); }
.sp-fee-bar { height: 12px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.sp-fee-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #d9242a, #a855f7); transition: width .5s ease; }
.sp-fee-note { margin: 12px 0 0; font-size: 0.82rem; color: var(--sp-muted); display: flex; align-items: center; gap: 7px; }
.sp-fee-note i { color: var(--sp-primary); }

/* Fee overview — full width */
.sp-fee-overview {
    background: var(--sp-card);
    border: 1px solid var(--sp-border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 24px rgba(217, 36, 42, 0.06);
}
.sp-fee-overview-hero {
    padding: 22px 24px 20px;
    background: linear-gradient(135deg, #8e161b 0%, #b01c22 52%, #d9242a 100%);
    color: #fff;
}
.sp-fee-overview-hero-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.sp-fee-overview-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 6px;
}
.sp-fee-overview-title h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}
.sp-fee-overview-title p {
    margin: 6px 0 0;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.82);
    max-width: 520px;
    line-height: 1.5;
}
.sp-fee-overview-ring {
    --pct: 0;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: conic-gradient(#a7f3d0 calc(var(--pct) * 1%), rgba(255, 255, 255, 0.15) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}
.sp-fee-overview-ring-inner {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}
.sp-fee-overview-ring-inner strong { font-size: 1.15rem; font-weight: 800; color: #fff; }
.sp-fee-overview-ring-inner span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255, 255, 255, 0.75); font-weight: 700; margin-top: 2px; }
.sp-fee-overview-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
    margin: 18px 0 16px;
}
.sp-fee-overview-track-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6ee7b7, #34d399);
    transition: width 0.5s ease;
}
.sp-fee-overview-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.sp-fee-overview-metric {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.sp-fee-overview-metric span {
    display: block;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 700;
    margin-bottom: 3px;
}
.sp-fee-overview-metric strong { font-size: 0.95rem; font-weight: 800; color: #fff; }
.sp-fee-overview-metric.is-green strong { color: #bbf7d0; }
.sp-fee-overview-metric.is-red strong { color: #fecaca; }

.sp-fee-overview-body {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 0;
    border-top: 1px solid var(--sp-border);
}
.sp-fee-overview-panel {
    padding: 20px 22px;
    border-right: 1px solid var(--sp-border);
}
.sp-fee-overview-panel-wide { border-right: none; }
.sp-fee-overview-panel.is-full { grid-column: 1 / -1; border-right: none; }
.sp-fee-overview-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.sp-fee-overview-panel-head h3 {
    margin: 0;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--sp-text);
}
.sp-fee-overview-panel-head h3 i { color: var(--sp-primary); }
.sp-fee-overview-panel-head > span {
    font-size: 0.72rem;
    color: var(--sp-muted);
    font-weight: 600;
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--sp-border);
}
.sp-fee-head-grid { display: flex; flex-direction: column; gap: 8px; }
.sp-fee-head-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
}
.sp-fee-head-chip:hover { border-color: #f5c2c4; background: #fffafa; }
.sp-fee-head-chip-ico {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fde8e9;
    color: var(--sp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}
.sp-fee-head-chip-body { flex: 1; min-width: 0; }
.sp-fee-head-chip-body strong {
    display: block;
    font-size: 0.84rem;
    color: var(--sp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-fee-head-chip-body span { font-size: 0.82rem; font-weight: 800; color: var(--sp-primary); }

.sp-fee-month-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.72rem;
    font-weight: 700;
}
.sp-fee-month-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sp-fee-month-legend .is-paid { color: #059669; }
.sp-fee-month-legend .is-partial { color: #d97706; }
.sp-fee-month-legend .is-pending { color: #64748b; }
.sp-fee-month-legend i { font-size: 0.45rem; }

.sp-month-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}
.sp-month-card {
    position: relative;
    padding: 12px 12px 10px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.sp-month-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06); }
.sp-month-card.is-paid { background: #ecfdf5; border-color: #a7f3d0; }
.sp-month-card.is-partial { background: #fffbeb; border-color: #fde68a; }
.sp-month-card.is-pending { background: #fff; border-color: #e2e8f0; }
.sp-month-card.is-current { box-shadow: inset 0 0 0 2px #fdba74; }
.sp-month-card.is-paid.is-current { box-shadow: inset 0 0 0 2px #34d399; }
.sp-month-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}
.sp-month-card-top strong { font-size: 0.88rem; color: var(--sp-text); }
.sp-month-card-top .sp-badge { font-size: 0.62rem; padding: 2px 7px; flex-shrink: 0; }
.sp-month-card-amt { font-size: 1rem; font-weight: 800; color: var(--sp-text); line-height: 1.2; }
.sp-month-card.is-paid .sp-month-card-amt { color: #047857; }
.sp-month-card small { font-size: 0.68rem; color: var(--sp-muted); font-weight: 600; margin-top: auto; }
.sp-month-card.is-paid small { color: #059669; }
.sp-month-card-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    font-style: normal;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ea580c;
    background: #fff7ed;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid #fed7aa;
}
.sp-month-card.is-paid .sp-month-card-tag { color: #059669; background: #ecfdf5; border-color: #a7f3d0; }

.sp-fee-history-card { margin-bottom: 0; }

@media (max-width: 900px) {
    .sp-fee-overview-body { grid-template-columns: 1fr; }
    .sp-fee-overview-panel { border-right: none; border-bottom: 1px solid var(--sp-border); }
    .sp-fee-overview-panel-wide { border-bottom: none; }
}
@media (max-width: 560px) {
    .sp-fee-overview-hero { padding: 18px 16px; }
    .sp-fee-overview-panel { padding: 16px; }
    .sp-month-grid { grid-template-columns: repeat(2, 1fr); }
}
.sp-receipt-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; background: #fde8e9; color: var(--sp-primary); font-size: 0.76rem; font-weight: 700; text-decoration: none; border: 1px solid #f5c2c4; transition: all .15s; white-space: nowrap; }
.sp-receipt-btn:hover { background: var(--sp-primary); color: #fff; border-color: var(--sp-primary); transform: translateY(-1px); }

/* Homework cards */
.sp-hw-card { transition: transform .18s, box-shadow .18s; }
.sp-hw-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,23,42,.07); }
.sp-hw-top { display: flex; align-items: center; gap: 13px; }
.sp-hw-title { flex: 1; min-width: 0; }
.sp-hw-title strong { display: block; font-size: 1rem; color: var(--sp-text); }
.sp-hw-subject { display: inline-block; margin-top: 3px; font-size: 0.74rem; font-weight: 600; color: var(--sp-primary); }
.sp-hw-desc { margin: 14px 0 0; padding: 14px; background: #faf9ff; border: 1px solid var(--sp-border); border-radius: 12px; color: #475569; font-size: 0.9rem; line-height: 1.6; }
.sp-hw-foot { margin-top: 12px; font-size: 0.76rem; color: #94a3b8; display: flex; align-items: center; gap: 6px; }

/* Notice cards */
.sp-notice-card { transition: transform .18s, box-shadow .18s; }
.sp-notice-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,23,42,.07); }
.sp-notice-top { display: flex; align-items: center; gap: 13px; }
.sp-notice-title { flex: 1; min-width: 0; }
.sp-notice-title strong { display: block; font-size: 1rem; color: var(--sp-text); }
.sp-notice-title small { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 0.76rem; color: #94a3b8; }
.sp-notice-body { margin: 14px 0 0; color: #475569; font-size: 0.92rem; line-height: 1.65; }

/* Profile */
.sp-profile-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 26px; border-radius: 20px; background: linear-gradient(135deg, #8e161b, #d9242a); color: #fff; position: relative; overflow: hidden; margin-bottom: 16px; }
.sp-profile-hero::before { content: ''; position: absolute; top: -60px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.sp-profile-avatar { width: 92px; height: 92px; border-radius: 22px; object-fit: cover; border: 3px solid rgba(255,255,255,.4); position: relative; z-index: 1; }
.sp-profile-hero-info { position: relative; z-index: 1; }
.sp-profile-hero-info h2 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 800; }
.sp-profile-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sp-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sp-info-item { display: flex; gap: 12px; align-items: center; padding: 14px; background: #faf9ff; border: 1px solid var(--sp-border); border-radius: 14px; }
.sp-info-item i { width: 38px; height: 38px; border-radius: 11px; background: #fde8e9; color: var(--sp-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sp-info-item span { display: block; font-size: 0.72rem; color: var(--sp-muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.sp-info-item strong { display: block; font-size: 0.92rem; color: var(--sp-text); word-break: break-word; }
.sp-info-full { grid-column: 1 / -1; }

/* Guardians */
.sp-guardian-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.sp-guardian { display: flex; gap: 13px; align-items: flex-start; padding: 16px; background: #faf9ff; border: 1px solid var(--sp-border); border-radius: 15px; }
.sp-guardian-av { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.sp-guardian-body { min-width: 0; flex: 1; }
.sp-guardian-body strong { display: block; font-size: 0.95rem; color: var(--sp-text); }
.sp-guardian-rel { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 0.7rem; font-weight: 700; color: var(--sp-primary); background: #fde8e9; padding: 3px 10px; border-radius: 999px; }
.sp-guardian-contact { margin-top: 10px; display: grid; gap: 5px; }
.sp-guardian-contact span { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #475569; word-break: break-word; }
.sp-guardian-contact i { color: var(--sp-primary); width: 14px; text-align: center; flex-shrink: 0; }

/* Remark box */
.sp-remark { display: flex; gap: 14px; align-items: flex-start; background: #faf9ff; border: 1px solid var(--sp-border); border-left: 3px solid var(--sp-primary); border-radius: 0 14px 14px 0; padding: 16px 18px; }
.sp-remark i { color: #f5c2c4; font-size: 1.3rem; flex-shrink: 0; }
.sp-remark p { margin: 0; font-size: 0.9rem; color: #475569; line-height: 1.7; }

/* ID card flip controls */
.sp-idcard-actions { display: flex; align-items: center; gap: 8px; }
button.sp-card-link { cursor: pointer; font-family: inherit; }
.sp-idcard-hint { margin: 14px 0 0; text-align: center; font-size: 0.8rem; color: var(--sp-muted); display: flex; align-items: center; justify-content: center; gap: 7px; }
.sp-idcard-hint i { color: var(--sp-primary); }

/* Form (change password) */
.sp-form { max-width: 460px; }
.sp-field { margin-bottom: 16px; }
.sp-field label { display: block; font-size: 0.8rem; font-weight: 700; color: #334155; margin-bottom: 8px; }
.sp-pass-tips { margin-top: 18px; padding: 14px 16px; background: linear-gradient(135deg, #fffafa, #fff5f5); border: 1px solid #f5c2c4; border-radius: 14px; }
.sp-pass-tips strong { display: block; font-size: 0.84rem; color: #334155; margin-bottom: 8px; }
.sp-pass-tips ul { margin: 0; padding-left: 18px; }
.sp-pass-tips li { font-size: 0.82rem; color: var(--sp-muted); line-height: 1.7; }
.sp-alert-success { display: flex; align-items: center; gap: 9px; background: #ecfdf5; color: #059669; padding: 12px 14px; border-radius: 11px; margin-bottom: 18px; font-size: 0.88rem; border: 1px solid #a7f3d0; }

/* ===== Auth / Login (split panel — violet theme) ===== */
.sp-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: #261013;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.sp-login-bg {
    position: fixed;
    inset: 0;
    background-color: #fff;
    /* background: linear-gradient(135deg, #261013 0%, #8e161b 45%, #d9242a 100%); */
    z-index: 0;
}

.sp-login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    pointer-events: none;
}

.sp-login-orb-1 { width: 420px; height: 420px; background: #c084fc; top: -120px; right: -80px; }
.sp-login-orb-2 { width: 320px; height: 320px; background: #f0a3a6; bottom: -80px; left: -60px; }
.sp-login-orb-3 { width: 200px; height: 200px; background: #f0abfc; top: 40%; left: 35%; opacity: 0.25; }

.sp-login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
}

.sp-login-wrap {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: var(--sp-card);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sp-login-brand {
    background: linear-gradient(160deg, #d9242a 0%, #b01c22 50%, #2e1065 100%);
    color: #fff;
    padding: 40px 36px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.sp-login-brand::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.sp-login-brand-inner { position: relative; z-index: 1; }

.sp-login-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.sp-login-logo-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.sp-login-logo-icon.has-logo { background: rgba(255, 255, 255, 0.92); }
.sp-login-logo-icon img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

.sp-login-logo-tag {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.75;
    font-weight: 600;
}

.sp-login-logo h1 {
    margin: 2px 0 0;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.sp-login-tagline {
    margin: 0 0 28px;
    opacity: 0.88;
    line-height: 1.65;
    font-size: 0.95rem;
    max-width: 340px;
}

.sp-login-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sp-login-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.sp-login-feature:hover { background: rgba(255, 255, 255, 0.12); }

.sp-login-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sp-login-feature strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.sp-login-feature span {
    font-size: 0.72rem;
    opacity: 0.75;
    line-height: 1.35;
}

.sp-login-brand-footer {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    opacity: 0.7;
}

.sp-login-brand-footer i { margin-right: 6px; }

.sp-login-form-panel {
    padding: 48px 44px;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, #ffffff 0%, #faf9ff 100%);
}

.sp-login-form { width: 100%; max-width: 400px; margin: 0 auto; }

.sp-login-form-head { margin-bottom: 28px; }

.sp-login-form-badge {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #fff5f5, #fde8e9);
    color: var(--sp-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
    border: 1px solid #f5c2c4;
}

.sp-login-form h2 {
    margin: 0 0 6px;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.sp-login-form-head > p { margin: 0; color: var(--sp-muted); font-size: 0.92rem; }

.sp-login-alert { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.sp-login-alert i { flex-shrink: 0; margin-top: 2px; }

.sp-login-form-fields { display: flex; flex-direction: column; gap: 20px; }

.sp-login-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.sp-login-input {
    display: flex;
    align-items: stretch;
    min-height: 52px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.sp-login-input:focus-within {
    border-color: #f5c2c4;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(217, 36, 42, 0.1);
}

.sp-login-input-icon {
    width: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fff5f5 0%, #fde8e9 100%);
    color: var(--sp-primary);
    font-size: 1rem;
    border-right: 1px solid #e2e8f0;
}

.sp-login-input input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    background: transparent;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.4;
}

.sp-login-input input:focus { outline: none; }
.sp-login-input input::placeholder { color: #94a3b8; font-weight: 400; }
.sp-login-input-password input { padding-right: 8px; }

.sp-login-eye {
    flex-shrink: 0;
    width: 48px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: color 0.2s, background 0.2s;
}

.sp-login-eye:hover { color: var(--sp-primary); background: #f8fafc; }

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #d9242a, #b01c22);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    padding: 13px 20px;
    box-shadow: 0 10px 24px rgba(217, 36, 42, 0.28);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.sp-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(217, 36, 42, 0.34); }

.sp-login-submit {
    width: 100%;
    justify-content: center;
    padding: 15px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 6px;
    border-radius: 14px;
    letter-spacing: 0.02em;
}

.sp-login-submit span { flex: 1; text-align: center; }

.sp-alert-error {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 14px;
    border-radius: 11px;
    margin-bottom: 18px;
    font-size: 0.88rem;
    border: 1px solid #fecaca;
}

.sp-login-help {
    display: flex;
    gap: 14px;
    margin-top: 28px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #fffafa 0%, #fff5f5 100%);
    border: 1px solid #f5c2c4;
    border-radius: 14px;
}

.sp-login-help-icon {
    width: 36px;
    height: 36px;
    background: #fff5f5;
    color: var(--sp-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-login-help strong { display: block; font-size: 0.88rem; color: #334155; margin-bottom: 4px; }
.sp-login-help p { margin: 0; font-size: 0.8rem; color: var(--sp-muted); line-height: 1.55; }
.sp-login-help em { font-style: normal; color: var(--sp-primary); font-weight: 600; }

.sp-login-switch { display: flex; gap: 8px; margin-top: 20px; }
.sp-login-switch a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px;
    border-radius: 11px;
    border: 1px solid var(--sp-border);
    background: #fff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.sp-login-switch a:hover { border-color: var(--sp-primary); color: var(--sp-primary); background: #fffafa; }

.sp-login-copyright {
    text-align: center;
    margin: 20px 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .sp-login-page { padding: 16px; align-items: center; padding-top: 24px; }
    .sp-login-wrap { grid-template-columns: 1fr; border-radius: 20px; }
    .sp-login-brand { display: none; }
    .sp-login-help { display: none; }
    .sp-login-form-panel { padding: 28px 24px 32px; }
}

@media (max-width: 900px) {
    .sp-wrapper {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .sp-sidebar {
        position: fixed !important;
        top: 0 !important;
        right: auto;
        bottom: 0 !important;
        left: 0 !important;
        width: min(280px, 86vw);
        height: auto !important;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none !important;
        z-index: 200;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 12px 0 32px rgba(15, 23, 42, 0.28);
        overflow: hidden;
    }
    .sp-sidebar.open { transform: translateX(0); }

    .sp-sidebar-close { display: flex; }

    .sp-nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sp-sidebar-footer {
        margin-top: auto;
        flex-shrink: 0;
    }

    .sp-overlay {
        position: fixed;
        inset: 0;
        z-index: 190;
    }

    .sp-menu-toggle { display: flex; align-items: center; justify-content: center; }
    .sp-header-center { display: none; }
    .sp-header-breadcrumb { display: none; }
    .sp-header-user-info, .sp-header-user-chevron { display: none; }
    .sp-header-user { margin-left: 0; }
    .sp-header-user-trigger { padding: 3px; border-radius: 10px; border: none; background: transparent; }
    .sp-header-user-trigger img { width: 34px; height: 34px; border-radius: 10px; }
    .sp-header-actions {
        gap: 6px;
        margin-left: auto;
        flex-shrink: 0;
    }
    .sp-header-actions .sp-header-icon-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
    .sp-header-actions .sp-header-icon-btn:last-of-type { display: none; }
    .sp-header-left { gap: 10px; min-width: 0; }

    .sp-main {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-top: 60px;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        overflow-x: clip;
    }

    .sp-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 60px;
        padding: 0 12px;
        gap: 8px;
        z-index: 150;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    }

    .sp-content {
        padding: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: clip;
    }

    .sp-footer {
        display: none;
    }

    .sp-welcome,
    .sp-welcome::before,
    .sp-welcome::after {
        max-width: 100%;
    }

    .sp-welcome {
        overflow: hidden;
    }

    .sp-bottom-nav {
        display: flex !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        z-index: 9999 !important;
        align-items: stretch;
        justify-content: space-around;
        gap: 2px;
        width: 100% !important;
        max-width: 100vw !important;
        min-height: 60px;
        margin: 0 !important;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        background: #ffffff;
        border-top: 1px solid var(--sp-border);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        /* Keep fixed in Android WebView while page scrolls */
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .sp-bottom-nav-item {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 2px;
        text-decoration: none;
        color: var(--sp-muted);
        border-radius: 12px;
        transition: color .15s, background .15s;
        -webkit-tap-highlight-color: transparent;
    }

    .sp-bottom-nav-item i {
        font-size: 1.15rem;
        line-height: 1;
    }

    .sp-bottom-nav-item span {
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: .01em;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .sp-bottom-nav-item.active {
        color: var(--sp-primary);
        background: #fff5f5;
    }

    .sp-bottom-nav-item:active {
        background: #fde8e9;
    }

    .sp-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 14px;
        width: 100%;
        max-width: 100%;
    }

    .sp-stat {
        padding: 12px;
        border-radius: 14px;
        gap: 10px;
        align-items: flex-start;
        overflow: hidden;
        max-width: 100%;
    }

    .sp-stat::after {
        display: none;
    }

    .sp-stat:hover {
        transform: none;
    }

    .sp-stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .sp-stat strong { font-size: 1.15rem; }
    .sp-stat small { font-size: 0.7rem; line-height: 1.35; }

    .sp-quick-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
        max-width: 100%;
    }

    .sp-quick {
        padding: 14px 12px;
        border-radius: 12px;
        max-width: 100%;
    }

    .sp-quick-ic {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        font-size: 1rem;
    }

    .sp-card {
        padding: 16px;
        border-radius: 14px;
        margin-bottom: 14px;
        overflow: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }

    .sp-card-head {
        flex-wrap: wrap;
        gap: 8px;
        margin: -16px -16px 14px;
        padding: 12px 16px;
        border-radius: 14px 14px 0 0;
    }
    .sp-card-head::before { top: 14px; bottom: 14px; }

    .sp-card-head h3 { font-size: 0.92rem; }
    .sp-card-head h3 i { width: 30px; height: 30px; border-radius: 9px; font-size: 0.8rem; }

    .sp-list-main strong,
    .sp-list-main p {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 760px) {
    .sp-grid-2, .sp-grid-2.wide-first { grid-template-columns: 1fr; }
    .sp-welcome {
        padding: 16px;
        gap: 12px;
        border-radius: 14px;
        margin-bottom: 14px;
        align-items: flex-start;
        overflow: hidden;
    }
    .sp-welcome-avatar {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }
    .sp-welcome-body {
        min-width: 0;
        flex: 1 1 calc(100% - 70px);
    }
    .sp-welcome-body h2 {
        font-size: 1.15rem;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .sp-welcome-body p {
        font-size: 0.84rem;
        margin-bottom: 10px;
    }
    .sp-welcome-chips {
        gap: 6px;
        width: 100%;
        flex: 1 1 100%;
    }
    .sp-welcome-chip {
        font-size: 0.72rem;
        padding: 4px 10px;
        max-width: 100%;
    }
    .sp-welcome-date { display: none; }
    .sp-ring-card { justify-content: center; }
    .sp-list-row { gap: 10px; padding: 12px 0; }
    .sp-list-ico { width: 36px; height: 36px; border-radius: 10px; }
    .sp-list-main { min-width: 0; flex: 1; }
    .sp-list-main strong { font-size: 0.88rem; }
    .sp-list-main p { font-size: 0.8rem; }
}

@media (max-width: 640px) {
    .sp-topbar {
        padding: 0 10px;
        height: 56px;
    }
    .sp-main { padding-top: 56px; }
    .sp-header-actions .sp-header-icon-btn {
        width: 36px;
        height: 36px;
    }
    .sp-header-user-trigger img { width: 32px; height: 32px; }
    .sp-content { padding: 10px; }
    .sp-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 16px 14px 20px;
    }
    .sp-footer-left { width: 100%; }
    .sp-footer p { font-size: 0.8rem; line-height: 1.45; word-break: break-word; }
    .sp-footer-right {
        width: 100%;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .sp-footer-right a {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        text-align: center;
        padding: 9px 8px;
        border-radius: 10px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        font-size: 0.74rem;
        font-weight: 600;
        color: #475569;
    }
    .sp-footer-right a:hover {
        background: #fff5f5;
        border-color: #f5c2c4;
        color: var(--sp-primary);
    }
}

@media (max-width: 480px) {
    .sp-stat-grid { grid-template-columns: 1fr; }
    .sp-quick-grid { grid-template-columns: 1fr 1fr; }
    .sp-quick strong { font-size: 0.84rem; }
    .sp-quick small { font-size: 0.7rem; }
    .sp-welcome-body h2 { font-size: 1.05rem; }
    .sp-card-link { width: auto; }
    .sp-footer { padding: 14px 12px 18px; }
    .sp-footer-right a {
        flex: 1 1 calc(50% - 6px);
        font-size: 0.72rem;
        padding: 8px 6px;
    }
}

/* ===== Coaching: My Batch, dashboard lectures, timetable ===== */
.spb-muted { font-size: 0.8rem; color: var(--sp-muted); font-weight: 600; }
.spb-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 28px;
    margin-bottom: 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #8e161b 0%, #b01c22 55%, #d9242a 100%);
    color: #fff;
    box-shadow: 0 14px 30px rgba(217, 36, 42, 0.2);
}
.spb-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: 80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.spb-hero-main { position: relative; min-width: 0; }
.spb-kicker {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}
.spb-hero h2 { margin: 6px 0 4px; font-size: 1.6rem; color: #fff; }
.spb-hero p { margin: 0 0 12px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.88); }
.spb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.spb-chips span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.8rem;
    font-weight: 600;
}
.spb-hero-badge {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 24px;
    background: #fff;
    color: #d9242a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}
.spb-hero-badge strong { font-size: 2rem; line-height: 1; font-weight: 800; }
.spb-hero-badge span { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #b01c22; margin-top: 4px; }

.spb-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
.spb-grid .sp-card { margin-bottom: 0; }
.spb-fee-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.spb-fee-top span { display: block; font-size: 0.78rem; font-weight: 600; color: var(--sp-muted); }
.spb-fee-top strong { display: block; font-size: 1.8rem; font-weight: 800; color: var(--sp-text); line-height: 1.2; }
.spb-fee-top small { font-size: 0.78rem; color: var(--sp-muted); }
.spb-ring {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: conic-gradient(#10b981 calc(var(--pct) * 1%), #fde8e9 0);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.spb-ring b {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    color: var(--sp-text);
}
.spb-bar { height: 8px; border-radius: 999px; background: #fde8e9; overflow: hidden; margin: 16px 0 14px; }
.spb-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, #059669); }
.spb-fee-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spb-fee-split > div { padding: 12px 14px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--sp-border); }
.spb-fee-split span { display: block; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sp-muted); }
.spb-fee-split strong { font-size: 1.15rem; }
.spb-fee-split .is-paid { background: #ecfdf5; border-color: #a7f3d0; }
.spb-fee-split .is-paid strong { color: #047857; }
.spb-fee-split .is-due { background: #fef2f2; border-color: #fecaca; }
.spb-fee-split .is-due strong { color: #b91c1c; }
.spb-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
}
.spb-note.is-due { background: #fff5f5; color: #b01c22; }
.spb-note.is-ok { background: #ecfdf5; color: #047857; }

.spb-contact-list { display: flex; flex-direction: column; gap: 12px; }
.spb-contact-list > div { display: flex; gap: 12px; align-items: flex-start; font-size: 0.88rem; color: #334155; line-height: 1.45; }
.spb-contact-list i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff5f5;
    color: #d9242a;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.spb-contact-list span { padding-top: 6px; word-break: break-word; }
.spb-contact-actions { display: flex; gap: 10px; margin-top: 16px; }
.spb-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    border-radius: 12px;
    background: #d9242a;
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
}
.spb-btn:hover { background: #b01c22; color: #fff; }
.spb-btn.is-wa { background: #16a34a; }
.spb-btn.is-wa:hover { background: #15803d; }

.spb-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.spb-subject {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--sp-border);
    background: #fff;
}
.spb-subject > div { flex: 1; min-width: 0; }
.spb-subject-ic {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #d9242a, #b01c22);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    flex-shrink: 0;
}
.spb-subject strong { display: block; font-size: 0.92rem; color: var(--sp-text); }
.spb-subject small { display: block; font-size: 0.78rem; color: var(--sp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spb-subject small i { color: #d9242a; margin-right: 3px; }
.spb-subject em {
    font-style: normal;
    padding: 3px 9px;
    border-radius: 999px;
    background: #fff5f5;
    color: #b01c22;
    font-size: 0.74rem;
    font-weight: 700;
}

.spb-week { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.spb-day {
    padding: 12px;
    border-radius: 14px;
    border: 1px dashed var(--sp-border);
    background: #fafafa;
    text-align: center;
}
.spb-day strong { display: block; font-size: 0.95rem; color: var(--sp-text); }
.spb-day span { display: block; font-size: 0.78rem; color: var(--sp-muted); margin-top: 2px; }
.spb-day small { display: block; font-size: 0.7rem; color: #94a3b8; margin-top: 4px; }
.spb-day.has { border-style: solid; border-color: #f5c2c4; background: #fff5f5; }
.spb-day.has span { color: #b01c22; font-weight: 700; }
.spb-day.is-today { border-color: #d9242a; box-shadow: 0 0 0 2px rgba(217, 36, 42, 0.15); }

.spd-lectures { display: flex; flex-direction: column; gap: 10px; }
.spd-lec {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--sp-border);
    border-left: 4px solid #d9242a;
    background: #fff;
}
.spd-lec.is-done { opacity: .6; border-left-color: #cbd5e1; }
.spd-lec.is-live { background: #fff5f5; border-color: #f5c2c4; border-left-color: #d9242a; }
.spd-lec.is-next { border-left-color: #f59e0b; }
.spd-lec-time { min-width: 72px; }
.spd-lec-time strong { display: block; font-size: 0.86rem; color: var(--sp-text); }
.spd-lec-time small { font-size: 0.72rem; color: #94a3b8; }
.spd-lec-body { flex: 1; min-width: 0; }
.spd-lec-body strong { display: block; font-size: 0.92rem; color: var(--sp-text); }
.spd-lec-body small { font-size: 0.78rem; color: var(--sp-muted); }
.spd-lec-body small i { color: #d9242a; }
.spd-tag {
    padding: 3px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
}
.spd-tag.is-live { background: #d9242a; color: #fff; }
.spd-tag.is-next { background: #fffbeb; color: #b45309; }

.spd-fee { display: flex; align-items: center; gap: 20px; }
.spd-fee-ring {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: conic-gradient(#10b981 calc(var(--pct) * 1%), #fde8e9 0);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.spd-fee-ring > div {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.spd-fee-ring strong { font-size: 1.25rem; color: var(--sp-text); line-height: 1; }
.spd-fee-ring span { font-size: 0.72rem; color: var(--sp-muted); font-weight: 600; }
.spd-fee-rows { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.spd-fee-rows > div {
    display: flex;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 0.86rem;
}
.spd-fee-rows span { color: var(--sp-muted); font-weight: 600; }
.spd-fee-rows .is-paid strong { color: #047857; }
.spd-fee-rows .is-due { background: #fef2f2; }
.spd-fee-rows .is-due strong { color: #b91c1c; }
.spd-last-pay {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    background: #fff5f5;
    border: 1px solid #f5c2c4;
    color: #334155;
    font-size: 0.84rem;
    text-decoration: none;
}
.spd-last-pay > i { color: #d9242a; }
.spd-last-pay span { flex: 1; }
.spd-last-pay em { font-style: normal; font-weight: 700; color: #d9242a; white-space: nowrap; }

.spt-time { width: auto !important; min-width: 64px; padding: 0 8px; font-size: 0.72rem !important; }
.spt-def { display: block; font-size: 0.66rem; color: #94a3b8; font-weight: 600; }
.spt-cell-time { color: #b01c22 !important; font-weight: 600; }

@media (max-width: 900px) {
    .spb-grid { grid-template-columns: 1fr; }
    .spb-week { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .spb-hero { padding: 20px; }
    .spb-hero h2 { font-size: 1.25rem; }
    .spb-hero-badge { width: 70px; height: 70px; border-radius: 18px; }
    .spb-hero-badge strong { font-size: 1.4rem; }
    .spb-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spd-fee { flex-direction: column; align-items: stretch; }
    .spd-fee-ring { align-self: center; }
}

/* ===== Course fees page ===== */
.spf-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 28px;
    margin-bottom: 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #8e161b 0%, #b01c22 55%, #d9242a 100%);
    color: #fff;
    box-shadow: 0 14px 30px rgba(217, 36, 42, 0.2);
}
.spf-hero::before {
    content: '';
    position: absolute;
    right: 120px;
    top: -90px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.spf-hero-main { position: relative; min-width: 0; }
.spf-kicker {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}
.spf-hero h2 { margin: 6px 0 2px; font-size: 1.1rem; font-weight: 600; color: rgba(255, 255, 255, 0.92); }
.spf-total { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.spf-total strong { font-size: 2.3rem; font-weight: 800; line-height: 1.1; color: #fff; }
.spf-total span { font-size: 0.85rem; color: rgba(255, 255, 255, 0.8); }
.spf-status { display: flex; flex-wrap: wrap; gap: 8px; }
.spf-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.8rem;
    font-weight: 700;
}
.spf-pill.is-ok { background: #ecfdf5; color: #047857; }
.spf-pill.is-due { background: #fff; color: #b01c22; }
.spf-ring {
    position: relative;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: conic-gradient(#34d399 calc(var(--pct) * 1%), rgba(255, 255, 255, 0.2) 0);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.spf-ring > div {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px #f3e4e4;
}
.spf-ring strong { font-size: 1.5rem; font-weight: 800; color: var(--sp-text); line-height: 1; }
.spf-ring span { font-size: 0.74rem; font-weight: 600; color: var(--sp-muted); margin-top: 2px; }

.spf-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.spf-metric {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--sp-border);
    box-shadow: 0 2px 10px rgba(217, 36, 42, 0.04);
}
.spf-metric-ic {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #fff5f5;
    color: #d9242a;
}
.spf-metric div span { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--sp-muted); }
.spf-metric strong { font-size: 1.2rem; font-weight: 800; color: var(--sp-text); }
.spf-metric.is-paid .spf-metric-ic { background: #ecfdf5; color: #047857; }
.spf-metric.is-paid strong { color: #047857; }
.spf-metric.is-due .spf-metric-ic { background: #fef2f2; color: #b91c1c; }
.spf-metric.is-due strong { color: #b91c1c; }

.spf-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: start;
}

.spf-lines { display: flex; flex-direction: column; gap: 10px; }
.spf-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--sp-border);
    background: #fff;
}
.spf-line > div { flex: 1; min-width: 0; }
.spf-line strong { display: block; font-size: 0.9rem; color: var(--sp-text); }
.spf-line small { font-size: 0.74rem; color: var(--sp-muted); }
.spf-line em { font-style: normal; font-weight: 800; font-size: 0.98rem; color: var(--sp-text); white-space: nowrap; }
.spf-line-ic {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #fff5f5;
    color: #d9242a;
    font-size: 0.85rem;
}
.spf-line.is-minus { background: #f0fdf4; border-color: #bbf7d0; }
.spf-line.is-minus .spf-line-ic { background: #dcfce7; color: #047857; }
.spf-line.is-minus em { color: #047857; }
.spf-line.is-plus { background: #fef2f2; border-color: #fecaca; }
.spf-line.is-plus .spf-line-ic { background: #fee2e2; color: #b91c1c; }
.spf-line.is-plus em { color: #b91c1c; }
.spf-net {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff5f5, #fde8e9);
    border: 1px dashed #f0a3a6;
}
.spf-net span { font-size: 0.82rem; font-weight: 700; color: #8e161b; text-transform: uppercase; letter-spacing: 0.04em; }
.spf-net strong { font-size: 1.3rem; font-weight: 800; color: #b01c22; }

.spf-insts { display: flex; flex-direction: column; gap: 10px; }
.spf-inst {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--sp-border);
    border-left: 4px solid #f59e0b;
    background: #fff;
}
.spf-inst.is-paid { border-left-color: #10b981; }
.spf-inst.is-pending { border-left-color: #d9242a; }
.spf-inst-month {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff5f5;
    color: #b01c22;
}
.spf-inst.is-paid .spf-inst-month { background: #ecfdf5; color: #047857; }
.spf-inst-month strong { font-size: 0.95rem; text-transform: uppercase; line-height: 1; }
.spf-inst-month small { font-size: 0.68rem; font-weight: 600; opacity: .8; margin-top: 3px; }
.spf-inst-body { flex: 1; min-width: 0; }
.spf-inst-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.spf-inst-top strong { font-size: 1.05rem; color: var(--sp-text); }
.spf-inst-bar { height: 6px; border-radius: 999px; background: #f1f5f9; overflow: hidden; margin: 8px 0 6px; }
.spf-inst-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, #059669); }
.spf-inst-body > small { font-size: 0.76rem; color: var(--sp-muted); }
.spf-inst-body > small i { color: #047857; }
.spf-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}
.spf-badge.is-paid { background: #ecfdf5; color: #047857; }
.spf-badge.is-partial { background: #fffbeb; color: #b45309; }
.spf-badge.is-pending { background: #fef2f2; color: #b91c1c; }
.spf-badge.is-void { background: #f1f5f9; color: #64748b; }

.spf-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--sp-border);
}
.spf-help > div:first-child { flex: 1; min-width: 200px; }
.spf-help strong { font-size: 0.88rem; color: var(--sp-text); }
.spf-help strong i { color: #d9242a; margin-right: 4px; }
.spf-help p { margin: 4px 0 0; font-size: 0.8rem; color: var(--sp-muted); line-height: 1.45; }
.spf-help-actions { display: flex; gap: 8px; }
.spf-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    background: #d9242a;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}
.spf-btn:hover { background: #b01c22; color: #fff; }
.spf-btn.is-wa { background: #16a34a; }
.spf-btn.is-wa:hover { background: #15803d; }

.spf-history { margin-top: 16px; }
.spf-pays { display: flex; flex-direction: column; gap: 10px; }
.spf-pay {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--sp-border);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.spf-pay:hover { border-color: #f5c2c4; box-shadow: 0 6px 16px rgba(217, 36, 42, 0.06); }
.spf-pay.is-void { opacity: .6; }
.spf-pay.is-void .spf-pay-amt { text-decoration: line-through; color: var(--sp-muted); }
.spf-pay-date {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #ecfdf5;
    color: #047857;
}
.spf-pay-date strong { font-size: 1.15rem; line-height: 1; }
.spf-pay-date small { font-size: 0.64rem; font-weight: 700; margin-top: 3px; }
.spf-pay-body { flex: 1; min-width: 0; }
.spf-pay-body strong { display: block; font-size: 0.9rem; color: var(--sp-text); }
.spf-pay-body small { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; font-size: 0.76rem; color: var(--sp-muted); }
.spf-method {
    padding: 2px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}
.spf-pay-amt { font-size: 1.05rem; font-weight: 800; color: #047857; white-space: nowrap; }
.spf-pay-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #f5c2c4;
    background: #fff;
    color: #d9242a;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.spf-pay-btn:hover { background: #d9242a; border-color: #d9242a; color: #fff; }
.spf-pay-btn.is-disabled { border-color: var(--sp-border); color: #94a3b8; }

@media (max-width: 1000px) {
    .spf-grid { grid-template-columns: 1fr; }
    .spf-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .spf-hero { flex-direction: column-reverse; align-items: flex-start; padding: 20px; }
    .spf-ring { width: 100px; height: 100px; align-self: center; }
    .spf-ring > div { width: 78px; height: 78px; }
    .spf-ring strong { font-size: 1.2rem; }
    .spf-total strong { font-size: 1.8rem; }
    .spf-metrics { gap: 10px; }
    .spf-metric { padding: 12px; }
    .spf-pay { flex-wrap: wrap; }
    .spf-pay-body { flex-basis: calc(100% - 70px); }
    .spf-pay-amt { margin-left: 68px; }
    .spf-pay-btn { margin-left: auto; }
    .spf-pay-btn span { display: none; }
}

/* ===== Profile page ===== */
.spp-hero {
    position: relative;
    margin-bottom: 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--sp-border);
    box-shadow: 0 4px 16px rgba(217, 36, 42, 0.05);
    overflow: hidden;
}
.spp-cover {
    height: 110px;
    background:
        radial-gradient(circle at 85% -20%, rgba(255, 255, 255, 0.18) 0 120px, transparent 121px),
        linear-gradient(135deg, #8e161b 0%, #b01c22 50%, #d9242a 100%);
}
.spp-hero-body {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 0 26px 18px;
    flex-wrap: wrap;
}
.spp-avatar {
    width: 116px;
    height: 116px;
    border-radius: 26px;
    object-fit: cover;
    border: 5px solid #fff;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
    flex-shrink: 0;
    margin-top: -58px;
    position: relative;
}
.spp-hero-info { flex: 1; min-width: 220px; padding-top: 16px; }
.spp-hero-info h2 {
    margin: 0 0 4px;
    font-size: 1.45rem;
    color: var(--sp-text);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.spp-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.72rem;
    font-weight: 700;
}
.spp-status i { font-size: 0.45rem; }
.spp-hero-info p { margin: 0 0 10px; font-size: 0.9rem; color: var(--sp-muted); font-weight: 500; }
.spp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.spp-chips span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #fff5f5;
    border: 1px solid #f5c2c4;
    color: #8e161b;
    font-size: 0.78rem;
    font-weight: 600;
}
.spp-chips i { color: #d9242a; font-size: 0.72rem; }
.spp-hero-actions { display: flex; gap: 10px; padding-top: 18px; }
.spp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 11px;
    border: 1px solid #d9242a;
    background: #d9242a;
    color: #fff;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.spp-btn:hover { background: #b01c22; border-color: #b01c22; color: #fff; }
.spp-btn.is-ghost { background: #fff; color: #d9242a; border-color: #f5c2c4; }
.spp-btn.is-ghost:hover { background: #fff5f5; color: #b01c22; }
.spp-btn.is-sm { height: 36px; padding: 0 13px; font-size: 0.8rem; }
.spp-btn.is-wa { background: #16a34a; border-color: #16a34a; }
.spp-btn.is-wa:hover { background: #15803d; border-color: #15803d; }
.spp-complete {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 26px;
    border-top: 1px solid #f3e4e4;
    background: #fffafa;
    flex-wrap: wrap;
}
.spp-complete-text { min-width: 220px; flex: 1; }
.spp-complete-text strong { display: block; font-size: 0.86rem; color: var(--sp-text); }
.spp-complete-text span { font-size: 0.76rem; color: var(--sp-muted); }
.spp-complete-bar { flex: 1.4; min-width: 180px; height: 8px; border-radius: 999px; background: #fde8e9; overflow: hidden; }
.spp-complete-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f87171, #d9242a); }

.spp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}
.spp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spp-field {
    padding: 11px 13px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    min-width: 0;
}
.spp-field span {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 3px;
}
.spp-field strong { display: block; font-size: 0.9rem; color: var(--sp-text); overflow-wrap: anywhere; }
.spp-na { color: #cbd5e1; font-weight: 500; font-style: italic; }

.spp-contact { display: flex; flex-direction: column; gap: 10px; }
.spp-contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #eef2f7;
}
.spp-contact-row > div { min-width: 0; }
.spp-contact-row span:not(.spp-ic):not(.spp-na) {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}
.spp-contact-row strong { display: block; font-size: 0.9rem; color: var(--sp-text); overflow-wrap: anywhere; }
.spp-ic {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #fff5f5;
    color: #d9242a;
}

.spp-parents { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.spp-parent {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--sp-border);
    background: linear-gradient(180deg, #fff, #fffafa);
}
.spp-parent-av {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #d9242a, #b01c22);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
}
.spp-parent-body { flex: 1; min-width: 0; }
.spp-parent-body strong { display: block; font-size: 0.92rem; color: var(--sp-text); }
.spp-rel {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 2px 0;
    font-size: 0.74rem;
    font-weight: 700;
    color: #b01c22;
}
.spp-parent-body small { display: block; font-size: 0.78rem; color: var(--sp-muted); overflow-wrap: anywhere; }
.spp-call {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #ecfdf5;
    color: #047857;
    text-decoration: none;
}
.spp-call:hover { background: #047857; color: #fff; }

.spp-bottom {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.spp-idcard { width: 446px; max-width: 100%; }
.spp-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.spp-side .sp-card { margin-bottom: 0; }
.spp-docs { display: flex; flex-direction: column; gap: 8px; }
.spp-doc {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #eef2f7;
    color: inherit;
    text-decoration: none;
}
.spp-doc:hover { border-color: #f5c2c4; background: #fffafa; }
.spp-doc > div { flex: 1; min-width: 0; }
.spp-doc strong { display: block; font-size: 0.86rem; color: var(--sp-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spp-doc small { font-size: 0.74rem; color: var(--sp-muted); }
.spp-doc > i { color: #d9242a; font-size: 0.85rem; }
.spp-doc-ext {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #fff5f5;
    color: #b01c22;
    font-size: 0.66rem;
    font-weight: 800;
}
.spp-muted-note { margin: 0; font-size: 0.86rem; color: var(--sp-muted); display: flex; align-items: center; gap: 8px; }
.spp-muted-note i { color: #f0a3a6; }
.spp-help { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(135deg, #fffafa, #fff5f5); border-color: #f5c2c4; }
.spp-help-ic {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #d9242a;
    color: #fff;
}
.spp-help strong { font-size: 0.92rem; color: var(--sp-text); }
.spp-help p { margin: 4px 0 12px; font-size: 0.82rem; color: var(--sp-muted); line-height: 1.5; }
.spp-help-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1100px) {
    .spp-bottom { grid-template-columns: 1fr; }
    .spp-idcard { width: auto; }
}
@media (max-width: 900px) {
    .spp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .spp-cover { height: 86px; }
    .spp-hero-body { padding: 0 16px 16px; gap: 12px; }
    .spp-avatar { width: 90px; height: 90px; border-radius: 22px; border-width: 4px; margin-top: -46px; }
    .spp-hero-info { flex-basis: 100%; padding-top: 0; }
    .spp-hero-actions { padding-top: 0; }
    .spp-hero-info h2 { font-size: 1.2rem; }
    .spp-hero-actions { width: 100%; }
    .spp-hero-actions .spp-btn { flex: 1; justify-content: center; }
    .spp-complete { padding: 12px 16px; }
    .spp-fields { grid-template-columns: 1fr; }
}
