/* -------------------------------------------------------------
 * Brand Identity & Theme Variables
 * ------------------------------------------------------------- */
:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #06070a;
    --bg-input: #f1f5f9;
    
    --border-color: #e2e8f0;
    --border-focus: #10b981;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.1);
    
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.1);
    
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.1);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.1);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------
 * Layout Structure
 * ------------------------------------------------------------- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling (Deep Black/High Contrast) */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 10;
    transition: var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding-left: 0.5rem;
}

.sidebar-brand svg {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.sidebar-brand h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: #9ca3af;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-item a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-item.active a {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.02) 100%);
    border-left: 3px solid var(--primary);
    padding-left:calc(1rem - 3px);
}

.sidebar-item svg {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

.user-details p {
    font-size: 0.75rem;
    color: #6b7280;
}

.btn-logout {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    flex-grow: 1;
    padding: 2.5rem;
    min-width: 0; /* Prevents flex items from overflowing */
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.content-header h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* -------------------------------------------------------------
 * Auth & Setup Pages Styling
 * ------------------------------------------------------------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-image: linear-gradient(rgba(10, 11, 15, 0.75), rgba(10, 11, 15, 0.75)), url('assets/images/office_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 1.5rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background-color: rgba(18, 20, 29, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.auth-card h1 {
    color: #ffffff;
}

.auth-card p {
    color: #cbd5e1;
}

.auth-card label {
    color: #cbd5e1;
}

.auth-card .form-group input {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.auth-card .form-group input:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.auth-card .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Browser autofill overrides for the auth page inputs */
.auth-card .form-group input:-webkit-autofill,
.auth-card .form-group input:-webkit-autofill:hover, 
.auth-card .form-group input:-webkit-autofill:focus, 
.auth-card .form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(18, 20, 29, 0.95) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header .logo {
    display: inline-flex;
    padding: 1rem;
    background-color: rgba(16, 185, 129, 0.15);
    border-radius: 16px;
    margin-bottom: 1.25rem;
}

.auth-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 0.875rem;
}

/* -------------------------------------------------------------
 * Cards & Containers
 * ------------------------------------------------------------- */
.grid-system {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 2rem;
    align-items: start;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.card-title svg {
    color: var(--primary);
}

/* -------------------------------------------------------------
 * Forms & Inputs
 * ------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input, .form-group select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Currency input prefix wrapper */
.amount-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-wrapper span {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    pointer-events: none;
}

.amount-wrapper input {
    padding-left: 2.5rem;
}

/* -------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* -------------------------------------------------------------
 * Notifications & Alerts
 * ------------------------------------------------------------- */
.alert {
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* -------------------------------------------------------------
 * Pix Result Display (Premium Card)
 * ------------------------------------------------------------- */
.pix-result-container {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--bg-input);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

.qr-code-box {
    display: inline-flex;
    background: #ffffff;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.qr-code-box img, .qr-code-box canvas {
    display: block;
    max-width: 200px;
    height: auto;
}

.copia-cola-box {
    margin-top: 1rem;
}

.copy-input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.copy-input-group input {
    flex-grow: 1;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.85rem;
    outline: none;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------
 * Tables (Transactions)
 * ------------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.table th {
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background-color: #f1f5f9;
}

.table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-pending::before { background-color: #fbbf24; }

.badge-paid {
    background-color: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-paid::before { background-color: #34d399; }

.badge-failed {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.badge-failed::before { background-color: #f87171; }

.action-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-icon:hover {
    color: var(--primary);
    background-color: rgba(16, 185, 129, 0.1);
}

/* -------------------------------------------------------------
 * Modals
 * ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* -------------------------------------------------------------
 * Responsive Design
 * ------------------------------------------------------------- */
@media (max-width: 1024px) {
    .grid-system {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

/* -------------------------------------------------------------
 * Collapsible / Hidden Sidebar
 * ------------------------------------------------------------- */
body.sidebar-hidden .sidebar {
    transform: translateX(-100%);
}

body.sidebar-hidden .main-content {
    margin-left: 0;
}

/* -------------------------------------------------------------
 * Light Theme Overrides
 * ------------------------------------------------------------- */
/* -------------------------------------------------------------
 * Collapsible / Hidden Sidebar
 * ------------------------------------------------------------- */
body.sidebar-hidden .sidebar {
    transform: translateX(-100%);
}

body.sidebar-hidden .main-content {
    margin-left: 0;
}

/* Global Transitions for smooth layout adjustments */
body, .sidebar, .card, input, select, .table, th, td, h1, h2, h3, h4, .user-details, .btn-secondary {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

