:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f4f4f5;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    padding: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* Card */
.card {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Status Card */
.status-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.status-loading {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

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

.status-content {
    color: white;
}

.status-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

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

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

.status-value {
    font-weight: 600;
    font-size: 16px;
}

.daily-limit {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    text-align: center;
}

.daily-limit-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.daily-limit-value {
    font-size: 24px;
    font-weight: 700;
}

.warning {
    background: rgba(255, 87, 51, 0.2);
    border-left: 3px solid #ff5733;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 13px;
}

.saved-info {
    background: rgba(76, 217, 100, 0.2);
    border-left: 3px solid #4cd964;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 13px;
}

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

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

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

.btn-icon {
    font-size: 20px;
}

.btn-expense {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-income {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-primary {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    width: 100%;
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--tg-theme-hint-color);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 16px;
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--tg-theme-bg-color);
    width: 100%;
    border-radius: 16px 16px 0 0;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    font-size: 20px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--tg-theme-hint-color);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

/* Transactions List */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--tg-theme-bg-color);
    border-radius: 8px;
}

.transaction-info {
    flex: 1;
}

.transaction-description {
    font-weight: 500;
    margin-bottom: 2px;
}

.transaction-date {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.transaction-amount {
    font-weight: 600;
    font-size: 16px;
}

.transaction-amount.expense {
    color: #f5576c;
}

.transaction-amount.income {
    color: #00f2fe;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color);
}
