/* SearchStudent.css */

.app-container {
    display: flex;
    min-height: calc(100vh - 180px);
    width: min(1420px, calc(100% - 32px));
    margin: 0 auto 1.25rem;
    padding: 1rem 0 1.25rem;
    gap: 1.5rem;
    background: transparent;
    overflow: visible;
    align-items: stretch;
}

.top-nav {
    padding: 1.2rem 1.5rem;
    background: color-mix(in srgb, var(--bg-glass) 88%, transparent);
    border-bottom: 1px solid var(--border-glass);
    backdrop-filter: blur(18px);
}

.logo-area h2 {
    color: var(--text-main);
}

.search-brand-icon {
    font-size: 2rem;
    color: var(--primary);
}

/* Sidebar Layout */
.sidebar {
    flex: 0 0 24%;
    width: 24%;
    min-width: 260px;
    max-width: 360px;
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    background: color-mix(in srgb, var(--bg-glass) 92%, transparent) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-glass);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
    border-radius: 1.5rem !important;
    height: fit-content;
    max-height: calc(100vh - 48px);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-note {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.filter-sections-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
.filter-sections-container::-webkit-scrollbar {
    width: 6px;
}

.filter-sections-container::-webkit-scrollbar-track {
    background: transparent;
}

.filter-sections-container::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 70%, transparent);
    border-radius: 10px;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group input, 
.filter-group select {
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--input-bg) 92%, transparent);
    color: var(--input-color);
    border: 1.5px solid var(--border-glass);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.6rem;
}

.filter-group select option {
    color: var(--text-main);
    background: var(--card-bg);
}

.filter-group input:focus, 
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

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

.filter-group select,
.filter-group select:disabled,
.filter-group select option,
.filter-group label {
    text-shadow: none;
}

.filter-row {
    display: flex;
    gap: 1rem;
}

.filter-group.half {
    width: calc(50% - 0.5rem);
}

/* Main Search Button */
.btn-search-main {
    position: relative;
    width: 100%;
    padding: 1.1rem;
    margin: 0 0 1.25rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--primary) 35%, transparent);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.btn-search-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px color-mix(in srgb, var(--primary) 45%, transparent);
}

.btn-search-main:active {
    transform: scale(0.96);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease-out;
    pointer-events: none;
}

.btn-search-main:hover .btn-glow {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
}

.mobile-floating-search {
    display: none;
}

.btn-icon-only {
    padding: 0.5rem;
    background: color-mix(in srgb, var(--card-bg) 72%, transparent);
    border: none;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: color-mix(in srgb, var(--accent-light) 88%, transparent);
    color: var(--text-main);
    transform: rotate(45deg);
}

/* Results Area */
.main-workspace {
    flex: 1 1 76%;
    width: 76%;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-workspace .erp-breadcrumbs {
    width: 100%;
    margin: 0 0 0.75rem;
    flex: 0 0 auto;
}

.results-header {
    background: color-mix(in srgb, var(--bg-glass) 92%, transparent) !important;
    backdrop-filter: blur(20px) !important;
    padding: 1.5rem !important;
    border-radius: 1.5rem !important;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--border-glass);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.r-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.r-info p {
    margin-top: 0.25rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.r-actions {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.r-actions .btn {
    min-width: 0;
    white-space: nowrap;
}

.show-style-control {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.55rem 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), color-mix(in srgb, var(--accent-light) 35%, transparent)),
        color-mix(in srgb, var(--card-bg) 84%, transparent);
}

.card-size-control {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, #14b8a6 28%, transparent);
    background:
        linear-gradient(135deg, color-mix(in srgb, #14b8a6 13%, transparent), color-mix(in srgb, var(--card-bg) 78%, transparent));
}

.card-size-control label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.card-size-control input[type="range"] {
    width: 92px;
    accent-color: #14b8a6;
}

.card-size-control span {
    min-width: 52px;
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 800;
}

.show-style-control label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.show-style-control select {
    min-width: 108px;
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 2rem 0.55rem 0.85rem;
    color: var(--text-main);
    background:
        linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%),
        color-mix(in srgb, var(--input-bg) 94%, white 6%);
    background-position:
        calc(100% - 15px) calc(50% - 3px),
        calc(100% - 10px) calc(50% - 3px),
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    appearance: none;
    font-weight: 800;
    outline: none;
}

.search-grid {
    height: 100%;
}

.student-summary-view {
    width: 100%;
    min-height: 520px;
    padding: 1.25rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.student-summary-phone {
    width: min(100%, 980px);
    margin: 0 auto;
    background: color-mix(in srgb, var(--card-bg) 96%, white 4%);
    border: 1px solid color-mix(in srgb, var(--border-glass) 70%, transparent);
    border-radius: 28px;
    box-shadow: 0 24px 58px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.summary-appbar {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.6rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border-glass) 76%, transparent);
    background: color-mix(in srgb, var(--card-bg) 98%, white 2%);
}

.summary-appbar h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.8rem;
    line-height: 1.1;
    font-weight: 900;
}

.summary-appbar-actions {
    display: flex;
    gap: 1rem;
    color: var(--text-main);
    font-size: 1.85rem;
}

.summary-groups {
    display: grid;
    gap: 1.4rem;
    padding: 1.5rem 1.6rem 1.8rem;
}

.summary-group {
    display: grid;
    gap: 1rem;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border-glass) 76%, transparent);
}

.summary-group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.summary-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.summary-group-head h4 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.28rem;
    font-weight: 900;
}

.summary-group-head span {
    display: inline-flex;
    min-width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #059669;
    background: #dcfce7;
    font-weight: 900;
}

.summary-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

.summary-student-card {
    position: relative;
    min-height: 210px;
    padding: 1.05rem;
    border-radius: 24px;
    background: #f1f1f1;
    color: #111827;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.summary-student-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(15, 23, 42, 0.05);
    pointer-events: none;
}

.summary-student-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.summary-student-top img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}

.summary-star {
    margin-left: auto;
    color: #fbbf24;
    font-size: 1.85rem;
}

.summary-menu {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: #666;
    font-size: 1.6rem;
    cursor: pointer;
}

.summary-status {
    margin-top: 1.2rem;
    color: var(--summary-tone, #059669);
    font-size: 1.02rem;
    font-weight: 800;
}

.summary-progress {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.45rem;
}

.summary-progress::before {
    content: "";
    grid-column: 1;
    grid-row: 1;
    height: 7px;
    border-radius: 999px;
    background: #c7dbd2;
}

.summary-progress span {
    grid-column: 1;
    grid-row: 1;
    height: 7px;
    border-radius: 999px;
    background: #10b981;
    z-index: 1;
}

.summary-progress b {
    color: #888;
    font-size: 0.92rem;
    font-weight: 900;
}

.summary-student-card h5 {
    margin: 0.9rem 0 0;
    color: #050505;
    font-size: 1.18rem;
    line-height: 1.08;
    font-weight: 900;
}

.summary-student-card p,
.summary-student-card small {
    display: block;
    margin: 0.45rem 0 0;
    color: #5b5f66;
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 700;
}

.summary-tone-green { --summary-tone: #109967; }
.summary-tone-blue { --summary-tone: #6d5fc6; }
.summary-tone-orange { --summary-tone: #b76c0b; }
.summary-tone-amber { --summary-tone: #d89a16; }
.summary-tone-red { --summary-tone: #dc2626; }
.summary-tone-violet { --summary-tone: #7c3aed; }

.student-summary-empty {
    min-height: 420px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.student-summary-empty i {
    font-size: 2.5rem;
    color: var(--primary);
}

.student-summary-empty h3,
.student-summary-empty p {
    margin: 0;
}

#searchGrid {
    width: 100%;
    min-height: 640px;
}

.student-card-view {
    min-height: 640px;
    padding: 1.15rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.1rem;
    align-content: start;
    overflow: auto;
}

.student-card-view.card-size-small {
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
}

.student-card-view.card-size-large {
    grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
}

.card-size-small .student-business-card {
    min-height: 270px;
    padding: 0.9rem;
    border-radius: 22px;
}

.card-size-small .student-card-top {
    grid-template-columns: 68px 1fr;
    gap: 0.75rem;
}

.card-size-small .student-card-photo-wrap {
    width: 68px;
    height: 82px;
    border-radius: 18px;
}

.card-size-small .student-card-title h3 {
    font-size: 1.05rem;
}

.card-size-small .student-card-details {
    grid-template-columns: 1fr;
    gap: 0.45rem;
}

.card-size-small .student-card-details div:nth-child(n + 3) {
    display: none;
}

.card-size-large .student-business-card {
    min-height: 370px;
    padding: 1.35rem;
}

.card-size-large .student-card-top {
    grid-template-columns: 108px 1fr;
}

.card-size-large .student-card-photo-wrap {
    width: 108px;
    height: 130px;
}

.card-size-large .student-card-title h3 {
    font-size: 1.6rem;
}

.student-business-card {
    position: relative;
    min-height: 318px;
    padding: 1.15rem;
    border-radius: 28px;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.24), transparent 24%),
        linear-gradient(135deg, var(--card-a), var(--card-b) 54%, var(--card-c));
    transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease;
}

.student-business-card:hover {
    transform: translateY(-6px) rotateX(1deg);
    box-shadow: 0 30px 72px rgba(15, 23, 42, 0.32);
    filter: saturate(1.08);
}

.card-theme-aurora { --card-a: #0f766e; --card-b: #2563eb; --card-c: #7c3aed; }
.card-theme-mint { --card-a: #047857; --card-b: #0ea5e9; --card-c: #06b6d4; }
.card-theme-sunset { --card-a: #be123c; --card-b: #f97316; --card-c: #f59e0b; }
.card-theme-ocean { --card-a: #0f172a; --card-b: #0369a1; --card-c: #14b8a6; }
.card-theme-berry { --card-a: #831843; --card-b: #be185d; --card-c: #8b5cf6; }
.card-theme-graphite { --card-a: #111827; --card-b: #334155; --card-c: #0f766e; }
.card-theme-gold { --card-a: #78350f; --card-b: #b45309; --card-c: #ca8a04; }
.card-theme-cyber { --card-a: #172554; --card-b: #4338ca; --card-c: #0891b2; }

.card-orb {
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    filter: blur(1px);
    z-index: -1;
}

.card-orb-one {
    width: 150px;
    height: 150px;
    right: -44px;
    top: -42px;
}

.card-orb-two {
    width: 110px;
    height: 110px;
    left: -34px;
    bottom: -38px;
}

.student-card-top {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 1rem;
    align-items: center;
}

.student-card-photo-wrap {
    width: 88px;
    height: 104px;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.54);
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.student-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-card-title {
    min-width: 0;
}

.student-card-id {
    display: inline-flex;
    max-width: 100%;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-card-title h3 {
    margin: 0.55rem 0 0.25rem;
    font-size: 1.35rem;
    line-height: 1.05;
    color: #fff;
}

.student-card-title p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.student-card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.student-card-metrics span {
    padding: 0.42rem 0.62rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.17);
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.76rem;
    font-weight: 800;
}

.student-card-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.student-card-details div {
    padding: 0.65rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(10px);
}

.student-card-details b,
.student-card-details span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-card-details b {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.student-card-details span {
    margin-top: 0.18rem;
    color: #fff;
    font-weight: 800;
}

.student-card-actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 1rem;
}

.student-card-actions .student-action-btn {
    width: auto;
    flex: 1;
    gap: 0.45rem;
    padding: 0 0.9rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
}

.student-card-empty {
    grid-column: 1 / -1;
    min-height: 420px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    gap: 0.5rem;
    border-radius: 28px;
    border: 1px dashed color-mix(in srgb, var(--text-muted) 34%, transparent);
    background: color-mix(in srgb, var(--card-bg) 70%, transparent);
}

.student-card-empty i {
    font-size: 3rem;
    color: var(--primary);
}

.mobile-grid-view {
    width: 100%;
    min-height: 420px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-grid-table-wrap {
    min-width: 720px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #ffffff;
}

.mobile-grid-table {
    width: 100%;
    border-collapse: collapse;
    color: #0f172a;
    font-size: 0.86rem;
}

.mobile-grid-table th,
.mobile-grid-table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.mobile-grid-table th {
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-grid-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.mobile-grid-actions {
    justify-content: flex-start;
}

.mobile-grid-empty {
    min-height: 320px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    gap: 0.4rem;
    color: var(--text-muted);
}

.mobile-grid-empty i {
    color: var(--primary);
    font-size: 2.4rem;
}

/* Grid Container Styles */
.ag-theme-alpine {
    --ag-grid-size: 8px;
    --ag-list-item-height: 40px;
    --ag-row-height: 48px;
    --ag-header-height: 48px;
    --ag-background-color: color-mix(in srgb, var(--card-bg) 96%, transparent);
    --ag-foreground-color: var(--text-main);
    --ag-border-color: var(--border-color);
    --ag-header-background-color: color-mix(in srgb, var(--accent-light) 78%, var(--card-bg) 22%);
    --ag-header-foreground-color: var(--text-secondary);
    --ag-row-hover-color: color-mix(in srgb, var(--accent-light) 55%, transparent);
    --ag-selected-row-background-color: color-mix(in srgb, var(--accent-light) 88%, transparent);
    --ag-font-size: 14px;
    --ag-font-family: 'Outfit', sans-serif;
    border: none !important;
}

.ag-theme-alpine .ag-root-wrapper,
.ag-theme-alpine .ag-root,
.ag-theme-alpine .ag-body-viewport,
.ag-theme-alpine .ag-center-cols-viewport,
.ag-theme-alpine .ag-center-cols-container,
.ag-theme-alpine .ag-pinned-left-cols-container,
.ag-theme-alpine .ag-pinned-right-cols-container {
    background: color-mix(in srgb, var(--card-bg) 96%, white 4%) !important;
}

.ag-theme-alpine .ag-header,
.ag-theme-alpine .ag-pinned-left-header,
.ag-theme-alpine .ag-pinned-right-header {
    background: color-mix(in srgb, var(--accent-light) 72%, white 28%) !important;
}

.ag-theme-alpine .ag-header-cell,
.ag-theme-alpine .ag-header-group-cell {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.ag-header-cell-label {
    font-weight: 700 !important;
}

.ag-row {
    color: #0f172a !important;
    transition: background-color 0.2s;
}

.ag-theme-alpine .ag-row-odd {
    background: rgba(255, 255, 255, 0.96) !important;
}

.ag-theme-alpine .ag-row-even {
    background: rgba(248, 250, 252, 0.98) !important;
}

.ag-theme-alpine .ag-cell,
.ag-theme-alpine .ag-cell-value,
.ag-theme-alpine .ag-group-value,
.ag-theme-alpine .ag-cell-wrapper,
.ag-theme-alpine .ag-cell-wrapper span {
    color: #0f172a !important;
    font-weight: 600;
}

.ag-theme-alpine .ag-row-hover .ag-cell,
.ag-theme-alpine .ag-row-hover .ag-cell-value,
.ag-theme-alpine .ag-row-selected .ag-cell,
.ag-theme-alpine .ag-row-selected .ag-cell-value {
    color: #020617 !important;
}

.ag-row-hover {
    background-color: var(--ag-row-hover-color) !important;
}

.ag-theme-alpine .ag-paging-panel,
.ag-theme-alpine .ag-status-bar {
    color: #334155 !important;
    background: color-mix(in srgb, var(--card-bg) 94%, white 6%) !important;
}

.student-action-cell {
    padding: 6px 8px !important;
}

.student-action-group {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.student-action-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.student-action-btn i {
    font-size: 1rem;
    pointer-events: none;
}

.student-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
    filter: brightness(1.05);
}

.student-action-btn--preview {
    background: linear-gradient(135deg, #8b1038 0%, #b91c5c 100%);
}

.student-action-btn--edit {
    background: linear-gradient(135deg, #4e9b13 0%, #84cc16 100%);
}

/* Inner Grid Loader */
.inner-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    padding: 2rem 3rem;
    background: color-mix(in srgb, var(--card-bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
    font-weight: 600;
    color: var(--primary);
}

/* Loader Animation */
.loading-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 4px;
    background: var(--primary);
    border-radius: 50%;
    animation: dots-loading 1s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
.loading-dots span:nth-child(4) { animation-delay: 0.6s; }

@keyframes dots-loading {
    0%, 100% { transform: scale(0.3); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Common Classes Override */
.flex-col { display: flex; flex-direction: column; }
.flex-grow { flex-grow: 1; }
.mt-4 { margin-top: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.text-neutral { color: var(--text-secondary); }
.relative { position: relative; }
.hidden { display: none !important; }

/* ag-grid customization for premium look */
.ag-root-wrapper {
    border-radius: 1.5rem !important;
    overflow: hidden !important;
}

body.theme-light .top-nav,
body.theme-aurora-bloom .top-nav,
body.theme-arctic-breeze .top-nav {
    background: color-mix(in srgb, var(--card-bg) 78%, transparent);
}

@media (max-width: 1200px) {
    .app-container {
        width: min(1420px, calc(100% - 24px));
        gap: 1rem;
    }

    .sidebar {
        flex-basis: 260px;
        width: 260px;
        min-width: 240px;
    }

    .main-workspace {
        flex-basis: calc(100% - 276px);
        width: calc(100% - 276px);
    }
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        width: min(1420px, calc(100% - 20px));
        min-height: auto;
        padding-top: 0.75rem;
    }

    .sidebar {
        position: static;
        width: 100%;
        max-width: none;
        min-width: 0;
        flex-basis: auto;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .main-workspace {
        width: 100%;
        flex-basis: auto;
        overflow: visible;
    }

    body {
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    }

    .mobile-floating-search {
        position: fixed;
        left: auto;
        right: 1rem;
        bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
        z-index: 3000;
        width: auto;
        min-width: 154px;
        max-width: calc(100% - 2rem);
        min-height: 48px;
        padding: 0 1rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.65rem;
        border: 0;
        border-radius: 999px;
        color: #ffffff;
        background: linear-gradient(135deg, var(--primary), #14b8a6);
        box-shadow: 0 20px 48px rgba(15, 23, 42, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.28) inset;
        font: inherit;
        font-size: 1rem;
        font-weight: 900;
        cursor: pointer;
    }

    .mobile-floating-search i {
        font-size: 1.25rem;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    #searchGrid {
        min-height: 520px;
    }

    .r-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .top-nav {
        padding: 0.9rem 1rem;
    }

    .app-container {
        gap: 0.85rem;
    }

    .sidebar {
        padding: 1rem;
        border-radius: 1rem !important;
    }

    .sidebar-header {
        margin-bottom: 1rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-group.half {
        width: 100%;
    }

    .btn-search-main {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: 1;
        width: 100%;
        min-height: 46px;
        padding: 0.85rem 1rem;
        margin-bottom: 1rem;
        border-radius: 18px;
    }

    .results-header {
        padding: 1rem !important;
        border-radius: 1rem !important;
    }

    .r-info h3 {
        font-size: 1.15rem;
        line-height: 1.25;
    }

    .r-actions,
    .show-style-control,
    .card-size-control {
        width: 100%;
    }

    .show-style-control,
    .card-size-control {
        justify-content: space-between;
        border-radius: 14px;
    }

    .show-style-control select,
    .card-size-control input[type="range"] {
        min-width: 0;
        flex: 1;
    }

    .student-card-view,
    .student-card-view.card-size-small,
    .student-card-view.card-size-large {
        grid-template-columns: 1fr;
        min-height: 420px;
        padding: 0.8rem;
    }

    .student-business-card,
    .card-size-large .student-business-card {
        min-height: 0;
        padding: 1rem;
        border-radius: 20px;
    }

    .student-card-top,
    .card-size-large .student-card-top,
    .card-size-small .student-card-top {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 0.8rem;
    }

    .student-card-photo-wrap,
    .card-size-large .student-card-photo-wrap,
    .card-size-small .student-card-photo-wrap {
        width: 72px;
        height: 86px;
        border-radius: 18px;
    }

    .student-card-title h3,
    .card-size-large .student-card-title h3 {
        font-size: 1.08rem;
        line-height: 1.18;
    }

    .student-card-details {
        grid-template-columns: 1fr;
    }

    .student-card-actions {
        flex-direction: column;
    }

    .student-card-actions .student-action-btn {
        width: 100%;
        min-height: 40px;
    }

    .student-summary-view {
        padding: 0;
        min-height: 520px;
        background: #eef3ee;
    }

    .student-summary-phone {
        width: 100%;
        min-height: 100%;
        border-radius: 0;
        border: 0;
        box-shadow: none;
        background: #ffffff;
    }

    .summary-appbar {
        min-height: 76px;
        padding: 1rem 1.05rem;
    }

    .summary-appbar h3 {
        font-size: 1.6rem;
    }

    .summary-appbar-actions {
        font-size: 1.55rem;
    }

    .summary-groups {
        padding: 1.1rem;
        gap: 1.15rem;
    }

    .summary-group-head h4 {
        font-size: 1.15rem;
    }

    .summary-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    @media (max-width: 360px) {
        .summary-card-grid {
            grid-template-columns: 1fr;
        }
    }

    .summary-student-card {
        min-height: 190px;
        padding: 0.9rem;
        border-radius: 20px;
    }

    .summary-student-top img {
        width: 46px;
        height: 46px;
    }

    .summary-status {
        margin-top: 1rem;
        font-size: 0.92rem;
    }

    .summary-progress {
        gap: 0.55rem;
    }

    .summary-progress b {
        font-size: 0.8rem;
    }

    .summary-student-card h5 {
        font-size: 1rem;
        line-height: 1.1;
    }

    .summary-student-card p,
    .summary-student-card small {
        font-size: 0.74rem;
    }

    .mobile-grid-view {
        display: block;
        width: 100%;
        padding: 0.5rem 0.35rem 5.5rem;
        min-height: 420px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .mobile-grid-view.hidden {
        display: none !important;
    }

    .mobile-grid-table-wrap {
        min-width: 760px;
        border-radius: 16px;
        border: 1px solid #dbe3ef;
        background: #ffffff;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
    }

    .mobile-grid-table th,
    .mobile-grid-table td {
        padding: 0.7rem 0.65rem;
        font-size: 0.82rem;
    }

    .mobile-grid-actions .student-action-btn {
        width: 38px;
        min-width: 38px;
        height: 34px;
        border-radius: 10px;
    }

    .mobile-contact-list {
        display: grid;
        gap: 1rem;
    }

    .mobile-contact-card {
        position: relative;
        padding: 1.15rem 1rem 1rem;
        border-radius: 24px;
        background: #ffffff;
        color: #101828;
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
        overflow: hidden;
    }

    .mobile-contact-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto;
        height: 74px;
        background: linear-gradient(135deg, #0f9f59, #0a8f74);
        opacity: 0.96;
    }

    .mobile-contact-avatar-wrap {
        position: relative;
        z-index: 1;
        width: 92px;
        height: 92px;
        margin: 1.5rem auto 0.65rem;
    }

    .mobile-contact-avatar {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        border: 5px solid #ffffff;
        background: #f1f5f9;
        box-shadow: 0 14px 26px rgba(15, 23, 42, 0.2);
    }

    .mobile-contact-camera {
        position: absolute;
        right: -0.15rem;
        bottom: 0.1rem;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        background: #ffffff;
        color: #0f9f59;
        border: 1px solid rgba(15, 23, 42, 0.16);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
    }

    .mobile-contact-main {
        text-align: center;
    }

    .mobile-contact-main h3 {
        margin: 0;
        font-size: 1.45rem;
        line-height: 1.15;
        color: #111827;
        font-weight: 800;
    }

    .mobile-contact-main p {
        margin: 0.35rem 0 0;
        color: #0f9f59;
        font-size: 1rem;
        font-weight: 650;
    }

    .mobile-contact-actions {
        display: flex;
        justify-content: center;
        gap: 1.05rem;
        margin: 1.1rem 0;
    }

    .mobile-round-action {
        width: 52px;
        height: 52px;
        border: 0;
        border-radius: 50%;
        display: grid;
        place-items: center;
        background: #0f9f59;
        color: #ffffff;
        font-size: 1.35rem;
        text-decoration: none;
        box-shadow: 0 12px 24px rgba(15, 159, 89, 0.28);
    }

    .mobile-contact-tags {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.55rem;
        margin-bottom: 1rem;
    }

    .mobile-contact-tags span {
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.4rem 0.75rem;
        border-radius: 10px;
        background: #eef8f1;
        color: #166534;
        border: 1px solid #b7d6c0;
        font-weight: 700;
    }

    .mobile-contact-tags span:nth-child(2) {
        background: #fee2e2;
        color: #991b1b;
        border-color: #fecaca;
    }

    .mobile-contact-tags span:nth-child(3) {
        background: #dbeafe;
        color: #1e3a8a;
        border-color: #bfdbfe;
    }

    .mobile-contact-activity {
        display: grid;
        grid-template-columns: 44px 1fr;
        gap: 0.8rem;
        align-items: center;
        padding: 0.9rem 0.1rem 0;
        border-top: 1px solid #e5e7eb;
    }

    .mobile-contact-activity > i {
        color: #6b7280;
        font-size: 1.8rem;
        justify-self: center;
    }

    .mobile-contact-activity strong,
    .mobile-contact-activity span,
    .mobile-contact-activity small {
        display: block;
        color: #111827;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .mobile-contact-activity span,
    .mobile-contact-activity small {
        color: #4b5563;
    }

    .main-workspace > .glass-panel.mt-4 {
        width: 100%;
        overflow-x: visible;
        overflow-y: visible;
        padding: 0.75rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .main-workspace > .glass-panel.mt-4:has(#searchGrid:not(.hidden)) {
        overflow-x: auto;
    }

    .main-workspace > .glass-panel.mt-4.is-mobile-native-grid {
        overflow-x: auto !important;
        min-height: 460px;
    }

    #searchGrid {
        width: 860px;
        max-width: none;
        min-height: 460px;
    }

    #searchGrid.hidden {
        display: none !important;
    }

    #searchGrid .ag-root-wrapper {
        min-width: 860px;
    }

    .ag-theme-alpine {
        --ag-font-size: 13px;
        --ag-row-height: 44px;
        --ag-header-height: 44px;
    }

    .ag-theme-alpine .ag-paging-panel {
        min-width: 860px;
    }
}

@media print {
    body.print-card-view {
        background: #ffffff !important;
        color: #0f172a !important;
    }

    body.print-card-view .erp-page-topbar,
    body.print-card-view .sidebar,
    body.print-card-view .results-header,
    body.print-card-view #searchGrid,
    body.print-card-view #loader,
    body.print-card-view #grid-loader {
        display: none !important;
    }

    body.print-card-view .app-container,
    body.print-card-view .main-workspace,
    body.print-card-view .glass-panel {
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        box-shadow: none !important;
        border: 0 !important;
        background: #ffffff !important;
    }

    body.print-card-view #studentCardView {
        display: grid !important;
        min-height: 0 !important;
        padding: 0 !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10mm !important;
        overflow: visible !important;
    }

    body.print-card-view .student-business-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.print-card-view .student-card-actions {
        display: none !important;
    }
}
