:root {
    --ios-bg: #f2f2f7;
    --ios-card: #ffffff;
    --ios-blue: #007aff;
    --ios-text: #000000;
    --ios-gray: #8e8e93;
    --ios-red: #ff3b30;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--ios-bg);
    margin: 0;
    padding-bottom: 80px;
    padding-top: 60px;
    color: var(--ios-text);
}

.topbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px; /* Reduzido de 20px para 10px */
    border-bottom: 0.5px solid #d1d1d6;
    z-index: 1000;
    box-sizing: border-box;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 4px; /* Reduzido gap para aproximar os elementos */
}

.topbar-back {
    color: var(--ios-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 5px;
    margin-left: -5px;
    text-decoration: none !important;
    transition: opacity 0.2s;
}

.topbar-back:active {
    opacity: 0.4;
}

.topbar-back i {
    width: 28px;
    height: 28px;
}

.topbar-logo {
    height: 28px;
    width: auto;
}

.topbar h1 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

.btn-logout {
    color: var(--ios-blue);
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
}

.content {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.card {
    background: var(--ios-card);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Dashboard Enhancements */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--ios-card);
    padding: 20px;
    border-radius: 20px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 0.5px solid #d1d1d6;
    width: 100%;
    box-sizing: border-box;
}

.stat-card h4 {
    margin: 0;
    font-size: 13px;
    color: var(--ios-gray);
    font-weight: 500;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 22px;
    font-weight: 700;
    margin: 8px 0;
    display: block;
}

.chart-container {
    background: var(--ios-card);
    padding: 20px;
    border-radius: 24px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

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

.projection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 0.5px solid #f2f2f7;
}

.projection-item:last-child {
    border-bottom: none;
}

.projection-month {
    font-weight: 600;
    font-size: 15px;
}

/* Occupancy Circular Progress */
.occupancy-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.circular-progress {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.inner-circle {
    width: 95px;
    height: 95px;
    background: var(--ios-card);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.occupancy-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--ios-text);
}

/* Login Screen Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 320px;
    padding: 30px;
    background: var(--ios-card);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
}

.login-card .logo-wrapper {
    margin-bottom: 20px;
}

.login-card img {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-card p {
    color: var(--ios-gray);
    margin-bottom: 25px;
    font-size: 14px;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid #f2f2f7;
}

th {
    font-size: 14px;
    color: var(--ios-gray);
    font-weight: 500;
}

td {
    font-size: 15px;
}

/* Month Selector iOS Style */
.month-selector-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ios-card);
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 0.5px solid #d1d1d6;
}

.nav-arrow {
    color: var(--ios-blue);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f7;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.2s;
}

.nav-arrow:active { background: #e5e5ea; }
.nav-arrow i { width: 20px; height: 20px; }

.current-month-display { text-align: center; flex-grow: 1; }
.month-name { display: block; font-size: 17px; font-weight: 700; color: var(--ios-text); }
.year-name { font-size: 12px; color: var(--ios-gray); font-weight: 500; }

/* Mobile Optimized List Items */
.ios-list {
    background: var(--ios-card);
    border-radius: 14px;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
    list-style: none;
}

.ios-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 0.5px solid #d1d1d6;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
    gap: 12px;
}

.ios-item:last-child { border-bottom: none; }
.ios-item:active { background-color: #e5e5ea; }

.ios-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ios-item-icon.receita { background: #34c759; color: white; }
.ios-item-icon.despesa { background: #ff3b30; color: white; }
.ios-item-icon.pago { background: #8e8e93; color: white; }

.ios-item-body {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ios-item-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ios-text);
}

.ios-item-subtitle {
    font-size: 13px;
    color: var(--ios-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.ios-item-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.ios-item-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--ios-text);
}

.ios-item-value.receita { color: #34c759; }

.ios-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.ios-badge.pending { background: rgba(0, 122, 255, 0.1); color: var(--ios-blue); }
.ios-badge.paid { background: rgba(52, 199, 89, 0.1); color: #34c759; }

/* Floating Pill Menu */
.menu-container {
    position: fixed;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1001;
    pointer-events: none;
}

.floating-menu {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 35px;
    padding: 8px 12px;
    display: flex;
    gap: 5px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12), 0 5px 15px rgba(0,0,0,0.05);
    border: 0.5px solid rgba(255, 255, 255, 0.4);
    pointer-events: auto;
    width: auto;
}

.menu-item {
    text-decoration: none;
    color: var(--ios-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 18px;
    border-radius: 28px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item.active {
    color: var(--ios-blue);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.menu-icon {
    width: 22px;
    height: 22px;
    stroke-width: 2px;
    margin-bottom: 4px;
}

.menu-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

button, .btn, .btn-full, .btn-small, .btn-logout, .nav-arrow {
    text-decoration: none !important;
}

button, .btn {
    background-color: var(--ios-blue);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.btn-full {
    display: flex;
    width: 100%;
    padding: 16px;
    font-size: 17px;
    border-radius: 14px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
    background: var(--ios-blue);
    color: white;
}

button:active, .btn:active, .btn-full:active, .btn-small:active {
    opacity: 0.8;
    transform: scale(0.98);
}

input, select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border-radius: 10px;
    border: 1px solid #d1d1d6;
    background: #f9f9f9;
    font-size: 16px;
    box-sizing: border-box;
    outline: none;
}

input:focus {
    border-color: var(--ios-blue);
}
