@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-body: #ECEEF2;
    /* Light Blue/Grey from image */
    --bg-card: #FFFFFF;
    --text-primary: #1F2937;
    /* Dark Grey */
    --text-secondary: #6B7280;

    --primary-green: #10B981;
    /* Emerald Green for ADD/Generate */
    --primary-green-hover: #059669;
    --primary-orange: #F59E0B;
    /* Orange for ADD */

    --pill-green-bg: #E6F6F1;
    /* Light Green for Month */
    --pill-green-text: #1F4236;

    --pill-blue-bg: #E0F2FE;
    /* Light Sky Blue */
    --pill-blue-text: #075985;

    --radius-l: 20px;
    --radius-m: 12px;
    --radius-s: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    /* Dynamic Viewport Height for mobile browsers */
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.mobile-container {
    width: 100%;
    max-width: 420px;
    height: 100%;
    padding: 36px 12px 4px 12px;
    /* Further/Final reduction */
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

/* --- HEADER --- */
/* The header card itself in the image is White with rounded corners */
.header-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 8px 12px;
    /* reduced */
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.header-content h1 {
    font-size: 15px;
    /* reduced */
    font-weight: 800;
    color: #111827;
    letter-spacing: 0.5px;
    margin-bottom: 0px;
    text-transform: uppercase;
}

.building-name {
    font-size: 11px;
    color: #6B7280;
    font-weight: 500;
    margin-bottom: 4px;
}

.date-row {
    display: flex;
    gap: 8px;
}

/* Specific Pill Styles */
.month-pill {
    flex: 1;
    background-color: var(--pill-green-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    height: 32px;
    /* reduced from 36 */
    color: var(--pill-green-text);
}

.month-pill i {
    color: #10B981;
    font-size: 12px;
}

#monthSelect {
    background: transparent;
    border: none;
    font-weight: 600;
    color: inherit;
    font-size: 12px;
    cursor: pointer;
    flex: 1;
    margin-left: 4px;
    outline: none;
}

.year-pill {
    flex: 1;
    background-color: var(--pill-blue-bg);
    /* Sky Blue */
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    height: 32px;
    /* reduced */
    position: relative;
    color: var(--pill-blue-text);
}

#yearInput {
    background: transparent;
    border: none;
    font-weight: 600;
    color: inherit;
    font-size: 12px;
    width: 100%;
    outline: none;
    padding-right: 8px;
    text-align: center;
    /* Centered since icon gone */
}

.input-icon {
    position: absolute;
    right: 12px;
    color: var(--pill-blue-text);
    font-size: 12px;
    pointer-events: none;
}

/* Hiding spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* --- ADD CARD --- */
.add-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 8px 12px;
    /* reduced */
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.form-group label {
    font-size: 9px;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
    display: block;
}

.input-wrapper,
input {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

select,
input {
    width: 100%;
    height: 32px;
    /* reduced */
    background: #FAFAFA;
    /* Very light grey input bg */
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-s);
    padding: 0 10px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #374151;
    outline: none;
    appearance: none;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    border-color: #A7F3D0;
    background: #FFF;
}

.select-icon {
    position: absolute;
    right: 10px;
    font-size: 10px;
    color: #9CA3AF;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.btn-primary {
    flex: 1;
    background-color: var(--primary-orange);
    /* Orange ADD Button */
    color: white;
    height: 34px;
    /* reduced */
    border: none;
    border-radius: var(--radius-s);
    font-weight: 700;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary {
    flex: 1;
    background-color: transparent;
    border: 1px solid #E5E7EB;
    color: #6B7280;
    height: 34px;
    /* reduced */
    border-radius: var(--radius-s);
    font-weight: 600;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
}

/* --- LIST CARD --- */
.list-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 8px 12px;
    /* reduced */
    flex: 1;
    /* Stretch to fill space */
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 44px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    /* Ensure self overflow is hidden */
}

.card-title {
    font-size: 9px;
    font-weight: 800;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.expense-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.expense-container::-webkit-scrollbar {
    width: 3px;
}

.expense-container::-webkit-scrollbar-thumb {
    background-color: #D1D5DB;
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    color: #9CA3AF;
    font-size: 11px;
    padding: 10px 0;
    /* Dramatically reduced from 20/40 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    /* Center vertically in available space */
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #F3F4F6;
}

.expense-item:last-child {
    border-bottom: none;
}

.item-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-icon {
    width: 28px;
    height: 28px;
    background: #F3F4F6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    font-size: 11px;
}

.cat-name {
    font-weight: 600;
    font-size: 13px;
    color: #1F2937;
}

.cat-notes {
    font-size: 10px;
    color: #9CA3AF;
    display: block;
}

.item-amt {
    font-weight: 700;
    color: #1F2937;
    font-size: 13px;
}

.delete-btn {
    background: none;
    border: none;
    color: #D1D5DB;
    cursor: pointer;
    font-size: 12px;
}

.delete-btn:hover {
    color: #EF4444;
}


/* --- SUMMARY CARD CONTAINER --- */
.summary-card-container {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 0px;
}

.summary-box {
    flex: 1;
    background-color: #FFF;
    border-radius: 14px;
    padding: 4px;
    /* Tight padding */
    position: relative;
    overflow: hidden;
    /* For clipping illustration */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 64px;
    /* Reduced from 72/80 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.summary-box label {
    font-size: 8px;
    font-weight: 800;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    margin-bottom: 0px;
}

.summary-box input {
    text-align: center;
    width: 50px;
    height: 22px;
    margin-bottom: 12px;
    /* Space for illustration */
    border: 1px solid #E5E7EB;
    background: #FFF;
    z-index: 2;
    font-size: 13px;
}

.summary-box .value {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    z-index: 2;
    margin-bottom: 12px;
}

.illustration-area {
    position: absolute;
    bottom: -4px;
    width: 100%;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0.8;
}

.illustration-area i {
    font-size: 28px;
}

/* Colors for illustrations */
.ill-flats {
    color: #E0F2FE;
}

/* Light Blue */
.ill-flats i {
    color: #BAE6FD;
}

.ill-total {
    color: #DCFCE7;
}

/* Light Green */
.ill-total i {
    color: #86EFAC;
}

.ill-per {
    color: #E0E7FF;
}

/* Light Indigo */
.ill-per i {
    color: #A5B4FC;
}

/* Wrapper to simulate the "Picture" look */
.ill-flats::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    bottom: -10px;
    background: #ECFEFF;
    border-radius: 50%;
    z-index: -1;
}

.ill-total::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    bottom: -10px;
    background: #ECFDF5;
    border-radius: 50%;
    z-index: -1;
}

.ill-per::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    bottom: -10px;
    background: #EEF2FF;
    border-radius: 50%;
    z-index: -1;
}


/* --- CTA --- */
.cta-container {
    margin-top: 4px;
    flex-shrink: 0;
}

.btn-cta {
    width: 100%;
    height: 38px;
    /* Reduced from 40 */
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: var(--radius-m);
    font-weight: 700;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.25);
}

.btn-cta:active {
    transform: translateY(1px);
}

.app-footer {
    display: block;
    /* Visible now */
    text-align: center;
    color: #9CA3AF;
    font-size: 9px;
    margin-top: 4px;
    padding-bottom: 2px;
    flex-shrink: 0;
}

.report-container-hidden {
    display: none;
}