/* ST Finance Group - Admin Portal Styles */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1F2937;
    background-color: #F5F7FC;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid #1E5AFA;
    outline-offset: 2px;
}

/* Links */
a {
    color: #1E5AFA;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #0A2463;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.card-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-primary { background: #EEF2FF; color: #1E5AFA; }
.badge-success { background: #D1FAE5; color: #059669; }
.badge-warning { background: #FEF3C7; color: #D97706; }
.badge-danger { background: #FEE2E2; color: #DC2626; }
.badge-gray { background: #F3F4F6; color: #6B7280; }

/* Status badges */
.status-draft { background: #F3F4F6; color: #6B7280; }
.status-submitted { background: #DBEAFE; color: #1D4ED8; }
.status-in_review { background: #FEF3C7; color: #D97706; }
.status-under_review { background: #FEF3C7; color: #D97706; }
.status-changes_requested { background: #FEF3C7; color: #D97706; }
.status-approved { background: #D1FAE5; color: #059669; }
.status-verified { background: #D1FAE5; color: #059669; }
.status-rejected { background: #FEE2E2; color: #DC2626; }
.status-disbursed { background: #E9D5FF; color: #7C3AED; }
.status-cancelled { background: #F3F4F6; color: #6B7280; }
.status-active { background: #D1FAE5; color: #059669; }
.status-closed { background: #F3F4F6; color: #6B7280; }
.status-defaulted { background: #FEE2E2; color: #DC2626; }
.status-pending { background: #FEF3C7; color: #D97706; }
.status-suspended { background: #FEE2E2; color: #DC2626; }
.status-successful { background: #D1FAE5; color: #059669; }
.status-failed { background: #FEE2E2; color: #DC2626; }
.status-reversed { background: #FEF3C7; color: #D97706; }
.status-pending_approval { background: #DBEAFE; color: #1D4ED8; }
.status-processing { background: #E0E7FF; color: #4338CA; }
.status-completed { background: #D1FAE5; color: #059669; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary {
    background: #0A2463;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #061638;
}

.btn-secondary {
    background: #6B7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4B5563;
}

.btn-success {
    background: #10B981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-danger {
    background: #EF4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
}

.btn-outline {
    background: transparent;
    border-color: #D1D5DB;
    color: #374151;
}

.btn-outline:hover:not(:disabled) {
    background: #F9FAFB;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #1E5AFA;
    box-shadow: 0 0 0 3px rgba(30, 90, 250, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #EF4444;
}

.form-error {
    font-size: 0.75rem;
    color: #EF4444;
    margin-top: 0.25rem;
}

.form-help {
    font-size: 0.75rem;
    color: #6B7280;
    margin-top: 0.25rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E5E7EB;
}

table tbody tr:hover {
    background: #F9FAFB;
}

table tbody tr.clickable {
    cursor: pointer;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Utilities */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.currency::before {
    content: '₦ ';
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }

    table {
        font-size: 0.8125rem;
    }

    table th,
    table td {
        padding: 0.5rem 0.75rem;
    }
}

/* Dark mode (if needed) */
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] body {
    background: #111827;
    color: #F3F4F6;
}

[data-theme="dark"] .card {
    background: #1F2937;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    background: #111827;
    border-color: #374151;
    color: #F3F4F6;
}

[data-theme="dark"] table th {
    background: #1F2937;
    border-color: #374151;
}

[data-theme="dark"] table td {
    border-color: #374151;
}

[data-theme="dark"] table tbody tr:hover {
    background: #1F2937;
}
