/* ============================================
   SAB Springville - Custom Stylesheet
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --secondary: #0ea5e9;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --sidebar-width: 270px;
    --topbar-height: 65px;
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   AUTH PAGE
   ============================================ */
.auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.auth-body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(6, 182, 212, 0.10) 0%, transparent 50%);
    animation: authBgFloat 20s ease-in-out infinite;
}

@keyframes authBgFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2%, -2%); }
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: authCardAppear 0.6s ease-out;
}

@keyframes authCardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.auth-logo-icon i {
    font-size: 1.75rem;
    color: white;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.auth-logo p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.auth-card .form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.auth-card .form-control {
    border-radius: 10px;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--gray-200);
    font-size: 0.9375rem;
    transition: var(--transition);
    background: var(--gray-50);
}

.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

.auth-card .btn-primary {
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: var(--transition);
}

.auth-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--secondary);
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-avatar {
    flex-shrink: 0;
}

.sidebar-user-avatar i {
    font-size: 2.25rem;
    color: var(--gray-400);
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    line-height: 1.3;
}

.sidebar-user-role {
    margin-top: 0.125rem;
}

.sidebar-user-role .badge {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.2em 0.6em;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav-item {
    margin: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar-nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav-link.active {
    color: white;
    background: rgba(37, 99, 235, 0.15);
    border-left-color: var(--primary);
}

.sidebar-nav-link.active i {
    color: var(--primary-light);
}

.sidebar-nav-link i {
    font-size: 1.125rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav-link .badge {
    font-size: 0.6875rem;
    padding: 0.2em 0.5em;
}

.sidebar-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.5rem 1.5rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.25rem;
    display: none;
}

.topbar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-date {
    font-size: 0.8125rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.content-wrapper {
    padding: 1.5rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--gray-100);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.card-body {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.1;
    transform: translate(30%, -30%);
}

.stat-card.stat-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

.stat-card.stat-primary::after { background: white; }

.stat-card.stat-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.stat-card.stat-success::after { background: white; }

.stat-card.stat-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.stat-card.stat-warning::after { background: white; }

.stat-card.stat-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.stat-card.stat-danger::after { background: white; }

.stat-card.stat-info {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.stat-card.stat-info::after { background: white; }

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-card .stat-value.stat-value-sm {
    font-size: 1.125rem;
}

/* ============================================
   TABLE
   ============================================ */
.table-wrapper {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-wrapper .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
}

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

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

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
}

.btn-outline-secondary {
    border-color: var(--gray-300);
    color: var(--gray-600);
}

/* ============================================
   FORMS
   ============================================ */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid var(--gray-200);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.input-group-text {
    border-radius: 8px;
    border: 1.5px solid var(--gray-200);
    background: var(--gray-50);
    font-size: 0.875rem;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-bar .form-group {
    flex: 1;
    min-width: 140px;
}

.filter-bar .form-label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.filter-bar .form-control,
.filter-bar .form-select {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border: none;
    border-radius: 8px !important;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.page-item.active .page-link {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h5 {
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 0.875rem;
    padding: 0.875rem 1.25rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .main-content {
        margin-left: 0;
    }

    .topbar-toggle {
        display: block;
    }

    .topbar-date {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }

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

    .filter-bar .form-group {
        width: 100%;
    }

    .table-responsive {
        font-size: 0.8125rem;
    }
}

/* ============================================
   PROOF IMAGE PREVIEW
   ============================================ */
.proof-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out;
}

/* Page Section Title */
.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

/* Detail card for payment show */
.detail-row {
    display: flex;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
}

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

.detail-label {
    width: 160px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--gray-600);
}

.detail-value {
    flex: 1;
    color: var(--gray-800);
}
