/* ══════════════════════════════════════════════════════════════
   PayTech — Dark Glassmorphism Theme
   ══════════════════════════════════════════════════════════════ */

:root {
    --brand: #00d4ff;
    --brand-rgb: 0, 212, 255;
    --accent: #6366f1;
    --dark: #0a0e1a;
    --dark-2: #111827;
    --surface: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--dark);
    background-image:
        radial-gradient(ellipse at 15% 80%, rgba(0, 212, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────── */
#app-wrapper {
    display: flex;
    min-height: 100vh;
}

#main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: margin-left var(--transition);
    min-width: 0;
}

body.sidebar-collapsed #main-content {
    margin-left: var(--sidebar-collapsed);
}

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: width var(--transition);
    overflow: hidden;
}

body.sidebar-collapsed #sidebar {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    min-height: 60px;
}

.sidebar-header .brand-text {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition);
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .link-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

#sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebar-toggle:hover {
    color: var(--brand);
    background: rgba(0, 212, 255, 0.1);
}

/* ── Nav Links ───────────────────────────────────────────── */
.nav-group {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.nav-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    padding: 1rem 0.75rem 0.4rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-bottom: 2px;
    position: relative;
}

.nav-link:hover {
    background: rgba(0, 212, 255, 0.08);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(0, 212, 255, 0.12);
    color: var(--brand);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--brand);
    border-radius: 0 3px 3px 0;
}

.nav-link i {
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

/* ── Sidebar Footer ──────────────────────────────────────── */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
}

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

@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

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

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

    #main-content {
        margin-left: 0 !important;
    }

    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .link-text,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .user-info {
        opacity: 1;
        width: auto;
    }
}

/* ── Glass Card ──────────────────────────────────────────── */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-primary);
}

/* ── Modals ──────────────────────────────────────────────── */
.modal-content.glass-card {
    background-color: #111827 !important;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.modal-header, .modal-footer {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.modal-backdrop {
    background-color: #000;
}

.modal-backdrop.show {
    opacity: 0.7;
}

.modal-body label {
    color: rgba(255, 255, 255, 0.6) !important;
    font-weight: 500;
}

.modal-body .form-control:focus {
    background-color: rgba(0,0,0,0.5) !important;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--brand-rgb), 0.15);
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ── Pulse Dot ───────────────────────────────────────────── */
.pulse-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* ── DataTables Dark Override ────────────────────────────── */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: rgba(255, 255, 255, 0.7) !important;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    margin: 0 2px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(0, 212, 255, 0.15) !important;
    color: var(--brand) !important;
    border-color: rgba(0, 212, 255, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: rgba(0, 212, 255, 0.2) !important;
    color: var(--brand) !important;
    border-color: rgba(0, 212, 255, 0.4) !important;
    font-weight: 600;
}

table.dataTable tbody tr:hover {
    background: rgba(0, 212, 255, 0.05) !important;
}

/* ── Scrollbar ───────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-info {
    background: linear-gradient(135deg, var(--brand), #0ea5e9) !important;
    border: none !important;
    color: #0a0e1a !important;
    font-weight: 600;
}

.btn-info:hover {
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
}

.btn-outline-info {
    border-color: rgba(0, 212, 255, 0.4) !important;
    color: var(--brand) !important;
}

.btn-outline-info:hover {
    background: rgba(0, 212, 255, 0.1) !important;
    color: var(--brand) !important;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ── Form styling overrides ───────────────────────────────── */
.form-control, .form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}
.form-select option, select option {
    background-color: #111827;
    color: #f1f5f9;
}
.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--brand);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 212, 255, 0.15);
}
.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.form-control:disabled, .form-select:disabled {
    background-color: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.4);
}

/* Glass table */
.table {
    color: var(--text-primary);
    border-color: var(--glass-border);
}
.table > :not(caption) > * > * {
    background: transparent;
    border-bottom-color: var(--glass-border);
}
.table-hover tbody tr:hover td {
    color: var(--brand);
}

/* Login screen custom styling */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

/* ── Tabs Navigation Custom Dark Glassmorphism ── */
.nav-tabs {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.nav-tabs .nav-link {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-secondary) !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 0.6rem 1.2rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    margin-bottom: -1px !important;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: transparent !important;
}

.nav-tabs .nav-link.active {
    color: var(--brand) !important;
    background: rgba(0, 212, 255, 0.1) !important;
    border-color: rgba(0, 212, 255, 0.2) rgba(0, 212, 255, 0.2) transparent !important;
    font-weight: 600 !important;
}

/* Disable the vertical active bar from the sidebar navigation link style */
.nav-tabs .nav-link::before {
    display: none !important;
}

/* Specific styling for the danger (debit) tab button to keep it red */
.nav-tabs .nav-link.text-danger {
    color: #ef4444 !important;
    opacity: 0.75;
}

.nav-tabs .nav-link.text-danger:hover {
    opacity: 1;
    color: #ef4444 !important;
}

.nav-tabs .nav-link.text-danger.active {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) rgba(239, 68, 68, 0.2) transparent !important;
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
    #sidebar, .sidebar-overlay, header, .no-print, .btn, .dataTables_length, .dataTables_filter, .dataTables_info, .dataTables_paginate { display: none !important; }
    #main-content { margin: 0 !important; padding: 0 !important; }
    body { background: #fff !important; color: #000 !important; }
    .glass-card { background: #fff !important; border: 1px solid #ddd !important; color: #000 !important; }
}
