/* ===== 기본 리셋 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    width: 100%;
    font-size: 16px;
}

/* ===== 공통 입력 스타일 ===== */
.text-input {
    font: inherit;
    color: inherit;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autosize-input {
    width: 1ch;
    max-width: 100%;
}

/* ===== 상태바 ===== */
.status-bar {
    background-color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

.time {
    font-size: 16px;
    line-height: 18px;
    height: 18px;
    display: block;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-right-img {
    height: 18px;
    width: auto;
    display: block;
}

.signal-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
}

.bar {
    width: 3px;
    background-color: #333;
}

.bar:nth-child(1) { height: 4px; }
.bar:nth-child(2) { height: 6px; }
.bar:nth-child(3) { height: 8px; }
.bar:nth-child(4) { height: 10px; }

.battery {
    width: 24px;
    height: 12px;
    border: 1px solid #333;
    border-radius: 4px;
    position: relative;
    margin-left: 5px;
    overflow: hidden;
}

.battery::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 3px;
    width: 2px;
    height: 6px;
    background-color: #333;
    border-radius: 0 2px 2px 0;
}

.battery-fill {
    width: 40%;
    height: 100%;
    background-color: #333;
    border-radius: 3px 0 0 3px;
}

/* ===== 헤더 ===== */
.header {
    background-color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e5e5;
}

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

.back-btn {
    font-size: 16px;
    color: #333;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.header-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    top: 2px;
    flex: 1;
    min-width: 0;
}

.header-dropdown {
    font-size: 16px;
    color: #999;
}

.header-icons {
    display: flex;
    gap: 18px;
    flex: none;
}

.icon {
    font-size: 16px;
    color: #333;
    line-height: 1;
}

/* ===== 잔액 섹션 ===== */
.balance-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #e8f4fd 100%);
    padding: 50px 20px 30px;
    position: relative;
    min-height: 250px;
}

.bank-brand {
    position: absolute;
    top: 18px;
    left: 18px;
    right: 64px;
    display: flex;
    align-items: center;
    gap: 5px;
    height: auto;
    max-width: calc(100% - 18px - 64px);
}

.bank-brand-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding-top: 2px;
    flex: 1;
}

.bank-brand-top {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
}

.bank-brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    flex: 0 0 auto;
    width: 1ch;
    min-width: 0;
    position: relative;
    top: 10px;
}

.bank-brand-account {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    line-height: 1.15;
    height: auto;
    position: relative;
    top: 2px;
}

.bank-logo {
    color: #0066cc;
    width: 28px;
    height: 28px;
    position: relative;
    top: 3px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    font-style: italic;
    flex: none;
}

.bank-brand-input {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    outline: none;
    flex: 0 0 auto;
    width: 1ch;
    height: 32px;
    line-height: 32px;
    caret-color: auto;
    cursor: text;
}

.bank-brand-input::placeholder {
    color: #333;
    opacity: 0.7;
}

.bank-brand-chevron {
    font-size: 16px;
    color: #666;
    height: 32px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    margin-left: 3px;
    flex: none;
    position: relative;
    top: 10px;
}

.bank-brand-check {
    height: 6.5px;
    width: auto;
    display: inline-block;
    margin-left: 3px;
    flex: none;
    position: relative;
    top: 8.5px;
}

.balance-amount {
    font-size: 24px;
    font-weight: 650;
    color: #333;
    text-align: right;
    margin-bottom: 50px;
    padding-top: 30px;
    padding-right: 10px;
    width: 100%;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.action-btn {
    background-color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.more-options {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 16px;
    color: #666;
    cursor: pointer;
}

.dropdown-arrow {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    color: #666;
    display: none;
}

/* ===== 거래내역 섹션 ===== */
.transaction-section {
    background-color: white;
    padding: 0 20px 20px;
    border-top: 12px solid #f5f7fa;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    gap: 12px;
    min-width: 0;
    padding: 15px 20px;
    margin-left: -20px;
    margin-right: -20px;
    background-color: #f5f7fa;
    border-bottom: 1px solid #e0e0e0;
}

.transaction-count {
    font-size: 16px;
    color: #333;
}

.filter-dropdown {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
}

/* ===== 거래 내역 아이템 ===== */
.transaction-list {
    display: flex;
    flex-direction: column;
    padding-top: 16px;
}

.date-divider {
    font-size: 16px;
    color: #666;
    font-weight: 600;
    padding: 15px 0 10px 0;
    border-top: 1px solid #f0f0f0;
    width: 100%;
}

.date-divider:first-child {
    border-top: none;
}

.transaction-item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.transaction-time {
    font-size: 14px;
    color: #999;
    margin-bottom: 5px;
    width: 100%;
}

.transaction-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

.transaction-type {
    font-size: 16px;
    font-weight: 700;
    color: #323131f1;
    width: 100%;
}

.transaction-amount {
    text-align: right;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

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

.amount-label {
    font-size: 16px;
    color: #999;
    margin-bottom: 3px;
}

.amount-value {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 3px;
}

.transaction-balance {
    font-size: 16px;
    color: #999;
}

.transaction-amount .transaction-balance {
    margin-top: 3px;
    text-align: right;
    width: 100%;
}

.amount-value.income {
    color: #0066cc;
}

.amount-value.expense {
    color: #ff4444;
}

/* ===== 반응형 (375px 이하) ===== */
@media (max-width: 375px) {
    .status-bar {
        padding: 10px 16px;
    }

    .header {
        padding: 15px 16px;
    }

    .balance-section {
        padding: 50px 16px 28px;
    }

    .transaction-section {
        padding: 0 16px 18px;
    }

    .action-btn {
        padding: 12px 22px;
    }

    .transaction-header {
        flex-wrap: wrap;
        padding: 14px 16px;
        margin-left: -16px;
        margin-right: -16px;
    }
}
