/* Dashboard stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stats-grid .card {
    margin-bottom: 0;
}

/* Report tables */
.report-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.report-table th {
    background: var(--primary);
    color: white;
    padding: 10px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.report-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-table tr:nth-child(even) {
    background: #FAFAFA;
}

.report-table .amount {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.report-table tfoot td {
    font-weight: 700;
    background: #F5F5F5;
    border-top: 2px solid var(--border);
}

/* Scrollable table wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
}

/* Attendance grid */
.attendance-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attendance-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: var(--radius);
    gap: 12px;
    min-height: 52px;
}

.attendance-row .student-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.attendance-row .status-btns {
    display: flex;
    gap: 6px;
}

.attendance-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.15s;
}

.attendance-btn.present {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.attendance-btn.absent {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.attendance-btn.late {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
}

/* Receipt */
.receipt {
    background: white;
    padding: 20px;
    font-family: 'Courier New', monospace;
    max-width: 320px;
    margin: 0 auto;
}

.receipt-header {
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 0.85rem;
}

.receipt-total {
    border-top: 1px dashed var(--border);
    margin-top: 8px;
    padding-top: 8px;
    font-weight: 700;
}

/* Student profile */
.profile-header {
    text-align: center;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    background: var(--primary);
    margin: 0 auto 12px;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.profile-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Info rows */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.info-value {
    font-weight: 600;
    text-align: right;
}

/* Date filter bar */
.date-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-end;
}

.date-filter .form-group {
    flex: 1;
    margin-bottom: 0;
}

.date-filter .form-control {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.85rem;
}

/* Face scan overlay */
.face-scan-overlay {
    position: fixed;
    inset: 0;
    background: black;
    z-index: 300;
    display: flex;
    flex-direction: column;
}

.face-scan-overlay video {
    width: 100%;
    flex: 1;
    object-fit: cover;
}

.face-scan-overlay canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.face-scan-controls {
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-bottom));
    background: rgba(0,0,0,0.8);
    display: flex;
    gap: 12px;
    justify-content: center;
}

.face-scan-status {
    position: absolute;
    top: calc(var(--safe-top) + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Fee item checkboxes (payment flow) */
.fee-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.fee-item-row:last-child {
    border-bottom: none;
}

.fee-item-row:active {
    background: #F5F5F5;
}

.fee-item-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.fee-item-info {
    flex: 1;
    min-width: 0;
}

.fee-item-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.fee-item-inv {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.fee-item-amount {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Print styles */
@media print {
    body > *:not(#fullpage-container) {
        display: none !important;
    }

    #fullpage-container {
        position: static !important;
    }

    .fullpage-header,
    .fullpage-footer {
        display: none !important;
    }

    .fullpage-body {
        padding: 0 !important;
    }

    .receipt {
        max-width: none;
        margin: 0;
        padding: 10px;
        font-size: 12px;
        box-shadow: none;
    }

    .receipt-header h3 {
        font-size: 16px;
    }

    .receipt-row {
        font-size: 12px;
    }
}

/* ===== Analytics filters ===== */
.an-filters {
    padding: 14px;
    background: linear-gradient(135deg, #E3F2FD 0%, #FFFFFF 60%);
    border: 1px solid #BBDEFB;
}
.an-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.an-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.an-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #607080);
}
.an-select {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: 1px solid var(--border, #E0E0E0);
    border-radius: 8px;
    padding: 10px 32px 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #1A1A1A);
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231565C0' stroke-width='3'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    transition: border-color .15s, box-shadow .15s;
}
.an-select:focus {
    outline: none;
    border-color: var(--primary, #1565C0);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}
.an-scope {
    display: flex;
    gap: 0;
    background: #F1F3F5;
    border-radius: 10px;
    padding: 4px;
}
.an-scope .seg-btn {
    flex: 1;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--text-secondary, #607080);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    border-radius: 7px;
    transition: background .15s, color .15s, box-shadow .15s;
}
.an-scope .seg-btn.on {
    background: #fff;
    color: var(--primary, #1565C0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
