* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.navbar {
    background: linear-gradient(135deg, #1a5276, #2e86c1);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 60px;
}

.nav-brand a {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.15);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255,255,255,0.3);
}

.user-info {
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
}

.btn-logout {
    background: rgba(231, 76, 60, 0.8) !important;
    color: #fff !important;
    padding: 0.4rem 1rem !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.flash-messages {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.8rem;
    color: #1a5276;
    font-weight: 700;
}

.page-header-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.page-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.page-header p {
    color: #666;
    margin-top: 0.3rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #f0f2f5;
}

.card-header h2 {
    font-size: 1.2rem;
    color: #1a5276;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2e86c1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.3rem;
}

.stat-card.accent {
    background: linear-gradient(135deg, #2e86c1, #1a5276);
    color: #fff;
}

.stat-card.accent .stat-value {
    color: #fff;
}

.stat-card.accent .stat-label {
    color: rgba(255,255,255,0.8);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.service-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.service-card .icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.service-card h3 {
    font-size: 1.1rem;
    color: #1a5276;
    margin-bottom: 0.3rem;
}

.service-card p {
    font-size: 0.85rem;
    color: #666;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2e86c1;
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #2e86c1;
    color: #fff;
}

.btn-primary:hover {
    background: #1a5276;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #1e8449;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #444;
}

table tr:hover {
    background: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-primary {
    background: #cce5ff;
    color: #004085;
}

/* ═══════════════════════════════════════════════
   WALLET CREDIT CARD — ISO 7810 aspect ratio
   ═══════════════════════════════════════════════ */
.wallet-card-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.4rem;
}

.wallet-credit-card {
    width: 100%;
    max-width: 460px;
    aspect-ratio: 85.6 / 53.98;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    color: #fff;
    border-radius: 18px;
    padding: 6% 7%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    transition: transform .25s, box-shadow .25s;
    cursor: default;
}
.wallet-credit-card:hover {
    transform: translateY(-4px) rotateX(2deg);
    box-shadow: 0 28px 70px rgba(0,0,0,0.4), 0 6px 20px rgba(0,0,0,0.25);
}

/* Decorative gloss circles */
.wallet-credit-card::before {
    content: '';
    position: absolute;
    top: -55%;
    right: -20%;
    width: 75%;
    height: 150%;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.wallet-credit-card::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -15%;
    width: 60%;
    height: 130%;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

/* ── Card gradient variants per role ── */
.wallet-credit-card.card-agente {
    background: linear-gradient(135deg, #3a1c71 0%, #d76d77 60%, #ffaf7b 100%);
}
.wallet-credit-card.card-negocio {
    background: linear-gradient(135deg, #004d40 0%, #00695c 50%, #26a69a 100%);
}
.wallet-credit-card.card-admin {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* ── Top row: chip + contactless + brand ── */
.wcc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.wcc-chip {
    width: 12%;
    min-width: 34px;
    max-width: 48px;
    aspect-ratio: 1.4 / 1;
    background: linear-gradient(135deg, #c8a84b 0%, #f5d060 40%, #d4a017 70%, #f0c040 100%);
    border-radius: 4px;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    flex-shrink: 0;
}
.wcc-chip::before {
    content: '';
    position: absolute;
    top: 28%; left: 0; right: 0; bottom: 28%;
    border-top: 1px solid rgba(100,70,0,0.35);
    border-bottom: 1px solid rgba(100,70,0,0.35);
}
.wcc-chip::after {
    content: '';
    position: absolute;
    top: 0; left: 28%; right: 28%; bottom: 0;
    border-left: 1px solid rgba(100,70,0,0.35);
    border-right: 1px solid rgba(100,70,0,0.35);
    border-radius: 2px;
}

.wcc-nfc {
    font-size: clamp(.85rem, 2.5vw, 1.2rem);
    opacity: .55;
    letter-spacing: -.5px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}

.wcc-brand-top {
    display: flex;
    align-items: center;
    gap: .35em;
}
.wcc-logo-img {
    width: clamp(28px, 7%, 44px);
    height: clamp(28px, 7%, 44px);
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    flex-shrink: 0;
}
.wcc-logo {
    font-size: clamp(.6rem, 1.8vw, .9rem);
    font-weight: 800;
    letter-spacing: .2em;
    opacity: .75;
    text-transform: uppercase;
}

/* ── Card number ── */
.wcc-number {
    font-size: clamp(.85rem, 3vw, 1.25rem);
    font-weight: 500;
    letter-spacing: .18em;
    font-family: 'Courier New', 'Lucida Console', monospace;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
    margin: 0;
}

/* ── Bottom row: holder / balance + card network ── */
.wcc-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 1;
    gap: .5rem;
}
.wcc-bottom-left { flex: 1; min-width: 0; }
.wcc-bottom-right { flex-shrink: 0; text-align: right; }

.wcc-label {
    font-size: clamp(.45rem, 1.3vw, .6rem);
    text-transform: uppercase;
    letter-spacing: .15em;
    opacity: .6;
    margin-bottom: .15em;
    white-space: nowrap;
}
.wcc-name {
    font-size: clamp(.65rem, 2vw, .9rem);
    font-weight: 600;
    letter-spacing: .08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.wcc-balance {
    font-size: clamp(1.1rem, 4.5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1;
}
.wcc-htg {
    font-size: clamp(.5rem, 1.5vw, .7rem);
    opacity: .65;
    margin-top: .2em;
    letter-spacing: .04em;
}

/* Network circles (Visa/MC style) at bottom right */
.wcc-network {
    display: flex;
    align-items: center;
}
.wcc-circle {
    width: clamp(18px, 5%, 28px);
    height: clamp(18px, 5%, 28px);
    border-radius: 50%;
    opacity: .75;
}
.wcc-circle:first-child {
    background: #eb001b;
    margin-right: -8px;
}
.wcc-circle:last-child {
    background: #f79e1b;
}

/* ── ID strip at bottom ── */
.wcc-id {
    position: absolute;
    bottom: 4%;
    left: 7%;
    font-size: clamp(.45rem, 1.2vw, .62rem);
    opacity: .38;
    letter-spacing: .06em;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: opacity .2s;
}
.wcc-id:hover { opacity: .75; }

.wcc-copy-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    padding: 2px 5px;
    font-size: .65rem;
    line-height: 1;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
}
.wcc-copy-btn:hover  { background: rgba(255,255,255,0.3); }
.wcc-copy-btn.copied { background: rgba(39,174,96,0.5); border-color: rgba(39,174,96,0.7); }

.wallet-conversions {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.conversion-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex: 1;
    min-width: 220px;
    border-left: 4px solid #2e86c1;
}

.conversion-card.htg {
    border-left-color: #e67e22;
}

.conversion-card.local {
    border-left-color: #27ae60;
}

.conv-flag {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.conversion-card.htg .conv-flag {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.conversion-card.local .conv-flag {
    background: linear-gradient(135deg, #27ae60, #1e8449);
}

.conv-info {
    flex: 1;
}

.conv-label {
    font-size: 0.75rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conv-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a5276;
    margin: 0.1rem 0;
}

.conv-rate {
    font-size: 0.7rem;
    color: #aaa;
}

.wallet-actions-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.wallet-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #333;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 90px;
}

.wallet-action-btn:hover {
    border-color: #2e86c1;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.wallet-action-btn .wa-icon {
    font-size: 1.3rem;
    font-weight: 700;
}

.wallet-action-btn.deposit { border-color: #27ae60; }
.wallet-action-btn.deposit:hover { background: #eafaf1; }
.wallet-action-btn.transfer { border-color: #2e86c1; }
.wallet-action-btn.transfer:hover { background: #eaf2f8; }
.wallet-action-btn.withdraw { border-color: #e67e22; }
.wallet-action-btn.withdraw:hover { background: #fef5e7; }
.wallet-action-btn.code { border-color: #8e44ad; }
.wallet-action-btn.code:hover { background: #f4ecf7; }
.wallet-action-btn.redeem { border-color: #16a085; }
.wallet-action-btn.redeem:hover { background: #e8f8f5; }
.wallet-action-btn.history { border-color: #7f8c8d; }
.wallet-action-btn.history:hover { background: #f2f3f4; }

.wallet-card {
    background: linear-gradient(135deg, #1a5276, #2e86c1);
    color: #fff;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.wallet-balance {
    font-size: 2.5rem;
    font-weight: 700;
}

.wallet-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.wallet-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.qr-container {
    text-align: center;
    padding: 1.5rem;
}

.qr-container img {
    max-width: 200px;
    border: 3px solid #eee;
    border-radius: 8px;
}

.login-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #0f2027;
}

.login-flash {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    width: 90%;
    max-width: 500px;
}

.login-split {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

.login-carousel-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.login-left .carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.login-left .carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.login-left .carousel-slide.active {
    opacity: 1;
}

.login-left .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-left .carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.2rem 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.login-left .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 5;
    color: #fff;
    font-weight: 300;
    transition: background 0.3s;
}

.login-left .carousel-btn:hover {
    background: rgba(255,255,255,0.35);
}

.login-left .carousel-prev {
    left: 16px;
}

.login-left .carousel-next {
    right: 16px;
}

.login-left .carousel-dots {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.login-left .carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.login-left .carousel-dot.active {
    background: #fff;
    transform: scale(1.4);
}

.login-left-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 2.5rem;
    background: linear-gradient(transparent, rgba(15,32,39,0.85));
    z-index: 4;
    pointer-events: none;
}

.login-left-overlay h2 {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: 0.5px;
}

.login-left-overlay p {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    line-height: 1.5;
}

.login-right {
    width: 480px;
    min-width: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0f2027, #203a43);
    padding: 3rem;
}

.login-right-inner {
    width: 100%;
    max-width: 360px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15), transparent);
    border: 3px solid rgba(46,134,193,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 0 25px rgba(46,134,193,0.3), 0 0 50px rgba(46,134,193,0.1), inset 0 0 15px rgba(255,255,255,0.05);
    animation: logoPulse 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.login-logo-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(46,134,193,0.15), transparent);
    animation: logoSpin 6s linear infinite;
}

.login-logo-circle img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 0 25px rgba(46,134,193,0.3), 0 0 50px rgba(46,134,193,0.1); }
    50% { box-shadow: 0 0 35px rgba(46,134,193,0.5), 0 0 70px rgba(46,134,193,0.2); }
}

@keyframes logoSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-fixed-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(15,32,39,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    animation: fixedLogoPulse 4s ease-in-out infinite;
}

.login-fixed-logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

@keyframes fixedLogoPulse {
    0%, 100% { box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 0 0 0 rgba(46,134,193,0); }
    50% { box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 0 0 12px rgba(46,134,193,0.15); }
}

.login-rates-title {
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}

.login-rates-ticker {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}

.login-rate-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s;
}

.login-rate-item:hover {
    background: rgba(255,255,255,0.1);
}

.rate-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(46,134,193,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    flex-shrink: 0;
}

.rate-name {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    min-width: 28px;
}

.rate-value {
    font-size: 0.7rem;
    color: #4fc3f7;
    font-weight: 700;
    margin-left: auto;
    white-space: nowrap;
}

.login-logo h1 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.login-tagline {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 0.3rem;
}

.login-form {
    width: 100%;
}

.login-input-group {
    margin-bottom: 1.2rem;
}

.login-input-group label {
    display: block;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.5;
}

.login-input-wrap input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.login-input-wrap input::placeholder {
    color: rgba(255,255,255,0.3);
}

.login-input-wrap input:focus {
    outline: none;
    border-color: #2e86c1;
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 0 3px rgba(46,134,193,0.2);
}

.login-submit {
    width: 100%;
    padding: 0.9rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2e86c1, #1a5276);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
    letter-spacing: 0.5px;
}

.login-submit:hover {
    background: linear-gradient(135deg, #3498db, #2e86c1);
    box-shadow: 0 4px 20px rgba(46,134,193,0.4);
    transform: translateY(-1px);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 1.8rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.login-divider span {
    padding: 0 1rem;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.login-register p {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.login-register-btn {
    display: inline-block;
    width: 100%;
    padding: 0.8rem;
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.login-register-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.4);
}

.login-countries {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.login-countries span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.login-countries span:hover {
    background: rgba(46,134,193,0.3);
    color: #fff;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-card .product-info {
    padding: 1rem;
}

.product-card .product-name {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.product-card .product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #27ae60;
    margin: 0.3rem 0;
}

.product-card .product-stock {
    font-size: 0.8rem;
    color: #666;
}

.package-row {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.order-timeline {
    padding: 1rem 0;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    align-items: center;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2e86c1;
    flex-shrink: 0;
}

.timeline-dot.inactive {
    background: #ddd;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h2 {
    margin-bottom: 1rem;
    color: #1a5276;
}

.actions-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.receipt {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.receipt h3 {
    color: #1a5276;
    margin-bottom: 1rem;
}

.receipt .line {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px dotted #ddd;
    font-size: 0.9rem;
}

.receipt .total {
    font-weight: 700;
    font-size: 1.1rem;
    border-top: 2px solid #333;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.online-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.online-badge.online {
    background: #27ae60;
}

.online-badge.offline {
    background: #e74c3c;
}

@media (max-width: 900px) {
    .login-split {
        flex-direction: column;
    }

    .login-left {
        height: 280px;
        flex: none;
    }

    .login-right {
        width: 100%;
        min-width: 0;
        padding: 2rem 1.5rem;
    }

    .login-left-overlay {
        padding: 1.5rem;
    }

    .login-left-overlay h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #1a5276;
        flex-direction: column;
        padding: 1rem;
        gap: 0.3rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .nav-user {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.3);
        padding-top: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .wallet-balance, .wcc-balance {
        font-size: 1.8rem;
    }
    .wallet-actions-row {
        justify-content: center;
    }
}

/* ══════════════════════════════════════════════
   MEJORAS MOBILE — pantallas pequeñas (< 600px)
   ══════════════════════════════════════════════ */
@media (max-width: 600px) {
    .container { padding: 0 .6rem; }
    .page-header h1 { font-size: 1.3rem; }
    .card { border-radius: 10px; padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
    .stat-card { padding: .9rem .6rem; }
    .stat-value { font-size: 1.4rem; }
    /* Card scales automatically via aspect-ratio + 100% width */
    .wallet-credit-card { border-radius: 14px; }
    .wallet-actions-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: .4rem;
        justify-items: center;
    }
    .wallet-action-btn {
        width: 100%; padding: .6rem .3rem;
        font-size: .72rem;
        border-radius: 10px;
    }
    table { font-size: .8rem; }
    th, td { padding: .45rem .5rem; }
    .btn, .btn-primary, .btn-success, .btn-danger {
        padding: .55rem 1rem; font-size: .9rem;
    }
    .form-group input, .form-group select, .form-group textarea {
        font-size: 1rem;
    }
    .modal-content { margin: 1rem; padding: 1.2rem; border-radius: 12px; }
    .nav-links { z-index: 999; }
    .nav-brand span { font-size: .95rem; }
}

/* ══════════════════════════════════════════════
   EXTRA SMALL — pantallas muy pequeñas (< 380px)
   ══════════════════════════════════════════════ */
@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr; }
    .wallet-actions-row { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════
   PWA / iOS safe areas
   ══════════════════════════════════════════════ */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    .container {
        padding-left: max(.8rem, env(safe-area-inset-left));
        padding-right: max(.8rem, env(safe-area-inset-right));
    }
}
