/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #060608;
    --bg-card: #111114;
    --bg-card-hover: #18181c;
    --bg-input: #1a1a1f;
    --border: #252529;
    --border-light: #333338;
    --text: #f2f2f5;
    --text-secondary: #8e8e96;
    --text-muted: #55555d;
    --green: #00d959;
    --green-dark: #00b84a;
    --green-light: #00ff6a;
    --green-glow: rgba(0, 217, 89, 0.12);
    --green-glow-strong: rgba(0, 217, 89, 0.25);
    --red: #ff4757;
    --red-dark: #e0303f;
    --yellow: #ffd32a;
    --nav-height: 72px;
    --header-height: 58px;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-green: 0 4px 20px rgba(0, 217, 89, 0.2);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* Padding para área segura (notch / barra inferior do iPhone) */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(6, 6, 8, 0.88);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--green);
    box-shadow: 0 0 10px rgba(0, 217, 89, 0.3);
}

.header-greeting {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green-light), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.header-date {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== TAB CONTENT ===== */
.tab-content {
    padding: calc(var(--header-height) + 14px) 14px calc(var(--nav-height) + 36px);
    max-width: 500px;
    margin: 0 auto;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeSlideIn 0.25s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== SECTION CARDS ===== */
.section-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition);
}

.section-card:hover {
    border-color: var(--border-light);
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.2px;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 18px;
    background: var(--green);
    border-radius: 3px;
    flex-shrink: 0;
}

.card-highlight {
    border-color: rgba(0, 217, 89, 0.3);
    background: linear-gradient(145deg, rgba(0, 217, 89, 0.06), var(--bg-card) 60%);
    box-shadow: var(--shadow-card), 0 0 30px rgba(0, 217, 89, 0.05);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.05rem;
    outline: none;
    transition: all var(--transition);
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0, 217, 89, 0.1);
    background: rgba(0, 217, 89, 0.03);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238e8e96' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.flex-1 {
    flex: 1;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    transition: opacity 0.15s;
}

.btn:active::after {
    opacity: 0.1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #000;
    box-shadow: var(--shadow-green);
    letter-spacing: 0.2px;
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(0, 217, 89, 0.15);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:active {
    background: var(--border);
    transform: scale(0.97);
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #fff;
}

.btn-install {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #000;
    box-shadow: var(--shadow-green);
    margin-top: 10px;
}

.btn-danger:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 24px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    font-size: 1.3em;
    line-height: 1;
}

/* ===== STATS ===== */
.stats-row {
    display: flex;
    gap: 10px;
}

.stat-box {
    flex: 1;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.stat-box:hover {
    border-color: var(--border-light);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-yellow { color: var(--yellow) !important; }

/* ===== CHART ===== */
.chart-container {
    position: relative;
    height: 200px;
    padding: 4px 0;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chart-empty::before {
    content: '📊';
    font-size: 2rem;
    opacity: 0.4;
}

/* ===== FILTRO DE DATA ===== */
.filtro-data-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.filtro-data-header .section-title {
    margin-bottom: 0;
}

.filtro-data-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.82rem;
    padding: 6px 10px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.filtro-data-input:focus {
    border-color: var(--green);
}

.filtro-data-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.filtro-data-input::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

/* ===== LISTA ENTREGAS ===== */
.lista-entregas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.entrega-item {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all var(--transition);
    animation: slideInItem 0.3s ease;
}

@keyframes slideInItem {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.entrega-item:hover {
    border-color: var(--border-light);
}

.entrega-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entrega-hora {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.entrega-valor-principal {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--green);
    letter-spacing: -0.3px;
}

.entrega-detalhes {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.entrega-detalhe {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.entrega-detalhe strong {
    color: var(--text);
    font-weight: 600;
}

.entrega-obs {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 6px 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border-left: 2px solid var(--border);
}

.entrega-acoes {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.entrega-acoes button {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--transition);
}

.btn-editar {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}

.btn-editar:active {
    background: rgba(255,255,255,0.12);
}

.btn-excluir {
    background: rgba(255, 71, 87, 0.1);
    color: var(--red);
}

.btn-excluir:active {
    background: rgba(255, 71, 87, 0.2);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 16px;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-state::before {
    content: attr(data-icon);
    font-size: 2.2rem;
    opacity: 0.4;
}

/* ===== CARTEIRA ===== */
.period-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 4px;
    border: 1px solid var(--border);
}

.period-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.period-btn.active {
    background: var(--green);
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 217, 89, 0.3);
}

.ganhos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ganho-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    transition: all var(--transition);
}

.ganho-card.highlight {
    border-color: rgba(0, 217, 89, 0.3);
    background: linear-gradient(145deg, rgba(0, 217, 89, 0.08), var(--bg-input));
    grid-column: 1 / -1;
    box-shadow: 0 0 20px rgba(0, 217, 89, 0.06);
}

.ganho-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.ganho-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

/* ===== GASTOS FIXOS ===== */
.lista-gastos {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.gasto-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    transition: all var(--transition);
}

.gasto-item:hover {
    border-color: var(--border-light);
}

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

.gasto-nome {
    font-size: 0.95rem;
    font-weight: 700;
}

.gasto-valor {
    font-size: 0.85rem;
    color: var(--red);
    font-weight: 600;
}

.gasto-acoes {
    display: flex;
    gap: 6px;
}

.gasto-acoes button {
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--transition);
}

/* ===== GUARDAR INFO ===== */
.guardar-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.guardar-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.guardar-value {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.guardar-destaque {
    background: linear-gradient(145deg, rgba(0, 217, 89, 0.1), rgba(0, 217, 89, 0.04));
    border: 1.5px solid rgba(0, 217, 89, 0.35);
    border-radius: var(--radius-sm);
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 217, 89, 0.06);
}

.guardar-msg {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.guardar-valor-grande {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--green-light), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 10px 0;
    letter-spacing: -1px;
}

/* ===== METAS / PROGRESS ===== */
.meta-config {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.meta-progress {
    padding: 4px 0;
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--green-dark), var(--green), var(--green-light));
    border-radius: 12px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    position: relative;
    box-shadow: 0 0 12px rgba(0, 217, 89, 0.2);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
    border-radius: 12px 12px 0 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.progress-meta-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ===== PERFIL ===== */
.perfil-card {
    text-align: center;
}

.perfil-avatar-container {
    margin-bottom: 20px;
}

.perfil-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--bg-input), var(--bg));
    border: 3px solid var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: 0 0 20px rgba(0, 217, 89, 0.15);
}

.perfil-avatar:active {
    transform: scale(0.93);
}

.perfil-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 2.2rem;
    opacity: 0.7;
}

.perfil-foto-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
}

.perfil-info {
    margin-top: 18px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.perfil-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(6, 6, 8, 0.92);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid rgba(255,255,255,0.06);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 16px;
    transition: all var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

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

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--green);
    border-radius: 0 0 3px 3px;
    box-shadow: 0 2px 8px rgba(0, 217, 89, 0.4);
}

.nav-icon {
    width: 24px;
    height: 24px;
    transition: transform var(--transition);
}

.nav-item:active .nav-icon {
    transform: scale(0.85);
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
    animation: modalBgIn 0.2s ease;
}

@keyframes modalBgIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    width: 100%;
    max-width: 400px;
    animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h3 {
    font-size: 1.15rem;
    margin-bottom: 20px;
    color: var(--green);
    font-weight: 800;
    letter-spacing: -0.3px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* ===== CONGRATS ===== */
.congrats-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 60, 20, 0.98), rgba(0, 15, 5, 0.98));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: congratsIn 0.5s ease;
    overflow: hidden;
}

@keyframes congratsIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.congrats-content {
    text-align: center;
    padding: 32px;
    position: relative;
    z-index: 2;
}

.congrats-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: celebrateBounce 0.8s ease infinite alternate;
    filter: drop-shadow(0 0 20px rgba(0, 217, 89, 0.4));
}

@keyframes celebrateBounce {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-16px) scale(1.05); }
}

.congrats-content h2 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--green-light), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.congrats-content p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 24px;
}

.congrats-amount {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--green-light), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 36px;
    letter-spacing: -1px;
}

/* Confetti particles */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    top: -10px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--green);
    color: #000;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    z-index: 250;
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 217, 89, 0.3);
    letter-spacing: 0.2px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 24px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== VERSION TAG ===== */
.version-tag {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 16px 0 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 380px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo-img {
    width: 220px;
    max-width: 80%;
    margin-bottom: 8px;
}

.auth-logo h1 {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--green-light), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.auth-logo p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}


.auth-error {
    font-size: 0.85rem;
    color: var(--red);
    text-align: center;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(255, 71, 87, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 71, 87, 0.2);
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

/* ===== INSTALL BANNER ===== */
.install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
    background: var(--bg-card);
    color: var(--text);
    padding: 14px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    box-shadow: 0 4px 32px rgba(0,0,0,0.6);
    border: 1px solid var(--border-light);
    animation: bannerSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bannerSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(24px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.install-banner-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

.install-banner-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.install-banner-msg {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.install-banner-btn {
    background: var(--green);
    color: #000;
    border: none;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--transition);
}

.install-banner-btn:active {
    transform: scale(0.95);
    background: var(--green-dark);
}

.install-banner-dismiss {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.install-banner-dismiss:hover {
    opacity: 1;
}

/* ===== iOS INSTALL GUIDE MODAL ===== */
.ios-guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    display: flex;
    align-items: flex-end;
    animation: overlayFadeIn 0.25s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ios-guide-sheet {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 24px 24px 0 0;
    width: 100%;
    padding: 12px 24px 32px;
    padding-bottom: max(32px, calc(32px + env(safe-area-inset-bottom)));
    animation: sheetSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}

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

.ios-guide-handle {
    width: 40px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.ios-guide-header {
    text-align: center;
    margin-bottom: 28px;
}

.ios-guide-app-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.ios-guide-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.ios-guide-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.ios-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.ios-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.ios-guide-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green);
    color: #000;
    font-size: 0.85rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ios-guide-step-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ios-guide-step-content strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.ios-guide-step-content span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
    html { font-size: 14px; }
    .stats-row { flex-direction: column; }
    .form-row { flex-direction: column; }
    .ganhos-grid { grid-template-columns: 1fr; }
    .ganho-card.highlight { grid-column: auto; }
}

@media (min-width: 500px) {
    .tab-content {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Tablet */
@media (min-width: 640px) {
    .tab-content {
        max-width: 560px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .ganhos-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .ganho-card.highlight {
        grid-column: auto;
    }

    .stats-row .stat-box {
        padding: 18px 14px;
    }

    .section-card {
        padding: 24px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --header-height: 48px;
        --nav-height: 56px;
    }

    .auth-logo {
        margin-bottom: 20px;
    }

    .auth-logo-img {
        width: 140px;
    }
}

/* ===== PULSE ANIMATION FOR LIVE INDICATOR ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    animation: pulse 2s ease infinite;
    box-shadow: 0 0 6px rgba(0, 217, 89, 0.5);
}

/* ===== PWA INSTALL BANNER ===== */
.pwa-install-banner {
    position: fixed;
    bottom: calc(var(--nav-height, 64px) + env(safe-area-inset-bottom, 0px) + 12px);
    left: 12px;
    right: 12px;
    background: #16181f;
    border: 1px solid rgba(0, 217, 89, 0.35);
    border-radius: 18px;
    padding: 14px 14px 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9000;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 217, 89, 0.08);
    transform: translateY(140%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    pointer-events: none;
}

.pwa-install-banner.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.pwa-install-banner.hidden {
    display: none;
}

.pwa-install-banner.auth-mode {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
}

.pwa-banner-icon {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.pwa-banner-body {
    flex: 1;
    min-width: 0;
}

.pwa-banner-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.4;
}

.pwa-banner-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    flex-shrink: 0;
}

.pwa-btn-install {
    background: var(--green, #00d959);
    color: #000;
    border: none;
    border-radius: 22px;
    padding: 9px 18px;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: filter 0.15s;
}

.pwa-btn-install:active {
    filter: brightness(0.88);
}

.pwa-btn-dismiss {
    background: transparent;
    color: rgba(255,255,255,0.4);
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    text-align: center;
    padding: 2px 4px;
}

/* ===== iOS INSTALL MODAL ===== */
.ios-install-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 9100;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ios-install-modal.visible {
    opacity: 1;
}

.ios-install-modal.hidden {
    display: none;
}

.ios-modal-sheet {
    background: #1a1d24;
    border-radius: 24px 24px 0 0;
    padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 16px));
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.08);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ios-install-modal.visible .ios-modal-sheet {
    transform: translateY(0);
}

.ios-modal-handle {
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.ios-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.ios-modal-icon {
    width: 58px;
    height: 58px;
    border-radius: 15px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.ios-modal-title-block {
    flex: 1;
}

.ios-modal-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
}

.ios-modal-subtitle {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.4;
}

.ios-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ios-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.ios-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 217, 89, 0.12);
    border: 1px solid rgba(0, 217, 89, 0.3);
    color: var(--green, #00d959);
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.ios-step-text {
    flex: 1;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.55;
    padding-top: 5px;
}

.ios-step-text strong {
    color: #fff;
    font-weight: 600;
}

.ios-step-text .step-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    vertical-align: middle;
}

.ios-modal-close {
    width: 100%;
    padding: 15px;
    background: rgba(255,255,255,0.07);
    border: none;
    border-radius: 14px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.ios-modal-close:active {
    background: rgba(255,255,255,0.12);
}
