/* School Fees Management System Admin Styles */
.sfms-modern-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
}

.sfms-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.sfms-stat-card {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sfms-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.sfms-stat-card .stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #2271b1;
    margin-bottom: 5px;
}

.sfms-stat-card .stat-label {
    color: #646970;
    font-size: 0.9em;
}

.sfms-dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.sfms-recent-activity,
.sfms-quick-actions {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
}

.sfms-quick-actions .quick-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Search and Filters */
.sfms-search-filters {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1d2327;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Buttons */
.sfms-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border: 1px solid;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #3c434a;
}

.sfms-button:hover {
    background: #f0f0f1;
    border-color: #c3c4c7;
    color: #2c3338;
}

.sfms-button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: white;
}

.sfms-button-primary:hover {
    background: #135e96;
    border-color: #135e96;
    color: white;
}

.sfms-button-secondary {
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #3c434a;
}

.sfms-button-secondary:hover {
    background: #f0f0f1;
    border-color: #c3c4c7;
    color: #2c3338;
}

.sfms-button-success {
    background: #00a32a;
    border-color: #00a32a;
    color: white;
}

.sfms-button-success:hover {
    background: #008a20;
    border-color: #008a20;
}

.sfms-button-danger {
    background: #d63638;
    border-color: #d63638;
    color: white;
}

.sfms-button-danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

.sfms-button-small {
    padding: 4px 8px;
    font-size: 12px;
}

.sfms-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sfms-button:disabled:hover {
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #3c434a;
}

/* Forms */
.sfms-form {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1d2327;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dcdcde;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tables */
.sfms-table-container {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.sfms-modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sfms-modern-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #dcdcde;
    color: #1d2327;
}

.sfms-modern-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: top;
}

.sfms-modern-table tr:hover {
    background: #f8f9fa;
}

.sfms-modern-table tr:last-child td {
    border-bottom: none;
}

/* Action buttons in tables */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.action-buttons .sfms-button {
    margin: 2px;
}

/* Status indicators */
.status-active {
    color: #00a32a;
    font-weight: 600;
    background: #f0f9f4;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.status-inactive {
    color: #d63638;
    font-weight: 600;
    background: #fcf0f1;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.status-pending {
    color: #dba617;
    font-weight: 600;
    background: #fef8ee;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.status-sent {
    color: #2271b1;
    font-weight: 600;
    background: #f0f6fc;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.balance-positive {
    color: #00a32a;
    font-weight: 600;
}

.balance-negative {
    color: #d63638;
    font-weight: 600;
}

.warning-reminder {
    color: #dba617;
    background: #fef8ee;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.warning-overdue {
    color: #d63638;
    background: #fcf0f1;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.warning-final {
    color: #8c2e0b;
    font-weight: bold;
    background: #f9f0ef;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Bulk Actions Panel */
.sfms-bulk-actions-panel {
    background: #f8f9fa;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
}

.bulk-actions-content {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-actions-content select {
    min-width: 200px;
}

/* Modals */
.sfms-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s ease;
}

.sfms-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #1d2327;
}

.modal-body {
    padding: 20px;
}

.sfms-close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #646970;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.sfms-close-modal:hover {
    color: #135e96;
    background: #f0f0f1;
}

/* Communications Styles */
.sfms-communications-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sfms-quick-send-form,
.sfms-communication-history {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
}

.communication-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.communication-type-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f6f7f7;
}

.communication-type-btn:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.communication-type-btn.active {
    border-color: #2271b1;
    background: #2271b1;
    color: white;
}

.communication-type-btn i {
    display: block;
    font-size: 20px;
    margin-bottom: 5px;
}

/* Student Portal Styles */
.sfms-student-portal,
.sfms-parent-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.student-welcome,
.parent-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.student-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5e9;
}

.student-class {
    background: #2271b1;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.student-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.fee-status {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.balance-amount {
    font-size: 1.5em;
    font-weight: bold;
    margin: 10px 0;
    text-align: center;
}

.balance-label {
    display: block;
    font-size: 0.8em;
    font-weight: normal;
    color: #646970;
}

.payment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.payment-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f1;
}

.payment-list li:last-child {
    border-bottom: none;
}

.payment-date {
    color: #646970;
    font-size: 0.9em;
}

.payment-amount {
    font-weight: 600;
}

.payment-type {
    color: #646970;
    font-size: 0.9em;
}

/* Notices and Alerts */
.sfms-notice {
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.sfms-notice-success {
    background: #f0f9f4;
    border-left-color: #00a32a;
    color: #1e4620;
}

.sfms-notice-error {
    background: #fcf0f1;
    border-left-color: #d63638;
    color: #5c2a30;
}

.sfms-notice-warning {
    background: #fef8ee;
    border-left-color: #dba617;
    color: #5c4417;
}

.sfms-notice-info {
    background: #f0f6fc;
    border-left-color: #2271b1;
    color: #1e3a5f;
}

/* Loading States */
.sfms-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sfms-communications-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sfms-dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .student-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .bulk-actions-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-actions-content select {
        min-width: auto;
    }
    
    .sfms-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .communication-type-selector {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .sfms-stats-container {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .action-buttons .sfms-button {
        flex: 1;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .sfms-button,
    .filter-actions,
    .form-actions {
        display: none !important;
    }
    
    .sfms-table-container {
        border: none;
        box-shadow: none;
    }
}