/**
 * Teacher Portal Frontend Stylesheet
 * Color Scheme: Professional Navy Blue (#0f172a, #1e3a8a) + White + Gold (#f59e0b)
 */

.fees-portal-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e293b;
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
    line-height: 1.5;
}

/* ================= LOGIN FORM STYLING ================= */
.fees-login-container {
    max-width: 440px;
    margin: 40px auto;
}

.fees-login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.fees-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.fees-portal-logo {
    max-height: 70px;
    max-width: 180px;
    margin-bottom: 12px;
    object-fit: contain;
}

.fees-portal-icon-badge {
    font-size: 42px;
    display: inline-block;
    background: #eff6ff;
    width: 72px;
    height: 72px;
    line-height: 72px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.fees-login-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.fees-login-sub {
    color: #64748b;
    font-size: 13px;
    margin: 0;
}

.fees-form-group {
    margin-bottom: 18px;
}

.fees-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.fees-input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fees-input-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.fees-input-icon-wrap input {
    width: 100%;
    padding: 11px 40px 11px 38px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.fees-input-icon-wrap input:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
    outline: none;
}

.fees-toggle-pass {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    color: #64748b;
}

.fees-btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fees-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
    transform: translateY(-1px);
    color: #ffffff;
}

.fees-btn-block {
    width: 100%;
}

.fees-login-footer {
    text-align: center;
    margin-top: 22px;
    color: #94a3b8;
    font-size: 12px;
}

.fees-alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.4;
}

.fees-alert-error {
    background-color: #fee2e2;
    border: 1px solid #f87171;
    color: #991b1b;
}

.fees-alert-success {
    background-color: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

/* ================= PORTAL NAVBAR ================= */
.fees-portal-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    color: #ffffff;
    padding: 14px 22px;
    border-radius: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.fees-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fees-nav-logo {
    max-height: 42px;
    max-width: 120px;
    object-fit: contain;
    background: #ffffff;
    padding: 4px;
    border-radius: 6px;
}

.fees-nav-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.fees-nav-subtitle {
    font-size: 12px;
    color: #f59e0b; /* Gold */
}

.fees-nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.fees-user-info {
    text-align: right;
}

.fees-user-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
}

.fees-user-emp {
    display: block;
    font-size: 11px;
    color: #94a3b8;
}

.fees-btn-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.fees-btn-logout:hover {
    background: #ef4444;
    color: #ffffff;
}

.fees-badge-admin-preview {
    background: #f59e0b;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* ================= SELECTION CARD ================= */
.fees-selection-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.fees-steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: flex-end;
}

.fees-step-item label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fees-step-num {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    background: #1e3a8a;
    color: #ffffff;
    border-radius: 50%;
    text-align: center;
    font-size: 11px;
    margin-right: 4px;
}

.fees-select, .fees-input, .fees-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.fees-select:focus, .fees-input:focus, .fees-textarea:focus {
    border-color: #1e3a8a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.fees-select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* ================= ACTION BAR & CHIPS ================= */
.fees-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.fees-stats-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fees-chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.fees-chip strong {
    font-weight: 700;
}

.fees-chip-total {
    background: #eff6ff;
    color: #1e3a8a;
}

.fees-chip-pending {
    background: #fee2e2;
    color: #b91c1c;
}

.fees-chip-paid {
    background: #dcfce7;
    color: #15803d;
}

.fees-download-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fees-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.fees-btn-pdf {
    background: #dc2626;
    color: #ffffff !important;
}

.fees-btn-pdf:hover {
    background: #b91c1c;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.fees-btn-jpg {
    background: #0284c7;
    color: #ffffff !important;
}

.fees-btn-jpg:hover {
    background: #0369a1;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.fees-btn-print {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.fees-btn-print:hover {
    background: #e2e8f0;
}

/* ================= DATA TABLE ================= */
.fees-table-container {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.fees-print-header {
    display: none;
}

.fees-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.fees-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.fees-table th {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.fees-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.fees-table tr:hover {
    background-color: #f8fafc;
}

.fees-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-paid {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.status-pending {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.status-partial {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.fees-td-pending {
    color: #dc2626;
    font-weight: 700;
}

.fees-td-paid {
    color: #16a34a;
}

.fees-btn-remark {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
    margin-right: 4px;
}

.fees-btn-remark:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.fees-btn-whatsapp {
    background: #25d366;
    color: #ffffff !important;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 11px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: background 0.15s;
}

.fees-btn-whatsapp:hover {
    background: #128c7e;
}

/* ================= EMPTY & LOADING STATES ================= */
.fees-empty-state, .fees-loading-state {
    text-align: center;
    padding: 50px 20px;
    color: #64748b;
}

.fees-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.fees-empty-state h3 {
    margin: 0 0 6px 0;
    color: #0f172a;
    font-size: 18px;
}

.fees-empty-state p {
    margin: 0;
    font-size: 14px;
    max-width: 420px;
    margin: 0 auto;
}

.fees-spinner-large {
    width: 36px;
    height: 36px;
    border: 3.5px solid #cbd5e1;
    border-top-color: #1e3a8a;
    border-radius: 50%;
    animation: feesSpin 0.7s linear infinite;
    margin: 0 auto 12px auto;
}

.fees-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: feesSpin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

@keyframes feesSpin {
    to { transform: rotate(360deg); }
}

/* ================= MODAL STYLES ================= */
.fees-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fees-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
}

.fees-modal-content {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    z-index: 10;
}

.fees-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.fees-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
    font-weight: 700;
}

.fees-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}

.fees-modal-body {
    padding: 20px;
}

.fees-quick-templates label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    display: block;
    margin-bottom: 6px;
}

.fees-template-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fees-tpl-btn {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}

.fees-tpl-btn:hover {
    background: #dbeafe;
}

.fees-history-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.fees-history-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.fees-history-meta {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.fees-reply-box {
    margin-top: 6px;
    padding: 6px 8px;
    background: #fefce8;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 11px;
}

/* ================= PRINT MEDIA QUERY ================= */
@media print {
    body * {
        visibility: hidden;
    }
    #feesPrintableArea, #feesPrintableArea * {
        visibility: visible;
    }
    #feesPrintableArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        border: none;
    }
    .fees-print-header {
        display: block;
        margin-bottom: 20px;
        text-align: center;
    }
    .fees-btn-remark, .fees-btn-whatsapp, .fees-actions-bar, .fees-selection-card, .fees-portal-navbar {
        display: none !important;
    }
}

/* ================= MOBILE RESPONSIVENESS ================= */
@media (max-width: 768px) {
    .fees-portal-wrapper {
        padding: 14px;
    }
    .fees-portal-navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .fees-nav-user {
        width: 100%;
        justify-content: space-between;
    }
    .fees-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .fees-download-buttons {
        justify-content: space-between;
    }
    .fees-btn {
        flex: 1;
        justify-content: center;
    }
}
