/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #007dfe;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --cash-in-color: #28a745;
    --cash-out-color: #dc3545;
    --profit-color: #17a2b8;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 5px 20px rgba(0, 0, 0, 0.12);
    --sidebar-width: 260px;
    --header-height: 60px;
    --bottom-nav-height: 65px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (Desktop Only) */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #007dfe 0%, #0056b3 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar .logo {
    padding: 4px 2px 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: white;
}

.sidebar .logo img {
    width: 100%;
    max-width: 120px;
    height: auto;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

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

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
}

.nav-item i {
    font-size: 18px;
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.nav-item span {
    font-size: 14px;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding-bottom: 20px;
}

/* Header */
.header {
    background: var(--card-bg);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
}

.balance-display {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.balance-display:active {
    transform: scale(0.95);
}

.balance-display i {
    font-size: 14px;
}

.balance-display strong {
    font-size: 15px;
    font-weight: 600;
}

/* Pages */
.page {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 20px;
    padding: 25px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 125, 254, 0.3);
}

.balance-card-content {
    text-align: center;
}

.balance-label {
    font-size: 13px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin: 10px 0 15px;
}

.btn-topup-quick {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-topup-quick:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.quick-action-btn {
    background: var(--card-bg);
    border: none;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.quick-action-btn:active {
    transform: scale(0.95);
}

.quick-action-btn .quick-action-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.quick-action-btn.cash-in .quick-action-icon {
    background: linear-gradient(135deg, var(--cash-in-color), #1e7e34);
}

.quick-action-btn.cash-out .quick-action-icon {
    background: linear-gradient(135deg, var(--cash-out-color), #c82333);
}

.quick-action-btn span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card.mini {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.stat-card.mini i {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.cash-in-icon { color: var(--cash-in-color); background: rgba(40, 167, 69, 0.1); }
.cash-out-icon { color: var(--cash-out-color); background: rgba(220, 53, 69, 0.1); }
.profit-icon { color: var(--profit-color); background: rgba(23, 162, 184, 0.1); }
.transactions-icon { color: var(--primary-color); background: rgba(0, 125, 254, 0.1); }

.stat-card.mini .stat-info {
    flex: 1;
    min-width: 0;
}

.stat-card.mini .stat-info span {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-card.mini .stat-info strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Section Card */
.section-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-card-header h3 i {
    color: var(--primary-color);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* Transaction List */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 12px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.transaction-item:active {
    background: #e9ecef;
}

.transaction-item .type-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.transaction-item .type-icon.cash-in {
    background: var(--cash-in-color);
}

.transaction-item .type-icon.cash-out {
    background: var(--cash-out-color);
}

.transaction-item .transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-item .transaction-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-item .transaction-date {
    font-size: 12px;
    color: var(--text-muted);
}

.transaction-item .transaction-amount {
    text-align: right;
}

.transaction-item .transaction-amount .amount {
    font-weight: 700;
    font-size: 15px;
}

.transaction-item .transaction-amount .amount.cash-in {
    color: var(--cash-in-color);
}

.transaction-item .transaction-amount .amount.cash-out {
    color: var(--cash-out-color);
}

.transaction-item .transaction-amount .profit {
    font-size: 11px;
    color: var(--text-muted);
}

/* Empty State */
.empty-state-mobile {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-mobile i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state-mobile p {
    margin-bottom: 15px;
}

/* Type Selector */
.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.type-btn i {
    font-size: 24px;
    color: var(--text-secondary);
}

.type-btn span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.type-btn.active[data-type="cash-in"],
.type-btn:active[data-type="cash-in"] {
    border-color: var(--cash-in-color);
    background: rgba(40, 167, 69, 0.05);
}

.type-btn.active[data-type="cash-in"] i,
.type-btn.active[data-type="cash-in"] span {
    color: var(--cash-in-color);
}

.type-btn.active[data-type="cash-out"],
.type-btn:active[data-type="cash-out"] {
    border-color: var(--cash-out-color);
    background: rgba(220, 53, 69, 0.05);
}

.type-btn.active[data-type="cash-out"] i,
.type-btn.active[data-type="cash-out"] span {
    color: var(--cash-out-color);
}

/* Amount Input */
.amount-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.currency-symbol {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 5px;
}

.amount-input-large {
    font-size: 48px;
    font-weight: 700;
    border: none;
    background: transparent;
    width: 200px;
    text-align: left;
    color: var(--text-primary);
    outline: none;
}

.amount-input-large::placeholder {
    color: var(--border-color);
}

/* Fee Display */
.fee-display-inline {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 12px;
    margin-bottom: 25px;
}

.fee-item-inline {
    text-align: center;
}

.fee-item-inline span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.fee-item-inline strong {
    font-size: 18px;
    font-weight: 700;
}

.profit-amount {
    color: var(--cash-in-color) !important;
}

/* Input Group Mobile */
.input-group-mobile {
    margin-bottom: 15px;
}

.input-group-mobile label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-group-mobile label i {
    color: var(--primary-color);
    width: 16px;
}

.input-group-mobile input,
.input-group-mobile textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--card-bg);
}

.input-group-mobile input:focus,
.input-group-mobile textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Balance Change Preview */
.balance-change-preview {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.balance-row.highlight {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    border-top: 1px dashed var(--border-color);
    margin-top: 8px;
    padding-top: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 16px 24px;
    font-size: 16px;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Search & Filter */
.search-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: var(--card-bg);
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-toggle-btn {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-toggle-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 125, 254, 0.05);
}

/* Filters Panel */
.filters-panel {
    display: none;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.filters-panel.active {
    display: block;
}

.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.filter-chip {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-chip.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.date-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.date-filter-row input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
}

.date-filter-row span {
    color: var(--text-muted);
    font-size: 13px;
}

/* Top-up Page */
.topup-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.topup-balance-display {
    text-align: center;
    margin-bottom: 25px;
}

.topup-balance-display span {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.topup-balance-display h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 5px;
}

.topup-amount {
    margin-bottom: 15px;
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-amount-btn {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-amount-btn:active {
    border-color: var(--primary-color);
    background: rgba(0, 125, 254, 0.05);
}

.new-balance-preview {
    text-align: center;
    padding: 15px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 12px;
    margin-bottom: 20px;
}

.new-balance-preview span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.new-balance-preview h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--cash-in-color);
    margin-top: 5px;
}

/* Top-up History List */
.topup-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topup-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 12px;
    gap: 12px;
}

.topup-item .topup-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(40, 167, 69, 0.1);
    color: var(--cash-in-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.topup-item .topup-info {
    flex: 1;
}

.topup-item .topup-note {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.topup-item .topup-date {
    font-size: 12px;
    color: var(--text-muted);
}

.topup-item .topup-amount-value {
    font-weight: 700;
    font-size: 16px;
    color: var(--cash-in-color);
}

/* Connection Badge */
.connection-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.connection-badge.connected {
    background: rgba(40, 167, 69, 0.1);
    color: var(--cash-in-color);
}

.connection-badge.disconnected {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.connection-badge i {
    font-size: 8px;
}

.connection-form {
    margin-top: 15px;
}

/* Input with Copy Button */
.input-with-copy {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-copy input {
    flex: 1;
}

.btn-copy {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-copy:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-copy:active {
    background: var(--primary-color);
    color: white;
    transform: scale(0.95);
}

.btn-copy.copied {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.connection-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

/* Fee Actions */
.fee-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Mobile Fee Cards */
.fee-cards-mobile {
    display: none;
}

.fee-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
}

.fee-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.fee-card-header .range-display {
    font-weight: 600;
    font-size: 14px;
}

.fee-card-header .btn-delete {
    background: none;
    border: none;
    color: var(--danger-color);
    padding: 8px;
    cursor: pointer;
}

.fee-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.fee-card-body .fee-input-group {
    text-align: center;
}

.fee-card-body .fee-input-group label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.fee-card-body .fee-input-group label.cash-in {
    color: var(--cash-in-color);
}

.fee-card-body .fee-input-group label.cash-out {
    color: var(--cash-out-color);
}

.fee-card-body .fee-input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.modal.active {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    animation: slideUp 0.3s ease;
    padding-bottom: var(--safe-area-bottom);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 10px auto 0;
}

.modal-body {
    padding: 25px 20px;
    text-align: center;
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
}

.modal-icon.danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.modal-body h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.modal-body p {
    color: var(--text-secondary);
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

/* Transaction Detail in Modal */
.transaction-detail {
    text-align: left;
}

.transaction-detail-header {
    text-align: center;
    margin-bottom: 20px;
}

.transaction-detail-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.transaction-detail-type.cash-in {
    background: rgba(40, 167, 69, 0.1);
    color: var(--cash-in-color);
}

.transaction-detail-type.cash-out {
    background: rgba(220, 53, 69, 0.1);
    color: var(--cash-out-color);
}

.transaction-detail-amount {
    font-size: 32px;
    font-weight: 700;
    margin-top: 10px;
}

.transaction-detail-rows {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 5px 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    color: var(--text-muted);
}

.detail-row .value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Transaction Meta Info */
.transaction-detail-meta {
    margin-top: 15px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 10px;
}

.transaction-detail-meta .meta-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.transaction-detail-meta .meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.transaction-detail-meta .meta-row i {
    width: 16px;
    color: var(--text-muted);
    font-size: 11px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 20px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3000;
    font-size: 14px;
    font-weight: 500;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    background: var(--danger-color);
}

/* Bottom Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: calc(8px + var(--safe-area-bottom));
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 5px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 4px;
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item span {
    font-size: 10px;
    font-weight: 500;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

/* Desktop Only */
.desktop-only {
    display: block;
}

/* Hide desktop elements on mobile */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 20px);
    }

    .menu-toggle {
        display: block;
    }

    .bottom-nav {
        display: flex;
    }

    .page {
        padding: 15px;
    }

    .header {
        padding: 0 15px;
    }

    .balance-card {
        padding: 20px;
        border-radius: 16px;
    }

    .balance-amount {
        font-size: 32px;
    }

    .fee-cards-mobile {
        display: block;
    }

    .fee-table-container {
        display: none;
    }

    .toast {
        left: 15px;
        right: 15px;
        transform: translateX(0) translateY(100px);
        width: auto;
    }

    .toast.active {
        transform: translateX(0) translateY(0);
    }
}

/* Small phones */
@media (max-width: 375px) {
    .balance-amount {
        font-size: 28px;
    }

    .amount-input-large {
        font-size: 40px;
    }

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

    .stat-card.mini .stat-info strong {
        font-size: 14px;
    }
}

/* Desktop Tables */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
}

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

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.cash-in {
    background: rgba(40, 167, 69, 0.1);
    color: var(--cash-in-color);
}

.type-badge.cash-out {
    background: rgba(220, 53, 69, 0.1);
    color: var(--cash-out-color);
}

/* Desktop Styles */
@media (min-width: 769px) {
    /* Hide mobile-specific elements on dashboard */
    #dashboard .section-card,
    #dashboard .balance-card,
    #dashboard .quick-actions {
        display: none;
    }

    .balance-card {
        display: none;
    }

    .quick-actions {
        display: none;
    }

    /* Show filters by default on desktop */
    #transactions .filters-panel {
        display: block;
    }

    #transactions .filter-toggle-btn {
        display: none;
    }

    #transactions .search-filter-bar {
        max-width: 100%;
    }

    /* Hide mobile transaction list on desktop */
    #transactions .transaction-list {
        display: none;
    }

    /* Hide mobile topup list on desktop (show table instead) */
    #topup .topup-list {
        display: none;
    }

    /* Topup page: show form container, hide mobile section card */
    #topup > .section-card {
        display: none;
    }

    #topup .topup-container {
        display: block;
        max-width: 600px;
        margin: 0 auto 20px;
    }
}

/* Settings page - always visible on all screen sizes */
#fee-settings .section-card {
    display: block !important;
}

@media (min-width: 769px) {
    #fee-settings .section-card {
        max-width: 800px;
        margin: 0 auto 20px;
    }

    #fee-settings .fee-cards-mobile {
        display: none !important;
    }

    #fee-settings .fee-table-container {
        display: block !important;
    }

    #fee-settings .connection-form,
    #fee-settings .fee-actions {
        max-width: 100%;
    }

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

    .stat-card.mini {
        padding: 20px;
    }

    .stat-card.mini i {
        font-size: 24px;
        width: 50px;
        height: 50px;
    }

    .stat-card.mini .stat-info strong {
        font-size: 20px;
    }

    .form-container,
    .topup-container {
        max-width: 600px;
        margin: 0 auto;
    }

    .type-selector {
        max-width: 400px;
        margin: 0 auto 25px;
    }
}

/* Fee Table Desktop */
.fee-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

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

.fee-table th,
.fee-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.fee-table th {
    background: var(--bg-color);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.fee-table th.cash-in-header {
    color: var(--cash-in-color);
}

.fee-table th.cash-out-header {
    color: var(--cash-out-color);
}

.fee-table input {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    width: 80px;
}

.fee-table .btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
}

.fee-table .btn-delete:hover {
    color: var(--danger-color);
}

/* Loading Indicator */
#loadingIndicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 15px;
    color: white;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Print Styles */
@media print {
    .sidebar, .header, .bottom-nav, .modal, .toast, .install-banner {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }
}

/* PWA Install Banner */
.install-banner {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 10px);
    left: 10px;
    right: 10px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 2000;
    transform: translateY(200%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.install-banner.active {
    transform: translateY(0);
    opacity: 1;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.install-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
}

.install-banner-text {
    flex: 1;
}

.install-banner-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.install-banner-text span {
    font-size: 13px;
    color: var(--text-muted);
}

.install-banner-actions {
    display: flex;
    gap: 10px;
}

.install-btn-dismiss {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.install-btn-dismiss:active {
    background: var(--bg-color);
}

.install-btn-primary {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.install-btn-primary:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

/* Desktop: Hide install banner on larger screens or position differently */
@media (min-width: 769px) {
    .install-banner {
        bottom: 20px;
        left: auto;
        right: 20px;
        max-width: 360px;
    }
}

/* Standalone mode (when installed as PWA) */
@media (display-mode: standalone) {
    .install-banner {
        display: none !important;
    }
}
