/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1a5276;
    --primary-dark: #0e3450;
    --primary-light: #2980b9;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --white: #ffffff;
    --border-radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --transition: 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: var(--white);
    color: var(--gray-800);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.header-logo-img {
    height: 38px;
    width: auto;
    display: block;
}

.header-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-logo-text h1 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.header-logo-text span {
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-actions a {
    color: var(--gray-600);
    text-decoration: none;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.header-actions a:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(26,82,118,0.04);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.container-wide {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    color: var(--primary);
    font-size: 1.35rem;
}

.card-header p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-group label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.form-control.error {
    border-color: var(--danger);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.25rem;
    display: none;
}

.form-error.visible {
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(26,82,118,0.25);
}

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

.btn-success:hover {
    background: #219a52;
}

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

.btn-danger:hover {
    background: #c0392b;
}

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

.btn-warning:hover {
    background: #d68910;
}

.btn-secondary {
    background: var(--gray-500);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-600);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-light);
    color: var(--primary-light);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: var(--white);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ===== STEPPER ===== */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 30px;
    right: 30px;
    height: 2px;
    background: var(--gray-300);
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.step-number {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gray-300);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-light);
    color: var(--white);
}

.step.completed .step-number {
    background: var(--success);
    color: var(--white);
}

.step-label {
    font-size: 0.75rem;
    margin-top: 0.4rem;
    color: var(--gray-600);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

/* ===== PAYMENT INFO BOX ===== */
.payment-info {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin: 1rem 0;
}

.payment-info h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.payment-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.payment-detail:last-child {
    border-bottom: none;
}

.payment-detail .label {
    font-weight: 600;
    color: var(--gray-700);
}

.payment-detail .value {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: var(--gray-900);
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.payment-method-card {
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.payment-method-card:hover {
    border-color: var(--primary-light);
}

.payment-method-card.selected {
    border-color: var(--primary-light);
    background: rgba(41, 128, 185, 0.05);
}

.payment-method-card .method-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gray-800);
}

.payment-method-card .method-hint {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.fee-display {
    background: var(--primary);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 1rem 0;
}

.fee-display .fee-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.fee-display .fee-amount {
    font-size: 2rem;
    font-weight: 700;
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== CONFIRMATION PAGE ===== */
.confirmation-box {
    text-align: center;
    padding: 2rem;
}

.confirmation-box .check-icon {
    width: 70px;
    height: 70px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--white);
}

.confirmation-box h2 {
    color: var(--success);
    margin-bottom: 0.5rem;
}

.confirmation-box .ref-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    background: var(--gray-100);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    margin: 0.5rem 0;
}

/* ===== TABLE ===== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

table tbody tr:hover {
    background: var(--gray-50);
}

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-verified {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-approved {
    background: #d4edda;
    color: #155724;
}

.badge-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* ===== ADMIN LAYOUT (MIPS-style) ===== */

/* Admin header / top navbar */
.admin-layout .header {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e8ecf0;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 90;
    transition: left 0.3s ease;
}

.admin-layout .header .header-logo-text h1 {
    font-size: 1.05rem;
    color: #0A2558;
}

.admin-layout .header .header-logo-text span {
    color: #8896ab;
}

.admin-layout .header .header-actions a {
    color: #555;
    border-color: #e0e4e8;
    font-size: 0.8rem;
}

.admin-layout .header .header-actions a:hover {
    color: #0A2558;
    border-color: #0A2558;
    background: rgba(10,37,88,0.04);
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 64px;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: #0A2558;
    color: #fff;
    z-index: 91;
    overflow-y: auto;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar .sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar .sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.sidebar .sidebar-header p {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-top: 1px;
}

.sidebar nav {
    padding: 0.5rem 0;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: #f97316;
}

.sidebar nav a .nav-icon {
    width: 22px;
    text-align: center;
    font-size: 1.05rem;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 1.5rem 2rem;
    background: #f0f2f5;
    min-height: calc(100vh - 64px);
    transition: margin-left 0.3s ease;
}

/* ===== STATS CARDS (MIPS-style) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    font-size: 1.4rem;
}

.stat-card .stat-body {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
    margin-top: 2px;
}

.stat-card.color-pending   { background: linear-gradient(135deg, #0A2558, #17418f); }
.stat-card.color-verified  { background: linear-gradient(135deg, #006666, #00999e); }
.stat-card.color-approved  { background: linear-gradient(135deg, #1a7a3a, #2da160); }
.stat-card.color-rejected  { background: linear-gradient(135deg, #b30000, #e63946); }

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 24px rgba(0,0,0,0.04);
    border: 1px solid var(--gray-200);
}

.login-card h2 {
    text-align: center;
    color: var(--gray-900);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-card .login-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 1.75rem;
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-600); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray-600);
    font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 98;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--gray-700);
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

body.sidebar-open {
    overflow: hidden;
}

/* Tablet and below */
@media (max-width: 900px) {
    .sidebar-toggle {
        display: block;
    }

    .admin-layout .header {
        left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 600px) {
    .header {
        padding: 0.6rem 1rem;
    }

    .header-logo-img {
        height: 32px;
    }

    .header-logo-text {
        display: none;
    }

    .header-actions a {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }

    .container {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 10px;
    }

    .card-header h2 {
        font-size: 1.1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stepper {
        gap: 0;
        margin-bottom: 1.5rem;
    }

    .stepper::before {
        top: 14px;
        left: 12px;
        right: 12px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .step-label {
        font-size: 0.6rem;
        max-width: 50px;
        text-align: center;
        word-break: break-word;
    }

    table th,
    table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.78rem;
    }

    table th {
        font-size: 0.7rem;
    }

    .form-control {
        padding: 0.6rem 0.85rem;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.55rem 1rem;
        font-size: 0.8rem;
    }

    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group .ml-auto {
        margin-left: 0;
    }

    .payment-info > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .payment-methods {
        flex-direction: column;
    }

    .login-card {
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 2rem 1.5rem 1.5rem;
        max-width: 100%;
        min-height: 100vh;
    }

    .login-container {
        align-items: flex-start;
        padding-top: 2rem;
    }

    .footer {
        padding: 1.25rem;
        font-size: 0.75rem;
    }

    .fee-display {
        padding: 0.75rem;
    }

    .filter-form {
        flex-direction: column;
    }

    .nav-icon {
        width: 18px;
        font-size: 0.9rem;
    }

    .sidebar nav a {
        padding: 0.65rem 1.25rem;
        font-size: 0.85rem;
    }

    .form-row {
        gap: 0;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .header {
        padding: 0.5rem 0.75rem;
    }

    .header-logo-img {
        height: 28px;
    }

    .header-actions a {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .card {
        padding: 1rem;
    }

    table th,
    table td {
        padding: 0.4rem 0.4rem;
        font-size: 0.7rem;
    }
}

/* ===== PRINT ===== */
@media print {
    .sidebar, .header, .btn, .btn-group, .no-print { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}