/* ============================================================
   SCHOOL COMPONENTS — Directory, Toolbar, Segmented Tabs,
                      Filters, Pagination, Profile, Photos & Cropper
   Strictly complies with <= 350 lines limit
   ============================================================ */

/* ── Segmented Button / Pill Toggle ────────────────────────── */
.segmented-pill-group {
    display: inline-flex;
    border-radius: 8px;
    background: var(--bg-card);
    padding: 3px;
    border: 1px solid var(--border-color);
    gap: 4px;
}

.segmented-pill {
    font-weight: 600;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    padding: 4px 10px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.segmented-pill.active {
    background: var(--tenant-primary);
    color: var(--tenant-primary-text, #ffffff);
}

.segmented-pill.segmented-pill-danger.active {
    background: var(--danger);
    color: #ffffff;
}

.segmented-pill .badge {
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
}

.segmented-pill.active .badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.segmented-pill:not(.active) .badge-danger-light {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* ── Bulk Actions Toolbar ──────────────────────────────────── */
.bulk-actions-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: var(--bg-main);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.tab-title-bar-responsive {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* ── Filter Cards & Grids ──────────────────────────────────── */
.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 1.35rem 1.6rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
}

.filter-grid-students {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination-bar-responsive {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Student Profile Header & Meta ─────────────────────────── */
.profile-header-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 1.75rem 2rem;
    border-radius: 18px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.profile-avatar-circle {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tenant-primary) 0%, #4338ca 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.profile-tabs {
    display: flex;
    gap: 0.35rem;
    background: #f1f5f9;
    padding: 0.35rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.profile-tab-btn {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 0.65rem 1.15rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.profile-tab-btn:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.6);
}

.profile-tab-btn.active {
    background: #ffffff;
    color: var(--tenant-primary, #4f46e5);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.profile-grid-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.credential-highlight-box {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #c7d2fe;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-top: 0.5rem;
}

/* ── Student Photos & Cropper ──────────────────────────────── */
.photo-preview-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 2px solid var(--tenant-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.photo-preview-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-avatar-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    display: inline-block;
    vertical-align: middle;
}

.cropper-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.cropper-img-container {
    position: relative;
    width: 100%;
    height: 350px;
    min-height: 350px;
    background: #090d16;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
}

.cropper-container { width: 100% !important; height: 100% !important; }

.passport-overlay-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 260px;
    transform: translate(-50%, -50%);
    border: 2px dashed #4f46e5;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.cropper-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ── CRM Profile Specific Components ───────────────────────── */
.crm-profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.crm-profile-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.crm-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}
.crm-detail-row:last-child {
    border-bottom: none;
}
.crm-detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}
.crm-detail-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}
.crm-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.drawer-brand-wrap { max-width: 220px; }
.drawer-brand-title { color: var(--text-primary); }
.drawer-brand-tagline { color: var(--text-muted); }


