:root {
    --bg-page: #f1f5f9;
    --app-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --primary-blue: #2481cc;
    --primary-hover: #1c6eb3;
    --accent-green: #10b981;
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --app-max-width: 480px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Vertical Mobile-App Wrapper */
.mobile-app-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.mobile-app-container {
    width: 100%;
    max-width: var(--app-max-width);
    background-color: var(--app-bg);
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(15, 23, 42, 0.08);
    padding-bottom: 76px; /* Room for fixed bottom toolbar */
}

/* Mobile Header Bar */
.mobile-app-header {
    height: 62px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 80;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-badge-icon {
    width: 34px;
    height: 34px;
    background: transparent;
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
}

.brand-badge-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.brand-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.brand-text span {
    color: var(--primary-blue);
}

.header-user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.balance-pill:hover {
    background: #e2e8f0;
}

.text-amber {
    color: #d97706;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Mobile App Content */
.mobile-app-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.home-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* User Greeting */
.user-greeting {
    display: flex;
    flex-direction: column;
}

.greeting-text h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.greeting-text p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Saldo Card */
.saldo-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.25);
}

.saldo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saldo-title {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.saldo-status-badge {
    font-size: 11px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.saldo-amount h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.saldo-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.btn-saldo-action {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-saldo-action.primary {
    background: var(--primary-blue);
    color: #ffffff;
}

.btn-saldo-action.primary:hover {
    background: var(--primary-hover);
}

.btn-saldo-action.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-saldo-action.secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Info Banner */
.info-banner {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-blue);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.banner-icon {
    width: 32px;
    height: 32px;
    background: #dbeafe;
    color: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.banner-text h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.banner-text p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Section Blocks */
.section-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-server-status {
    font-size: 11px;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    padding: 2px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.service-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.color-blue .service-icon { background: #dbeafe; color: #2563eb; }
.color-emerald .service-icon { background: #d1fae5; color: #059669; }
.color-amber .service-icon { background: #fef3c7; color: #d97706; }
.color-indigo .service-icon { background: #e0e7ff; color: #4f46e5; }

.status-indicator {
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 10px;
}

.status-indicator.online {
    background: #dcfce7;
    color: #15803d;
}

.status-indicator.online .dot {
    width: 6px;
    height: 6px;
    background: #16a34a;
    border-radius: 50%;
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

.status-indicator.offline {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.status-indicator.offline .dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
}

.service-card.is-offline {
    opacity: 0.78;
    background: #fafafa;
    border-color: #e2e8f0;
    cursor: pointer;
}

.service-card.is-offline:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.service-card.is-offline .service-icon {
    filter: grayscale(85%);
}

.service-info h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);

}

.service-info p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* System Status List */
.system-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-icon-box {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 8px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.status-item-details h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.sys-type {
    font-size: 10px;
    color: var(--text-muted);
}

.status-badge-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge-pill.online {
    background: #dcfce7;
    color: #15803d;
}

.pulsing-dot {
    width: 6px;
    height: 6px;
    background: #16a34a;
    border-radius: 50%;
    animation: pulseDot 1.5s infinite;
}

/* Mobile Bottom Navigation Toolbar */
.mobile-bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-max-width);
    height: 64px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.toolbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #94a3b8;
    flex: 1;
    height: 100%;
    transition: color 0.2s ease;
}

.toolbar-item:hover,
.toolbar-item.active {
    color: var(--primary-blue);
}

.toolbar-icon-box {
    font-size: 18px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-label {
    font-size: 10px;
    font-weight: 600;
}

.toolbar-icon-box.fab-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(36, 129, 204, 0.4);
    transform: translateY(-8px);
}

.toolbar-item.active .toolbar-icon-box.fab-icon {
    background: var(--primary-hover);
}

/* Modals */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 990;
}

.modal-backdrop.show { display: block; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 20px;
    align-items: center;
    justify-content: center;
}

.modal.show { display: flex; }

.modal-dialog {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modalSlideUp 0.25s ease-out;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
}

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

.btn-primary-block {
    width: 100%;
    padding: 12px;
    background: var(--primary-blue);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    margin-top: 4px;
}

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

/* Nominal options in Deposit Modal */
.nominal-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.btn-nominal {
    padding: 10px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.btn-nominal:hover,
.btn-nominal.selected {
    background: #dbeafe;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Rate Table in Modal */
.rate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.rate-table th {
    padding: 8px 10px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    color: var(--text-secondary);
}

.rate-table td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.badge-status-sm {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
}

.badge-status-sm.online {
    background: #dcfce7;
    color: #15803d;
}

.result-box {
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
}
