/* ═══════════════════════════════════════════════════════
   Shared List Pages — lp-* namespace
   Used by: StudentList, TeacherList, ClassList,
            AcademicYearList, ClassFeePlanList,
            ExamList, FeeList, SubjectList
   ═══════════════════════════════════════════════════════ */

.lp-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Toolbar ── */
.lp-toolbar {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8ecf1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.lp-toolbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* ── Buttons ── */
.lp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
}

.lp-btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.lp-btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 4px 14px rgba(99,102,241,0.4);
    transform: translateY(-1px);
    color: #fff;
}

.lp-btn-outline {
    background: #f8fafc;
    color: #374151;
    border-color: #d1d5db;
}

.lp-btn-outline:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #9ca3af;
    color: #111827;
    transform: translateY(-1px);
}

.lp-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Count badge ── */
.lp-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f0f4ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Filters ── */
.lp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: flex-end;
}

.lp-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.lp-filter-search {
    flex: 1 1 200px;
}

.lp-filter-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.lp-select {
    height: 34px;
    padding: 0 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.8rem;
    background: #f8fafc;
    color: #374151;
    transition: border-color 0.18s, box-shadow 0.18s;
    min-width: 100px;
}

.lp-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.lp-select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.lp-search-wrap {
    position: relative;
}

.lp-search-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.8rem;
    pointer-events: none;
}

.lp-search-input {
    height: 34px;
    width: 100%;
    padding: 0 0.75rem 0 2.2rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.8rem;
    background: #f8fafc;
    color: #374151;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.lp-search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background: #fff;
}

/* ── Card / table ── */
.lp-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8ecf1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.lp-table-wrap {
    overflow-x: auto;
}

.lp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.lp-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e8ecf1;
}

.lp-table th {
    padding: 0.7rem 1rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    white-space: nowrap;
    text-align: left;
}

.lp-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.lp-row:hover { background: #f8faff; }

.lp-table td {
    padding: 0.7rem 1rem;
    color: #374151;
    vertical-align: middle;
}

/* ── Actions column ── */
.lp-td-actions {
    text-align: center;
    white-space: nowrap;
}

/* ── Icon buttons ── */
.lp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 0.75rem;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
    margin: 0 1px;
}

.lp-icon-btn--info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.lp-icon-btn--info:hover { background: #dbeafe; color: #1e40af; }

.lp-icon-btn--primary { background: #f0f4ff; color: #4f46e5; border-color: #c7d2fe; }
.lp-icon-btn--primary:hover { background: #ede9fe; color: #4338ca; }

.lp-icon-btn--success { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.lp-icon-btn--success:hover { background: #d1fae5; color: #065f46; }

.lp-icon-btn--warn    { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.lp-icon-btn--warn:hover { background: #fef3c7; color: #b45309; }

.lp-icon-btn--warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.lp-icon-btn--warning:hover { background: #fef3c7; color: #92400e; }

.lp-icon-btn--danger  { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.lp-icon-btn--danger:hover { background: #ffe4e6; color: #9f1239; }

/* ── Cell badge (count-in-cell) ── */
.lp-cell-badge {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #f0f4ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    white-space: nowrap;
}

/* ── Status badge ── */
.lp-status-badge {
    display: inline-block;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.lp-status-badge--success {
    background: #d1fae5;
    color: #065f46;
}

.lp-status-badge--gray {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Empty state ── */
.lp-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.lp-empty-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

/* ── Pagination ── */
.lp-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    background: #fafbfd;
}

.lp-pager-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #6b7280;
}

.lp-pager-select {
    min-width: 64px;
    font-size: 0.78rem;
    height: 30px;
}

.lp-pager-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lp-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #fff;
    color: #374151;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lp-pager-btn:hover:not(:disabled) {
    border-color: #6366f1;
    color: #6366f1;
    background: #f5f3ff;
}

.lp-pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lp-pager-info {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    min-width: 3.5rem;
    text-align: center;
}

.lp-pager-of    { color: #9ca3af; font-weight: 400; }
.lp-pager-count { font-size: 0.75rem; color: #6b7280; white-space: nowrap; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .lp-hide-md { display: none; }
}

@media (max-width: 768px) {
    .lp-hide-sm { display: none; }
}

@media (max-width: 640px) {
    .lp-filters { flex-direction: column; }
    .lp-filter-group { width: 100%; }
    .lp-pager { flex-direction: column; align-items: center; }
}
