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

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #a5b4fc;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    font-size: 28px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav a {
    padding: 10px 20px;
    text-decoration: none;
    color: var(--gray-600);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
}

.nav a:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

.main {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.actions {
    margin-bottom: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6b3d8f 100%);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

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

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.card-item {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card-item:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.card-item:hover::before {
    transform: scaleX(1);
}

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

.card-icon {
    font-size: 12px;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
}

.card-item:hover .card-icon {
    transform: scale(1.08);
    box-shadow: 0 5px 16px rgba(102, 126, 234, 0.25);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.card-header h3 {
    font-size: 20px;
    color: var(--gray-800);
    font-weight: 700;
}

.card-number {
    font-size: 12px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-weight: 500;
}

.card-body {
    margin-bottom: 20px;
}

.balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-md);
    color: #fff;
}

.balance .label {
    font-size: 14px;
    opacity: 0.9;
}

.balance .amount {
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-body .info {
    font-size: 14px;
    color: var(--gray-600);
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.card-body .info:last-child {
    border-bottom: none;
}

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

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-400);
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

.empty-state svg {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.form-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 32px;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border-color: #bbf7d0;
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border-color: #bfdbfe;
}

.card-detail {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
}

.card-info h2 {
    font-size: 28px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.card-info .card-icon {
    font-size: 42px;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
    }
    50% {
        transform: translateY(-3px);
        box-shadow: 0 9px 28px rgba(102, 126, 234, 0.3);
    }
}

.card-number {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
    font-weight: 500;
}

.balance-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    color: #fff;
}

.balance-display .label {
    font-size: 16px;
    opacity: 0.9;
}

.balance-display .amount {
    font-size: 36px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.meta-item {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.meta-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.meta-item .label {
    font-size: 13px;
    color: var(--gray-500);
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.meta-item .value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
}

.card-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.transactions-section {
    margin-top: 32px;
}

.transactions-section h3 {
    font-size: 24px;
    margin-bottom: 24px;
    color: var(--gray-800);
    font-weight: 700;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.transaction-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(4px);
}

.transaction-item.recharge {
    border-left-color: var(--success-color);
}

.transaction-item.consume {
    border-left-color: var(--danger-color);
}

.transaction-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-right: 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.transaction-item.recharge .transaction-icon {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #166534;
}

.transaction-item.consume .transaction-icon {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #991b1b;
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--gray-800);
}

.transaction-card {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.transaction-time {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 6px;
}

.transaction-method,
.transaction-remark {
    font-size: 13px;
    color: var(--gray-600);
}

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

.transaction-amount .amount {
    font-size: 22px;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

.transaction-amount .amount.positive {
    color: var(--success-color);
}

.transaction-amount .amount.negative {
    color: var(--danger-color);
}

.balance-change {
    font-size: 12px;
    color: var(--gray-500);
}

.card-info-summary {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.card-info-summary h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--gray-800);
    font-weight: 700;
}

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

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    margin-right: 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.stat-icon.balance {
    background: linear-gradient(135deg, #e7f3ff 0%, #dbeafe 100%);
    color: #1e40af;
}

.stat-icon.recharge {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #166534;
}

.stat-icon.consume {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #991b1b;
}

.stat-icon.remaining {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
}

.stats-section {
    margin-bottom: 32px;
}

.stats-section h3 {
    font-size: 24px;
    margin-bottom: 24px;
    color: var(--gray-800);
    font-weight: 700;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .container {
        padding: 0;
    }
    
    .header {
        padding: 20px;
        border-radius: var(--radius-lg);
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .nav {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav a {
        text-align: center;
        padding: 12px 20px;
    }
    
    .main {
        padding: 20px;
        border-radius: var(--radius-lg);
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card-item {
        padding: 20px;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn {
        width: 100%;
    }
    
    .transaction-item {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    
    .transaction-icon {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .transaction-amount {
        text-align: center;
        margin-top: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .form-container {
        padding: 24px;
        border-radius: var(--radius-lg);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .card-detail {
        padding: 24px;
        border-radius: var(--radius-lg);
    }
    
    .balance-display {
        padding: 20px;
        border-radius: var(--radius-lg);
    }
    
    .balance-display .amount {
        font-size: 28px;
    }
    
    .card-meta {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .meta-item {
        padding: 16px;
    }
    
    .meta-item .value {
        font-size: 18px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .header {
        padding: 16px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .main {
        padding: 16px;
    }
    
    .card-item {
        padding: 16px;
    }
    
    .balance .amount {
        font-size: 24px;
    }
    
    .balance-display .amount {
        font-size: 24px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .card-detail {
        padding: 20px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        margin-right: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .transaction-item {
        padding: 12px;
    }
    
    .transaction-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .transaction-amount .amount {
        font-size: 18px;
    }
}
