/* ==========================================================================
   iSpend Giao diện iOS Premium - Custom CSS
   ========================================================================== */

/* Thiết lập màu sắc hệ thống & Variables */
:root {
    --bg-black: #000000;
    --bg-dark-gray: #121214;
    --bg-card: #1c1c1e;
    --bg-card-hover: #2c2c2e;
    --border-gray: rgba(255, 255, 255, 0.1);
    
    /* Màu thương hiệu & Danh mục */
    --accent-blue: #0a84ff;
    --accent-blue-rgb: 10, 132, 255;
    --accent-green: #30d158;
    --accent-green-rgb: 48, 209, 88;
    --accent-orange: #ff9f0a;
    --accent-orange-rgb: 255, 159, 10;
    --accent-red: #ff453a;
    --accent-red-rgb: 255, 69, 58;
    --accent-indigo: #5e5ce6;
    --accent-indigo-rgb: 94, 92, 230;
    --accent-purple: #bf5af2;
    --accent-purple-rgb: 191, 90, 242;
    
    /* Chữ */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.35);
    
    /* Khác */
    --ios-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --card-radius: 20px;
    --btn-radius: 14px;
    --nav-height: 83px; /* iOS standard bottom bar height */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--ios-font);
}

/* Custom Scrollbar - mỏng và tối giản */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Ẩn scrollbar nhưng vẫn cuộn được trên các container nhất định */
#cal-day-expense-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}


body {
    background-color: #08080a;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Giả lập khung điện thoại khi xem trên máy tính */
.app-container {
    width: 100%;
    height: 100%;
    background-color: var(--bg-black);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Status Bar spacer cho iOS notched phones */
.ios-status-bar-spacer {
    height: env(safe-area-inset-top, 24px);
    background-color: var(--bg-black);
    flex-shrink: 0;
    width: 100%;
}

/* HEADER */
.app-header {
    padding: 16px 20px 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background-color: var(--bg-black);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    z-index: 10;
}

.date-today {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-blue);
    display: block;
    margin-bottom: 2px;
}

.header-title {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a1a1a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.icon-btn:active {
    transform: scale(0.9);
    background-color: var(--bg-card-hover);
}

/* MAIN CONTENT PANELS */
.app-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    padding-bottom: calc(var(--nav-height) + 30px);
    background-color: var(--bg-black);
    -webkit-overflow-scrolling: touch;
}

/* Ẩn thanh cuộn nhưng vẫn cuộn được */
.app-main::-webkit-scrollbar {
    display: none;
}

.tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* SUMMARY CARDS ROW */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-gray);
    position: relative;
    overflow: hidden;
    transition: var(--transition-bounce);
}

.card:active {
    transform: scale(0.96);
}

.card-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.card-today .card-icon {
    background-color: rgba(10, 132, 255, 0.15);
    color: var(--accent-blue);
}

.card-week .card-icon {
    background-color: rgba(48, 209, 88, 0.15);
    color: var(--accent-green);
}

.card-month .card-icon {
    background-color: rgba(191, 90, 242, 0.15);
    color: var(--accent-purple);
}

.card-icon i {
    width: 16px;
    height: 16px;
}

.card-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.card-amount {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SECTION CARDS */
.section-card {
    background-color: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid var(--border-gray);
}

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

.section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-header .chart-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* BUDGET CARD */
.budget-card {
    background: linear-gradient(145deg, #1c1c1e 0%, #151517 100%);
}

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

.budget-header h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.budget-percent {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-blue);
}

.progress-bar-container {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue) 0%, #54a9ff 100%);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.budget-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* CHART CONTAINER */
.chart-container {
    position: relative;
    width: 100%;
    height: 160px;
}

.doughnut-container {
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* SPENDING LISTS */
.recent-section {
    margin-top: 10px;
}

.text-link-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.spending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.empty-state i {
    width: 36px;
    height: 36px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.85rem;
}

/* GIAO DỊCH ITEM (iOS style list row) */
.transaction-group-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transaction-item {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-gray);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.transaction-item:active {
    transform: scale(0.98);
    background-color: var(--bg-card-hover);
}

.item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0; /* Cho phép text truncation hoạt động */
}

.item-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Màu sắc các danh mục */
.cat-anuong { background-color: rgba(255, 159, 10, 0.15); color: var(--accent-orange); }
.cat-muasam { background-color: rgba(191, 90, 242, 0.15); color: var(--accent-purple); }
.cat-dichuyen { background-color: rgba(10, 132, 255, 0.15); color: var(--accent-blue); }
.cat-giaitri { background-color: rgba(255, 69, 58, 0.15); color: var(--accent-red); }
.cat-hoadon { background-color: rgba(94, 92, 230, 0.15); color: var(--accent-indigo); }
.cat-khac { background-color: rgba(142, 142, 147, 0.15); color: #8e8e93; }

.item-details {
    min-width: 0;
}

.item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-has-photo {
    color: var(--accent-blue);
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
}

.item-has-photo i {
    width: 10px;
    height: 10px;
    margin-right: 2px;
}

.item-right {
    text-align: right;
    flex-shrink: 0;
}

.item-amount {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* HISTORY TAB CONTROLS */
.history-controls {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-bar {
    position: relative;
    width: 100%;
}

.search-bar input {
    width: 100%;
    height: 38px;
    border-radius: 10px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    padding-left: 36px;
    padding-right: 14px;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-bar input:focus {
    border-color: var(--accent-blue);
    background-color: var(--bg-card-hover);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.filter-scroll::-webkit-scrollbar {
    display: none;
}

.filter-tag {
    background-color: var(--bg-card);
    border: 1px solid var(--border-gray);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-tag.active {
    background-color: var(--accent-blue);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

/* BREAKDOWN REPORT */
.category-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.breakdown-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
}

.breakdown-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.breakdown-amount {
    color: var(--text-primary);
}

.breakdown-bar-bg {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.breakdown-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.1, 0.8, 0.3, 1);
}

/* SETTINGS */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.setting-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.settings-input {
    background-color: var(--bg-black);
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    width: 120px;
    text-align: right;
    font-weight: 700;
    outline: none;
}

.settings-input:focus {
    border-color: var(--accent-blue);
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.btn {
    border: none;
    padding: 10px 14px;
    border-radius: var(--btn-radius);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn i {
    width: 14px;
    height: 14px;
}

.btn-secondary {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-gray);
}

.btn-secondary:active {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn-danger-link {
    background: none;
    color: var(--accent-red);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0;
}

.btn-danger {
    background-color: var(--accent-red);
    color: #ffffff;
    width: 100%;
    padding: 12px;
}

.btn-danger:active {
    background-color: #d1342c;
    transform: scale(0.98);
}

/* APP NAVIGATION BOTTOM BAR */
.app-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: rgba(20, 20, 22, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    width: 60px;
    transition: var(--transition-smooth);
}

.nav-item i {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
}

.nav-item span {
    font-size: 0.6rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--accent-blue);
}

.nav-item.active i {
    transform: scale(1.05);
}

/* Quick Add button */
.nav-item-add {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #006adc 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.4);
    cursor: pointer;
    margin-top: -15px; /* Nút nhô lên trên */
    transition: var(--transition-bounce);
}

.nav-item-add:active {
    transform: scale(0.85) rotate(90deg);
    box-shadow: 0 2px 6px rgba(10, 132, 255, 0.2);
}

.nav-item-add i {
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   MODALS (BOTTOM SHEET)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Calendar modal is centered, not bottom sheet */
#calendar-expense-modal {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-sheet {
    width: 100%;
    max-height: 92%;
    background-color: #1c1c1e;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    padding: 10px 20px 24px 20px;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.15, 0.85, 0.35, 1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 25px rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

.modal-drag-indicator {
    width: 36px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    align-self: center;
    margin-bottom: 12px;
}

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

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-close-btn i {
    width: 20px;
    height: 20px;
}

/* AMOUNT INPUT (APPLE-PAY-STYLE) */
.amount-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.currency-symbol {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-blue);
    margin-right: 4px;
}

#expense-amount,
#detail-amount-input {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.8rem;
    font-weight: 800;
    width: 220px;
    outline: none;
    text-align: left;
    caret-color: var(--accent-blue);
}

/* PHOTO UPLOAD ZONE */
.photo-upload-zone {
    width: 100%;
    height: 120px;
    border-radius: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.photo-upload-zone:hover {
    border-color: var(--accent-blue);
    background-color: rgba(10, 132, 255, 0.02);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.upload-placeholder i {
    width: 28px;
    height: 28px;
    color: var(--accent-blue);
}

.upload-placeholder span {
    font-size: 0.8rem;
    font-weight: 700;
}

.upload-placeholder .upload-sub {
    font-size: 0.65rem;
    opacity: 0.6;
}

.image-preview-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-photo-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 69, 58, 0.9);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.remove-photo-btn i {
    width: 14px;
    height: 14px;
}

/* FORM FIELDS */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

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

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 44px;
    border-radius: var(--btn-radius);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    padding-left: 38px;
    padding-right: 14px;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.input-wrapper input:focus {
    border-color: var(--accent-blue);
    background-color: rgba(255, 255, 255, 0.08);
}

/* Category grid options */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.category-tag-option {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 10px 4px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.category-tag-option.active {
    background-color: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(10, 132, 255, 0.2);
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Submit Button */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #006adc 100%);
    color: #ffffff;
}

.btn-primary:active {
    background: #006adc;
    transform: scale(0.98);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

/* DETAIL SHEET */
.detail-amount-display {
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

#detail-amount {
    font-size: 2.5rem;
    font-weight: 800;
}

.detail-category-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.detail-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.info-value {
    font-size: 0.85rem;
    font-weight: 600;
}

.detail-photo-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.detail-photo-wrapper {
    width: 100%;
    max-height: 250px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-gray);
}

.detail-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: rgba(0, 0, 0, 0.2);
}

.detail-actions {
    margin-top: 10px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Kiểu dáng cho hàng nút Hủy & Lưu trong Form */
.form-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    width: 100%;
}

.btn-cancel {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-gray);
}

.btn-cancel:active {
    background-color: rgba(255, 255, 255, 0.15);
}

.form-actions-row .btn-submit {
    flex: 2;
    margin-top: 0 !important;
}

/* Đồng bộ Google Sheets */
.flex-column {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
}
.w-100 {
    width: 100% !important;
}
.text-left {
    text-align: left !important;
}
.sync-input-row {
    display: flex;
    gap: 8px;
}
.sync-input-row input {
    flex: 1;
    background-color: var(--bg-black);
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    outline: none;
}
.sync-input-row input:focus {
    border-color: var(--accent-blue);
}
.status-disconnected {
    color: var(--accent-red);
    font-weight: 600;
}
.status-connected {
    color: var(--accent-green);
    font-weight: 600;
}
.status-syncing {
    color: var(--accent-orange);
    font-weight: 600;
}
.btn-text-link-small {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.btn-icon-only {
    padding: 8px 12px;
    height: 38px;
}

/* PHẦN GIAO DIỆN GIẢ LẬP IPHONE 15 PRO TRÊN MÁY TÍNH */
@media (min-width: 480px) {
    body {
        background: radial-gradient(circle at top right, #181622 0%, #08070b 100%);
    }
    .app-container {
        width: 393px;  /* iPhone 15 Pro Width */
        height: 852px; /* iPhone 15 Pro Height */
        border-radius: 48px; /* Bo góc cực mượt */
        border: 11px solid #8c8a84; /* Viền titan tự nhiên (Natural Titanium) */
        box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0,0,0,0.6);
        position: relative;
    }
    /* iOS Dynamic Island Simulator */
    .app-container::before {
        content: '';
        position: absolute;
        top: 11px;
        left: 50%;
        transform: translateX(-50%);
        width: 110px;
        height: 28px;
        background-color: #000000;
        border-radius: 14px;
        border: 0.5px solid rgba(255, 255, 255, 0.15);
        z-index: 9999;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        pointer-events: none;
    }
    .ios-status-bar-spacer {
        height: 44px !important; /* Dùng !important để đảm bảo ghi đè các cấu hình khác */
    }
}

/* HEADER ICON BUTTON */
.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    z-index: 100;
}

.header-icon-btn i,
.header-icon-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.header-icon-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.18);
}

/* CALENDAR MODAL STYLES - Centered Popup */
.calendar-modal-sheet {
    /* Override bottom-sheet transform: use scale instead */
    width: calc(100% - 0px);
    max-width: 360px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 20px !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    padding: 18px 16px 20px;
    transform: scale(0.92) !important;
    transition: transform 0.35s cubic-bezier(0.15, 0.85, 0.35, 1) !important;
}

#calendar-expense-modal.active .calendar-modal-sheet {
    transform: scale(1) !important;
}

.calendar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.calendar-title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.calendar-year-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.calendar-month-label {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.calendar-nav-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-primary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.calendar-nav-btn i, .calendar-nav-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.calendar-nav-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.calendar-month-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.calendar-month-summary strong {
    color: var(--accent-blue);
    font-size: 0.95rem;
    font-weight: 800;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    padding: 0 2px;
}

.calendar-weekdays div:last-child {
    color: #ff453a;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.calendar-day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 3px 2px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    gap: 2px;
    min-height: 38px;
}

.calendar-day-cell.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day-cell.today {
    background: var(--accent-blue);
    border-radius: 50%;
}

.calendar-day-cell.today .calendar-day-number {
    color: #ffffff;
    font-weight: 800;
}

.calendar-day-cell.has-expense:not(.today) {
    background: rgba(255, 159, 10, 0.12);
    border-color: rgba(255, 159, 10, 0.3);
}

.calendar-day-cell:not(.empty):not(.today):active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.92);
}

.calendar-day-number {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.calendar-day-cell.sunday .calendar-day-number {
    color: #ff453a;
}

.calendar-day-amount {
    font-size: 0.52rem;
    font-weight: 700;
    color: #ff9f0a;
    width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
}
