/* =============================================================
   Student Refund Automation System — Global Styles
   Theme: Dark Blue & White | Clean, Minimal, Professional
   ============================================================= */

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:      #0d2b55;
    --primary-dark: #091e3d;
    --primary-light:#1a4a8a;
    --accent:       #1e6fcf;
    --accent-light: #3a8ee8;
    --white:        #ffffff;
    --off-white:    #f4f6fb;
    --border:       #d0daea;
    --text:         #1a2a3a;
    --text-muted:   #6b7c93;
    --success:      #18a558;
    --warning:      #e07b00;
    --danger:       #c0392b;
    --info:         #1e6fcf;
    --teal:         #0d7377;
    --cyan:         #0f8a8a;
    --indigo:       #3f3d9c;
    --orange:       #e07b00;
    --shadow:       0 2px 12px rgba(13, 43, 85, 0.10);
    --radius:       8px;
    --radius-sm:    4px;
    --font:         'Segoe UI', Arial, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--off-white);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Navbar ------------------------------------------------- */
.navbar {
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 58px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    position: sticky; top: 0; z-index: 100;
}

.navbar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex; align-items: center; gap: 8px;
    color: var(--white);
}

.navbar-logo { font-size: 1.3rem; }

.navbar-links {
    display: flex; align-items: center; gap: 8px;
}

.nav-link {
    color: rgba(255,255,255,0.85);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: background 0.15s;
}
.nav-link:hover, .nav-link.active {
    background: var(--primary-light);
    color: var(--white);
    text-decoration: none;
}
.nav-link.logout { color: rgba(255,180,180,0.9); }
.nav-link.logout:hover { background: var(--danger); color: var(--white); }

.nav-user {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    padding: 0 8px;
    border-left: 1px solid rgba(255,255,255,0.2);
    margin-left: 4px;
}

/* --- Main content ------------------------------------------- */
.main-content {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px;
    width: 100%;
}

/* --- Flash messages ----------------------------------------- */
.flash-container { margin-bottom: 20px; }

.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.92rem;
    border-left: 4px solid;
}
.alert-success { background: #eaf7ee; border-color: var(--success); color: #145c30; }
.alert-danger  { background: #fdf0ef; border-color: var(--danger);  color: var(--danger); }
.alert-warning { background: #fff8ec; border-color: var(--warning); color: #7a4600; }
.alert-info    { background: #eaf2fb; border-color: var(--info);    color: #0c3e6e; }

/* --- Page header -------------------------------------------- */
.page-header {
    margin-bottom: 24px;
}
.page-header h2 {
    font-size: 1.6rem;
    color: var(--primary);
    font-weight: 700;
}
.page-header .subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: 4px;
}

/* --- Summary cards ------------------------------------------ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px 18px;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--primary);
    transition: transform 0.15s;
}
.card:hover { transform: translateY(-2px); }

.card-icon { font-size: 1.8rem; margin-bottom: 8px; }
.card-value { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; }
.card-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }

.card-blue   { border-top-color: var(--primary); }
.card-green  { border-top-color: var(--success); .card-value { color: var(--success); } }
.card-teal   { border-top-color: var(--teal); }
.card-cyan   { border-top-color: var(--cyan); }
.card-indigo { border-top-color: var(--indigo); }
.card-orange { border-top-color: var(--orange); }
.card-red    { border-top-color: var(--danger); }

.card-green  .card-value { color: var(--success); }
.card-teal   .card-value { color: var(--teal); }
.card-cyan   .card-value { color: var(--cyan); }
.card-indigo .card-value { color: var(--indigo); }
.card-orange .card-value { color: var(--orange); }
.card-red    .card-value { color: var(--danger); }

/* --- Section card ------------------------------------------- */
.section-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.section-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: 600;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-header h3 { margin-bottom: 0; }

/* --- Action buttons ----------------------------------------- */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

/* --- Buttons ------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, opacity 0.15s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: 0.9; }

.btn-primary   { background: var(--accent);   color: var(--white); }
.btn-secondary { background: var(--primary);  color: var(--white); }
.btn-success   { background: var(--success);  color: var(--white); }
.btn-danger    { background: var(--danger);   color: var(--white); }
.btn-outline   { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--white); }
.btn-block     { display: block; width: 100%; text-align: center; }
.btn-disabled  { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-sm        { padding: 5px 12px; font-size: 0.82rem; }

/* --- Tables -------------------------------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table thead tr {
    background: var(--primary);
    color: var(--white);
}
.data-table thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}
.data-table tbody tr { border-bottom: 1px solid var(--border); }
.data-table tbody tr:hover { background: #f0f4fb; }
.data-table tbody td { padding: 11px 14px; }

/* --- Badges -------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.badge-blue   { background: #ddeeff; color: var(--primary); }
.badge-teal   { background: #d4f0f0; color: var(--teal); }
.badge-green  { background: #d9f5e5; color: var(--success); }
.badge-red    { background: #fce8e7; color: var(--danger); }
.badge-orange { background: #fef1d9; color: var(--orange); }

/* --- Forms --------------------------------------------------- */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30, 111, 207, 0.12);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.form-row .form-group {
    flex: 1;
    min-width: 180px;
    margin-bottom: 0;
}
.form-group-btn { flex: 0 0 auto; }

/* --- Auth pages ---------------------------------------------- */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
}
.auth-header {
    text-align: center;
    margin-bottom: 28px;
}
.auth-header h1 {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}
.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 6px;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Student form -------------------------------------------- */
.student-form-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}
.student-form-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px;
    width: 100%;
    max-width: 700px;
}
.form-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.form-header h2 { color: var(--primary); font-size: 1.4rem; }
.form-header p  { color: var(--text-muted); font-size: 0.9rem; margin-top: 6px; }

.prefilled-section { margin-bottom: 28px; }
.prefilled-section h3 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 14px;
    font-weight: 600;
}
.prefilled-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.prefilled-item {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.prefilled-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.prefilled-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}
.refund-amount { color: var(--success); font-weight: 700; font-size: 1.05rem; }

/* --- Misc ---------------------------------------------------- */
.empty-state {
    color: var(--text-muted);
    font-size: 0.92rem;
    text-align: center;
    padding: 24px 0;
}
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.hint        { font-size: 0.82rem; color: var(--text-muted); margin-top: 10px; }

/* --- Footer -------------------------------------------------- */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 14px;
    font-size: 0.8rem;
    margin-top: auto;
}

/* --- Responsive --------------------------------------------- */
@media (max-width: 768px) {
    .main-content    { padding: 18px 14px; }
    .navbar          { padding: 0 16px; }
    .navbar-links    { gap: 4px; }
    .nav-user        { display: none; }
    .cards-grid      { grid-template-columns: repeat(2, 1fr); }
    .auth-card       { padding: 28px 18px; }
    .student-form-card { padding: 22px 16px; }
    .form-row        { flex-direction: column; }
}

/* =============================================================
   Phase 2 — Excel Upload styles
   ============================================================= */

/* Info box */
.info-box {
    background: #eaf2fb;
    border: 1px solid #b8d4f0;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.88rem;
    color: #0c3e6e;
    margin-bottom: 20px;
}
.info-box code {
    background: #ddeeff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
    color: var(--primary);
}
.link-download { color: var(--accent); font-weight: 600; }

/* Drag-and-drop dropzone */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--off-white);
}
.upload-dropzone:hover, .upload-dropzone.drag-over {
    border-color: var(--accent);
    background: #eaf2fb;
}
.upload-icon { font-size: 2.5rem; }
.upload-text { font-size: 0.95rem; color: var(--text); font-weight: 500; }
.upload-hint { font-size: 0.82rem; color: var(--text-muted); }
.file-input-hidden { display: none; }

/* File preview bar */
.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #d9f5e5;
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-top: 12px;
}
.file-name { font-size: 0.9rem; color: var(--text); flex: 1; }

/* Form actions row */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    align-items: center;
}

/* Error row highlight in result table */
tr.row-error { background: #fdf0ef !important; }
tr.row-error:hover { background: #fde8e6 !important; }
.error-reason { color: var(--danger); font-size: 0.85rem; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.page-info { font-size: 0.88rem; color: var(--text-muted); }

/* Filter form */
.filter-form { padding-bottom: 0; }

/* =============================================================
   Phase 3 — WhatsApp logs styles
   ============================================================= */

.small-code {
    font-size: 0.78rem;
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--primary);
    word-break: break-all;
}

/* =============================================================
   Phase 4 — Student form styles
   ============================================================= */

/* Student-only pages (no admin navbar) */
.student-header {
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.student-header-logo { font-size: 1.4rem; }
.student-header-title { letter-spacing: 0.3px; }

.student-main {
    display: flex;
    justify-content: center;
    padding: 28px 16px;
    min-height: calc(100vh - 110px);
    background: var(--off-white);
}

.student-form-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 40px;
    width: 100%;
    max-width: 720px;
}

/* Form sections */
.form-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 24px;
}
.form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

/* Read-only prefilled section */
.readonly-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Field hints */
.field-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-top: -4px;
}

/* Form note box */
.form-note {
    background: #fff8ec;
    border-left: 3px solid var(--warning);
    padding: 9px 14px;
    font-size: 0.84rem;
    color: #7a4600;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 16px;
}

/* Error states */
.has-error .form-control, .input-error { border-color: var(--danger) !important; }
.field-error {
    display: block;
    font-size: 0.82rem;
    color: var(--danger);
    margin-top: 4px;
}
.required { color: var(--danger); }

/* File upload */
.file-upload-wrapper { position: relative; }
.file-upload-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--off-white);
    transition: border-color 0.15s, background 0.15s;
}
.file-upload-label:hover {
    border-color: var(--accent);
    background: #eaf2fb;
    color: var(--accent);
}
.file-upload-icon { font-size: 1.2rem; }

/* Image preview */
.img-preview-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    padding: 10px;
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.img-preview {
    max-width: 120px;
    max-height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
}

/* Consent section */
.consent-section { background: #f4f6fb; }
.consent-box { padding: 4px 0; }
.consent-label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
}
.consent-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}
.consent-text {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.6;
}
.consent-text ul {
    margin: 8px 0 0 18px;
    padding: 0;
}
.consent-text li { margin-bottom: 4px; }

/* Submit row */
.form-submit-row {
    text-align: center;
    padding-top: 8px;
}
.btn-large {
    padding: 13px 40px;
    font-size: 1rem;
}
.submit-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Success card */
.success-card { text-align: center; padding: 48px 40px; }
.success-icon  { font-size: 4rem; margin-bottom: 16px; }
.success-title { color: var(--success); font-size: 1.6rem; margin-bottom: 12px; }
.success-msg   { font-size: 1rem; color: var(--text); margin-bottom: 24px; line-height: 1.7; }

.success-info-box {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 24px;
    margin: 0 auto 28px;
    max-width: 360px;
    text-align: left;
}
.success-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.success-info-row:last-child { border-bottom: none; }
.success-info-label { color: var(--text-muted); }
.success-info-value { font-weight: 600; }

.success-next-steps {
    background: #eaf7ee;
    border: 1px solid #a8ddb5;
    border-radius: var(--radius);
    padding: 20px 28px;
    text-align: left;
    margin-bottom: 24px;
}
.success-next-steps h3 {
    color: var(--success);
    font-size: 0.95rem;
    margin-bottom: 12px;
}
.success-next-steps ol {
    padding-left: 20px;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text);
}

.success-footer-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
}

@media (max-width: 600px) {
    .student-form-card { padding: 22px 16px; }
    .success-card { padding: 32px 16px; }
    .form-section { padding: 16px; }
}


/* =============================================================
   SmartPing SMS OTP Modal Styles
   ============================================================= */
.otp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 43, 85, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}
.otp-modal-card {
    background: #ffffff;
    border-radius: var(--radius);
    max-width: 440px;
    width: 100%;
    padding: 32px 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: otpPopIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes otpPopIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.otp-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}
.otp-title {
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-weight: 700;
}
.otp-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}
.otp-inputs-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}
.otp-digit-box {
    width: 48px;
    height: 54px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.2s ease;
    background: var(--off-white);
    color: var(--primary-dark);
}
.otp-digit-box:focus {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}
.otp-error-alert {
    background: #fdf0ef;
    border: 1px solid var(--danger);
    color: var(--danger);
    font-size: 0.88rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    text-align: left;
}
.otp-timer-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.otp-resend-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.88rem;
    padding: 0;
}
.otp-resend-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    text-decoration: none;
}
.otp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
