/* ═══════════════════════════════════════════════════════
   REUSABLE COMPONENTS
   ═══════════════════════════════════════════════════════ */

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    line-height: 1.5;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-xl);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn-primary {
    background: var(--gradient-blue);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-blue);
    transform: translateY(-2px);
    color: white;
}

.btn-gold {
    background: var(--gradient-gold);
    color: #0a0e17;
    box-shadow: 0 4px 14px rgba(245, 183, 66, 0.35);
}

.btn-gold:hover {
    box-shadow: var(--shadow-glow-gold);
    transform: translateY(-2px);
    color: #0a0e17;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.btn-outline {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.btn-outline:hover {
    background: var(--accent-blue);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 14px var(--accent-red-glow);
}

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 14px var(--accent-green-glow);
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-full {
    width: 100%;
}

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    backdrop-filter: blur(12px);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-secondary);
}

.card-glass {
    background: var(--bg-glass);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    backdrop-filter: blur(16px);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-glow {
    position: relative;
    overflow: hidden;
}

.card-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card-glow:hover::before {
    opacity: 1;
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
    margin-top: 2px;
    flex-shrink: 0;
}

.form-error {
    font-size: var(--text-sm);
    color: var(--accent-red);
    margin-top: var(--space-1);
}

.form-hint {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-top: var(--space-1);
}

/* ─── Badges / Tags ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-pending);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-approved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-approved);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-rejected);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-suspended {
    background: rgba(99, 102, 241, 0.15);
    color: var(--status-suspended);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-inactive {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-tertiary);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* ─── Tables ─── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* ─── Toast Notifications ─── */
#toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + var(--space-4));
    right: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: fadeInRight 0.3s ease-out;
    min-width: 280px;
    max-width: 420px;
    font-size: var(--text-sm);
}

.toast-success {
    border-left: 3px solid var(--accent-green);
}

.toast-error {
    border-left: 3px solid var(--accent-red);
}

.toast-warning {
    border-left: 3px solid var(--accent-orange);
}

.toast-info {
    border-left: 3px solid var(--accent-blue);
}

.toast-icon {
    flex-shrink: 0;
    font-size: var(--text-lg);
}

.toast-message {
    flex: 1;
}

.toast-close {
    flex-shrink: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-1);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ─── Accordion ─── */
.accordion-item {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.accordion-item:hover {
    border-color: var(--border-secondary);
}

.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    font-size: var(--text-base);
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast);
}

.accordion-trigger:hover {
    background: var(--bg-card-hover);
}

.accordion-icon {
    transition: transform var(--transition-base);
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-body {
    padding: 0 var(--space-5) var(--space-5);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relax);
}

/* ─── Steps / Timeline ─── */
.step-card {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    position: relative;
}

.step-number {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--gradient-blue);
    color: white;
    font-size: var(--text-xl);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    box-shadow: 0 0 20px var(--accent-blue-glow);
}

.step-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.step-desc {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ─── Status Dot ─── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.status-dot-pending {
    background: var(--status-pending);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.status-dot-approved {
    background: var(--status-approved);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.status-dot-rejected {
    background: var(--status-rejected);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.status-dot-suspended {
    background: var(--status-suspended);
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
}

/* ─── Avatar ─── */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-accent);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

/* ─── Divider ─── */
.divider {
    border: none;
    border-top: 1px solid var(--border-primary);
    margin: var(--space-6) 0;
}

/* ─── Loading Spinner ─── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-secondary);
    border-top-color: var(--accent-blue);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

.empty-state-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.empty-state-desc {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    max-width: 400px;
    margin: 0 auto;
}

/* ─── Stat Card ─── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-5) var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    backdrop-filter: blur(12px);
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.stat-icon-gold {
    background: rgba(245, 183, 66, 0.15);
    color: var(--accent-gold);
}

.stat-icon-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.stat-icon-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.stat-icon-purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.stat-icon-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-top: var(--space-1);
}

/* ─── Tabs ─── */
.tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--space-6);
    overflow-x: auto;
}

.tab-btn {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-tertiary);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* ─── File Upload ─── */
.file-upload {
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.file-upload-icon {
    font-size: 36px;
    margin-bottom: var(--space-3);
    color: var(--text-muted);
}

.file-upload-text {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.file-upload-text strong {
    color: var(--accent-blue);
}

/* ─── Search Input ─── */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrapper .form-input {
    padding-left: var(--space-10);
}

/* ─── Filter bar ─── */
.filter-bar {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: var(--space-6);
}

.filter-bar .form-select,
.filter-bar .form-input {
    width: auto;
    min-width: 160px;
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-select,
    .filter-bar .form-input {
        width: 100%;
    }
}