:root {
    --primary-color: #1a5c38; /* UpCambios Forest Green */
    --primary-light: #2d8c58;
    --bg-color: #f4f7f6;
    --panel-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    --danger-border: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.logo-container {
    padding: 0 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.logo-text {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 800;
}
.logo-text span {
    color: var(--text-main);
}

.nav-menu {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(26, 92, 56, 0.05);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-header {
    background-color: var(--panel-bg);
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.avatar {
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.content-wrapper {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Warning Banner */
.warning-banner {
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
    transition: all 0.3s;
}

.warning-icon {
    font-size: 24px;
}

.warning-text h strong {
    color: var(--danger-text);
    display: block;
    margin-bottom: 5px;
}

.warning-text p {
    color: var(--danger-text);
    font-size: 14px;
    line-height: 1.5;
}

.btn-accept-warning {
    margin-top: 10px;
    background-color: var(--danger-text);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-accept-warning:hover {
    background-color: #7f1d1d;
}

/* Order Panel */
.glass-panel {
    background: var(--panel-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 30px;
    transition: opacity 0.3s;
}

.exchange-rates {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.rate-card {
    flex: 1;
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rate-card .currency {
    font-weight: 600;
    color: var(--text-muted);
}

.rate-card .rate {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 18px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

.form-row .form-group {
    flex: 1;
}

.icon-arrow {
    color: var(--text-muted);
    font-size: 20px;
    margin-top: 15px;
}

.input-amount {
    font-size: 18px;
    font-weight: 600;
}

.input-amount.highlight {
    background-color: #f0fdf4;
    color: var(--primary-color);
    border-color: #bbf7d0;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

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

/* Auth / KYC specific styles */
.auth-body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

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

.auth-card {
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header p {
    color: var(--text-muted);
    margin-top: 5px;
}

.text-center {
    text-align: center;
}

.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 25px; }

/* Steps indicator */
.steps-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.step {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    padding-bottom: 13px;
    margin-bottom: -15px; /* overlay the border */
    border-bottom: 3px solid transparent;
}

.step.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--bg-color);
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 15px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.file-upload {
    border: 2px dashed var(--border-color);
    padding: 20px;
    text-align: center;
    border-radius: 6px;
    background-color: var(--bg-color);
    position: relative;
    cursor: pointer;
}

.file-upload span {
    color: var(--text-muted);
    font-weight: 500;
}

.form-control-file {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
}

.link-muted {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.link-muted:hover {
    color: var(--primary-color);
}

.kyc-example-img {
    width: 100%;
    max-width: 150px;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.example-box {
    background-color: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

/* History List Styles */
.history-details summary {
    cursor: pointer;
    list-style: none;
    outline: none;
}
.history-details summary::-webkit-details-marker {
    display: none;
}
.history-details[open] .history-list-item {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    border-bottom: none;
    background-color: #f8fafc;
}
.history-expanded-card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
    border: 1px solid var(--border-color);
    border-top: none;
    box-shadow: none;
}
.history-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}
.history-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.history-info {
    flex: 1;
}
.history-date {
    margin-right: 20px;
}
.text-sm {
    font-size: 0.85rem;
}
.ml-2 {
    margin-left: 10px;
}

/* Admin Dashboard Specifics */
.admin-sidebar {
    background-color: #0f172a;
    border-right: none;
}
.admin-sidebar .logo-text { color: white; }
.admin-sidebar .logo-text span { color: #38bdf8; }
.admin-sidebar .nav-item { color: #94a3b8; }
.admin-sidebar .nav-item:hover, .admin-sidebar .nav-item.active {
    background-color: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border-right-color: #38bdf8;
}

.badge {
    background-color: #ef4444;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: auto;
}
.badge-warning { background-color: #f59e0b; }

.kyc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.kyc-id {
    color: var(--text-muted);
    font-size: 13px;
}

.status-badge {
    background-color: #fef3c7;
    color: #d97706;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}
.status-badge.success {
    background-color: #dcfce7;
    color: #15803d;
}
.status-badge.danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.kyc-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.highlight-text {
    font-weight: 700;
    color: var(--text-main);
    font-size: 16px;
}

.kyc-images {
    display: flex;
    gap: 20px;
}
.img-box { flex: 1; }
.img-box label { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: block;}
.placeholder-img {
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e1;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
}
.placeholder-img.small { height: 100px; }

.btn-danger {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.order-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.huge-name {
    font-size: 24px;
    font-weight: 800;
    margin-top: 10px;
}
.text-danger { color: #dc2626; }
.text-primary { color: var(--primary-color); }

.border-top { border-top: 1px solid var(--border-color); }
.pt-4 { padding-top: 25px; }
.help-text { font-size: 13px; color: var(--text-muted); margin-top: 8px;}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast-msg {
    background: white;
    color: var(--text-main);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast-msg.show {
    transform: translateX(0);
}
.toast-msg.error {
    border-left-color: #ef4444;
}
.toast-icon {
    font-size: 20px;
}
.toast-content {
    font-size: 14px;
    font-weight: 500;
}

/* Spinner Overlay */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10000;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
.spinner-text {
    font-weight: 600;
    color: var(--text-main);
    font-size: 16px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Botón flotante WhatsApp */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}
.whatsapp-float:hover {
    transform: scale(1.1);
}

/* RESPONSIVE DESIGN PARA MOVILES (ESTILO APP) */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 70px;
        flex-direction: row;
        padding: 5px 10px;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        background: white;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    .logo-container, #logoutContainer {
        display: none !important;
    }
    .nav-menu {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        margin-bottom: 0;
    }
    .nav-item {
        flex-direction: column;
        padding: 5px;
        font-size: 11px;
        gap: 4px;
        margin-bottom: 0;
        text-align: center;
        align-items: center;
        justify-content: center;
    }
    .nav-item svg {
        margin-right: 0;
    }
    .main-content {
        margin-left: 0;
        padding: 0;
        padding-bottom: 85px; /* Espacio para el nav inferior */
    }
    .content-wrapper {
        padding: 15px;
    }
    .glass-panel {
        padding: 15px;
    }
    .exchange-rates {
        flex-wrap: wrap;
        gap: 10px;
    }
    .rate-card {
        flex: 1 1 45%;
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .rate-card .rate {
        font-size: 16px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
    }
    .warning-banner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
    }
    .warning-icon {
        margin-bottom: 5px;
    }
    .btn-accept-warning {
        width: 100%;
        margin-top: 15px;
    }
    .whatsapp-float {
        bottom: 95px; /* Para no chocar con el nav inferior */
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 25px;
    }
}
